CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTBtiChip.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
14 //
15 //--------------------------------------------------
16 #ifndef DT_BTI_CHIP_H
17 #define DT_BTI_CHIP_H
18 
19 //------------------------------------
20 // Collaborating Class Declarations --
21 //------------------------------------
22 class DTBtiHit;
23 class DTBtiTrig;
24 class DTBtiTrigData;
25 class DTDigi;
26 
27 //----------------------
28 // Base Class Headers --
29 //----------------------
38 
39 //---------------
40 // C++ Headers --
41 //---------------
42 #include <vector>
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(const DTBtiChip& bti);
60 
62  ~DTBtiChip();
63 
65  DTBtiChip& operator=(const DTBtiChip& bti);
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*> get_CellDigis(int cell) { return _digis[cell];}
75 
77  void run();
78 
80  void clear();
81 
84  void addTrig(int step, 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<DTBtiTrig*> trigList(int step) const;
108 
110  DTBtiTrig* 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 
121 
123  inline DTTrigGeom* geom() const { return _geom; }
124 
126  inline DTBtiId id() const { return _id; }
127 
129  inline int wheel() const { return _geom->wheel(); }
130 
132  inline int station() const { return _geom->station(); }
133 
135  inline int sector() const { return _geom->sector(); }
136 
137  void init_clock(); // initialization from clocks
138 
139 
140 
141  private:
142 
143  void init(); // initialization
144  void tick(); // next step (80 MHz)
145  // return current step (40MHz)
146  inline int currentStep() const { return (int)(((float)(_curStep)+0.5)/2); }
147  inline int currentIntStep() const { return _curStep; } // int. step (80MHz)
148  void computeSums(); // compute sums and diffs
149  void sum(const int s, const int a, const int b); // " a sum and dif
150  void computeEqs(); // compute X and K equat.
151  void findTrig(); // find triggers
152  int keepTrig(const int eq, const int acp, const int code); // find a trigger
153  int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag);//SV
154  bool matchEq(float eqA, float eqB, int AC);
155  void acceptMask(BitArray<80> * BitArrPtr,int k,int accep);
156  void doLTS(); // adjacent LTRIG suppression
157  int store(const int eq, const int code, const int K, const int X,
158  float KeqAB=0., float KeqBC=0., float KeqCD=0.,
159  float KeqAC=0., float KeqBD=0., float KeqAD=0.);
160  void eraseTrigger(int step, unsigned n); // Erase the requested trigger
161  void setSnap();
162  void reSumSet(); //remainder table compute
163  int reSum(int a, int b) { return reSumAr[a][b+2];}
164  int reSum23(int a, int b) { return reSumAr23[a][b+2];}
165 
166  private:
167 
168  // parent card
170 
173 
175 
176  // input data from DTDigis
177  std::vector<const DTDigi*> _digis[9];
178  // input data from clock digis
179  std::vector<int > _digis_clock[9];
180 
181  // output data (ordered by step number)
182  std::vector<DTBtiTrig*> _trigs[ DTConfig::NSTEPL - DTConfig::NSTEPF+1 ];
183 
184  // internal use variables
185  int _curStep; // current step
186  std::vector<DTBtiHit*> _hits[9]; // current hits in cells
187  int _thisStepUsedTimes[9]; // current used times in cells (JTRIG)
188  DTBtiHit* _thisStepUsedHit[9]; // link to currently used hits
189  int _nStepUsedHits; // number of currently used hits
190  float _sums[25], _difs[25]; // time sums and differences
191  float _Keq[32][6]; // The K equations
192  float _Xeq[32][2]; // The X equations
193  int _MinKAcc; // min K value accepted by DTBtiChip
194  int _MaxKAcc; // max K value accepted by DTBtiChip
195  int _MinKleftTraco; // K limits for left traco
197  int _MinKcenterTraco; // K limits for center traco
199  int _MinKrightTraco; // K limits for right traco
201 
202  float _XeqAC_patt0, _XeqBD_patt0; // special pattern 0 X equations
204 
205  float _KTR[32][2]; //
206  float _JTR[32][3]; //
207  int init_done; // initialization flag
208  int _busyStart_clock[9]; // SV - busy wire flag
209 
210  //snap register variables
211  int ST43, RE43, ST23, RE23, ST, ST2, ST3, ST4, ST5, ST7;
212  //remainder table
213  int reSumAr[3][5];
214  int reSumAr23[3][5];
215 
216 };
217 #endif
218 
DTBtiId _id
Definition: DTBtiChip.h:174
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:69
std::vector< const DTDigi * > _digis[9]
Definition: DTBtiChip.h:177
int _MinKAcc
Definition: DTBtiChip.h:193
std::vector< const DTDigi * > get_CellDigis(int cell)
get digi vector - SV 28/XI/02
Definition: DTBtiChip.h:74
long int flag
Definition: mlp_lapack.h:47
float _JTR[32][3]
Definition: DTBtiChip.h:206
int _MinKrightTraco
Definition: DTBtiChip.h:199
float _XeqBD_patt0
Definition: DTBtiChip.h:202
float _XeqCD_patt0
Definition: DTBtiChip.h:203
DTBtiHit * _thisStepUsedHit[9]
Definition: DTBtiChip.h:188
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:63
int superlayer() const
Return superlayer.
Definition: DTBtiChip.h:92
list step
Definition: launcher.py:15
std::vector< DTBtiHit * > _hits[9]
Definition: DTBtiChip.h:186
int _thisStepUsedTimes[9]
Definition: DTBtiChip.h:187
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:198
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:49
int init_done
Definition: DTBtiChip.h:207
int sector() const
Return sector number.
Definition: DTBtiChip.h:135
void clear()
delete hits and triggers
Definition: DTBtiChip.cc:522
DTBtiId id() const
Return the DTBtiChip Id.
Definition: DTBtiChip.h:126
float _Xeq[32][2]
Definition: DTBtiChip.h:192
int reSum(int a, int b)
Definition: DTBtiChip.h:163
DTBtiCard * _card
Definition: DTBtiChip.h:169
void doLTS()
Definition: DTBtiChip.cc:741
std::vector< DTBtiTrig * > trigList(int step) const
Definition: DTBtiChip.cc:465
float _difs[25]
Definition: DTBtiChip.h:190
int _MaxKAcc
Definition: DTBtiChip.h:194
std::vector< int > _digis_clock[9]
Definition: DTBtiChip.h:179
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:630
int currentIntStep() const
Definition: DTBtiChip.h:147
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:195
DTTrigGeom * _geom
Definition: DTBtiChip.h:171
int reSumAr23[3][5]
Definition: DTBtiChip.h:214
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:129
Definition: DTDigi.h:19
int RE43
Definition: DTBtiChip.h:211
DTTrigGeom * geom() const
Return trigger geometry.
Definition: DTBtiChip.h:123
float _Keq[32][6]
Definition: DTBtiChip.h:191
GlobalPoint CMSPosition() const
Position in CMS frame.
Definition: DTBtiChip.h:98
void sum(const int s, const int a, const int b)
int _curStep
Definition: DTBtiChip.h:185
int k[5][pyjets_maxn]
int ST23
Definition: DTBtiChip.h:211
int station() const
Return station number.
Definition: DTTrigGeom.h:66
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:89
LocalPoint localPosition() const
Position in chamber frame (x is the one of first traco in slave plane)
Definition: DTBtiChip.h:95
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:213
int reSum23(int a, int b)
Definition: DTBtiChip.h:164
int _MaxKrightTraco
Definition: DTBtiChip.h:200
int _busyStart_clock[9]
Definition: DTBtiChip.h:208
double b
Definition: hdecay.h:120
float _XeqAC_patt0
Definition: DTBtiChip.h:202
float _KTR[32][2]
Definition: DTBtiChip.h:205
int currentStep() const
Definition: DTBtiChip.h:146
DTBtiChip & operator=(const DTBtiChip &bti)
Assignment operator.
Definition: DTBtiChip.cc:275
float _XeqAB_patt0
Definition: DTBtiChip.h:203
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:172
double a
Definition: hdecay.h:121
bool matchEq(float eqA, float eqB, int AC)
int RE23
Definition: DTBtiChip.h:211
int _nStepUsedHits
Definition: DTBtiChip.h:189
void init()
Definition: DTBtiChip.cc:549
std::vector< DTBtiTrig * > _trigs[DTConfig::NSTEPL-DTConfig::NSTEPF+1]
Definition: DTBtiChip.h:182
int nCellHit() const
Number of cells with hits.
Definition: DTBtiChip.cc:390
DTBtiTrig * trigger(int step, unsigned n) const
Return the requested trigger.
Definition: DTBtiChip.cc:475
int _MinKcenterTraco
Definition: DTBtiChip.h:197
int ST43
Definition: DTBtiChip.h:211
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:119
int station() const
Return station number.
Definition: DTBtiChip.h:132
void acceptMask(BitArray< 80 > *BitArrPtr, int k, int accep)
int _MaxKleftTraco
Definition: DTBtiChip.h:196
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:184
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:190
void setSnap()
Definition: DTBtiChip.cc:852