CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCDigiToRawAccept.cc
Go to the documentation of this file.
3 
5  CSCDetId chamberId = cscDetId.chamberId();
6  if (chamberId.ring() == 4) {
7  chamberId = CSCDetId(chamberId.endcap(), chamberId.station(), 1, chamberId.chamber(), 0);
8  }
9  return chamberId;
10 }
11 
12 // older function for pretriggers BX objects
14  const CSCDetId& cscId, const CSCCLCTPreTriggerCollection& lcts, int bxMin, int bxMax, int nominalBX) {
15  if (bxMin == -999)
16  return true;
17  CSCDetId chamberId = chamberID(cscId);
18  CSCCLCTPreTriggerCollection::Range lctRange = lcts.get(chamberId);
19  bool result = false;
20  for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) {
21  int bx = *lctItr - nominalBX;
22  if (bx >= bxMin && bx <= bxMax) {
23  result = true;
24  break;
25  }
26  }
27  return result;
28 }
29 
30 bool CSCDigiToRawAccept::accept(const CSCDetId& cscId,
32  int bxMin,
33  int bxMax,
34  int nominalBX,
35  std::vector<bool>& preTriggerInCFEB) {
36  if (bxMin == -999)
37  return true;
38 
39  bool atLeastOnePreTrigger = false;
40 
41  CSCDetId chamberId = chamberID(cscId);
42  CSCCLCTPreTriggerDigiCollection::Range lctRange = lcts.get(chamberId);
43  for (CSCCLCTPreTriggerDigiCollection::const_iterator lctItr = lctRange.first; lctItr != lctRange.second; ++lctItr) {
44  int bx = lctItr->getBX() - nominalBX;
45  if (bx >= bxMin && bx <= bxMax) {
46  atLeastOnePreTrigger = true;
47  // save the location of all pretriggers
48  preTriggerInCFEB[lctItr->getCFEB()] = true;
49  }
50  }
51  return atLeastOnePreTrigger;
52 }
int chamber() const
Definition: CSCDetId.h:62
bool accept(const CSCDetId &cscId, const LCTCollection &lcts, int bxMin, int bxMax, int nominalBX)
Range get(const IndexType &index) const
return the digis for a given DetUnit
tuple result
Definition: mps_fire.py:311
int endcap() const
Definition: CSCDetId.h:85
CSCDetId chamberID(const CSCDetId &cscDetId)
CSCDetId chamberId() const
Definition: CSCDetId.h:47
int ring() const
Definition: CSCDetId.h:68
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
int station() const
Definition: CSCDetId.h:79
A container for a generic type of digis indexed by some index, implemented with a map&lt;IndexType...