CMS 3D CMS Logo

Functions
cscd2r Namespace Reference

Functions

template<typename LCTCollection >
bool accept (const CSCDetId &cscId, const LCTCollection &lcts, int bxMin, int bxMax, bool me1abCheck=false)
 
template<>
bool accept (const CSCDetId &cscId, const CSCCLCTPreTriggerCollection &lcts, int bxMin, int bxMax, bool me1abCheck)
 
CSCDetId chamberID (const CSCDetId &cscDetId)
 takes layer ID, converts to chamber ID, switching ME1A to ME11 More...
 

Function Documentation

template<typename LCTCollection >
bool cscd2r::accept ( const CSCDetId cscId,
const LCTCollection &  lcts,
int  bxMin,
int  bxMax,
bool  me1abCheck = false 
)

Definition at line 41 of file CSCDigiToRaw.cc.

References CSCDetId::chamber(), chamberID(), CSCDetId::endcap(), mps_fire::result, CSCDetId::ring(), and CSCDetId::station().

Referenced by CSCDigiToRaw::add().

43 {
44  if (bxMin == -999) return true;
45  int nominalBX = 6;
46  CSCDetId chamberId = chamberID(cscId);
47  typename LCTCollection::Range lctRange = lcts.get(chamberId);
48  bool result = false;
49  for (typename LCTCollection::const_iterator lctItr = lctRange.first;
50  lctItr != lctRange.second; ++lctItr)
51  {
52  int bx = lctItr->getBX() - nominalBX;
53  if (bx >= bxMin && bx <= bxMax)
54  {
55  result = true;
56  break;
57  }
58  }
59 
60  bool me1 = cscId.station() == 1 && cscId.ring() == 1;
61  //this is another "creative" recovery of smart ME1A-ME1B TMB logic cases:
62  //wire selective readout requires at least one (A)LCT in the full chamber
63  if (me1 && result == false && me1abCheck){
64  CSCDetId me1aId = CSCDetId(chamberId.endcap(), chamberId.station(), 4, chamberId.chamber(), 0);
65  lctRange = lcts.get(me1aId);
66  for (typename LCTCollection::const_iterator lctItr = lctRange.first;
67  lctItr != lctRange.second; ++lctItr)
68  {
69  int bx = lctItr->getBX() - nominalBX;
70  if (bx >= bxMin && bx <= bxMax)
71  {
72  result = true;
73  break;
74  }
75  }
76  }
77 
78  return result;
79 }
int chamber() const
Definition: CSCDetId.h:68
PixelRecoRange< float > Range
int endcap() const
Definition: CSCDetId.h:93
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:30
int ring() const
Definition: CSCDetId.h:75
int station() const
Definition: CSCDetId.h:86
template<>
bool cscd2r::accept ( const CSCDetId cscId,
const CSCCLCTPreTriggerCollection lcts,
int  bxMin,
int  bxMax,
bool  me1abCheck 
)

Definition at line 83 of file CSCDigiToRaw.cc.

References chamberID(), mps_fire::result, CSCDetId::ring(), and CSCDetId::station().

85 {
86  if (bxMin == -999) return true;
87  int nominalBX = 6;
88  CSCDetId chamberId = chamberID(cscId);
89  CSCCLCTPreTriggerCollection::Range lctRange = lcts.get(chamberId);
90  bool result = false;
91  for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first;
92  lctItr != lctRange.second; ++lctItr)
93  {
94  int bx = *lctItr - nominalBX;
95  if (bx >= bxMin && bx <= bxMax)
96  {
97  result = true;
98  break;
99  }
100  }
101  bool me1a = cscId.station() == 1 && cscId.ring() == 4;
102  if (me1a && result == false && me1abCheck) {
103  //check pretriggers in me1a as well; relevant for TMB emulator writing to separate detIds
104  lctRange = lcts.get(cscId);
105  for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first;
106  lctItr != lctRange.second; ++lctItr)
107  {
108  int bx = *lctItr - nominalBX;
109  if (bx >= bxMin && bx <= bxMax)
110  {
111  result = true;
112  break;
113  }
114  }
115  }
116  return result;
117 }
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:30
int ring() const
Definition: CSCDetId.h:75
std::vector< CSCCLCTPreTrigger >::const_iterator const_iterator
int station() const
Definition: CSCDetId.h:86
std::pair< const_iterator, const_iterator > Range
CSCDetId cscd2r::chamberID ( const CSCDetId cscDetId)

takes layer ID, converts to chamber ID, switching ME1A to ME11

Definition at line 30 of file CSCDigiToRaw.cc.

References CSCDetId::chamber(), CSCDetId::chamberId(), CSCDetId::endcap(), CSCDetId::ring(), and CSCDetId::station().

Referenced by accept(), DTDigiToRaw::createFedBuffers(), CSCDigiToRaw::findEventData(), cscdqm::EventProcessor::processCSC(), and cscdqm::EventProcessor::processExaminer().

31 {
32  CSCDetId chamberId = cscDetId.chamberId();
33  if (chamberId.ring() ==4)
34  {
35  chamberId = CSCDetId(chamberId.endcap(), chamberId.station(), 1, chamberId.chamber(), 0);
36  }
37  return chamberId;
38 }
int chamber() const
Definition: CSCDetId.h:68
int endcap() const
Definition: CSCDetId.h:93
CSCDetId chamberId() const
Definition: CSCDetId.h:53
int ring() const
Definition: CSCDetId.h:75
int station() const
Definition: CSCDetId.h:86