57 cout <<
"DTBtiChip constructor called for BTI number " <<
n;
58 cout <<
" in superlayer " << supl << endl;
170 cout <<
"Position: R=" << gp.
perp() <<
"cm, Phi=" << gp.
phi()*180/3.14159;
171 cout <<
" deg, Z=" << gp.
z() <<
" cm" << endl;
176 theta = atan( -(gp.
z())/gp.
perp() );
178 theta = atan( (gp.
z())/gp.
perp() );
181 float fktmin =
tan(theta)*distp2+K0 ;
183 float fktmax =
tan(theta)*distp2+K0+1;
223 if(cell<1 || cell>9){
224 cout <<
"DTBtiChip::add_digi : wrong cell number: " << cell;
225 cout <<
". Digi not added!" << endl;
235 _digis[cell-1].push_back(digi);
239 cout <<
"DTBtiChip::add_digi: DTBtiChip # " <<
_id.
bti() <<
240 " cell " << cell <<
" --> drift time (tdc units)= " << digi->
countsTDC()<< endl;
247 cout <<
"DTBtiChip::add_digi: DTBtiChip # " <<
_id.
bti() <<
248 " cell " << cell <<
" in dead time -> digi not added! " << endl;
257 if(cell<1 || cell>9){
258 cout <<
"DTBtiChip::add_digi_clock : wrong cell number: " << cell;
259 cout <<
". Digi not added!" << endl;
270 cout <<
"DTBtiChip::add_digi_clock: DTBtiChip # " <<
number() <<
271 " cell " << cell <<
" --> clock time = " << digi << endl;
276 cout <<
"DTBtiChip::add_digi_clock: DTBtiChip # " <<
number() <<
277 " cell " << cell <<
" in dead time -> digi not added! " << endl;
287 if( !
d.empty() ) n++;
290 cout << n <<
" cells with hits found:" << endl;
294 for(
auto const&
d: _digis[i]) {
295 cout <<
"DTBtiChip # " <<
298 cout <<
" --> drift time (tdc units): " <<
d->countsTDC() << endl;
336 cout <<
"DTBtiChip: adding trigger..." <<endl;
340 cout <<
"DTBtiChip::addTrig: step " <<
step ;
341 cout <<
" outside range. Trigger not added" << endl;
349 cout <<
"DTBtiChip::nTrig: step out of range: " <<
step ;
350 cout <<
" 0 returned" << endl;
356 vector<std::unique_ptr<DTBtiTrig>>
const&
359 cout <<
"DTBtiChip::trigList: step out of range: " <<
step ;
360 cout <<
" empty pointer returned" << endl;
369 cout <<
"DTBtiChip::trigger: step out of range: " <<
step ;
370 cout <<
" empty pointer returned" << endl;
374 cout <<
"DTBtiChip::trigger: requested trigger does not exist: " <<
n;
375 cout <<
" empty pointer returned!" << endl;
379 return (*(
p+n-1)).get();
385 cout <<
"DTBtiChip::triggerData: step out of range: " <<
step ;
386 cout <<
" dummy trigger returned" << endl;
390 cout <<
"DTBtiChip::triggerData: requested trig. doesn't exist: " <<
n;
391 cout <<
" dummy trigger returned!" << endl;
395 return (*(
p+n-1))->data();
401 cout <<
"DTBtiChip::eraseTrigger: step out of range: " <<
step ;
402 cout <<
" trigger not deleted!" << endl;
405 cout <<
"DTBtiChip::trigger: requested trigger does not exist: " <<
n;
406 cout <<
" trigger not deleted!" << endl;
416 cout <<
"DTBtiChip::clear()" << endl;
437 cout <<
"DTBtiChip::init() -> initializing bti chip" << endl;
440 for(
int i=0;
i<25;
i++) {
445 for(
int cell=0;cell<9;cell++) {
449 vector<const DTDigi*>::const_iterator
p;
454 _hits[cell].push_back(hit);
459 vector<DTBtiHit*>::const_iterator
p1;
461 cout <<
" Filling hit in cell " << cell+1;
462 if((*p1)->curTime()!=4000)
463 cout <<
" raw time in trigger: " << (*p1)->curTime() << endl;
464 cout <<
" time (clock units): " << (*p1)->clockTime() << endl;
477 cout <<
"DTBtiChip::init_clock() -> initializing bti chip" << endl;
482 for(
int i=0;
i<25;
i++) {
487 for(
int cell=0;cell<9;cell++) {
494 _hits[cell].push_back(hit);
499 vector<DTBtiHit*>::const_iterator
p1;
501 cout <<
" Filling hit in cell " << cell+1;
502 if((*p1)->curTime()!=4000)
503 cout <<
" time: " << (*p1)->curTime() << endl;
505 cout <<
" time (clock units): " << (*p1)->clockTime() << endl;
519 cout <<
"DTBtiChip::run: Processing BTI " <<
_id.
bti() << endl;
526 cout <<
"DTBtiChip::run : wrong BTI number: " <<
_id.
bti() << endl;
576 for(
int cell=0;cell<9;cell++) {
579 for(
auto&
h:
_hits[cell]) {
585 for(
auto&
h:
_hits[cell]) {
586 if (
h->isDrifting() ) {
588 }
else if(
h->isInsideReg() ) {
593 if(
h->curTime() != 4000)
594 cout <<
"DTBtiChip::tick: hit in register: time=" <<
h->curTime();
596 cout <<
"DTBtiChip::tick: hit in register! " << endl;
597 cout <<
" jtrig=" <<
h->jtrig() << endl;
628 cout<<
"Do LTS"<<endl;
641 if(
trigger(is,1)->code()==8 ) {
646 if( tr->
code()<8 && (lts==1 || lts==3)) {
648 cout<<
"LTS: erasing trigger!"<<endl;
656 if( tr->
code()<8 && (lts==2 || lts==3) ) {
658 cout<<
"LTS: erasing trigger!"<<endl;
670 float KeqAB,
float KeqBC,
float KeqCD,
671 float KeqAC,
float KeqBD,
float KeqAD) {
699 float Keq[6] = {KeqAB,KeqBC,KeqCD,KeqAC,KeqBD,KeqAD};
701 auto trg = std::make_unique<DTBtiTrig>(
this,code,K,
X,trig_step,
eq,strobe,Keq);
706 const DTDigi* digi =
h->hitDigi();
726 cout <<
" allowed K range in theta view is: [";
728 cout <<
"K value is " << K << endl;
753 cout <<
"Snap register dump: " << endl;
758 cout <<
"ST = " <<
ST << endl;
759 cout <<
"ST2 = " <<
ST2 << endl;
760 cout <<
"ST3 = " <<
ST3 << endl;
761 cout <<
"ST4 = " <<
ST4 << endl;
762 cout <<
"ST5 = " <<
ST5 << endl;
763 cout <<
"ST7 = " <<
ST7 << endl;
DTBtiChip(DTBtiCard *card, DTTrigGeom *geom, int supl, int n, DTConfigBti *_config)
original constructor
int debug() const
Debug flag.
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
int superlayer() const
Return superlayer.
int DEADpar() const
Wire DEAD time parameter.
void print() const
Print content of digi.
std::array< std::vector< int >, 9 > _digis_clock
int ST43() const
ST and RE parameters for drift velocity.
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.)
std::array< int, 9 > _busyStart_clock
int CH() const
K right limit for center traco.
Geom::Phi< T > phi() const
float ST() const
Max drift time in 12.5 ns steps.
Geom::Theta< T > theta() const
void clear()
delete hits and triggers
static const float _stepTimeTdc
DTBtiTrig const * trigger(int step, unsigned n) const
Return the requested trigger.
void run()
Run DTBtiChip algorithm.
int currentIntStep() const
int superlayer() const
Returns the superlayer.
DTBtiTrigData triggerData(int step, unsigned n) const
Return the data part of the requested trigger.
float cellH() const
Height of a cell (cm)
std::array< std::vector< std::unique_ptr< DTBtiTrig > >, DTConfig::NSTEPL-DTConfig::NSTEPF+1 > _trigs
int code() const
Return trigger code.
Tan< T >::type tan(const T &t)
int nTrig(int step) const
Number of triggers found.
std::array< float, 25 > _difs
static const int NSTEPL
Constants: first and last step to start trigger finding.
uint32_t countsTDC() const
Get raw TDC count.
GlobalPoint CMSPosition() const
Position in CMS frame.
int KAccTheta() const
BTI angular acceptance in theta view.
std::array< std::vector< const DTDigi * >, 9 > _digis
std::array< std::vector< DTBtiHit * >, 9 > _hits
int number() const
Return DTBtiChip number.
int bti() const
Returns the bti.
std::array< float, 25 > _sums
DTChamberId statId() const
Identifier of the associated chamber.
bool useAcceptParamFlag()
Return acceptance flag.
int nCellHit() const
Number of cells with hits.
int CL() const
K left limit for center traco.
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
std::array< DTBtiHit *, 9 > _thisStepUsedHit
void addTrig(int step, std::unique_ptr< DTBtiTrig > btitrig)
DTConfigBti * config() const
Configuration set.
std::vector< std::unique_ptr< DTBtiTrig > > const & trigList(int step) const
int WENflag(int wire) const
Wire mask flag.
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)
void add_digi_clock(int cell, int clock_digi)
Add a clock digi to the DTBtiChip.