49 : _card(card), _geom(
geom), _config(conf) {
56 cout <<
"DTBtiChip constructor called for BTI number " <<
n;
57 cout <<
" in superlayer " << supl << endl;
167 cout <<
"Position: R=" <<
gp.perp() <<
"cm, Phi=" <<
gp.phi() * 180 / 3.14159;
168 cout <<
" deg, Z=" <<
gp.z() <<
" cm" << endl;
178 float fktmin =
tan(
theta) * distp2 + K0;
180 float fktmax =
tan(
theta) * distp2 + K0 + 1;
215 if (cell < 1 || cell > 9) {
216 cout <<
"DTBtiChip::add_digi : wrong cell number: " << cell;
217 cout <<
". Digi not added!" << endl;
226 _digis[cell - 1].push_back(digi);
230 cout <<
"DTBtiChip::add_digi: DTBtiChip # " <<
_id.
bti() <<
" cell " << cell
231 <<
" --> drift time (tdc units)= " << digi->
countsTDC() << endl;
237 cout <<
"DTBtiChip::add_digi: DTBtiChip # " <<
_id.
bti() <<
" cell " << cell
238 <<
" in dead time -> digi not added! " << endl;
243 if (cell < 1 || cell > 9) {
244 cout <<
"DTBtiChip::add_digi_clock : wrong cell number: " << cell;
245 cout <<
". Digi not added!" << endl;
256 cout <<
"DTBtiChip::add_digi_clock: DTBtiChip # " <<
number() <<
" cell " << cell <<
" --> clock time = " << digi
261 cout <<
"DTBtiChip::add_digi_clock: DTBtiChip # " <<
number() <<
" cell " << cell
262 <<
" in dead time -> digi not added! " << endl;
274 cout <<
n <<
" cells with hits found:" << endl;
277 for (
i = 0;
i < 9;
i++) {
279 cout <<
"DTBtiChip # " <<
_id.
bti() <<
" cell " <<
i + 1;
280 cout <<
" --> drift time (tdc units): " <<
d->countsTDC() << endl;
317 cout <<
"DTBtiChip: adding trigger..." << endl;
321 cout <<
"DTBtiChip::addTrig: step " <<
step;
322 cout <<
" outside range. Trigger not added" << endl;
329 cout <<
"DTBtiChip::nTrig: step out of range: " <<
step;
330 cout <<
" 0 returned" << endl;
338 cout <<
"DTBtiChip::trigList: step out of range: " <<
step;
339 cout <<
" empty pointer returned" << endl;
347 cout <<
"DTBtiChip::trigger: step out of range: " <<
step;
348 cout <<
" empty pointer returned" << endl;
352 cout <<
"DTBtiChip::trigger: requested trigger does not exist: " <<
n;
353 cout <<
" empty pointer returned!" << endl;
357 return (*(
p +
n - 1)).get();
362 cout <<
"DTBtiChip::triggerData: step out of range: " <<
step;
363 cout <<
" dummy trigger returned" << endl;
367 cout <<
"DTBtiChip::triggerData: requested trig. doesn't exist: " <<
n;
368 cout <<
" dummy trigger returned!" << endl;
372 return (*(
p +
n - 1))->data();
377 cout <<
"DTBtiChip::eraseTrigger: step out of range: " <<
step;
378 cout <<
" trigger not deleted!" << endl;
381 cout <<
"DTBtiChip::trigger: requested trigger does not exist: " <<
n;
382 cout <<
" trigger not deleted!" << endl;
390 cout <<
"DTBtiChip::clear()" << endl;
409 cout <<
"DTBtiChip::init() -> initializing bti chip" << endl;
412 for (
int i = 0;
i < 25;
i++) {
417 for (
int cell = 0; cell < 9; cell++) {
421 vector<const DTDigi*>::const_iterator
p;
431 vector<DTBtiHit*>::const_iterator
p1;
433 cout <<
" Filling hit in cell " << cell + 1;
434 if ((*p1)->curTime() != 4000)
435 cout <<
" raw time in trigger: " << (*p1)->curTime() << endl;
436 cout <<
" time (clock units): " << (*p1)->clockTime() << endl;
446 cout <<
"DTBtiChip::init_clock() -> initializing bti chip" << endl;
451 for (
int i = 0;
i < 25;
i++) {
456 for (
int cell = 0; cell < 9; cell++) {
468 vector<DTBtiHit*>::const_iterator
p1;
470 cout <<
" Filling hit in cell " << cell + 1;
471 if ((*p1)->curTime() != 4000)
472 cout <<
" time: " << (*p1)->curTime() << endl;
474 cout <<
" time (clock units): " << (*p1)->clockTime() << endl;
485 cout <<
"DTBtiChip::run: Processing BTI " <<
_id.
bti() << endl;
492 cout <<
"DTBtiChip::run : wrong BTI number: " <<
_id.
bti() << endl;
543 for (
int cell = 0; cell < 9; cell++) {
545 for (
auto&
h :
_hits[cell]) {
551 for (
auto&
h :
_hits[cell]) {
552 if (
h->isDrifting()) {
554 }
else if (
h->isInsideReg()) {
559 if (
h->curTime() != 4000)
560 cout <<
"DTBtiChip::tick: hit in register: time=" <<
h->curTime();
562 cout <<
"DTBtiChip::tick: hit in register! " << endl;
563 cout <<
" jtrig=" <<
h->jtrig() << endl;
590 cout <<
"Do LTS" << endl;
604 if (
trigger(is, 1)->code() == 8) {
606 for (
int js = is + 1; (js <= is + nbxlts && js <=
DTConfig::NSTEPL); js++) {
609 if (tr->
code() < 8 && (lts == 1 || lts == 3)) {
611 cout <<
"LTS: erasing trigger!" << endl;
619 if (tr->
code() < 8 && (lts == 2 || lts == 3)) {
621 cout <<
"LTS: erasing trigger!" << endl;
665 float Keq[6] = {KeqAB, KeqBC, KeqCD, KeqAC, KeqBD, KeqAD};
667 auto trg = std::make_unique<DTBtiTrig>(
this, code, K,
X, trig_step, eq, strobe, Keq);
672 const DTDigi* digi =
h->hitDigi();
690 cout <<
"DTBtiChip::store, REJECTED TRIGGER at step " <<
currentStep();
691 cout <<
" allowed K range in theta view is: [";
693 cout <<
"K value is " << K << endl;
707 ST2 =
int((
double(
ST43) * 3. / 4. +
double(
RE43) * 1. / 4.) * 2.);
708 ST3 =
int((
double(
ST43) * 3. / 4. +
double(
RE43) * 1. / 4.) * 3.);
709 ST4 =
int((
double(
ST43) * 3. / 4. +
double(
RE43) * 1. / 4.) * 4.);
710 ST5 =
int((
double(
ST43) * 3. / 4. +
double(
RE43) * 1. / 4.) * 5.);
711 ST7 =
int((
double(
ST43) * 3. / 4. +
double(
RE43) * 1. / 4.) * 7.);
714 cout <<
"Snap register dump: " << endl;
719 cout <<
"ST = " <<
ST << endl;
720 cout <<
"ST2 = " <<
ST2 << endl;
721 cout <<
"ST3 = " <<
ST3 << endl;
722 cout <<
"ST4 = " <<
ST4 << endl;
723 cout <<
"ST5 = " <<
ST5 << endl;
724 cout <<
"ST7 = " <<
ST7 << endl;
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
DTBtiChip(DTBtiCard *card, DTTrigGeom *geom, int supl, int n, DTConfigBti *_config)
original constructor
int WENflag(int wire) const
Wire mask flag.
std::vector< std::unique_ptr< DTBtiTrig > > const & trigList(int step) const
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
std::array< std::vector< std::unique_ptr< DTBtiTrig > >, DTConfig::NSTEPL - DTConfig::NSTEPF+1 > _trigs
std::array< std::vector< const DTDigi * >, 9 > _digis
GlobalPoint CMSPosition() const
Position in CMS frame.
void eraseTrigger(int step, unsigned n)
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.)
int code() const
Return trigger code.
int bti() const
Returns the bti.
void clear()
delete hits and triggers
std::array< float, 25 > _difs
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
int32_t countsTDC() const
Get raw TDC count.
DTBtiTrig const * trigger(int step, unsigned n) const
Return the requested trigger.
std::array< DTBtiHit *, 9 > _thisStepUsedHit
static const float _stepTimeTdc
void run()
Run DTBtiChip algorithm.
int CH() const
K right limit for center traco.
int number() const
Return DTBtiChip number.
Tan< T >::type tan(const T &t)
DTChamberId statId() const
Identifier of the associated chamber.
int superlayer() const
Returns the superlayer.
static const int NSTEPL
Constants: first and last step to start trigger finding.
std::array< int, 9 > _busyStart_clock
DTConfigBti * config() const
Configuration set.
std::array< std::vector< int >, 9 > _digis_clock
float cellH() const
Height of a cell (cm)
int currentIntStep() const
std::array< std::vector< DTBtiHit * >, 9 > _hits
int CL() const
K left limit for center traco.
int debug() const
Debug flag.
bool useAcceptParamFlag()
Return acceptance flag.
void print() const
Print content of digi.
int DEADpar() const
Wire DEAD time parameter.
std::array< float, 25 > _sums
float ST() const
Max drift time in 12.5 ns steps.
int nTrig(int step) const
Number of triggers found.
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
void addTrig(int step, std::unique_ptr< DTBtiTrig > btitrig)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Geom::Theta< T > theta() const
int nCellHit() const
Number of cells with hits.
int ST43() const
ST and RE parameters for drift velocity.
void add_digi_clock(int cell, int clock_digi)
Add a clock digi to the DTBtiChip.
int KAccTheta() const
BTI angular acceptance in theta view.
int superlayer() const
Return superlayer.
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)