CMS 3D CMS Logo

CSCCathodeLCTProcessor.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCCathodeLCTProcessor_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCCathodeLCTProcessor_h
3 
37 
38 #include <vector>
39 
41 public:
44  unsigned station,
45  unsigned sector,
46  unsigned subsector,
47  unsigned chamber,
48  const edm::ParameterSet& conf);
49 
52 
54  void setConfigParameters(const CSCDBL1TPParameters* conf);
55 
57  void clear();
58 
61  std::vector<CSCCLCTDigi> run(const CSCComparatorDigiCollection* compdc);
62 
65  void run(const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
66 
68  std::vector<CSCCLCTDigi> readoutCLCTs() const;
69  std::vector<CSCCLCTDigi> readoutCLCTsME1a() const;
70  std::vector<CSCCLCTDigi> readoutCLCTsME1b() const;
71 
73  std::vector<CSCCLCTDigi> getCLCTs() const;
74 
77  CSCCLCTDigi getBestCLCT(int bx) const;
78  CSCCLCTDigi getSecondCLCT(int bx) const;
79 
80  std::vector<int> preTriggerBXs() const { return thePreTriggerBXs; }
81 
83  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
84  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1a() const;
85  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1b() const;
86 
87 protected:
90 
93 
95  bool getDigis(const CSCComparatorDigiCollection* compdc);
96  void getDigis(const CSCComparatorDigiCollection* compdc, const CSCDetId& id);
97 
100 
102  void checkConfigParameters();
103 
104  //---------------- Methods common to all firmware versions ------------------
105  // Single-argument version for TMB07 (halfstrip-only) firmware.
106  // Takes the comparator & time info and stuffs it into halfstrip vector.
107  // Multiple hits on the same strip are allowed.
108  void readComparatorDigis(std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
109  void pulseExtension(const std::vector<int> time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
110  const int nStrips,
111  unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
112 
113  //--------------- Functions for post-2007 version of the firmware -----------
114  virtual std::vector<CSCCLCTDigi> findLCTs(
115  const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
116 
117  /* Check all half-strip pattern envelopes simultaneously, on every clock cycle, for a matching pattern */
118  virtual bool preTrigger(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
119  const int start_bx,
120  int& first_bx);
121 
122  /* For a given clock cycle, check each half-strip if a pattern matches */
123  bool patternFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
124  const int nStrips,
125  const unsigned int bx_time);
126 
127  /* Mark the half-strips around the best half-strip as busy */
128  void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
129 
130  //--------------------------- Auxiliary methods -----------------------------
132  void dumpConfigParams() const;
133 
135  void dumpDigis(const std::vector<int> strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS],
136  const int nStrips) const;
137 
138  //--------------------------- Member variables -----------------------------
139 
140  /* best pattern Id for a given half-strip */
142 
143  /* number of layers hit on a given half-strip */
145 
147 
148  /* does a given half-strip have a pre-trigger? */
150 
151  // we use these next ones to address the various bits inside the array that's
152  // used to make the cathode LCTs.
162  };
163 
164  /* number of strips used in this processor */
166 
167  /* Is the layer in the chamber staggered? */
169 
170  std::vector<CSCComparatorDigi> digiV[CSCConstants::NUM_LAYERS];
171  std::vector<int> thePreTriggerBXs;
172  std::vector<CSCCLCTPreTriggerDigi> thePreTriggerDigis;
173 
175  unsigned int fifo_tbins, fifo_pretrig; // only for test beam mode.
176  unsigned int hit_persist, drift_delay;
179  unsigned int tmb_l1a_window_size;
180 
183 
186 
189 
191  static const unsigned int def_fifo_tbins, def_fifo_pretrig;
192  static const unsigned int def_hit_persist, def_drift_delay;
193  static const unsigned int def_nplanes_hit_pretrig;
194  static const unsigned int def_nplanes_hit_pattern;
195  static const unsigned int def_pid_thresh_pretrig, def_min_separation;
196  static const unsigned int def_tmb_l1a_window_size;
197 };
198 
199 #endif
static const unsigned int def_drift_delay
CSCCLCTDigi bestCLCT[CSCConstants::MAX_CLCT_TBINS]
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
bool patternFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, const unsigned int bx_time)
std::vector< CSCCLCTDigi > readoutCLCTs() const
static const unsigned int def_fifo_tbins
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
static const unsigned int def_min_separation
std::vector< CSCCLCTDigi > readoutCLCTsME1b() const
static const unsigned int def_nplanes_hit_pretrig
virtual bool preTrigger(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int start_bx, int &first_bx)
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
static const unsigned int def_pid_thresh_pretrig
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
CSCCLCTDigi getSecondCLCT(int bx) const
void readComparatorDigis(std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
std::vector< CSCCLCTDigi > readoutCLCTsME1a() const
static const unsigned int def_tmb_l1a_window_size
bool getDigis(const CSCComparatorDigiCollection *compdc)
static const unsigned int def_nplanes_hit_pattern
CSCCLCTDigi getBestCLCT(int bx) const
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigisME1b() const
std::vector< CSCCLCTDigi > getCLCTs() const
double pulse(double x, double y, double z, double t)
std::vector< int > preTriggerBXs() const
static const unsigned int def_fifo_pretrig
std::vector< int > thePreTriggerBXs
static const unsigned int def_hit_persist
int stagger[CSCConstants::NUM_LAYERS]
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS]
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigisME1a() const
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigis() const
void setConfigParameters(const CSCDBL1TPParameters *conf)