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 
50  public:
51 
53  //DTBtiChip(DTTrigGeom* geom, int supl, int n);
54 
56  DTBtiChip(DTBtiCard* card, DTTrigGeom* geom, int supl, int n, DTConfigBti* _config );
57 
59  DTBtiChip(DTBtiChip&& bti) = delete;
60  DTBtiChip(DTBtiChip const& bti) = delete;
61 
63  ~DTBtiChip();
64 
66  DTBtiChip& operator=(DTBtiChip&& bti) = delete;
67  DTBtiChip& operator=(DTBtiChip const& bti) = delete;
68 
70  void add_digi(int cell, const DTDigi* digi);
71 
73  void add_digi_clock(int cell, int clock_digi);
74 
76  std::vector<const DTDigi*> const& get_CellDigis(int cell) const { return _digis[cell];}
77 
79  void run();
80 
82  void clear();
83 
86  void addTrig(int step, std::unique_ptr<DTBtiTrig> btitrig);
87 
88  // Public const methods
89 
91  inline int number() const { return _id.bti(); }
92 
94  inline int superlayer() const { return _id.superlayer(); }
95 
97  inline LocalPoint localPosition() const { return _geom->localPosition(_id); }
98 
100  inline GlobalPoint CMSPosition() const { return _geom->CMSPosition(_id); }
101 
103  int nCellHit() const;
104 
106  int nTrig(int step) const;
107 
108  // // Return the trigger vector
109  std::vector<std::unique_ptr<DTBtiTrig>> const& trigList(int step) const;
110 
112  DTBtiTrig const* trigger(int step, unsigned n) const;
113 
115  DTBtiTrigData triggerData(int step, unsigned n) const;
116 
118  //inline DTConfig* config() const { return _geom->config(); }
119 
121  inline DTConfigBti* config() const { return _config; }
122 
123 
125  inline DTTrigGeom* geom() const { return _geom; }
126 
128  inline DTBtiId id() const { return _id; }
129 
131  inline int wheel() const { return _geom->wheel(); }
132 
134  inline int station() const { return _geom->station(); }
135 
137  inline int sector() const { return _geom->sector(); }
138 
139  void init_clock(); // initialization from clocks
140 
141 
142 
143  private:
144 
145  void init(); // initialization
146  void tick(); // next step (80 MHz)
147  // return current step (40MHz)
148  inline int currentStep() const { return (int)(((float)(_curStep)+0.5)/2); }
149  inline int currentIntStep() const { return _curStep; } // int. step (80MHz)
150  void computeSums(); // compute sums and diffs
151  void sum(const int s, const int a, const int b); // " a sum and dif
152  void computeEqs(); // compute X and K equat.
153  void findTrig(); // find triggers
154  int keepTrig(const int eq, const int acp, const int code); // find a trigger
155  int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag);//SV
156  bool matchEq(float eqA, float eqB, int AC);
157  void acceptMask(BitArray<80> * BitArrPtr,int k,int accep);
158  void doLTS(); // adjacent LTRIG suppression
159  int store(const int eq, const int code, const int K, const int X,
160  float KeqAB=0., float KeqBC=0., float KeqCD=0.,
161  float KeqAC=0., float KeqBD=0., float KeqAD=0.);
162  void eraseTrigger(int step, unsigned n); // Erase the requested trigger
163  void setSnap();
164  void reSumSet(); //remainder table compute
165  int reSum(int a, int b) { return reSumAr[a][b+2];}
166  int reSum23(int a, int b) { return reSumAr23[a][b+2];}
167 
168  private:
169 
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 };
219 #endif
220 
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:66
std::array< int, 9 > _thisStepUsedTimes
Definition: DTBtiChip.h:189
int _MinKAcc
Definition: DTBtiChip.h:195
float _JTR[32][3]
Definition: DTBtiChip.h:208
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.
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:60
int superlayer() const
Return superlayer.
Definition: DTBtiChip.h:94
std::array< std::vector< int >, 9 > _digis_clock
Definition: DTBtiChip.h:181
int keepTrig(const int eq, const int acp, const int code)
void eraseTrigger(int step, unsigned n)
Definition: DTBtiChip.cc:399
int _MaxKcenterTraco
Definition: DTBtiChip.h:200
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:669
std::array< int, 9 > _busyStart_clock
Definition: DTBtiChip.h:210
void tick()
Definition: DTBtiChip.cc:560
static const int NSTEPF
Definition: DTConfig.h:36
#define X(str)
Definition: MuonsGrabber.cc:48
int init_done
Definition: DTBtiChip.h:209
int sector() const
Return sector number.
Definition: DTBtiChip.h:137
void clear()
delete hits and triggers
Definition: DTBtiChip.cc:413
DTBtiId id() const
Return the DTBtiChip Id.
Definition: DTBtiChip.h:128
float _Xeq[32][2]
Definition: DTBtiChip.h:194
int reSum(int a, int b)
Definition: DTBtiChip.h:165
DTBtiCard * _card
Definition: DTBtiChip.h:171
void doLTS()
Definition: DTBtiChip.cc:625
DTBtiTrig const * trigger(int step, unsigned n) const
Return the requested trigger.
Definition: DTBtiChip.cc:367
int _MaxKAcc
Definition: DTBtiChip.h:196
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:515
int currentIntStep() const
Definition: DTBtiChip.h:149
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:73
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
Definition: DTBtiChip.cc:383
std::vector< const DTDigi * > const & get_CellDigis(int cell) const
get digi vector - SV 28/XI/02
Definition: DTBtiChip.h:76
int _MinKleftTraco
Definition: DTBtiChip.h:197
DTTrigGeom * _geom
Definition: DTBtiChip.h:173
int reSumAr23[3][5]
Definition: DTBtiChip.h:216
std::array< std::vector< std::unique_ptr< DTBtiTrig > >, DTConfig::NSTEPL-DTConfig::NSTEPF+1 > _trigs
Definition: DTBtiChip.h:184
void init_clock()
Definition: DTBtiChip.cc:474
int nTrig(int step) const
Number of triggers found.
Definition: DTBtiChip.cc:347
std::array< float, 25 > _difs
Definition: DTBtiChip.h:192
~DTBtiChip()
Destructor.
Definition: DTBtiChip.cc:215
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:36
int wheel() const
Return wheel number.
Definition: DTBtiChip.h:131
Definition: DTDigi.h:17
int RE43
Definition: DTBtiChip.h:213
DTTrigGeom * geom() const
Return trigger geometry.
Definition: DTBtiChip.h:125
float _Keq[32][6]
Definition: DTBtiChip.h:193
GlobalPoint CMSPosition() const
Position in CMS frame.
Definition: DTBtiChip.h:100
std::array< std::vector< const DTDigi * >, 9 > _digis
Definition: DTBtiChip.h:179
void sum(const int s, const int a, const int b)
int _curStep
Definition: DTBtiChip.h:187
int k[5][pyjets_maxn]
int ST23
Definition: DTBtiChip.h:213
std::array< std::vector< DTBtiHit * >, 9 > _hits
Definition: DTBtiChip.h:188
int station() const
Return station number.
Definition: DTTrigGeom.h:63
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:91
LocalPoint localPosition() const
Position in chamber frame (x is the one of first traco in slave plane)
Definition: DTBtiChip.h:97
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
std::array< float, 25 > _sums
Definition: DTBtiChip.h:192
int reSumAr[3][5]
Definition: DTBtiChip.h:215
int reSum23(int a, int b)
Definition: DTBtiChip.h:166
int _MaxKrightTraco
Definition: DTBtiChip.h:202
double b
Definition: hdecay.h:120
float _XeqAC_patt0
Definition: DTBtiChip.h:204
float _KTR[32][2]
Definition: DTBtiChip.h:207
int currentStep() const
Definition: DTBtiChip.h:148
float _XeqAB_patt0
Definition: DTBtiChip.h:205
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:541
int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag)
DTConfigBti * _config
Definition: DTBtiChip.h:174
double a
Definition: hdecay.h:121
bool matchEq(float eqA, float eqB, int AC)
int RE23
Definition: DTBtiChip.h:213
int _nStepUsedHits
Definition: DTBtiChip.h:191
void init()
Definition: DTBtiChip.cc:434
int nCellHit() const
Number of cells with hits.
Definition: DTBtiChip.cc:283
step
Definition: StallMonitor.cc:94
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:220
std::array< DTBtiHit *, 9 > _thisStepUsedHit
Definition: DTBtiChip.h:190
void addTrig(int step, std::unique_ptr< DTBtiTrig > btitrig)
Definition: DTBtiChip.cc:333
DTConfigBti * config() const
Configuration set.
Definition: DTBtiChip.h:121
int station() const
Return station number.
Definition: DTBtiChip.h:134
void acceptMask(BitArray< 80 > *BitArrPtr, int k, int accep)
std::vector< std::unique_ptr< DTBtiTrig > > const & trigList(int step) const
Definition: DTBtiChip.cc:357
int _MaxKleftTraco
Definition: DTBtiChip.h:198
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:188
void add_digi_clock(int cell, int clock_digi)
Add a clock digi to the DTBtiChip.
Definition: DTBtiChip.cc:255
void setSnap()
Definition: DTBtiChip.cc:736