Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:35

0001 #ifndef L1Trigger_CSCTriggerPrimitives_LCTContainer_h
0002 #define L1Trigger_CSCTriggerPrimitives_LCTContainer_h
0003 
0004 /** \class LCTContainer
0005  *
0006  * This class is a helper class that contains LCTs per BX
0007  *
0008  * Author: Nick McColl
0009  *
0010  */
0011 
0012 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
0013 #include "DataFormats/CSCDigi/interface/CSCConstants.h"
0014 
0015 #include <vector>
0016 #include <algorithm>
0017 
0018 /** for the case when more than 2 LCTs/BX are allowed;
0019     maximum match window = 15 */
0020 class LCTContainer {
0021 public:
0022   // constructor
0023   LCTContainer(unsigned int trig_window_size);
0024 
0025   // default constructor
0026   LCTContainer() {}
0027 
0028   // access the LCT in a particular ALCT BX, a particular CLCT matched BX
0029   // and particular LCT number
0030   CSCCorrelatedLCTDigi& operator()(int bx, int match_bx, int lct);
0031 
0032   // get the matching LCTs for a certain ALCT BX
0033   void getTimeMatched(const int bx, std::vector<CSCCorrelatedLCTDigi>&) const;
0034 
0035   // get all LCTs in the 16 BX readout window
0036   void getMatched(std::vector<CSCCorrelatedLCTDigi>&) const;
0037 
0038   // clear the array with stubs
0039   void clear();
0040 
0041   void setMatchTrigWindowSize(unsigned trig_window_size) { match_trig_window_size_ = trig_window_size; }
0042 
0043 private:
0044   // array with stored LCTs
0045   // 1st index: depth of pipeline that stores the ALCT and CLCT
0046   // 2nd index: BX number of the ALCT-CLCT match in the matching window
0047   // 3rd index: LCT number in the time bin
0048   CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][CSCConstants::MAX_MATCH_WINDOW_SIZE]
0049                            [CSCConstants::MAX_LCTS_PER_CSC];
0050 
0051   // matching trigger window
0052   unsigned match_trig_window_size_;
0053 };
0054 
0055 #endif