Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:13

0001 #include "L1Trigger/VertexFinder/interface/AnalysisSettings.h"
0002 
0003 namespace l1tVertexFinder {
0004 
0005   ///=== Get configuration parameters
0006 
0007   AnalysisSettings::AnalysisSettings(const edm::ParameterSet& iConfig)
0008       : AlgoSettings(iConfig),
0009 
0010         // Parameter sets for differents types of configuration parameter.
0011         genCuts_(iConfig.getParameter<edm::ParameterSet>("GenCuts")),
0012         l1TrackDef_(iConfig.getParameter<edm::ParameterSet>("L1TrackDef")),
0013         trackMatchDef_(iConfig.getParameter<edm::ParameterSet>("TrackMatchDef")),
0014 
0015         //=== Cuts on MC truth tracks used for tracking efficiency measurements.
0016         genMinPt_(genCuts_.getParameter<double>("GenMinPt")),
0017         genMaxAbsEta_(genCuts_.getParameter<double>("GenMaxAbsEta")),
0018         genMaxVertR_(genCuts_.getParameter<double>("GenMaxVertR")),
0019         genMaxVertZ_(genCuts_.getParameter<double>("GenMaxVertZ")),
0020         genMinStubLayers_(genCuts_.getParameter<unsigned int>("GenMinStubLayers")),
0021 
0022         //=== Rules for deciding when the track finding has found an L1 track candidate
0023         useLayerID_(l1TrackDef_.getParameter<bool>("UseLayerID")),
0024 
0025         //=== Rules for deciding when a reconstructed L1 track matches a MC truth particle (i.e. tracking particle).
0026         minFracMatchStubsOnReco_(trackMatchDef_.getParameter<double>("MinFracMatchStubsOnReco")),
0027         minFracMatchStubsOnTP_(trackMatchDef_.getParameter<double>("MinFracMatchStubsOnTP")),
0028         minNumMatchLayers_(trackMatchDef_.getParameter<unsigned int>("MinNumMatchLayers")),
0029         minNumMatchPSLayers_(trackMatchDef_.getParameter<unsigned int>("MinNumMatchPSLayers")),
0030         stubMatchStrict_(trackMatchDef_.getParameter<bool>("StubMatchStrict")) {
0031     // If user didn't specify any PDG codes, use e,mu,pi,K,p, to avoid picking up unstable particles like Xi-.
0032     std::vector<unsigned int> genPdgIdsUnsigned(genCuts_.getParameter<std::vector<unsigned int>>("GenPdgIds"));
0033     std::vector<int> genPdgIdsAll_ = {11, 13, 211, 321, 2212};
0034     if (genPdgIdsUnsigned.empty()) {
0035       genPdgIds_.insert(genPdgIds_.begin(), genPdgIdsAll_.begin(), genPdgIdsAll_.end());
0036     } else {
0037       genPdgIds_.insert(genPdgIds_.begin(), genPdgIdsUnsigned.begin(), genPdgIdsUnsigned.end());
0038     }
0039 
0040     // For simplicity, user need not distinguish particles from antiparticles in configuration file.
0041     // But here we must store both explicitely in Settings, since TrackingParticleSelector expects them.
0042     std::transform(genPdgIds_.begin(), genPdgIds_.end(), std::back_inserter(genPdgIds_), std::negate<int>());
0043     std::transform(genPdgIdsAll_.begin(), genPdgIdsAll_.end(), std::back_inserter(genPdgIdsAll_), std::negate<int>());
0044 
0045     // Define the settings for the TrackingParticleSelectors
0046     tpSelectorUseForVtxReco_ = TrackingParticleSelector(genMinPt(),
0047                                                         99999999.,
0048                                                         -genMaxAbsEta(),
0049                                                         genMaxAbsEta(),
0050                                                         genMaxVertR(),
0051                                                         genMaxVertZ(),
0052                                                         0,
0053                                                         true,  //useOnlyTPfromPhysicsCollision
0054                                                         true,  //useOnlyInTimeParticles
0055                                                         true,
0056                                                         false,
0057                                                         genPdgIds());
0058     // Range big enough to include all TP needed to measure tracking efficiency
0059     // and big enough to include any TP that might be reconstructed for fake rate measurement.
0060     // Include all possible particle types here, as if some are left out, L1 tracks matching one of missing types will be declared fake.
0061     tpSelectorUse_ = TrackingParticleSelector(std::min(genMinPt(), 2.),
0062                                               9999999999,
0063                                               -std::max(genMaxAbsEta(), 3.5),
0064                                               std::max(genMaxAbsEta(), 3.5),
0065                                               std::max(10.0, genMaxVertR()),
0066                                               std::max(35.0, genMaxVertZ()),
0067                                               0,
0068                                               false,  //useOnlyTPfromPhysicsCollisionFalse
0069                                               false,  //useOnlyInTimeParticles
0070                                               true,
0071                                               false,
0072                                               genPdgIds(true));
0073     tpSelectorUseForEff_ = TrackingParticleSelector(genMinPt(),
0074                                                     9999999999,
0075                                                     -genMaxAbsEta(),
0076                                                     genMaxAbsEta(),
0077                                                     genMaxVertR(),
0078                                                     genMaxVertZ(),
0079                                                     0,
0080                                                     true,  //useOnlyTPfromPhysicsCollision
0081                                                     true,  //useOnlyInTimeParticles
0082                                                     true,
0083                                                     false,
0084                                                     genPdgIds());
0085 
0086     //--- Sanity checks
0087     if (minNumMatchLayers_ > genMinStubLayers_)
0088       throw cms::Exception(
0089           "Settings.cc: Invalid cfg parameters - You are setting the minimum number of layers incorrectly : type C.");
0090   }
0091 
0092 }  // end namespace l1tVertexFinder