CMS 3D CMS Logo

AnalysisSettings.cc
Go to the documentation of this file.
2 
3 namespace l1tVertexFinder {
4 
6 
8  : AlgoSettings(iConfig),
9 
10  // Parameter sets for differents types of configuration parameter.
11  genCuts_(iConfig.getParameter<edm::ParameterSet>("GenCuts")),
12  l1TrackDef_(iConfig.getParameter<edm::ParameterSet>("L1TrackDef")),
13  trackMatchDef_(iConfig.getParameter<edm::ParameterSet>("TrackMatchDef")),
14 
15  //=== Cuts on MC truth tracks used for tracking efficiency measurements.
16  genMinPt_(genCuts_.getParameter<double>("GenMinPt")),
17  genMaxAbsEta_(genCuts_.getParameter<double>("GenMaxAbsEta")),
18  genMaxVertR_(genCuts_.getParameter<double>("GenMaxVertR")),
19  genMaxVertZ_(genCuts_.getParameter<double>("GenMaxVertZ")),
20  genMinStubLayers_(genCuts_.getParameter<unsigned int>("GenMinStubLayers")),
21 
22  //=== Rules for deciding when the track finding has found an L1 track candidate
23  useLayerID_(l1TrackDef_.getParameter<bool>("UseLayerID")),
24 
25  //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle).
26  minFracMatchStubsOnReco_(trackMatchDef_.getParameter<double>("MinFracMatchStubsOnReco")),
27  minFracMatchStubsOnTP_(trackMatchDef_.getParameter<double>("MinFracMatchStubsOnTP")),
28  minNumMatchLayers_(trackMatchDef_.getParameter<unsigned int>("MinNumMatchLayers")),
29  minNumMatchPSLayers_(trackMatchDef_.getParameter<unsigned int>("MinNumMatchPSLayers")),
30  stubMatchStrict_(trackMatchDef_.getParameter<bool>("StubMatchStrict")) {
31  // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-.
32  std::vector<unsigned int> genPdgIdsUnsigned(genCuts_.getParameter<std::vector<unsigned int>>("GenPdgIds"));
33  std::vector<int> genPdgIdsAll_ = {11, 13, 211, 321, 2212};
34  if (genPdgIdsUnsigned.empty()) {
35  genPdgIds_.insert(genPdgIds_.begin(), genPdgIdsAll_.begin(), genPdgIdsAll_.end());
36  } else {
37  genPdgIds_.insert(genPdgIds_.begin(), genPdgIdsUnsigned.begin(), genPdgIdsUnsigned.end());
38  }
39 
40  // For simplicity, user need not distinguish particles from antiparticles in configuration file.
41  // But here we must store both explicitely in Settings, since TrackingParticleSelector expects them.
42  std::transform(genPdgIds_.begin(), genPdgIds_.end(), std::back_inserter(genPdgIds_), std::negate<int>());
43  std::transform(genPdgIdsAll_.begin(), genPdgIdsAll_.end(), std::back_inserter(genPdgIdsAll_), std::negate<int>());
44 
45  // Define the settings for the TrackingParticleSelectors
47  99999999.,
48  -genMaxAbsEta(),
49  genMaxAbsEta(),
50  genMaxVertR(),
51  genMaxVertZ(),
52  0,
53  true, //useOnlyTPfromPhysicsCollision
54  true, //useOnlyInTimeParticles
55  true,
56  false,
57  genPdgIds());
58  // Range big enough to include all TP needed to measure tracking efficiency
59  // and big enough to include any TP that might be reconstructed for fake rate measurement.
60  // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake.
62  9999999999,
63  -std::max(genMaxAbsEta(), 3.5),
64  std::max(genMaxAbsEta(), 3.5),
65  std::max(10.0, genMaxVertR()),
66  std::max(35.0, genMaxVertZ()),
67  0,
68  false, //useOnlyTPfromPhysicsCollisionFalse
69  false, //useOnlyInTimeParticles
70  true,
71  false,
72  genPdgIds(true));
74  9999999999,
75  -genMaxAbsEta(),
76  genMaxAbsEta(),
77  genMaxVertR(),
78  genMaxVertZ(),
79  0,
80  true, //useOnlyTPfromPhysicsCollision
81  true, //useOnlyInTimeParticles
82  true,
83  false,
84  genPdgIds());
85 
86  //--- Sanity checks
88  throw cms::Exception(
89  "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C.");
90  }
91 
92 } // end namespace l1tVertexFinder
l1tVertexFinder
Definition: AlgoSettings.h:10
l1tVertexFinder::AnalysisSettings::minNumMatchLayers_
unsigned int minNumMatchLayers_
Definition: AnalysisSettings.h:74
electrons_cff.bool
bool
Definition: electrons_cff.py:366
l1tVertexFinder::AnalysisSettings::AnalysisSettings
AnalysisSettings(const edm::ParameterSet &iConfig)
=== Get configuration parameters
Definition: AnalysisSettings.cc:7
l1tVertexFinder::AnalysisSettings::genPdgIds
const std::vector< int > & genPdgIds(bool all=false) const
Definition: AnalysisSettings.h:26
l1tVertexFinder::AnalysisSettings::genMaxVertZ
double genMaxVertZ() const
Definition: AnalysisSettings.h:25
AnalysisSettings.h
min
T min(T a, T b)
Definition: MathUtil.h:58
edm
HLT enums.
Definition: AlignableModifier.h:19
l1tVertexFinder::AnalysisSettings::tpSelectorUseForVtxReco_
TrackingParticleSelector tpSelectorUseForVtxReco_
Definition: AnalysisSettings.h:88
l1tVertexFinder::AnalysisSettings::genMinStubLayers_
unsigned int genMinStubLayers_
Definition: AnalysisSettings.h:66
l1tVertexFinder::AnalysisSettings::genMinPt
double genMinPt() const
Definition: AnalysisSettings.h:22
l1tVertexFinder::AnalysisSettings::genPdgIdsAll_
std::vector< int > genPdgIdsAll_
Definition: AnalysisSettings.h:65
l1tVertexFinder::AnalysisSettings::genCuts_
edm::ParameterSet genCuts_
Definition: AnalysisSettings.h:55
l1tVertexFinder::AnalysisSettings::tpSelectorUseForEff_
TrackingParticleSelector tpSelectorUseForEff_
Definition: AnalysisSettings.h:90
reco::modules::TrackingParticleSelector
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
Definition: TrackingParticleSelector.cc:17
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
l1tVertexFinder::AnalysisSettings::tpSelectorUse_
TrackingParticleSelector tpSelectorUse_
Definition: AnalysisSettings.h:89
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
createfilelist.int
int
Definition: createfilelist.py:10
l1tVertexFinder::AlgoSettings
Definition: AlgoSettings.h:24
l1tVertexFinder::AnalysisSettings::genMaxVertR
double genMaxVertR() const
Definition: AnalysisSettings.h:24
l1tVertexFinder::AnalysisSettings::genPdgIds_
std::vector< int > genPdgIds_
Definition: AnalysisSettings.h:64
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
l1tVertexFinder::AnalysisSettings::genMaxAbsEta
double genMaxAbsEta() const
Definition: AnalysisSettings.h:23