62 _tss[is].push_back(tss);
68 _tsm[is].push_back(tsm);
78 std::vector<DTTSS *>::iterator ptss;
79 std::vector<DTTSM *>::iterator ptsm;
83 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
88 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
107 std::vector<DTTSCand *>::iterator
p1;
113 std::vector<DTTSS *>::iterator ptss;
114 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
118 std::vector<DTTSM *>::iterator ptsm;
119 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
134 std::vector<DTTSS *>::iterator ptss;
135 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
136 (*ptss)->setConfig(
config());
139 std::vector<DTTSM *>::iterator ptsm;
140 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
141 (*ptsm)->setConfig(
config());
158 std::vector<DTTracoTrigData>::const_iterator
p;
159 std::vector<DTTracoTrigData>::const_iterator pend =
_tracocard->
end();
163 p->tracoNumber()) ) {
164 int step = p->step();
165 int fs = (p->isFirst()) ? 1 : 2;
179 std::cout <<
"DTTSPhi::addTracoT: step out of range: " <<
step;
180 std::cout <<
" trigger not added!" << std::endl;
184 if (!tracotrig->
pvCode() || !tracotrig->
code()) {
185 std::cout <<
"DTTSPhi::addTracoT: preview not present in TRACO trigger or " 187 std::cout <<
" trigger not added!" << std::endl;
194 std::cout <<
"DTTSPhi::addTracoT: wrong TRACO number: ";
196 std::cout <<
" trigger not added!" << std::endl;
202 if (
config()->TsmStatus().element(itss) == 0) {
236 bool existSecondPrevBx =
false;
249 std::vector<DTTSS *>::iterator
p;
252 if ((*p)->nTracoT(1) > 0) {
256 if ((*p)->nTracks() > 0) {
257 for (
int it = 1; it <= (*p)->nTracks(); it++) {
261 int my_itss = (*p)->number();
264 std::cout <<
" DTTSPhi::addTracoT - wrong TSMD: " << ntsstsmd
269 itsmd = (my_itss - 1) / ntsstsmd + 1;
271 std::cout <<
" DTTSPhi::addTracoT: itsmd = (my_itss -1 ) / " 272 "ntsstsmd + 1 ---> my_itss = " 273 << my_itss <<
" ntsstsmd = " << ntsstsmd
274 <<
" itsmd = " << itsmd << std::endl;
276 }
else if (bkmod == 1) {
281 std::cout <<
"****** >DTTSPhi::RunTSPhi wrong itsmd = " << itsmd
284 tsm->
addCand((*p)->getTrack(it));
293 std::vector<DTTSM *>::iterator p_tsm;
300 i_tsmd = (*p_tsm)->number() -
303 if ((*p_tsm)->nCand(1) > 0) {
306 (*p_tsm)->run(bkmod);
311 if ((*p_tsm)->nTracks() > 0) {
314 if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
317 if (
config()->TsmGetCarryFlag() ==
322 ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
328 <<
" is = " << is <<
" i_tsmd = " << i_tsmd
330 if ((*p_tsm)->nTracks() > 1) {
331 if ((*p_tsm)->getTrack(2)->tracoTr()->code() >
337 <<
" is = " << is <<
" i_tsmd = " << i_tsmd
341 (*p_tsm)->getTrack(2);
344 }
else if (
config()->TsmGetCarryFlag() ==
349 (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
351 if ((!existSecondPrevBx) ||
388 ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
391 if ((*p_tsm)->nTracks() > 1) {
393 if ((*p_tsm)->getTrack(2)->tracoTr()->code() >
396 (*p_tsm)->getTrack(2);
414 (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
416 if ((!existSecondPrevBx) || first->
isHtrig() || first->
isCorr()) {
421 ChamberId(), is, (*p_tsm)->getTrack(1)->tracoTr(), 1));
424 if ((*p_tsm)->nTracks() > 1) {
426 if ((*p_tsm)->getTrack(2)->tracoTr()->code() >
428 secondPrevBx = (*p_tsm)->getTrack(
443 }
else if (((*p_tsm)->nCand(1) == 0) &&
450 (ntsm[is - 1 - DTConfigTSPhi::NSTEPF][i_tsmd] > 1) &&
452 if (existSecondPrevBx) {
466 std::cout <<
"====================================================" 470 std::vector<DTChambPhSegm>::const_iterator
p;
474 std::cout <<
"====================================================" 486 std::cout <<
"DTTSPhi::ignoreSecondTrack: step out of range: " <<
step;
487 std::cout <<
" no flag set!" << std::endl;
492 std::cout <<
"DTTSPhi::ignoreSecondTrack: wrong TRACO number: " << tracon;
493 std::cout <<
" no flag set!" << std::endl;
504 itsmd = (itss - 1) / ntsstsmd + 1;
513 std::cout <<
"DTTSPhi::getDTTSS: step out of range: " <<
step;
514 std::cout <<
" empty pointer returned!" << std::endl;
518 std::cout <<
"DTTSPhi::getDTTSS: requested DTTSS not present: " <<
n;
519 std::cout <<
" (at step " << step <<
")";
520 std::cout <<
" empty pointer returned!" << std::endl;
524 std::vector<DTTSS *>::const_iterator
p =
531 std::cout <<
"DTTSPhi::getDTTSM: step out of range: " <<
step;
532 std::cout <<
" empty pointer returned!" << std::endl;
536 std::cout <<
"DTTSPhi::getDTTSM: requested DTTSM not present: " <<
n;
537 std::cout <<
" (at step " << step <<
")";
538 std::cout <<
" empty pointer returned!" << std::endl;
541 std::vector<DTTSM *>::const_iterator p_tsm =
548 std::vector<DTChambPhSegm>::const_iterator
p;
550 if (p->step() ==
step)
557 std::vector<DTChambPhSegm>::const_iterator
p;
559 if (p->step() == step &&
560 ((n == 1 && p->isFirst()) || (n == 2 && !p->isFirst())))
572 std::cout <<
"DTTSPhi::LocalPosition called with wrong argument!" 584 std::cout <<
"DTTSPhi::LocalDirection called with wrong argument!" LocalPoint localPosition(const DTTrigData *) const override
Local position in chamber of a trigger-data object.
void ignoreSecondTrack()
Set a flag to skip sort2.
Local3DVector LocalVector
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
Point3DBase< Scalar, LocalTag > LocalPoint
int sector() const
Return sector number.
int nSegm(int step)
Return number of DTTSPhi segments.
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.
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.
void print() const override
print
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.
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.
const DTConfigTSPhi * _config
~DTTSPhi() override
Destructor.
int pvCode() const
Return the preview code.
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1]
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)
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 override
Local direction in chamber of a trigger-data object.
const_iterator end() const
Get last cache element.
LocalPoint localPosition(const DTTrigData *) const override
NEWGEO Local position in chamber of a trigger-data object.
bool usedTraco(int i) const
Enabled TRACOs in TS.
int isCorr() const
Return correlation bit.
int size() const
Get cache vector's size.
DTTSM * getDTTSM(int step, unsigned n) const
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction in chamber of a trigger-data object.