57 _tss[is].push_back(tss);
63 _tsm[is].push_back(tsm);
72 std::vector<DTTSS *>::iterator ptss;
73 std::vector<DTTSM *>::iterator ptsm;
76 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
81 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
99 std::vector<DTTSCand *>::iterator
p1;
105 std::vector<DTTSS *>::iterator ptss;
106 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
110 std::vector<DTTSM *>::iterator ptsm;
111 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
123 std::vector<DTTSS *>::iterator ptss;
124 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
125 (*ptss)->setConfig(
config());
128 std::vector<DTTSM *>::iterator ptsm;
129 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
130 (*ptsm)->setConfig(
config());
146 std::vector<DTTracoTrigData>::const_iterator
p;
147 std::vector<DTTracoTrigData>::const_iterator pend =
_tracocard->
end();
150 int step = p->step();
151 int fs = (p->isFirst()) ? 1 : 2;
165 std::cout <<
"DTTSPhi::addTracoT: step out of range: " <<
step;
166 std::cout <<
" trigger not added!" << std::endl;
170 if (!tracotrig->
pvCode() || !tracotrig->
code()) {
171 std::cout <<
"DTTSPhi::addTracoT: preview not present in TRACO trigger or "
173 std::cout <<
" trigger not added!" << std::endl;
180 std::cout <<
"DTTSPhi::addTracoT: wrong TRACO number: ";
182 std::cout <<
" trigger not added!" << std::endl;
188 if (
config()->TsmStatus().element(itss) == 0) {
211 std::cout <<
" to TSS " << tss->
number() <<
", position=" << pos << std::endl;
220 bool existSecondPrevBx =
false;
231 std::vector<DTTSS *>::iterator
p;
233 if ((*p)->nTracoT(1) > 0) {
237 if ((*p)->nTracks() > 0) {
238 for (
int it = 1; it <= (*p)->nTracks(); it++) {
242 int my_itss = (*p)->number();
245 std::cout <<
" DTTSPhi::addTracoT - wrong TSMD: " << ntsstsmd << std::endl;
249 itsmd = (my_itss - 1) / ntsstsmd + 1;
251 std::cout <<
" DTTSPhi::addTracoT: itsmd = (my_itss -1 ) / "
252 "ntsstsmd + 1 ---> my_itss = "
253 << my_itss <<
" ntsstsmd = " << ntsstsmd <<
" itsmd = " << itsmd << std::endl;
255 }
else if (bkmod == 1) {
259 std::cout <<
"****** >DTTSPhi::RunTSPhi wrong itsmd = " << itsmd << std::endl;
261 tsm->
addCand((*p)->getTrack(it));
270 std::vector<DTTSM *>::iterator p_tsm;
275 i_tsmd = (*p_tsm)->number() - 1;
277 if ((*p_tsm)->nCand(1) > 0) {
280 (*p_tsm)->run(bkmod);
285 if ((*p_tsm)->nTracks() > 0) {
288 if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
290 if (
config()->TsmGetCarryFlag() == 0) {
297 <<
" i_tsmd = " << i_tsmd << std::endl;
298 if ((*p_tsm)->nTracks() > 1) {
299 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
303 <<
" i_tsmd = " << i_tsmd << std::endl;
305 secondPrevBx = (*p_tsm)->getTrack(2);
308 }
else if (
config()->TsmGetCarryFlag() == 1) {
313 if ((!existSecondPrevBx) ||
339 if ((*p_tsm)->nTracks() > 1) {
341 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
342 secondPrevBx = (*p_tsm)->getTrack(2);
358 if ((!existSecondPrevBx) || first->
isHtrig() || first->
isCorr()) {
364 if ((*p_tsm)->nTracks() > 1) {
366 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
367 secondPrevBx = (*p_tsm)->getTrack(2);
386 if (existSecondPrevBx) {
399 std::cout <<
"====================================================" << std::endl;
400 std::cout <<
" Phi segments " << std::endl;
401 std::vector<DTChambPhSegm>::const_iterator
p;
405 std::cout <<
"====================================================" << std::endl;
415 std::cout <<
"DTTSPhi::ignoreSecondTrack: step out of range: " <<
step;
416 std::cout <<
" no flag set!" << std::endl;
421 std::cout <<
"DTTSPhi::ignoreSecondTrack: wrong TRACO number: " << tracon;
422 std::cout <<
" no flag set!" << std::endl;
433 itsmd = (itss - 1) / ntsstsmd + 1;
442 std::cout <<
"DTTSPhi::getDTTSS: step out of range: " <<
step;
443 std::cout <<
" empty pointer returned!" << std::endl;
447 std::cout <<
"DTTSPhi::getDTTSS: requested DTTSS not present: " <<
n;
448 std::cout <<
" (at step " << step <<
")";
449 std::cout <<
" empty pointer returned!" << std::endl;
459 std::cout <<
"DTTSPhi::getDTTSM: step out of range: " <<
step;
460 std::cout <<
" empty pointer returned!" << std::endl;
464 std::cout <<
"DTTSPhi::getDTTSM: requested DTTSM not present: " <<
n;
465 std::cout <<
" (at step " << step <<
")";
466 std::cout <<
" empty pointer returned!" << std::endl;
475 std::vector<DTChambPhSegm>::const_iterator
p;
477 if (p->step() ==
step)
484 std::vector<DTChambPhSegm>::const_iterator
p;
486 if (p->step() == step && ((n == 1 && p->isFirst()) || (n == 2 && !p->isFirst())))
498 std::cout <<
"DTTSPhi::LocalPosition called with wrong argument!" << std::endl;
508 std::cout <<
"DTTSPhi::LocalDirection called with wrong argument!" << std::endl;
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction 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.
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
LocalPoint localPosition(const DTTrigData *) const override
Local position in chamber of a trigger-data object.
~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.
void print() const override
print
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.
const_iterator end() const
Get last cache element.
LocalVector localDirection(const DTTrigData *) const override
Local direction 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
LocalPoint localPosition(const DTTrigData *) const override
NEWGEO Local position in chamber of a trigger-data object.