57 cout <<
"DTBtiChip constructor called for BTI number " <<
n;
58 cout <<
" in superlayer " << supl << endl;
74 for(
int cell=1; cell<=9; cell++){
169 cout <<
"Position: R=" << gp.
perp() <<
"cm, Phi=" << gp.
phi()*180/3.14159;
170 cout <<
" deg, Z=" << gp.
z() <<
" cm" << endl;
175 theta = atan( -(gp.
z())/gp.
perp() );
177 theta = atan( (gp.
z())/gp.
perp() );
180 float fktmin =
tan(theta)*distp2+K0 ;
182 float fktmax =
tan(theta)*distp2+K0+1;
222 vector<DTBtiTrig*>::const_iterator
p;
229 vector<const DTDigi*>::const_iterator
p;
234 vector<DTBtiHit*>::const_iterator
p1;
235 for(p1=bti.
_hits[i].begin();p1<bti.
_hits[
i].end();p1++){
284 vector<DTBtiTrig*>::const_iterator
p;
291 vector<const DTDigi*>::const_iterator
p;
296 vector<DTBtiHit*>::const_iterator
p1;
297 for(p1=bti.
_hits[i].begin();p1<bti.
_hits[
i].end();p1++){
330 if(cell<1 || cell>9){
331 cout <<
"DTBtiChip::add_digi : wrong cell number: " << cell;
332 cout <<
". Digi not added!" << endl;
342 _digis[cell-1].push_back(digi);
346 cout <<
"DTBtiChip::add_digi: DTBtiChip # " <<
_id.
bti() <<
347 " cell " << cell <<
" --> drift time (tdc units)= " << digi->
countsTDC()<< endl;
354 cout <<
"DTBtiChip::add_digi: DTBtiChip # " <<
_id.
bti() <<
355 " cell " << cell <<
" in dead time -> digi not added! " << endl;
364 if(cell<1 || cell>9){
365 cout <<
"DTBtiChip::add_digi_clock : wrong cell number: " << cell;
366 cout <<
". Digi not added!" << endl;
377 cout <<
"DTBtiChip::add_digi_clock: DTBtiChip # " <<
number() <<
378 " cell " << cell <<
" --> clock time = " << digi << endl;
383 cout <<
"DTBtiChip::add_digi_clock: DTBtiChip # " <<
number() <<
384 " cell " << cell <<
" in dead time -> digi not added! " << endl;
397 cout << n <<
" cells with hits found:" << endl;
401 vector<const DTDigi*>::const_iterator
p;
403 cout <<
"DTBtiChip # " <<
406 cout <<
" --> drift time (tdc units): " << (*p)->countsTDC() << endl;
444 cout <<
"DTBtiChip: adding trigger..." <<endl;
448 cout <<
"DTBtiChip::addTrig: step " <<
step ;
449 cout <<
" outside range. Trigger not added" << endl;
457 cout <<
"DTBtiChip::nTrig: step out of range: " <<
step ;
458 cout <<
" 0 returned" << endl;
467 cout <<
"DTBtiChip::trigList: step out of range: " <<
step ;
468 cout <<
" empty pointer returned" << endl;
477 cout <<
"DTBtiChip::trigger: step out of range: " <<
step ;
478 cout <<
" empty pointer returned" << endl;
482 cout <<
"DTBtiChip::trigger: requested trigger does not exist: " <<
n;
483 cout <<
" empty pointer returned!" << endl;
493 cout <<
"DTBtiChip::triggerData: step out of range: " <<
step ;
494 cout <<
" dummy trigger returned" << endl;
498 cout <<
"DTBtiChip::triggerData: requested trig. doesn't exist: " <<
n;
499 cout <<
" dummy trigger returned!" << endl;
503 return (*(p+n-1))->data();
509 cout <<
"DTBtiChip::eraseTrigger: step out of range: " <<
step ;
510 cout <<
" trigger not deleted!" << endl;
513 cout <<
"DTBtiChip::trigger: requested trigger does not exist: " <<
n;
514 cout <<
" trigger not deleted!" << endl;
517 if(&(*p))
delete (*p);
525 cout <<
"DTBtiChip::clear()" << endl;
527 for(
int c=0;
c<9;
c++) {
532 vector<DTBtiHit*>::iterator
p;
539 vector<DTBtiTrig*>::iterator
p1;
552 cout <<
"DTBtiChip::init() -> initializing bti chip" << endl;
555 for(
int i=0;
i<25;
i++) {
560 for(
int cell=0;cell<9;cell++) {
564 vector<const DTDigi*>::const_iterator
p;
569 _hits[cell].push_back(hit);
574 vector<DTBtiHit*>::const_iterator
p1;
576 cout <<
" Filling hit in cell " << cell+1;
577 if((*p1)->curTime()!=4000)
578 cout <<
" raw time in trigger: " << (*p1)->curTime() << endl;
579 cout <<
" time (clock units): " << (*p1)->clockTime() << endl;
592 cout <<
"DTBtiChip::init_clock() -> initializing bti chip" << endl;
597 for(
int i=0;
i<25;
i++) {
602 for(
int cell=0;cell<9;cell++) {
609 _hits[cell].push_back(hit);
614 vector<DTBtiHit*>::const_iterator
p1;
616 cout <<
" Filling hit in cell " << cell+1;
617 if((*p1)->curTime()!=4000)
618 cout <<
" time: " << (*p1)->curTime() << endl;
620 cout <<
" time (clock units): " << (*p1)->clockTime() << endl;
634 cout <<
"DTBtiChip::run: Processing BTI " <<
_id.
bti() << endl;
641 cout <<
"DTBtiChip::run : wrong BTI number: " <<
_id.
bti() << endl;
691 for(
int cell=0;cell<9;cell++) {
694 vector<DTBtiHit*>::const_iterator
p;
696 (*p)->stepDownTime();
702 if ( (*p)->isDrifting() ) {
704 }
else if( (*p)->isInsideReg() ) {
709 if((*p)->curTime() != 4000)
710 cout <<
"DTBtiChip::tick: hit in register: time=" << (*p)->curTime();
712 cout <<
"DTBtiChip::tick: hit in register! " << endl;
713 cout <<
" jtrig=" << (*p)->jtrig() << endl;
744 cout<<
"Do LTS"<<endl;
757 if(
trigger(is,1)->code()==8 ) {
762 if( tr->
code()<8 && (lts==1 || lts==3)) {
764 cout<<
"LTS: erasing trigger!"<<endl;
772 if( tr->
code()<8 && (lts==2 || lts==3) ) {
774 cout<<
"LTS: erasing trigger!"<<endl;
786 float KeqAB,
float KeqBC,
float KeqCD,
787 float KeqAC,
float KeqBD,
float KeqAD) {
815 float Keq[6] = {KeqAB,KeqBC,KeqCD,KeqAC,KeqBD,KeqAD};
820 for(
int c=0;
c<9;
c++) {
842 cout <<
" allowed K range in theta view is: [";
844 cout <<
"K value is " << K << endl;
869 cout <<
"Snap register dump: " << endl;
874 cout <<
"ST = " <<
ST << endl;
875 cout <<
"ST2 = " <<
ST2 << endl;
876 cout <<
"ST3 = " <<
ST3 << endl;
877 cout <<
"ST4 = " <<
ST4 << endl;
878 cout <<
"ST5 = " <<
ST5 << endl;
879 cout <<
"ST7 = " <<
ST7 << endl;
DTBtiChip(DTBtiCard *card, DTTrigGeom *geom, int supl, int n, DTConfigBti *_config)
original constructor
std::vector< const DTDigi * > _digis[9]
int debug() const
Debug flag.
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
DTBtiHit * _thisStepUsedHit[9]
int superlayer() const
Return superlayer.
int DEADpar() const
Wire DEAD time parameter.
void print() const
Print.
std::vector< DTBtiHit * > _hits[9]
void print() const
Print content of digi.
void addDigi(const DTDigi *digi)
Add a digi to the list.
int _thisStepUsedTimes[9]
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.)
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
std::vector< DTBtiTrig * > trigList(int step) const
std::vector< int > _digis_clock[9]
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)
int code() const
Return trigger code.
Tan< T >::type tan(const T &t)
const DTDigi * hitDigi() const
Return the associated DTDigi.
int jtrig() const
position in registers
int nTrig(int step) const
Number of triggers found.
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.
int number() const
Return DTBtiChip number.
int bti() const
Returns the bti.
void addTrig(int step, DTBtiTrig *btitrig)
float curTime() const
Return the current time.
DTChamberId statId() const
Identifier of the associated chamber.
DTBtiChip & operator=(const DTBtiChip &bti)
Assignment operator.
bool useAcceptParamFlag()
Return acceptance flag.
std::vector< DTBtiTrig * > _trigs[DTConfig::NSTEPL-DTConfig::NSTEPF+1]
int nCellHit() const
Number of cells with hits.
DTBtiTrig * trigger(int step, unsigned n) const
Return the requested trigger.
int CL() const
K left limit for center traco.
void add_digi(int cell, const DTDigi *digi)
Add a digi to the DTBtiChip.
DTConfigBti * config() const
Configuration set.
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.