Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[91X] Replace TMatrix by Eigen matrices and various fixes in MillePede workflow #18177

Merged
merged 54 commits into from Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2167ceb
Create common base class for alignment producers.
gregor-mittag Mar 9, 2017
9edcc78
Added documentation to alignment producer base class.
gregor-mittag Mar 16, 2017
1c252f8
Removed `EventSetup` from `endOfLoop` methods in alignment monitors.
gregor-mittag Mar 14, 2017
49a064b
Derive ESProducerLooper-version of alignment producer from common bas…
gregor-mittag Mar 12, 2017
84d1d19
Derive EDAnalyzer-version of alignment producer from common base class.
gregor-mittag Mar 15, 2017
191c964
Make raw pointer to `AlignmentAlgorithmBase` `std::unique_ptr`.
gregor-mittag Mar 16, 2017
77055b5
Make raw pointers to `AlignmentMonitorBase` `std::unique_ptr`.
gregor-mittag Mar 16, 2017
8d7a65c
Make `globalPositions_` `std::unique_ptr`.
gregor-mittag Mar 16, 2017
6e2b05a
Renamed `PCLTrackerAlProducer` to more generic `AlignmentProducerAsAn…
gregor-mittag Mar 16, 2017
88c6584
Make `AlignmentProducerAsAnalyzer` an `edm::one` module.
gregor-mittag Mar 16, 2017
d524440
Renamed python config from `TrackerAlignmentProducerForPCL_cff` to ge…
gregor-mittag Mar 16, 2017
83fcbdc
Make test config of PCL workflow geometry-independent.
gregor-mittag Mar 16, 2017
acdfa24
Migrate offline MillePede workflow to analyzer-version of the alignme…
gregor-mittag Mar 16, 2017
e722b8d
Clean up of pede shell script + usage of parallel binary copy.
gregor-mittag Mar 17, 2017
ee0cd58
Fix usage of payloads from 'pro' database.
gregor-mittag Mar 22, 2017
0f60c8b
Fix missing replacement of 'TTRHBuilder'.
gregor-mittag Mar 23, 2017
f1b0ab1
Automatically turn off pixel quality flag if templates are not used.
gregor-mittag Mar 23, 2017
5bbec04
Cosmetic changes to the unified sequence.
gregor-mittag Mar 23, 2017
eb5a485
Added 'TTRHBuilder' option to 'MilleSetup'.
gregor-mittag Mar 23, 2017
e79f6b5
Include required offline beam spot module in unified refitting sequence.
gregor-mittag Mar 23, 2017
9315359
Use appropriate default value corresponding to phase-1 GT.
gregor-mittag Mar 23, 2017
c46d07b
Support auto GT in db-query tools.
gregor-mittag Mar 23, 2017
63e5185
Added unit test for MPS workflow.
gregor-mittag Mar 23, 2017
76ed399
Add option to redirect mille binaries to another mass storage directory.
gregor-mittag Mar 24, 2017
f0ac0e6
Move to Eigen-version of GBL developed by Claus Kleinwort.
gregor-mittag Feb 14, 2017
dfb9973
Optimize 'GblData'.
gregor-mittag Mar 20, 2017
6801c4d
Optimize 'GblPoint'.
gregor-mittag Mar 20, 2017
3edd13b
Optimize 'GblTrajectory'.
gregor-mittag Mar 20, 2017
5668283
Replace fixed-length std::vector with std::array.
gregor-mittag Mar 20, 2017
33b6745
Replace copy into container by move into container.
gregor-mittag Mar 20, 2017
0707a36
Optimize usage of 'proDer' matrices in 'GblTrajectory'.
gregor-mittag Mar 20, 2017
8a63641
Remove tabs and trailing whitespace. Purely cosmetic and no functiona…
gregor-mittag Mar 20, 2017
0738d1f
Avoid redundant step in 'GblPoint.h'.
gregor-mittag Mar 20, 2017
a9ae5ef
Move typedefs in gbl namespace.
gregor-mittag Mar 20, 2017
ce21abd
Replace call-by-value with call-by-const-reference.
gregor-mittag Mar 20, 2017
8dbd7a4
Code clean-up.
gregor-mittag Mar 20, 2017
8bc4529
Enable ROOT support in GBL-eigen.
gregor-mittag Feb 16, 2017
315b2ca
Minimal adaption of CMSSW code to deal with new GBL Eigen interfaces.
gregor-mittag Feb 15, 2017
10c5a7d
Removed TMatrix from MillePedeAlignmentAlgorithm.
gregor-mittag Feb 16, 2017
8b8ba34
Optimize usage of Eigen matrices in 'MillePedeAlignmentAlgorithm'.
gregor-mittag Feb 17, 2017
9f57e58
Removed TMatrix from ReferenceTrajectories.
gregor-mittag Feb 17, 2017
d57c561
Turned off GBL_EIGEN_SUPPORT_ROOT.
gregor-mittag Mar 21, 2017
d90e497
Allow 'cmsexpress' as a mille queue.
gregor-mittag Mar 28, 2017
61ba73f
Allow more flexibility for single IOV output.
gregor-mittag Mar 29, 2017
d530e5e
Better handling of subprocess and system calls in `mps_alisetup.py`.
gregor-mittag Mar 30, 2017
869114e
Add utility to easily add EDFilter to mille step.
gregor-mittag Mar 30, 2017
80c7a1f
Add APV mode filter to ensure consistency of cosmics configuration.
gregor-mittag Mar 30, 2017
80fe378
Adjust mps template examples to Phase-1.
gregor-mittag Mar 30, 2017
a982bb4
Remove debug remnant.
gregor-mittag Mar 31, 2017
2c4feee
Fix typo in file list creator.
gregor-mittag Mar 31, 2017
069fe44
Fix clang warning in 'GblTrajectory.cc'.
gregor-mittag Apr 3, 2017
b65a945
Comply to CMSSW coding rules.
gregor-mittag Apr 3, 2017
d3d175b
Fix bug in covariance diagonalisation.
gregor-mittag Apr 5, 2017
9d31bc2
Fix 'create_single_iov_db' method for local sqlite files.
gregor-mittag Apr 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Alignment/CommonAlignment/plugins/APVModeFilter.cc
Expand Up @@ -101,6 +101,10 @@ constexpr APVModeFilter::BitMask APVModeFilter::multi_;
//
APVModeFilter::APVModeFilter(const edm::ParameterSet& iConfig) :
mode_(convertMode(iConfig.getUntrackedParameter<std::string>("apvMode"))) {
edm::LogInfo("Alignment")
<< "@SUB=APVModeFilter::APVModeFilter"
<< "Selecting events with APV mode '"
<< iConfig.getUntrackedParameter<std::string>("apvMode") << "'.";
}


Expand Down
50 changes: 40 additions & 10 deletions Alignment/CommonAlignment/python/tools/trackselectionRefitting.py
Expand Up @@ -6,7 +6,7 @@
def getSequence(process, collection,
saveCPU = False,
TTRHBuilder = "WithAngleAndTemplate",
usePixelQualityFlag = True,
usePixelQualityFlag = None,
openMassWindow = False,
cosmicsDecoMode = False,
cosmicsZeroTesla = True,
Expand All @@ -16,7 +16,7 @@ def getSequence(process, collection,
subsequent processing steps.
The modules in the sequence are already attached to the given `process`
object using the given track collection `collection` and the given
optionial arguments.
optional arguments.

Arguments:
- `process`: 'cms.Process' object to which the modules of the sequence will
Expand All @@ -27,6 +27,11 @@ def getSequence(process, collection,
This option is currently not recommended.
- `TTRHBuilder`: Option used for the Track(Re)Fitter modules.
- `usePixelQualityFlag`: Option used for the TrackHitFilter module.
Defaults to 'True' but is automatically set to
'False' if a `TTRHBuilder` without templates is
used.
If this is still wanted for some reason, one can
explicitely specify it as 'True'.
- `openMassWindow`: Used to configure the TwoBodyDecaySelector for ZMuMu.
- `cosmicsDecoMode`: If set to 'True' a lower Signal/Noise cut is used.
- `cosmicsZeroTesla`: If set to 'True' a 0T-specific selection is used.
Expand All @@ -35,6 +40,18 @@ def getSequence(process, collection,
to provide here the name of the constraint module.
"""

###################################################
# resolve default values incl. consistency checks #
###################################################

if usePixelQualityFlag is None:
if "Template" not in TTRHBuilder:
usePixelQualityFlag = False # not defined without templates
print "Using 'TTRHBuilder' without templates:", TTRHBuilder
print " --> Turning off pixel quality flag in hit filter."
else:
usePixelQualityFlag = True # default for usage with templates


#############################
## setting general options ##
Expand All @@ -55,7 +72,7 @@ def getSequence(process, collection,
options["TrackSelector"]["Alignment"] = {
"filter": True,
"pMin": 3.0,
"nHitMin2D": 2,
"nHitMin2D": 2,
"d0Min": -50.0,
"d0Max": 50.0,
"etaMin": -3.0,
Expand All @@ -65,6 +82,7 @@ def getSequence(process, collection,
}
options["TrackRefitter"]["First"] = {
"NavigationSchool": "",
"TTRHBuilder": TTRHBuilder
}
options["TrackRefitter"]["Second"] = {
"NavigationSchool": "",
Expand Down Expand Up @@ -93,7 +111,8 @@ def getSequence(process, collection,
#########################################
isCosmics = False

if collection == "ALCARECOTkAlMinBias" or collection == "generalTracks" or collection == "ALCARECOTkAlMinBiasHI" or collection == "hiGeneralTracks":
if collection in ("ALCARECOTkAlMinBias", "generalTracks",
"ALCARECOTkAlMinBiasHI", "hiGeneralTracks"):
options["TrackSelector"]["Alignment"].update({
"ptMin": 1.0,
"pMin": 8.,
Expand Down Expand Up @@ -124,15 +143,19 @@ def getSequence(process, collection,
"applyMultiplicityFilter": True,
"maxMultiplicity": 1
})
elif collection == "ALCARECOTkAlMuonIsolated" or collection == "ALCARECOTkAlMuonIsolatedHI" or collection == "ALCARECOTkAlMuonIsolatedPA":
elif collection in ("ALCARECOTkAlMuonIsolated",
"ALCARECOTkAlMuonIsolatedHI",
"ALCARECOTkAlMuonIsolatedPA"):
options["TrackSelector"]["Alignment"].update({
("minHitsPerSubDet", "inPIXEL"): 1,
"ptMin": 5.0,
"nHitMin": 10,
"applyMultiplicityFilter": True,
"maxMultiplicity": 1,
})
elif collection == "ALCARECOTkAlZMuMu" or collection == "ALCARECOTkAlZMuMuHI" or collection == "ALCARECOTkAlZMuMuPA":
elif collection in ("ALCARECOTkAlZMuMu",
"ALCARECOTkAlZMuMuHI",
"ALCARECOTkAlZMuMuPA"):
options["TrackSelector"]["Alignment"].update({
"ptMin": 15.0,
"etaMin": -3.0,
Expand Down Expand Up @@ -201,7 +224,7 @@ def getSequence(process, collection,
("TrackSelector", "Alignment", {"method": "load"}),
("TrackRefitter", "Second", {"method": "load",
"clone": True})]
if isCosmics: mods = mods[1:]
if isCosmics: mods = mods[1:] # skip high purity selector for cosmics



Expand All @@ -218,6 +241,13 @@ def getSequence(process, collection,



#######################################################
# load offline beam spot module required by the refit #
#######################################################
process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")



###############################
## put the sequence together ##
###############################
Expand All @@ -239,9 +269,9 @@ def getSequence(process, collection,
isCosmics = isCosmics, **(mods[-1][2]))
modules.append(getattr(process, src))

moduleSum = modules[0]
for mod in modules[1:]:
moduleSum += mod
moduleSum = process.offlineBeamSpot # first element of the sequence
for module in modules: moduleSum += module # append the other modules

return cms.Sequence(moduleSum)


Expand Down
Expand Up @@ -61,7 +61,7 @@ class AlignmentMonitorBase
void duringLoop(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks);

/// Called at end of loop: don't reimplement
void endOfLoop(const edm::EventSetup &iSetup);
void endOfLoop();

/// Called at end of processing: don't implement
void endOfJob() {}
Expand All @@ -76,7 +76,7 @@ class AlignmentMonitorBase

/// Called after updating AlignableTracker and AlignableMuon (by
/// "endOfLoop()"): may be reimplemented
virtual void afterAlignment(const edm::EventSetup &iSetup) { }
virtual void afterAlignment() { }

protected:
/// Use this every time you book a histogram (so that
Expand Down Expand Up @@ -111,6 +111,6 @@ class AlignmentMonitorBase
};

/*** Global typedefs ***/
typedef std::vector<AlignmentMonitorBase*> AlignmentMonitors;
using AlignmentMonitors = std::vector<std::unique_ptr<AlignmentMonitorBase> >;

#endif
Expand Up @@ -85,7 +85,6 @@ class AlignmentMonitorAsAnalyzer : public edm::EDAnalyzer {
AlignmentParameterStore *m_alignmentParameterStore;

std::vector<AlignmentMonitorBase*> m_monitors;
const edm::EventSetup *m_lastSetup;

bool m_firstEvent;
};
Expand Down Expand Up @@ -219,8 +218,6 @@ AlignmentMonitorAsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSe
(*monitor)->duringLoop(iEvent, iSetup, trajTracks);
}

// Keep this for endOfLoop (why does endOfLoop want iSetup???)
m_lastSetup = &iSetup;
}


Expand All @@ -236,7 +233,7 @@ void
AlignmentMonitorAsAnalyzer::endJob()
{
for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = m_monitors.begin(); monitor != m_monitors.end(); ++monitor) {
(*monitor)->endOfLoop(*m_lastSetup);
(*monitor)->endOfLoop();
}
for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = m_monitors.begin(); monitor != m_monitors.end(); ++monitor) {
(*monitor)->endOfJob();
Expand Down
Expand Up @@ -43,10 +43,6 @@ class AlignmentMonitorGeneric:
const ConstTrajTrackPairCollection&
);

virtual void afterAlignment(
const edm::EventSetup&
) {}

private:

static const unsigned int nBin_ = 50;
Expand Down
Expand Up @@ -38,7 +38,7 @@ class AlignmentMonitorMuonResiduals: public AlignmentMonitorBase {

void book() override;
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks) override;
void afterAlignment(const edm::EventSetup &iSetup) override;
void afterAlignment() override;

private:
std::map<int, int> m_numx;
Expand Down Expand Up @@ -820,7 +820,7 @@ void AlignmentMonitorMuonResiduals::event(const edm::Event &iEvent, const edm::E
} // end loop over track-trajectories
}

void AlignmentMonitorMuonResiduals::afterAlignment(const edm::EventSetup &iSetup) {
void AlignmentMonitorMuonResiduals::afterAlignment() {
std::vector<Alignable*> chambers;
std::vector<Alignable*> tmp1 = pMuon()->DTChambers();
for (std::vector<Alignable*>::const_iterator iter = tmp1.begin(); iter != tmp1.end(); ++iter) chambers.push_back(*iter);
Expand Down
Expand Up @@ -42,7 +42,7 @@ class AlignmentMonitorMuonSystemMap1D: public AlignmentMonitorBase
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks) override;
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const edm::Event &iEvent);

void afterAlignment(const edm::EventSetup &iSetup) override;
void afterAlignment() override;

private:

Expand Down Expand Up @@ -480,7 +480,7 @@ void AlignmentMonitorMuonSystemMap1D::processMuonResidualsFromTrack(MuonResidual
}


void AlignmentMonitorMuonSystemMap1D::afterAlignment(const edm::EventSetup &iSetup)
void AlignmentMonitorMuonSystemMap1D::afterAlignment()
{
std::cout << "AlignmentMonitorMuonSystemMap1D counters:"<<std::endl;
std::cout << " monitor m_counter_event = " << m_counter_event << std::endl;
Expand Down
Expand Up @@ -42,8 +42,6 @@ class AlignmentMonitorMuonVsCurvature: public AlignmentMonitorBase
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks) override;
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft, const Trajectory* traj = NULL);

void afterAlignment(const edm::EventSetup &iSetup) override {}

private:

edm::InputTag m_muonCollectionTag;
Expand Down
Expand Up @@ -42,8 +42,6 @@ class AlignmentMonitorSegmentDifferences: public AlignmentMonitorBase
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks) override;
void processMuonResidualsFromTrack(MuonResidualsFromTrack &mrft);

void afterAlignment(const edm::EventSetup &iSetup) override {}

private:

edm::InputTag m_muonCollectionTag;
Expand Down
Expand Up @@ -32,7 +32,7 @@ class AlignmentMonitorTemplate: public AlignmentMonitorBase {

void book() override;
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks) override;
void afterAlignment(const edm::EventSetup &iSetup) override;
void afterAlignment() override;

private:
TH1F *m_hist, *m_ihist, *m_otherdir, *m_otherdir2;
Expand Down Expand Up @@ -120,7 +120,7 @@ void AlignmentMonitorTemplate::event(const edm::Event &iEvent, const edm::EventS
} // end loop over tracks/trajectories
}

void AlignmentMonitorTemplate::afterAlignment(const edm::EventSetup &iSetup) {
void AlignmentMonitorTemplate::afterAlignment() {
m_otherdir->Fill(iteration()); // this one will only get one fill per iteration, because it's called in afterAlignment()
}

Expand Down
Expand Up @@ -39,7 +39,7 @@ class AlignmentMonitorTracksFromTrajectories: public AlignmentMonitorBase {

void book();
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks);
void afterAlignment(const edm::EventSetup &iSetup);
void afterAlignment();

private:
MuonServiceProxy *theMuonServiceProxy;
Expand Down Expand Up @@ -260,7 +260,7 @@ void AlignmentMonitorTracksFromTrajectories::event(const edm::Event &iEvent, con
// afterAlignment()
//////////////////////////////////////////////////////////////////////

void AlignmentMonitorTracksFromTrajectories::afterAlignment(const edm::EventSetup &iSetup) {
void AlignmentMonitorTracksFromTrajectories::afterAlignment() {
}

//
Expand Down
4 changes: 2 additions & 2 deletions Alignment/CommonAlignmentMonitor/src/AlignmentMonitorBase.cc
Expand Up @@ -62,9 +62,9 @@ void AlignmentMonitorBase::duringLoop(const edm::Event &iEvent, const edm::Event
}


void AlignmentMonitorBase::endOfLoop(const edm::EventSetup &iSetup)
void AlignmentMonitorBase::endOfLoop()
{
afterAlignment(iSetup);
afterAlignment();
}


Expand Down
11 changes: 11 additions & 0 deletions Alignment/CommonAlignmentProducer/BuildFile.xml
@@ -1,3 +1,13 @@
<use name="Alignment/CommonAlignment"/>
<use name="Alignment/CommonAlignmentAlgorithm"/>
<use name="Alignment/CommonAlignmentMonitor"/>
<use name="Alignment/CommonAlignmentParametrization"/>
<use name="Alignment/MuonAlignment"/>
<use name="Alignment/TrackerAlignment"/>
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/Alignment"/>
<use name="CondFormats/AlignmentRecord"/>
<use name="CondFormats/GeometryObjects"/>
<use name="DataFormats/MuonDetId"/>
<use name="DataFormats/SiStripDetId"/>
<use name="DataFormats/SiPixelDetId"/>
Expand All @@ -14,6 +24,7 @@
<use name="FWCore/Framework"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="DataFormats/Alignment"/>
<use name="Geometry/Records"/>
<use name="Geometry/TrackerGeometryBuilder"/>
Expand Down