59 _tss[is].push_back(tss);
65 _tsm[is].push_back(tsm);
74 std::vector<DTTSS *>::iterator ptss;
75 std::vector<DTTSM *>::iterator ptsm;
78 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
83 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
101 std::vector<DTTSCand *>::iterator
p1;
107 std::vector<DTTSS *>::iterator ptss;
108 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
112 std::vector<DTTSM *>::iterator ptsm;
113 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
125 std::vector<DTTSS *>::iterator ptss;
126 for (ptss =
_tss[is].
begin(); ptss !=
_tss[is].end(); ptss++) {
127 (*ptss)->setConfig(
config());
130 std::vector<DTTSM *>::iterator ptsm;
131 for (ptsm =
_tsm[is].
begin(); ptsm !=
_tsm[is].end(); ptsm++) {
132 (*ptsm)->setConfig(
config());
143 <<
", sector=" <<
sector();
147 std::vector<DTTracoTrigData>::const_iterator
p;
148 std::vector<DTTracoTrigData>::const_iterator pend =
_tracocard->
end();
151 int step =
p->step();
152 int fs = (
p->isFirst()) ? 1 : 2;
166 edm::LogWarning(
"DTTSPhi") <<
"addTracoT: step out of range: " <<
step <<
" trigger not added!";
170 if (!tracotrig->
pvCode() || !tracotrig->
code()) {
171 edm::LogWarning(
"DTTSPhi") <<
"addTracoT: preview not present in TRACO trigger or its code=0 " 172 <<
" trigger not added!";
180 <<
" trigger not added!";
186 if (
config()->TsmStatus().element(itss) == 0) {
209 <<
", position=" <<
pos;
218 bool existSecondPrevBx =
false;
228 std::vector<DTTSS *>::iterator
p;
230 if ((*p)->nTracoT(1) > 0) {
234 if ((*p)->nTracks() > 0) {
235 for (
int it = 1;
it <= (*p)->nTracks();
it++) {
239 int my_itss = (*p)->number();
246 itsmd = (my_itss - 1) / ntsstsmd + 1;
248 edm::LogInfo(
"DTTSPhi") <<
" addTracoT: itsmd = (my_itss -1 ) / ntsstsmd + 1 ---> my_itss = " 249 << my_itss <<
" ntsstsmd = " << ntsstsmd <<
" itsmd = " << itsmd;
251 }
else if (bkmod == 1) {
255 edm::LogWarning(
"DTTSPhi") <<
"****** RunTSPhi wrong itsmd = " << itsmd;
265 std::vector<DTTSM *>::iterator p_tsm;
270 i_tsmd = (*p_tsm)->number() - 1;
272 if ((*p_tsm)->nCand(1) > 0) {
275 (*p_tsm)->run(bkmod);
280 if ((*p_tsm)->nTracks() > 0) {
283 if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
285 if (
config()->TsmGetCarryFlag() == 0) {
292 <<
" i_tsmd = " << i_tsmd;
293 if ((*p_tsm)->nTracks() > 1) {
294 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
298 <<
" i_tsmd = " << i_tsmd;
300 secondPrevBx = (*p_tsm)->getTrack(2);
303 }
else if (
config()->TsmGetCarryFlag() == 1) {
308 if ((!existSecondPrevBx) ||
334 if ((*p_tsm)->nTracks() > 1) {
336 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
337 secondPrevBx = (*p_tsm)->getTrack(2);
353 if ((!existSecondPrevBx) ||
first->isHtrig() ||
first->isCorr()) {
359 if ((*p_tsm)->nTracks() > 1) {
361 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
362 secondPrevBx = (*p_tsm)->getTrack(2);
381 if (existSecondPrevBx) {
395 std::vector<DTChambPhSegm>::const_iterator
p;
408 edm::LogWarning(
"DTTSPhi") <<
"ignoreSecondTrack: step out of range: " <<
step <<
" no flag set!";
413 edm::LogWarning(
"DTTSPhi") <<
"ignoreSecondTrack: wrong TRACO number: " << tracon <<
" no flag set!";
424 itsmd = (itss - 1) / ntsstsmd + 1;
433 edm::LogWarning(
"DTTSPhi") <<
"getDTTSS: step out of range: " <<
step <<
" empty pointer returned!";
437 edm::LogWarning(
"DTTSPhi") <<
"getDTTSS: requested DTTSS not present: " <<
n <<
" (at step " <<
step <<
")" 438 <<
" empty pointer returned!";
448 edm::LogWarning(
"DTTSPhi") <<
"getDTTSM: step out of range: " <<
step <<
" empty pointer returned!";
452 edm::LogWarning(
"DTTSPhi") <<
"getDTTSM: requested DTTSM not present: " <<
n <<
" (at step " <<
step <<
")" 453 <<
" empty pointer returned!";
462 std::vector<DTChambPhSegm>::const_iterator
p;
464 if (
p->step() ==
step)
471 std::vector<DTChambPhSegm>::const_iterator
p;
473 if (
p->step() ==
step && ((
n == 1 &&
p->isFirst()) || (
n == 2 && !
p->isFirst())))
485 edm::LogWarning(
"DTTSPhi") <<
"LocalPosition called with wrong argument!";
495 edm::LogWarning(
"DTTSPhi") <<
"LocalDirection called with wrong argument!";
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction in chamber of a trigger-data object.
int station() const
Return station number.
void ignoreSecondTrack()
Set a flag to skip sort2.
Local3DVector LocalVector
Point3DBase< Scalar, LocalTag > LocalPoint
BitArray< 8 > TsmStatus() const
TSM status.
int pvCode() const
Return the preview code.
int nSegm(int step)
Return number of DTTSPhi segments.
int number() const
Return identifier.
void runTSPhi()
run DTTSPhi algorithm (DTTSS+DTTSM)
DTTSS * getDTTSS(int step, unsigned n) const
int TsmGetCarryFlag() const
Handling of second track (carry) in case of pile-up, in TSM.
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.
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
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) ...
int size() const
Get cache vector's size.
int isInner() const
Return Inner/Outer bit.
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
void ignoreSecondTrack(int step, int tracon)
Set a flag to ignore second tracks (if first track at following BX)
bool usedTraco(int i) const
Enabled TRACOs in TS.
int wheel() const
Return wheel number.
const DTConfigTSPhi * getDTConfigTSPhi(DTChamberId) const
Get desired Trigger Server Phi configuration.
int sector() const
Return sector number.
static const int NTSMD
Constant: number of TSMD.
const DTChambPhSegm * segment(int step, unsigned n)
Return the requested DTTSPhi segment.
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
int tracoNumber() const
Return parent TRACO number.
int isHtrig() const
Return HTRIG/LTRIG bit.
std::vector< DTTSM * > _tsm[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
const_iterator end() const
Get last cache element.
static const int NSTEPL
Constants: first and last step to start trigger finding.
std::vector< DTTSS * > _tss[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
const DTConfigTSPhi * _config
int isCorr() const
Return correlation bit.
LocalPoint localPosition(const DTTrigData *) const override
Local position in chamber of a trigger-data object.
~DTTSPhi() override
Destructor.
Log< level::Info, false > LogInfo
DTTSM * getDTTSM(int step, unsigned n) const
void ignoreSecondTrack()
Set a flag to skip sort2.
DTTSPhi(DTTrigGeom *, DTTracoCard *)
Constructor.
void print() const override
print
void setConfig(const DTConfigManager *conf)
Set configuration.
DTChamberId ChamberId() const
Identifier of the associated chamber.
std::vector< DTTSCand * > _tctrig[DTConfigTSPhi::NSTEPL - DTConfigTSPhi::NSTEPF+1]
void addTracoT(int step, const DTTracoTrigData *tracotrig, int ifs)
static const int NTSSTSMD
Constant: maximum number of TSS in input to a single TSMD.
void addCand(DTTSCand *cand)
Add a TSS candidate to the TSM, ifs is first/second track flag.
const DTConfigTSPhi * config() const
Return the configuration class.
Log< level::Warning, false > LogWarning
const_iterator begin() const
Get first cache element.
LocalVector localDirection(const DTTrigData *) const override
Local direction in chamber of a trigger-data object.
bool debug() const
Return the debug flag.
int element(const int pos) const
int code() const
Return trigger code.
LocalPoint localPosition(const DTTrigData *) const override
NEWGEO Local position in chamber of a trigger-data object.