60 _tss[is].push_back(tss);
66 _tsm[is].push_back(tsm);
77 std::vector<DTTSS*>::iterator ptss;
78 std::vector<DTTSM*>::iterator ptsm;
81 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++){
86 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++){
108 std::vector<DTTSCand*>::iterator
p1;
114 std::vector<DTTSS*>::iterator ptss;
115 for(ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
119 std::vector<DTTSM*>::iterator ptsm;
120 for(ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
135 std::vector<DTTSS*>::iterator ptss;
136 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++){
137 (*ptss)->setConfig(
config());
140 std::vector<DTTSM*>::iterator ptsm;
141 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++){
142 (*ptsm)->setConfig(
config());
156 std::cout <<
"DTTSPhi::loadDTTSPhi called for wheel=" <<
wheel() ;
162 std::vector<DTTracoTrigData>::const_iterator
p;
163 std::vector<DTTracoTrigData>::const_iterator pend=
_tracocard->
end();
167 int step = p->step();
168 int fs = (p->isFirst()) ? 1 : 2 ;
183 std::cout <<
"DTTSPhi::addTracoT: step out of range: " <<
step;
184 std::cout <<
" trigger not added!" << std::endl;
188 if(!tracotrig->
pvCode() || !tracotrig->
code() ) {
189 std::cout <<
"DTTSPhi::addTracoT: preview not present in TRACO trigger or its code=0 ";
190 std::cout <<
" trigger not added!" << std::endl;
197 std::cout <<
"DTTSPhi::addTracoT: wrong TRACO number: ";
199 std::cout <<
" trigger not added!" << std::endl;
204 if(
config()->TsmStatus().element(itss)==0){
227 std::cout <<
" to TSS " << tss->
number() <<
", position=" << pos << std::endl;
239 bool existSecondPrevBx =
false;
250 std::vector<DTTSS*>::iterator
p;
253 if((*p)->nTracoT(1)>0) {
257 if((*p)->nTracks()>0){
258 for(
int it=1;it<=(*p)->nTracks();it++){
262 int my_itss = (*p)->number();
265 std::cout <<
" DTTSPhi::addTracoT - wrong TSMD: " << ntsstsmd << std::endl;
269 itsmd = (my_itss -1 ) / ntsstsmd + 1;
271 std::cout <<
" DTTSPhi::addTracoT: itsmd = (my_itss -1 ) / ntsstsmd + 1 ---> my_itss = " <<
272 my_itss <<
" ntsstsmd = " << ntsstsmd <<
" itsmd = " << itsmd << std::endl;}
277 if(itsmd>2)
std::cout <<
"****** >DTTSPhi::RunTSPhi wrong itsmd = " << itsmd << std::endl;
279 tsm->
addCand((*p)->getTrack(it));
289 std::vector<DTTSM*>::iterator p_tsm;
296 i_tsmd = (*p_tsm)->number()-1;
298 if((*p_tsm)->nCand(1)>0) {
301 (*p_tsm)->run(bkmod);
306 if((*p_tsm)->nTracks()>0){
309 if((*p_tsm)->getTrack(1)->tracoTr()->code()>0) {
312 if(
config()->TsmGetCarryFlag()==0 ) {
318 if((*p_tsm)->nTracks()>1) {
319 if((*p_tsm)->getTrack(2)->tracoTr()->code()>0) {
324 secondPrevBx=(*p_tsm)->getTrack(2) ;
329 else if(
config()->TsmGetCarryFlag()==1 ) {
330 existSecondPrevBx = ((is-1-
DTConfigTSPhi::NSTEPF>=0) && ( ntsm[is-1-DTConfigTSPhi::NSTEPF][i_tsmd]>1) &&
332 if( (!existSecondPrevBx) ||
357 if((*p_tsm)->nTracks()>1) {
359 if((*p_tsm)->getTrack(2)->tracoTr()->code()>0) {
360 secondPrevBx=(*p_tsm)->getTrack(2) ;
373 if( (!existSecondPrevBx) || first->
isHtrig() || first->
isCorr()) {
379 if((*p_tsm)->nTracks()>1) {
381 if((*p_tsm)->getTrack(2)->tracoTr()->code()>0) {
382 secondPrevBx=(*p_tsm)->getTrack(2) ;
399 if(existSecondPrevBx) {
412 std::cout <<
"====================================================" << std::endl;
413 std::cout <<
" Phi segments " << std::endl;
414 std::vector<DTChambPhSegm>::const_iterator
p;
419 std::cout <<
"====================================================" << std::endl;
433 std::cout <<
"DTTSPhi::ignoreSecondTrack: step out of range: " <<
step;
434 std::cout <<
" no flag set!" << std::endl;
439 std::cout <<
"DTTSPhi::ignoreSecondTrack: wrong TRACO number: " << tracon;
440 std::cout <<
" no flag set!" << std::endl;
451 itsmd = (itss -1 ) / ntsstsmd + 1;
462 std::cout <<
"DTTSPhi::getDTTSS: step out of range: " <<
step;
463 std::cout <<
" empty pointer returned!" << std::endl;
467 std::cout <<
"DTTSPhi::getDTTSS: requested DTTSS not present: " <<
n;
468 std::cout <<
" (at step " << step <<
")";
469 std::cout <<
" empty pointer returned!" << std::endl;
483 std::cout <<
"DTTSPhi::getDTTSM: step out of range: " <<
step;
484 std::cout <<
" empty pointer returned!" << std::endl;
488 std::cout <<
"DTTSPhi::getDTTSM: requested DTTSM not present: " <<
n;
489 std::cout <<
" (at step " << step <<
")";
490 std::cout <<
" empty pointer returned!" << std::endl;
502 std::vector<DTChambPhSegm>::const_iterator
p;
504 if(p->step()==
step)n++;
511 std::vector<DTChambPhSegm>::const_iterator
p;
513 if(p->step()==step&&((n==1&&p->isFirst())||(n==2&&!p->isFirst())))
525 std::cout <<
"DTTSPhi::LocalPosition called with wrong argument!" << std::endl;
536 std::cout <<
"DTTSPhi::LocalDirection called with wrong argument!" << std::endl;
void ignoreSecondTrack()
Set a flag to skip sort2.
Local3DVector LocalVector
Point3DBase< Scalar, LocalTag > LocalPoint
int sector() const
Return sector number.
int nSegm(int step)
Return number of DTTSPhi segments.
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
int isHtrig() const
Return HTRIG/LTRIG bit.
void runTSPhi()
run DTTSPhi algorithm (DTTSS+DTTSM)
void loadTSPhi()
store DTTracoChip triggers in the DTTSS's
void addDTTSCand(DTTSCand *cand)
Add a TS candidate to the TSS, ifs is first/second track flag.
int tracoNumber() const
Return parent TRACO number.
LocalPoint localPosition(const DTTrigData *) const
Local position in chamber of a trigger-data object.
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
int station() const
Return station number.
const DTConfigTSPhi * config() const
Return the configuration class.
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
DTTSS * getDTTSS(int step, unsigned n) const
int wheel() const
Return wheel number.
void ignoreSecondTrack(int step, int tracon)
Set a flag to ignore second tracks (if first track at following BX)
bool debug() const
Return the debug flag.
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
static const int NTSMD
Constant: number of TSMD.
const DTChambPhSegm * segment(int step, unsigned n)
Return the requested DTTSPhi segment.
int TsmGetCarryFlag() const
Handling of second track (carry) in case of pile-up, in TSM.
DTChamberId ChamberId() const
Identifier of the associated chamber.
int TSSinTSMD(int stat, int sect) const
Return the max nb. of TSSs in input to a single TSMD (called ONLY in back-up mode) ...
static const int NSTEPL
Constants: first and last step to start trigger finding.
LocalPoint localPosition(const DTTrigData *) const
NEWGEO Local position in chamber of a trigger-data object.
const DTConfigTSPhi * _config
int pvCode() const
Return the preview code.
void ignoreSecondTrack()
Set a flag to skip sort2.
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
int element(const int pos) const
DTTSPhi(DTTrigGeom *, DTTracoCard *)
Constructor.
const_iterator begin() const
Get first cache element.
int isInner() const
Return Inner/Outer bit.
void setConfig(const DTConfigManager *conf)
Set configuration.
int code() const
Return trigger code.
int number() const
Return identifier.
void addTracoT(int step, const DTTracoTrigData *tracotrig, int ifs)
Add a DTTracoChip trigger to the DTTSPhi, ifs is track number (first or second)
static const int NTSSTSMD
Constant: maximum number of TSS in input to a single TSMD.
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
BitArray< 8 > TsmStatus() const
TSM status.
const DTTracoTrigData * tracoTrig() const
Return associated TRACO trigger.
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.
void addCand(DTTSCand *cand)
Add a TSS candidate to the TSM, ifs is first/second track flag.
LocalVector localDirection(const DTTrigData *) const
Local direction in chamber of a trigger-data object.
const_iterator end() const
Get last cache element.
bool usedTraco(int i) const
Enabled TRACOs in TS.
LocalVector localDirection(const DTTrigData *) const
NEWGEO Local direction in chamber of a trigger-data object.
int isCorr() const
Return correlation bit.
int size() const
Get cache vector's size.
DTTSM * getDTTSM(int step, unsigned n) const