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 
42 // ---------------------
43 // -- Class Interface --
44 // ---------------------
45 
46 class DTBtiChip {
47 
48  public:
49 
51  //DTBtiChip(DTTrigGeom* geom, int supl, int n);
52 
54  DTBtiChip(DTBtiCard* card, DTTrigGeom* geom, int supl, int n, DTConfigBti* _config );
55 
57  DTBtiChip(const DTBtiChip& bti);
58 
60  ~DTBtiChip();
61 
63  DTBtiChip& operator=(const DTBtiChip& bti);
64 
66  void add_digi(int cell, const DTDigi* digi);
67 
69  void add_digi_clock(int cell, int clock_digi);
70 
72  std::vector<const DTDigi*> get_CellDigis(int cell) { return _digis[cell];}
73 
75  void run();
76 
78  void clear();
79 
82  void addTrig(int step, DTBtiTrig* btitrig);
83 
84  // Public const methods
85 
87  inline int number() const { return _id.bti(); }
88 
90  inline int superlayer() const { return _id.superlayer(); }
91 
93  inline LocalPoint localPosition() const { return _geom->localPosition(_id); }
94 
96  inline GlobalPoint CMSPosition() const { return _geom->CMSPosition(_id); }
97 
99  int nCellHit() const;
100 
102  int nTrig(int step) const;
103 
104  // // Return the trigger vector
105  std::vector<DTBtiTrig*> trigList(int step) const;
106 
108  DTBtiTrig* trigger(int step, unsigned n) const;
109 
111  DTBtiTrigData triggerData(int step, unsigned n) const;
112 
114  //inline DTConfig* config() const { return _geom->config(); }
115 
117  inline DTConfigBti* config() const { return _config; }
118 
119 
121  inline DTTrigGeom* geom() const { return _geom; }
122 
124  inline DTBtiId id() const { return _id; }
125 
127  inline int wheel() const { return _geom->wheel(); }
128 
130  inline int station() const { return _geom->station(); }
131 
133  inline int sector() const { return _geom->sector(); }
134 
135  void init_clock(); // initialization from clocks
136 
137 
138 
139  private:
140 
141  void init(); // initialization
142  void tick(); // next step (80 MHz)
143  // return current step (40MHz)
144  inline int currentStep() const { return (int)(((float)(_curStep)+0.5)/2); }
145  inline int currentIntStep() const { return _curStep; } // int. step (80MHz)
146  void computeSums(); // compute sums and diffs
147  void sum(const int s, const int a, const int b); // " a sum and dif
148  void computeEqs(); // compute X and K equat.
149  void findTrig(); // find triggers
150  int keepTrig(const int eq, const int acp, const int code); // find a trigger
151  int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag);//SV
152  bool matchEq(float eqA, float eqB, int AC);
153  void acceptMask(BitArray<80> * BitArrPtr,int k,int accep);
154  void doLTS(); // adjacent LTRIG suppression
155  int store(const int eq, const int code, const int K, const int X,
156  float KeqAB=0., float KeqBC=0., float KeqCD=0.,
157  float KeqAC=0., float KeqBD=0., float KeqAD=0.);
158  void eraseTrigger(int step, unsigned n); // Erase the requested trigger
159  void setSnap();
160  void reSumSet(); //remainder table compute
161  int reSum(int a, int b) { return reSumAr[a][b+2];}
162  int reSum23(int a, int b) { return reSumAr23[a][b+2];}
163 
164  private:
165 
166  // parent card
168 
171 
173 
174  // input data from DTDigis
175  std::vector<const DTDigi*> _digis[9];
176  // input data from clock digis
177  std::vector<int > _digis_clock[9];
178 
179  // output data (ordered by step number)
180  std::vector<DTBtiTrig*> _trigs[ DTConfig::NSTEPL - DTConfig::NSTEPF+1 ];
181 
182  // internal use variables
183  int _curStep; // current step
184  std::vector<DTBtiHit*> _hits[9]; // current hits in cells
185  int _thisStepUsedTimes[9]; // current used times in cells (JTRIG)
186  DTBtiHit* _thisStepUsedHit[9]; // link to currently used hits
187  int _nStepUsedHits; // number of currently used hits
188  float _sums[25], _difs[25]; // time sums and differences
189  float _Keq[32][6]; // The K equations
190  float _Xeq[32][2]; // The X equations
191  int _MinKAcc; // min K value accepted by DTBtiChip
192  int _MaxKAcc; // max K value accepted by DTBtiChip
193  int _MinKleftTraco; // K limits for left traco
195  int _MinKcenterTraco; // K limits for center traco
197  int _MinKrightTraco; // K limits for right traco
199 
200  float _XeqAC_patt0, _XeqBD_patt0; // special pattern 0 X equations
202 
203  float _KTR[32][2]; //
204  float _JTR[32][3]; //
205  int init_done; // initialization flag
206  int _busyStart_clock[9]; // SV - busy wire flag
207 
208  //snap register variables
209  int ST43, RE43, ST23, RE23, ST, ST2, ST3, ST4, ST5, ST7;
210  //remainder table
211  int reSumAr[3][5];
212  int reSumAr23[3][5];
213 
214 };
215 #endif
216 
DTBtiId _id
Definition: DTBtiChip.h:172
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:67
std::vector< const DTDigi * > _digis[9]
Definition: DTBtiChip.h:175
int _MinKAcc
Definition: DTBtiChip.h:191
std::vector< const DTDigi * > get_CellDigis(int cell)
get digi vector - SV 28/XI/02
Definition: DTBtiChip.h:72
float _JTR[32][3]
Definition: DTBtiChip.h:204
int _MinKrightTraco
Definition: DTBtiChip.h:197
float _XeqBD_patt0
Definition: DTBtiChip.h:200
float _XeqCD_patt0
Definition: DTBtiChip.h:201
DTBtiHit * _thisStepUsedHit[9]
Definition: DTBtiChip.h:186
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:61
int superlayer() const
Return superlayer.
Definition: DTBtiChip.h:90
std::vector< DTBtiHit * > _hits[9]
Definition: DTBtiChip.h:184
int _thisStepUsedTimes[9]
Definition: DTBtiChip.h:185
int keepTrig(const int eq, const int acp, const int code)
void eraseTrigger(int step, unsigned n)
Definition: DTBtiChip.cc:507
int _MaxKcenterTraco
Definition: DTBtiChip.h:196
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:785
void tick()
Definition: DTBtiChip.cc:675
static const int NSTEPF
Definition: DTConfig.h:36
#define X(str)
Definition: MuonsGrabber.cc:48
int init_done
Definition: DTBtiChip.h:205
int sector() const
Return sector number.
Definition: DTBtiChip.h:133
void clear()
delete hits and triggers
Definition: DTBtiChip.cc:522
DTBtiId id() const
Return the DTBtiChip Id.
Definition: DTBtiChip.h:124
float _Xeq[32][2]
Definition: DTBtiChip.h:190
int reSum(int a, int b)
Definition: DTBtiChip.h:161
DTBtiCard * _card
Definition: DTBtiChip.h:167
void doLTS()
Definition: DTBtiChip.cc:741
std::vector< DTBtiTrig * > trigList(int step) const
Definition: DTBtiChip.cc:465
float _difs[25]
Definition: DTBtiChip.h:188
int _MaxKAcc
Definition: DTBtiChip.h:192
std::vector< int > _digis_clock[9]
Definition: DTBtiChip.h:177
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:630
int currentIntStep() const
Definition: DTBtiChip.h:145
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:491
int _MinKleftTraco
Definition: DTBtiChip.h:193
DTTrigGeom * _geom
Definition: DTBtiChip.h:169
int reSumAr23[3][5]
Definition: DTBtiChip.h:212
void init_clock()
Definition: DTBtiChip.cc:589
int nTrig(int step) const
Number of triggers found.
Definition: DTBtiChip.cc:455
~DTBtiChip()
Destructor.
Definition: DTBtiChip.cc:267
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:127
Definition: DTDigi.h:17
int RE43
Definition: DTBtiChip.h:209
DTTrigGeom * geom() const
Return trigger geometry.
Definition: DTBtiChip.h:121
float _Keq[32][6]
Definition: DTBtiChip.h:189
GlobalPoint CMSPosition() const
Position in CMS frame.
Definition: DTBtiChip.h:96
void sum(const int s, const int a, const int b)
int _curStep
Definition: DTBtiChip.h:183
int k[5][pyjets_maxn]
int ST23
Definition: DTBtiChip.h:209
int station() const
Return station number.
Definition: DTTrigGeom.h:64
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:87
LocalPoint localPosition() const
Position in chamber frame (x is the one of first traco in slave plane)
Definition: DTBtiChip.h:93
int bti() const
Returns the bti.
Definition: DTBtiId.h:75
void addTrig(int step, DTBtiTrig *btitrig)
Definition: DTBtiChip.cc:441
int reSumAr[3][5]
Definition: DTBtiChip.h:211
int reSum23(int a, int b)
Definition: DTBtiChip.h:162
int _MaxKrightTraco
Definition: DTBtiChip.h:198
int _busyStart_clock[9]
Definition: DTBtiChip.h:206
double b
Definition: hdecay.h:120
float _XeqAC_patt0
Definition: DTBtiChip.h:200
float _KTR[32][2]
Definition: DTBtiChip.h:203
int currentStep() const
Definition: DTBtiChip.h:144
DTBtiChip & operator=(const DTBtiChip &bti)
Assignment operator.
Definition: DTBtiChip.cc:275
float _XeqAB_patt0
Definition: DTBtiChip.h:201
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag)
DTConfigBti * _config
Definition: DTBtiChip.h:170
double a
Definition: hdecay.h:121
bool matchEq(float eqA, float eqB, int AC)
int RE23
Definition: DTBtiChip.h:209
int _nStepUsedHits
Definition: DTBtiChip.h:187
void init()
Definition: DTBtiChip.cc:549
std::vector< DTBtiTrig * > _trigs[DTConfig::NSTEPL-DTConfig::NSTEPF+1]
Definition: DTBtiChip.h:180
int nCellHit() const
Number of cells with hits.
Definition: DTBtiChip.cc:390
step
DTBtiTrig * trigger(int step, unsigned n) const
Return the requested trigger.
Definition: DTBtiChip.cc:475
int _MinKcenterTraco
Definition: DTBtiChip.h:195
int ST43
Definition: DTBtiChip.h:209
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
Definition: DTBtiChip.cc:327
DTConfigBti * config() const
Configuration set.
Definition: DTBtiChip.h:117
int station() const
Return station number.
Definition: DTBtiChip.h:130
void acceptMask(BitArray< 80 > *BitArrPtr, int k, int accep)
int _MaxKleftTraco
Definition: DTBtiChip.h:194
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:182
void add_digi_clock(int cell, int clock_digi)
Add a clock digi to the DTBtiChip.
Definition: DTBtiChip.cc:362
float _sums[25]
Definition: DTBtiChip.h:188
void setSnap()
Definition: DTBtiChip.cc:852