CMS 3D CMS Logo

DTBtiChip.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
12 //
13 //--------------------------------------------------
14 #ifndef DT_BTI_CHIP_H
15 #define DT_BTI_CHIP_H
16 
17 //------------------------------------
18 // Collaborating Class Declarations --
19 //------------------------------------
20 class DTBtiHit;
21 class DTBtiTrig;
22 class DTBtiTrigData;
23 class DTDigi;
24 
25 //----------------------
26 // Base Class Headers --
27 //----------------------
36 
37 //---------------
38 // C++ Headers --
39 //---------------
40 #include <vector>
41 #include <memory>
42 #include <array>
43 
44 // ---------------------
45 // -- Class Interface --
46 // ---------------------
47 
48 class DTBtiChip {
49 public:
51  //DTBtiChip(DTTrigGeom* geom, int supl, int n);
52 
54  DTBtiChip(DTBtiCard* card, DTTrigGeom* geom, int supl, int n, DTConfigBti* _config);
55 
57  DTBtiChip(DTBtiChip&& bti) = delete;
58  DTBtiChip(DTBtiChip const& bti) = delete;
59 
61  ~DTBtiChip();
62 
64  DTBtiChip& operator=(DTBtiChip&& bti) = delete;
65  DTBtiChip& operator=(DTBtiChip const& bti) = delete;
66 
68  void add_digi(int cell, const DTDigi* digi);
69 
71  void add_digi_clock(int cell, int clock_digi);
72 
74  std::vector<const DTDigi*> const& get_CellDigis(int cell) const { return _digis[cell]; }
75 
77  void run();
78 
80  void clear();
81 
84  void addTrig(int step, std::unique_ptr<DTBtiTrig> btitrig);
85 
86  // Public const methods
87 
89  inline int number() const { return _id.bti(); }
90 
92  inline int superlayer() const { return _id.superlayer(); }
93 
95  inline LocalPoint localPosition() const { return _geom->localPosition(_id); }
96 
98  inline GlobalPoint CMSPosition() const { return _geom->CMSPosition(_id); }
99 
101  int nCellHit() const;
102 
104  int nTrig(int step) const;
105 
106  // // Return the trigger vector
107  std::vector<std::unique_ptr<DTBtiTrig>> const& trigList(int step) const;
108 
110  DTBtiTrig const* trigger(int step, unsigned n) const;
111 
113  DTBtiTrigData triggerData(int step, unsigned n) const;
114 
116  //inline DTConfig* config() const { return _geom->config(); }
117 
119  inline DTConfigBti* config() const { return _config; }
120 
122  inline DTTrigGeom* geom() const { return _geom; }
123 
125  inline DTBtiId id() const { return _id; }
126 
128  inline int wheel() const { return _geom->wheel(); }
129 
131  inline int station() const { return _geom->station(); }
132 
134  inline int sector() const { return _geom->sector(); }
135 
136  void init_clock(); // initialization from clocks
137 
138 private:
139  void init(); // initialization
140  void tick(); // next step (80 MHz)
141  // return current step (40MHz)
142  inline int currentStep() const { return (int)(((float)(_curStep) + 0.5) / 2); }
143  inline int currentIntStep() const { return _curStep; } // int. step (80MHz)
144  void computeSums(); // compute sums and diffs
145  void sum(const int s, const int a, const int b); // " a sum and dif
146  void computeEqs(); // compute X and K equat.
147  void findTrig(); // find triggers
148  int keepTrig(const int eq, const int acp, const int code); // find a trigger
149  int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag); //SV
150  bool matchEq(float eqA, float eqB, int AC);
151  void acceptMask(BitArray<80>* BitArrPtr, int k, int accep);
152  void doLTS(); // adjacent LTRIG suppression
153  int store(const int eq,
154  const int code,
155  const int K,
156  const int X,
157  float KeqAB = 0.,
158  float KeqBC = 0.,
159  float KeqCD = 0.,
160  float KeqAC = 0.,
161  float KeqBD = 0.,
162  float KeqAD = 0.);
163  void eraseTrigger(int step, unsigned n); // Erase the requested trigger
164  void setSnap();
165  void reSumSet(); //remainder table compute
166  int reSum(int a, int b) { return reSumAr[a][b + 2]; }
167  int reSum23(int a, int b) { return reSumAr23[a][b + 2]; }
168 
169 private:
170  // parent card
172 
175 
177 
178  // input data from DTDigis
179  std::array<std::vector<const DTDigi*>, 9> _digis;
180  // input data from clock digis
181  std::array<std::vector<int>, 9> _digis_clock;
182 
183  // output data (ordered by step number)
184  std::array<std::vector<std::unique_ptr<DTBtiTrig>>, DTConfig::NSTEPL - DTConfig::NSTEPF + 1> _trigs;
185 
186  // internal use variables
187  int _curStep; // current step
188  std::array<std::vector<DTBtiHit*>, 9> _hits; // current hits in cells
189  std::array<int, 9> _thisStepUsedTimes; // current used times in cells (JTRIG)
190  std::array<DTBtiHit*, 9> _thisStepUsedHit; // link to currently used hits
191  int _nStepUsedHits; // number of currently used hits
192  std::array<float, 25> _sums, _difs; // time sums and differences
193  float _Keq[32][6]; // The K equations
194  float _Xeq[32][2]; // The X equations
195  int _MinKAcc; // min K value accepted by DTBtiChip
196  int _MaxKAcc; // max K value accepted by DTBtiChip
197  int _MinKleftTraco; // K limits for left traco
199  int _MinKcenterTraco; // K limits for center traco
201  int _MinKrightTraco; // K limits for right traco
203 
204  float _XeqAC_patt0, _XeqBD_patt0; // special pattern 0 X equations
206 
207  float _KTR[32][2]; //
208  float _JTR[32][3]; //
209  int init_done; // initialization flag
210  std::array<int, 9> _busyStart_clock; // SV - busy wire flag
211 
212  //snap register variables
213  int ST43, RE43, ST23, RE23, ST, ST2, ST3, ST4, ST5, ST7;
214  //remainder table
215  int reSumAr[3][5];
216  int reSumAr23[3][5];
217 };
218 #endif
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
Definition: DTBtiChip.cc:360
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:508
DTBtiId _id
Definition: DTBtiChip.h:176
DTBtiChip(DTBtiCard *card, DTTrigGeom *geom, int supl, int n, DTConfigBti *_config)
original constructor
Definition: DTBtiChip.cc:48
int sector() const
Return sector number.
Definition: DTTrigGeom.h:65
int _MinKAcc
Definition: DTBtiChip.h:195
float _JTR[32][3]
Definition: DTBtiChip.h:208
std::vector< std::unique_ptr< DTBtiTrig > > const & trigList(int step) const
Definition: DTBtiChip.cc:336
int _MinKrightTraco
Definition: DTBtiChip.h:201
float _XeqBD_patt0
Definition: DTBtiChip.h:204
float _XeqCD_patt0
Definition: DTBtiChip.h:205
DTBtiChip & operator=(DTBtiChip &&bti)=delete
Assignment operator.
std::array< std::vector< std::unique_ptr< DTBtiTrig > >, DTConfig::NSTEPL - DTConfig::NSTEPF+1 > _trigs
Definition: DTBtiChip.h:184
std::array< std::vector< const DTDigi * >, 9 > _digis
Definition: DTBtiChip.h:179
GlobalPoint CMSPosition() const
Position in CMS frame.
Definition: DTBtiChip.h:98
int keepTrig(const int eq, const int acp, const int code)
void eraseTrigger(int step, unsigned n)
Definition: DTBtiChip.cc:375
int _MaxKcenterTraco
Definition: DTBtiChip.h:200
DTBtiId id() const
Return the DTBtiChip Id.
Definition: DTBtiChip.h:125
int store(const int eq, const int code, const int K, const int X, float KeqAB=0., float KeqBC=0., float KeqCD=0., float KeqAC=0., float KeqBD=0., float KeqAD=0.)
Definition: DTBtiChip.cc:630
void tick()
Definition: DTBtiChip.cc:527
static const int NSTEPF
Definition: DTConfig.h:35
#define X(str)
Definition: MuonsGrabber.cc:38
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
std::array< int, 9 > _thisStepUsedTimes
Definition: DTBtiChip.h:189
int init_done
Definition: DTBtiChip.h:209
void clear()
delete hits and triggers
Definition: DTBtiChip.cc:388
std::array< float, 25 > _difs
Definition: DTBtiChip.h:192
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:177
DTBtiTrig const * trigger(int step, unsigned n) const
Return the requested trigger.
Definition: DTBtiChip.cc:345
float _Xeq[32][2]
Definition: DTBtiChip.h:194
int reSum(int a, int b)
Definition: DTBtiChip.h:166
std::array< DTBtiHit *, 9 > _thisStepUsedHit
Definition: DTBtiChip.h:190
DTBtiCard * _card
Definition: DTBtiChip.h:171
void doLTS()
Definition: DTBtiChip.cc:588
int _MaxKAcc
Definition: DTBtiChip.h:196
DTTrigGeom * geom() const
Return trigger geometry.
Definition: DTBtiChip.h:122
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:482
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:59
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:89
int _MinKleftTraco
Definition: DTBtiChip.h:197
DTTrigGeom * _geom
Definition: DTBtiChip.h:173
int reSumAr23[3][5]
Definition: DTBtiChip.h:216
void init_clock()
Definition: DTBtiChip.cc:444
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:61
~DTBtiChip()
Destructor.
Definition: DTBtiChip.cc:210
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
Definition: DTDigi.h:17
int RE43
Definition: DTBtiChip.h:213
float _Keq[32][6]
Definition: DTBtiChip.h:193
std::array< int, 9 > _busyStart_clock
Definition: DTBtiChip.h:210
int station() const
Return station number.
Definition: DTTrigGeom.h:62
void sum(const int s, const int a, const int b)
int _curStep
Definition: DTBtiChip.h:187
DTConfigBti * config() const
Configuration set.
Definition: DTBtiChip.h:119
int station() const
Return station number.
Definition: DTBtiChip.h:131
int ST23
Definition: DTBtiChip.h:213
std::array< std::vector< int >, 9 > _digis_clock
Definition: DTBtiChip.h:181
int currentIntStep() const
Definition: DTBtiChip.h:143
std::array< std::vector< DTBtiHit * >, 9 > _hits
Definition: DTBtiChip.h:188
int sector() const
Return sector number.
Definition: DTBtiChip.h:134
int reSumAr[3][5]
Definition: DTBtiChip.h:215
int reSum23(int a, int b)
Definition: DTBtiChip.h:167
int _MaxKrightTraco
Definition: DTBtiChip.h:202
double b
Definition: hdecay.h:118
LocalPoint localPosition() const
Position in chamber frame (x is the one of first traco in slave plane)
Definition: DTBtiChip.h:95
float _XeqAC_patt0
Definition: DTBtiChip.h:204
float _KTR[32][2]
Definition: DTBtiChip.h:207
std::vector< const DTDigi * > const & get_CellDigis(int cell) const
get digi vector - SV 28/XI/02
Definition: DTBtiChip.h:74
float _XeqAB_patt0
Definition: DTBtiChip.h:205
int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag)
DTConfigBti * _config
Definition: DTBtiChip.h:174
double a
Definition: hdecay.h:119
bool matchEq(float eqA, float eqB, int AC)
int RE23
Definition: DTBtiChip.h:213
int _nStepUsedHits
Definition: DTBtiChip.h:191
std::array< float, 25 > _sums
Definition: DTBtiChip.h:192
void init()
Definition: DTBtiChip.cc:407
int nTrig(int step) const
Number of triggers found.
Definition: DTBtiChip.cc:327
step
Definition: StallMonitor.cc:98
int wheel() const
Return wheel number.
Definition: DTBtiChip.h:128
int _MinKcenterTraco
Definition: DTBtiChip.h:199
int ST43
Definition: DTBtiChip.h:213
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
Definition: DTBtiChip.cc:212
void addTrig(int step, std::unique_ptr< DTBtiTrig > btitrig)
Definition: DTBtiChip.cc:314
void acceptMask(BitArray< 80 > *BitArrPtr, int k, int accep)
int nCellHit() const
Number of cells with hits.
Definition: DTBtiChip.cc:266
int _MaxKleftTraco
Definition: DTBtiChip.h:198
void add_digi_clock(int cell, int clock_digi)
Add a clock digi to the DTBtiChip.
Definition: DTBtiChip.cc:242
int currentStep() const
Definition: DTBtiChip.h:142
int superlayer() const
Return superlayer.
Definition: DTBtiChip.h:92
void setSnap()
Definition: DTBtiChip.cc:699