CMS 3D CMS Logo

LCTContainer.cc
Go to the documentation of this file.
2 
3 LCTContainer::LCTContainer(unsigned int trig_window_size) : match_trig_window_size_(trig_window_size) {}
4 
5 CSCCorrelatedLCTDigi& LCTContainer::operator()(int bx, int match_bx, int lct) { return data[bx][match_bx][lct]; }
6 
7 void LCTContainer::getTimeMatched(const int bx, std::vector<CSCCorrelatedLCTDigi>& lcts) const {
8  for (unsigned int mbx = 0; mbx < match_trig_window_size_; mbx++) {
9  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
10  // consider only valid LCTs
11  if (not data[bx][mbx][i].isValid())
12  continue;
13 
14  // remove duplicated LCTs
15  if (std::find(lcts.begin(), lcts.end(), data[bx][mbx][i]) != lcts.end())
16  continue;
17 
18  lcts.push_back(data[bx][mbx][i]);
19  }
20  }
21 }
22 
23 void LCTContainer::getMatched(std::vector<CSCCorrelatedLCTDigi>& lcts) const {
24  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
25  std::vector<CSCCorrelatedLCTDigi> temp_lcts;
26  LCTContainer::getTimeMatched(bx, temp_lcts);
27  lcts.insert(std::end(lcts), std::begin(temp_lcts), std::end(temp_lcts));
28  }
29 }
30 
32  // Loop over all time windows
33  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++) {
34  // Loop over all matched trigger windows
35  for (unsigned int mbx = 0; mbx < match_trig_window_size_; mbx++) {
36  // Loop over all stubs
37  for (int i = 0; i < CSCConstants::MAX_LCTS_PER_CSC; i++) {
38  data[bx][mbx][i].clear();
39  }
40  }
41  }
42 }
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:23
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void getTimeMatched(const int bx, std::vector< CSCCorrelatedLCTDigi > &) const
Definition: LCTContainer.cc:7
CSCCorrelatedLCTDigi & operator()(int bx, int match_bx, int lct)
Definition: LCTContainer.cc:5
unsigned match_trig_window_size_
Definition: LCTContainer.h:52
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][CSCConstants::MAX_MATCH_WINDOW_SIZE][CSCConstants::MAX_LCTS_PER_CSC]
Definition: LCTContainer.h:49
void clear()
clear this LCT