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
DTBtiChip::_card
DTBtiCard * _card
Definition: DTBtiChip.h:171
DTBtiChip::add_digi_clock
void add_digi_clock(int cell, int clock_digi)
Add a clock digi to the DTBtiChip.
Definition: DTBtiChip.cc:242
DTBtiChip::addTrig
void addTrig(int step, std::unique_ptr< DTBtiTrig > btitrig)
Definition: DTBtiChip.cc:314
DTBtiCard
Definition: DTBtiCard.h:62
DTTrigGeom::wheel
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:59
DTBtiChip::id
DTBtiId id() const
Return the DTBtiChip Id.
Definition: DTBtiChip.h:125
DTBtiChip
Definition: DTBtiChip.h:48
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DTBtiChip::reSumSet
void reSumSet()
Definition: DTBtiChipEquations.cc:96
DTBtiChip::_Keq
float _Keq[32][6]
Definition: DTBtiChip.h:193
DTBtiChip::RE43
int RE43
Definition: DTBtiChip.h:213
DTBtiChip::get_CellDigis
std::vector< const DTDigi * > const & get_CellDigis(int cell) const
get digi vector - SV 28/XI/02
Definition: DTBtiChip.h:74
DTBtiChip::_id
DTBtiId _id
Definition: DTBtiChip.h:176
DTBtiChip::eraseTrigger
void eraseTrigger(int step, unsigned n)
Definition: DTBtiChip.cc:375
step
step
Definition: StallMonitor.cc:94
DTBtiChip::_curStep
int _curStep
Definition: DTBtiChip.h:187
DTBtiChip::config
DTConfigBti * config() const
Configuration set.
Definition: DTBtiChip.h:119
DTBtiChip::_config
DTConfigBti * _config
Definition: DTBtiChip.h:174
X
#define X(str)
Definition: MuonsGrabber.cc:38
DTBtiChip::triggerData
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
Definition: DTBtiChip.cc:360
DTBtiChip::_MinKAcc
int _MinKAcc
Definition: DTBtiChip.h:195
DTBtiChip::tick
void tick()
Definition: DTBtiChip.cc:527
DTBtiChip::_digis_clock
std::array< std::vector< int >, 9 > _digis_clock
Definition: DTBtiChip.h:181
DTBtiChip::_thisStepUsedTimes
std::array< int, 9 > _thisStepUsedTimes
Definition: DTBtiChip.h:189
DTBtiChip::_hits
std::array< std::vector< DTBtiHit * >, 9 > _hits
Definition: DTBtiChip.h:188
DTBtiChip::_XeqCD_patt0
float _XeqCD_patt0
Definition: DTBtiChip.h:205
DTBtiId.h
DTBtiChip::sector
int sector() const
Return sector number.
Definition: DTBtiChip.h:134
DTBtiHit
Definition: DTBtiHit.h:43
DTBtiChip::reSumAr
int reSumAr[3][5]
Definition: DTBtiChip.h:215
DTBtiChip::trigList
std::vector< std::unique_ptr< DTBtiTrig > > const & trigList(int step) const
Definition: DTBtiChip.cc:336
DTBtiChip::clear
void clear()
delete hits and triggers
Definition: DTBtiChip.cc:388
DTTrigGeom.h
DTConfigBti
Definition: DTConfigBti.h:36
DTConfig::NSTEPL
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
DTConfig::NSTEPF
static const int NSTEPF
Definition: DTConfig.h:35
DTBtiChip::trigger
DTBtiTrig const * trigger(int step, unsigned n) const
Return the requested trigger.
Definition: DTBtiChip.cc:345
DTBtiChip::_trigs
std::array< std::vector< std::unique_ptr< DTBtiTrig > >, DTConfig::NSTEPL - DTConfig::NSTEPF+1 > _trigs
Definition: DTBtiChip.h:184
DTBtiChip::reSum
int reSum(int a, int b)
Definition: DTBtiChip.h:166
DTBtiChip::ST5
int ST5
Definition: DTBtiChip.h:213
DTBtiChip::ST7
int ST7
Definition: DTBtiChip.h:213
DTBtiChip::setSnap
void setSnap()
Definition: DTBtiChip.cc:699
DTBtiChip::run
void run()
Run DTBtiChip algorithm.
Definition: DTBtiChip.cc:482
DTBtiChip::_nStepUsedHits
int _nStepUsedHits
Definition: DTBtiChip.h:191
DTBtiChip::computeEqs
void computeEqs()
Definition: DTBtiChipEquations.cc:134
DTBtiChip::_geom
DTTrigGeom * _geom
Definition: DTBtiChip.h:173
DTBtiChip::_sums
std::array< float, 25 > _sums
Definition: DTBtiChip.h:192
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DTBtiChip::reSumAr23
int reSumAr23[3][5]
Definition: DTBtiChip.h:216
DTBtiChip::findTrig
void findTrig()
Definition: DTBtiChipSelTrig.cc:39
DTBtiChip::wheel
int wheel() const
Return wheel number.
Definition: DTBtiChip.h:128
DTBtiChip::_MinKcenterTraco
int _MinKcenterTraco
Definition: DTBtiChip.h:199
DTBtiChip::ST3
int ST3
Definition: DTBtiChip.h:213
DTBtiChip::operator=
DTBtiChip & operator=(DTBtiChip &&bti)=delete
Assignment operator.
DTBtiTrigData
Definition: DTBtiTrigData.h:39
DTBtiChip::nCellHit
int nCellHit() const
Number of cells with hits.
Definition: DTBtiChip.cc:266
DTBtiChip::_MaxKleftTraco
int _MaxKleftTraco
Definition: DTBtiChip.h:198
DTBtiChip::_thisStepUsedHit
std::array< DTBtiHit *, 9 > _thisStepUsedHit
Definition: DTBtiChip.h:190
DTBtiChip::_KTR
float _KTR[32][2]
Definition: DTBtiChip.h:207
DTBtiChip::init_clock
void init_clock()
Definition: DTBtiChip.cc:444
dqmdumpme.k
k
Definition: dqmdumpme.py:60
DTBtiChip::CMSPosition
GlobalPoint CMSPosition() const
Position in CMS frame.
Definition: DTBtiChip.h:98
Point3DBase< float, LocalTag >
b
double b
Definition: hdecay.h:118
DTBtiChip::geom
DTTrigGeom * geom() const
Return trigger geometry.
Definition: DTBtiChip.h:122
DTBtiChip::DTBtiChip
DTBtiChip(DTBtiCard *card, DTTrigGeom *geom, int supl, int n, DTConfigBti *_config)
original constructor
Definition: DTBtiChip.cc:48
DTBtiChip::sum
void sum(const int s, const int a, const int b)
Definition: DTBtiChipEquations.cc:80
a
double a
Definition: hdecay.h:119
DTBtiChip::ST23
int ST23
Definition: DTBtiChip.h:213
DTTrigGeom::localPosition
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:508
DTBtiChip::_MinKrightTraco
int _MinKrightTraco
Definition: DTBtiChip.h:201
DTTrigGeom::sector
int sector() const
Return sector number.
Definition: DTTrigGeom.h:65
DTBtiChip::_MinKleftTraco
int _MinKleftTraco
Definition: DTBtiChip.h:197
DTConfig.h
DTBtiChip::_digis
std::array< std::vector< const DTDigi * >, 9 > _digis
Definition: DTBtiChip.h:179
DTBtiChip::~DTBtiChip
~DTBtiChip()
Destructor.
Definition: DTBtiChip.cc:210
DTBtiChip::currentStep
int currentStep() const
Definition: DTBtiChip.h:142
edm::eq
bool eq(const ELstring &s1, const ELstring s2)
Definition: ELstring.cc:39
DTBtiId
Definition: DTBtiId.h:32
DTBtiChip::superlayer
int superlayer() const
Return superlayer.
Definition: DTBtiChip.h:92
DTBtiChip::store
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
DTBtiChip::_XeqAC_patt0
float _XeqAC_patt0
Definition: DTBtiChip.h:204
DTBtiChip::_MaxKcenterTraco
int _MaxKcenterTraco
Definition: DTBtiChip.h:200
DTBtiChip::station
int station() const
Return station number.
Definition: DTBtiChip.h:131
DTBtiChip::matchEq
bool matchEq(float eqA, float eqB, int AC)
DTBtiChip::keepTrigPatt
int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag)
Definition: DTBtiChipSelTrig.cc:355
DTBtiChip::currentIntStep
int currentIntStep() const
Definition: DTBtiChip.h:143
DTTrigGeom::CMSPosition
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:177
DTBtiChip::init_done
int init_done
Definition: DTBtiChip.h:209
DTBtiChip::init
void init()
Definition: DTBtiChip.cc:407
DTBtiTrig
Definition: DTBtiTrig.h:40
LocalPoint.h
DTTrigGeom
Definition: DTTrigGeom.h:41
DTBtiChip::ST4
int ST4
Definition: DTBtiChip.h:213
DTBtiChip::_Xeq
float _Xeq[32][2]
Definition: DTBtiChip.h:194
DTBtiChip::localPosition
LocalPoint localPosition() const
Position in chamber frame (x is the one of first traco in slave plane)
Definition: DTBtiChip.h:95
DTBtiChip::ST43
int ST43
Definition: DTBtiChip.h:213
DTBtiChip::reSum23
int reSum23(int a, int b)
Definition: DTBtiChip.h:167
DTBtiChip::_MaxKrightTraco
int _MaxKrightTraco
Definition: DTBtiChip.h:202
DTBtiChip::doLTS
void doLTS()
Definition: DTBtiChip.cc:588
DTDigi
Definition: DTDigi.h:17
DTBtiChip::ST
int ST
Definition: DTBtiChip.h:213
DTBtiChip::ST2
int ST2
Definition: DTBtiChip.h:213
DTBtiChip::acceptMask
void acceptMask(BitArray< 80 > *BitArrPtr, int k, int accep)
Definition: DTBtiChipSelTrig.cc:715
DTBtiChip::keepTrig
int keepTrig(const int eq, const int acp, const int code)
Definition: DTBtiChipSelTrig.cc:753
DTBtiChip::_MaxKAcc
int _MaxKAcc
Definition: DTBtiChip.h:196
DTConfigBti.h
DTBtiChip::computeSums
void computeSums()
Definition: DTBtiChipEquations.cc:38
DTBtiChip::_XeqAB_patt0
float _XeqAB_patt0
Definition: DTBtiChip.h:205
DTBtiChip::_busyStart_clock
std::array< int, 9 > _busyStart_clock
Definition: DTBtiChip.h:210
DTBtiId::bti
int bti() const
Returns the bti.
Definition: DTBtiId.h:63
BitArray.h
GlobalPoint.h
DTBtiChip::RE23
int RE23
Definition: DTBtiChip.h:213
DTTrigGeom::station
int station() const
Return station number.
Definition: DTTrigGeom.h:62
DTBtiChip::nTrig
int nTrig(int step) const
Number of triggers found.
Definition: DTBtiChip.cc:327
BitArray
Definition: BitArray.h:28
DTBtiChip::number
int number() const
Return DTBtiChip number.
Definition: DTBtiChip.h:89
DTBtiChip::add_digi
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
Definition: DTBtiChip.cc:212
DTBtiChip::_difs
std::array< float, 25 > _difs
Definition: DTBtiChip.h:192
DTBtiChip::_XeqBD_patt0
float _XeqBD_patt0
Definition: DTBtiChip.h:204
DTBtiCard.h
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
DTBtiChip::_JTR
float _JTR[32][3]
Definition: DTBtiChip.h:208
DTBtiId::superlayer
int superlayer() const
Returns the superlayer.
Definition: DTBtiId.h:61