CMS 3D CMS Logo

EMTFSubsystemCollector.cc
Go to the documentation of this file.
2 
5 
6 
7 // Specialized for CSC
8 template<>
10  CSCTag tag, // Defined in interface/EMTFSubsystemTag.h, maps to CSCCorrelatedLCTDigi
11  const edm::Event& iEvent,
12  const edm::EDGetToken& token,
14 ) {
16  iEvent.getByToken(token, cscDigis);
17 
18  auto chamber = cscDigis->begin();
19  auto chend = cscDigis->end();
20  for( ; chamber != chend; ++chamber ) {
21  auto digi = (*chamber).second.first;
22  auto dend = (*chamber).second.second;
23  for( ; digi != dend; ++digi ) {
24  // emplace_back does the same thing as push_back: appends to the end of the vector
25  out.emplace_back((*chamber).first,*digi);
26  }
27  }
28  return;
29 }
30 
31 // Specialized for RPC
32 template<>
34  RPCTag tag, // Defined in interface/EMTFSubsystemTag.h, maps to RPCDigi
35  const edm::Event& iEvent,
36  const edm::EDGetToken& token,
38 ) {
40  iEvent.getByToken(token, rpcDigis);
41 
42  auto chamber = rpcDigis->begin();
43  auto chend = rpcDigis->end();
44  for( ; chamber != chend; ++chamber ) {
45  auto digi = (*chamber).second.first;
46  auto dend = (*chamber).second.second;
47  for( ; digi != dend; ++digi ) {
48  if ((*chamber).first.region() != 0) { // 0 is barrel
49  if ((*chamber).first.station() <= 2 && (*chamber).first.ring() == 3) continue; // do not include RE1/3, RE2/3
50  if ((*chamber).first.station() >= 3 && (*chamber).first.ring() == 1) continue; // do not include RE3/1, RE4/1
51 
52  out.emplace_back((*chamber).first,digi->strip(),(*chamber).first.layer(),digi->bx());
53  }
54  }
55  }
56  return;
57 }
58 
59 // Specialized for GEM
60 template<>
62  GEMTag tag, // Defined in interface/EMTFSubsystemTag.h, maps to GEMPadDigi
63  const edm::Event& iEvent,
64  const edm::EDGetToken& token,
66 ) {
68  iEvent.getByToken(token, gemDigis);
69 
70  auto chamber = gemDigis->begin();
71  auto chend = gemDigis->end();
72  for( ; chamber != chend; ++chamber ) {
73  auto digi = (*chamber).second.first;
74  auto dend = (*chamber).second.second;
75  for( ; digi != dend; ++digi ) {
76  out.emplace_back((*chamber).first,*digi);
77  }
78  }
79  return;
80 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
int iEvent
Definition: GenABIO.cc:230
void extractPrimitives(T tag, const edm::Event &iEvent, const edm::EDGetToken &token, TriggerPrimitiveCollection &out)
L1TMuon::TriggerPrimitiveCollection TriggerPrimitiveCollection
Definition: Common.h:30