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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AnalysisSettings(const edm::ParameterSet &iConfig)
=== Get configuration parameters
const std::vector< int > & genPdgIds(bool all=false) const
TrackingParticleSelector tpSelectorUseForVtxReco_
TrackingParticleSelector tpSelectorUseForEff_
TrackingParticleSelector tpSelectorUse_
HLT enums.
SingleObjectSelector< TrackingParticleCollection, ::TrackingParticleSelector > TrackingParticleSelector
unsigned transform(const HcalDetId &id, unsigned transformCode)