CMS 3D CMS Logo

TrackFinder.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 #include <sstream>
5 
7  : setup_(iConfig),
8  sector_processors_(),
9  tokenDTPhi_(iConsumes.consumes<emtf::DTTag::digi_collection>(iConfig.getParameter<edm::InputTag>("DTPhiInput"))),
10  tokenDTTheta_(
11  iConsumes.consumes<emtf::DTTag::theta_digi_collection>(iConfig.getParameter<edm::InputTag>("DTThetaInput"))),
12  tokenCSC_(iConsumes.consumes<emtf::CSCTag::digi_collection>(iConfig.getParameter<edm::InputTag>("CSCInput"))),
13  tokenCSCComparator_(iConsumes.consumes<emtf::CSCTag::comparator_digi_collection>(
14  iConfig.getParameter<edm::InputTag>("CSCComparatorInput"))),
15  tokenRPC_(iConsumes.consumes<emtf::RPCTag::digi_collection>(iConfig.getParameter<edm::InputTag>("RPCInput"))),
16  tokenCPPF_(iConsumes.consumes<emtf::CPPFTag::digi_collection>(iConfig.getParameter<edm::InputTag>("CPPFInput"))),
17  tokenGEM_(iConsumes.consumes<emtf::GEMTag::digi_collection>(iConfig.getParameter<edm::InputTag>("GEMInput"))),
18  tokenME0_(iConsumes.consumes<emtf::ME0Tag::digi_collection>(iConfig.getParameter<edm::InputTag>("ME0Input"))),
19  verbose_(iConfig.getUntrackedParameter<int>("verbosity")) {}
20 
22 
24  const edm::EventSetup& iSetup,
25  EMTFHitCollection& out_hits,
26  EMTFTrackCollection& out_tracks) {
27  // Clear output collections
28  out_hits.clear();
29  out_tracks.clear();
30 
31  // Check and update geometry, conditions, versions, sp LUTs, and pt assignment engine
32  setup_.reload(iEvent, iSetup);
33 
34  auto tp_geom_ = &(setup_.getGeometryTranslator());
35 
36  // Check versions
37  if (verbose_ > 0) { // debug
38  std::cout << "Event: " << iEvent.id() << " isData: " << iEvent.isRealData() << " useO2O: " << setup_.useO2O()
39  << " era: " << setup_.era() << " fw_ver: " << setup_.get_fw_version()
40  << " pt_lut_ver: " << setup_.get_pt_lut_version()
41  << " pt_lut_ver in engine: " << setup_.getPtAssignmentEngine()->get_pt_lut_version()
42  << " pc_lut_ver: " << setup_.get_pc_lut_version()
43  << " pc_lut_ver in cond (i): " << setup_.getConditionHelper().get_pc_lut_version()
44  << " pc_lut_ver in cond (ii): " << setup_.getConditionHelper().get_pc_lut_version_unchecked()
45  << std::endl;
46  }
47 
48  // ___________________________________________________________________________
49  // Extract all trigger primitives
50 
51  TriggerPrimitiveCollection muon_primitives;
52 
53  EMTFSubsystemCollector collector;
54 
55  auto iConfig = setup_.getConfig();
56  auto useDT = iConfig.getParameter<bool>("DTEnable");
57  auto useCSC = iConfig.getParameter<bool>("CSCEnable");
58  auto useRPC = iConfig.getParameter<bool>("RPCEnable");
59  auto useIRPC = iConfig.getParameter<bool>("IRPCEnable");
60  auto useCPPF = iConfig.getParameter<bool>("CPPFEnable");
61  auto useGEM = iConfig.getParameter<bool>("GEMEnable");
62  auto useME0 = iConfig.getParameter<bool>("ME0Enable");
63 
64  if (useCSC) {
65  collector.extractPrimitives(emtf::CSCTag(), tp_geom_, iEvent, tokenCSC_, muon_primitives);
66  //collector.extractPrimitives(emtf::CSCTag(), tp_geom_, iEvent, tokenCSC_, tokenCSCComparator_, muon_primitives);
67  }
68  if (useRPC && useCPPF) {
69  collector.extractPrimitives(emtf::CPPFTag(), tp_geom_, iEvent, tokenCPPF_, muon_primitives);
70  } else if (useRPC) {
71  collector.extractPrimitives(emtf::RPCTag(), tp_geom_, iEvent, tokenRPC_, muon_primitives);
72  }
73  if (useIRPC) {
74  collector.extractPrimitives(emtf::IRPCTag(), tp_geom_, iEvent, tokenRPC_, muon_primitives);
75  }
76  if (useGEM) {
77  collector.extractPrimitives(emtf::GEMTag(), tp_geom_, iEvent, tokenGEM_, muon_primitives);
78  }
79  if (useME0) {
80  collector.extractPrimitives(emtf::ME0Tag(), tp_geom_, iEvent, tokenME0_, muon_primitives);
81  }
82  if (useDT) {
83  collector.extractPrimitives(emtf::DTTag(), tp_geom_, iEvent, tokenDTPhi_, tokenDTTheta_, muon_primitives);
84  }
85 
86  // Check trigger primitives. The printout is really verbose.
87  if (verbose_ > 2) { // debug
88  std::cout << "Num of TriggerPrimitive: " << muon_primitives.size() << std::endl;
89  for (const auto& p : muon_primitives) {
90  p.print(std::cout);
91  }
92  }
93 
94  // ___________________________________________________________________________
95  // Run the sector processors
96 
98  for (int sector = emtf::MIN_TRIGSECTOR; sector <= emtf::MAX_TRIGSECTOR; ++sector) {
100  (sector - emtf::MIN_TRIGSECTOR);
101 
102  sector_processors_.at(es).configure(&setup_, verbose_, endcap, sector);
103  sector_processors_.at(es).process(iEvent.id(), muon_primitives, out_hits, out_tracks);
104  }
105  }
106 
107  // ___________________________________________________________________________
108  // Check emulator input and output. They are printed as raw text that is
109  // used by the firmware simulator to do comparisons.
110  if (verbose_ > 1) { // debug
111  emtf::dump_fw_raw_input(out_hits, out_tracks);
112  }
113 
114  return;
115 }
EMTFSubsystemCollector::extractPrimitives
void extractPrimitives(T tag, const GeometryTranslator *tp_geom, const edm::Event &iEvent, const edm::EDGetToken &token, TriggerPrimitiveCollection &out) const
emtf::CSCTag
Definition: EMTFSubsystemTag.h:31
TrackFinder::tokenDTPhi_
const edm::EDGetToken tokenDTPhi_
Definition: TrackFinder.h:35
emtf::MIN_TRIGSECTOR
constexpr int MIN_TRIGSECTOR
Definition: Common.h:49
TrackFinder::tokenCSC_
const edm::EDGetToken tokenCSC_
Definition: TrackFinder.h:37
emtf::GEMTag
Definition: EMTFSubsystemTag.h:57
emtf::CPPFTag
Definition: EMTFSubsystemTag.h:52
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EMTFSetup::era
std::string era() const
Definition: EMTFSetup.h:52
emtf::MAX_ENDCAP
constexpr int MAX_ENDCAP
Definition: Common.h:46
ConditionHelper::get_pc_lut_version_unchecked
unsigned int get_pc_lut_version_unchecked() const
Definition: ConditionHelper.cc:88
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
TrackFinder.h
TrackFinder::tokenDTTheta_
const edm::EDGetToken tokenDTTheta_
Definition: TrackFinder.h:36
emtf::MAX_TRIGSECTOR
constexpr int MAX_TRIGSECTOR
Definition: Common.h:50
TrackFinder::tokenCPPF_
const edm::EDGetToken tokenCPPF_
Definition: TrackFinder.h:40
EMTFSetup::getConfig
const edm::ParameterSet & getConfig() const
Definition: EMTFSetup.h:49
TrackFinder::tokenRPC_
const edm::EDGetToken tokenRPC_
Definition: TrackFinder.h:39
EMTFSetup::useO2O
bool useO2O() const
Definition: EMTFSetup.h:51
TrackFinder::verbose_
int verbose_
Definition: TrackFinder.h:44
EMTFTrackCollection
l1t::EMTFTrackCollection EMTFTrackCollection
Definition: Common.h:27
TrackFinder::TrackFinder
TrackFinder(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iConsumes)
Definition: TrackFinder.cc:6
EMTFSetup::getGeometryTranslator
const GeometryTranslator & getGeometryTranslator() const
Definition: EMTFSetup.h:28
emtf
Definition: Event.h:15
emtf::MIN_ENDCAP
constexpr int MIN_ENDCAP
Definition: Common.h:45
EMTFHitCollection
l1t::EMTFHitCollection EMTFHitCollection
Definition: Common.h:23
TrackFinder::tokenGEM_
const edm::EDGetToken tokenGEM_
Definition: TrackFinder.h:41
TrackFinder::tokenME0_
const edm::EDGetToken tokenME0_
Definition: TrackFinder.h:42
TrackFinder::setup_
EMTFSetup setup_
Definition: TrackFinder.h:30
emtf::ME0Tag
Definition: EMTFSubsystemTag.h:62
EMTFSubsystemCollector
Definition: EMTFSubsystemCollector.h:13
emtf::RPCTag
Definition: EMTFSubsystemTag.h:38
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
emtf::dump_fw_raw_input
void dump_fw_raw_input(const l1t::EMTFHitCollection &out_hits, const l1t::EMTFTrackCollection &out_tracks)
Definition: DebugTools.cc:5
EMTFSetup::reload
void reload(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: EMTFSetup.cc:33
EMTFSetup::get_pt_lut_version
unsigned get_pt_lut_version() const
Definition: EMTFSetup.h:45
TriggerPrimitiveCollection
L1TMuon::TriggerPrimitiveCollection TriggerPrimitiveCollection
Definition: Common.h:32
emtf::IRPCTag
Definition: EMTFSubsystemTag.h:45
createfilelist.int
int
Definition: createfilelist.py:10
EMTFSetup::get_pc_lut_version
unsigned get_pc_lut_version() const
Definition: EMTFSetup.h:46
iEvent
int iEvent
Definition: GenABIO.cc:224
ConditionHelper::get_pc_lut_version
unsigned int get_pc_lut_version() const
Definition: ConditionHelper.cc:71
EMTFSetup::getPtAssignmentEngine
PtAssignmentEngine * getPtAssignmentEngine() const
Definition: EMTFSetup.h:36
edm::EventSetup
Definition: EventSetup.h:57
emtf::DTTag
Definition: EMTFSubsystemTag.h:24
PtAssignmentEngine::get_pt_lut_version
int get_pt_lut_version() const
Definition: PtAssignmentEngine.h:28
TrackFinder::sector_processors_
emtf::sector_array< SectorProcessor > sector_processors_
Definition: TrackFinder.h:32
muons1stStep_cfi.useME0
useME0
Definition: muons1stStep_cfi.py:95
TrackFinder::~TrackFinder
~TrackFinder()
Definition: TrackFinder.cc:21
muons1stStep_cfi.useGEM
useGEM
Definition: muons1stStep_cfi.py:93
EMTFSetup::get_fw_version
unsigned get_fw_version() const
Definition: EMTFSetup.h:44
EMTFSetup::getConditionHelper
const ConditionHelper & getConditionHelper() const
Definition: EMTFSetup.h:30
csctfTrackDigis_cfi.useDT
useDT
Definition: csctfTrackDigis_cfi.py:122
dtTriggerPhase2PrimitiveDigis_cfi.useRPC
useRPC
Definition: dtTriggerPhase2PrimitiveDigis_cfi.py:40
edm::Event
Definition: Event.h:73
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
TrackFinder::process
void process(const edm::Event &iEvent, const edm::EventSetup &iSetup, EMTFHitCollection &out_hits, EMTFTrackCollection &out_tracks)
Definition: TrackFinder.cc:23