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;
229 std::vector<DTTSS *>::iterator
p;
231 if ((*p)->nTracoT(1) > 0) {
235 if ((*p)->nTracks() > 0) {
236 for (
int it = 1; it <= (*p)->nTracks(); it++) {
240 int my_itss = (*p)->number();
247 itsmd = (my_itss - 1) / ntsstsmd + 1;
249 edm::LogInfo(
"DTTSPhi") <<
" addTracoT: itsmd = (my_itss -1 ) / ntsstsmd + 1 ---> my_itss = " 250 << my_itss <<
" ntsstsmd = " << ntsstsmd <<
" itsmd = " << itsmd;
252 }
else if (bkmod == 1) {
256 edm::LogWarning(
"DTTSPhi") <<
"****** RunTSPhi wrong itsmd = " << itsmd;
258 tsm->
addCand((*p)->getTrack(it));
267 std::vector<DTTSM *>::iterator p_tsm;
272 i_tsmd = (*p_tsm)->number() - 1;
274 if ((*p_tsm)->nCand(1) > 0) {
277 (*p_tsm)->run(bkmod);
282 if ((*p_tsm)->nTracks() > 0) {
285 if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
287 if (
config()->TsmGetCarryFlag() == 0) {
294 <<
" i_tsmd = " << i_tsmd;
295 if ((*p_tsm)->nTracks() > 1) {
296 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
300 <<
" i_tsmd = " << i_tsmd;
302 secondPrevBx = (*p_tsm)->getTrack(2);
305 }
else if (
config()->TsmGetCarryFlag() == 1) {
310 if ((!existSecondPrevBx) ||
336 if ((*p_tsm)->nTracks() > 1) {
338 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
339 secondPrevBx = (*p_tsm)->getTrack(2);
355 if ((!existSecondPrevBx) ||
first->isHtrig() ||
first->isCorr()) {
361 if ((*p_tsm)->nTracks() > 1) {
363 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
364 secondPrevBx = (*p_tsm)->getTrack(2);
383 if (existSecondPrevBx) {
397 std::vector<DTChambPhSegm>::const_iterator
p;
410 edm::LogWarning(
"DTTSPhi") <<
"ignoreSecondTrack: step out of range: " <<
step <<
" no flag set!";
415 edm::LogWarning(
"DTTSPhi") <<
"ignoreSecondTrack: wrong TRACO number: " << tracon <<
" no flag set!";
426 itsmd = (itss - 1) / ntsstsmd + 1;
435 edm::LogWarning(
"DTTSPhi") <<
"getDTTSS: step out of range: " <<
step <<
" empty pointer returned!";
439 edm::LogWarning(
"DTTSPhi") <<
"getDTTSS: requested DTTSS not present: " <<
n <<
" (at step " <<
step <<
")" 440 <<
" empty pointer returned!";
450 edm::LogWarning(
"DTTSPhi") <<
"getDTTSM: step out of range: " <<
step <<
" empty pointer returned!";
454 edm::LogWarning(
"DTTSPhi") <<
"getDTTSM: requested DTTSM not present: " <<
n <<
" (at step " <<
step <<
")" 455 <<
" empty pointer returned!";
464 std::vector<DTChambPhSegm>::const_iterator
p;
466 if (
p->step() ==
step)
473 std::vector<DTChambPhSegm>::const_iterator
p;
475 if (
p->step() ==
step && ((
n == 1 &&
p->isFirst()) || (
n == 2 && !
p->isFirst())))
487 edm::LogWarning(
"DTTSPhi") <<
"LocalPosition called with wrong argument!";
497 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.