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;
227 std::vector<DTTSS *>::iterator
p;
229 if ((*p)->nTracoT(1) > 0) {
233 if ((*p)->nTracks() > 0) {
234 for (
int it = 1;
it <= (*p)->nTracks();
it++) {
238 int my_itss = (*p)->number();
245 itsmd = (my_itss - 1) / ntsstsmd + 1;
247 edm::LogInfo(
"DTTSPhi") <<
" addTracoT: itsmd = (my_itss -1 ) / ntsstsmd + 1 ---> my_itss = " 248 << my_itss <<
" ntsstsmd = " << ntsstsmd <<
" itsmd = " << itsmd;
250 }
else if (bkmod == 1) {
254 edm::LogWarning(
"DTTSPhi") <<
"****** RunTSPhi wrong itsmd = " << itsmd;
264 std::vector<DTTSM *>::iterator p_tsm;
269 i_tsmd = (*p_tsm)->number() - 1;
271 if ((*p_tsm)->nCand(1) > 0) {
274 (*p_tsm)->run(bkmod);
279 if ((*p_tsm)->nTracks() > 0) {
282 if ((*p_tsm)->getTrack(1)->tracoTr()->code() > 0) {
284 if (
config()->TsmGetCarryFlag() == 0) {
291 <<
" i_tsmd = " << i_tsmd;
292 if ((*p_tsm)->nTracks() > 1) {
293 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
297 <<
" i_tsmd = " << i_tsmd;
299 secondPrevBx = (*p_tsm)->getTrack(2);
302 }
else if (
config()->TsmGetCarryFlag() == 1) {
307 if ((!existSecondPrevBx) ||
333 if ((*p_tsm)->nTracks() > 1) {
335 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
336 secondPrevBx = (*p_tsm)->getTrack(2);
352 if ((!existSecondPrevBx) ||
first->isHtrig() ||
first->isCorr()) {
358 if ((*p_tsm)->nTracks() > 1) {
360 if ((*p_tsm)->getTrack(2)->tracoTr()->code() > 0) {
361 secondPrevBx = (*p_tsm)->getTrack(2);
380 if (existSecondPrevBx) {
394 std::vector<DTChambPhSegm>::const_iterator
p;
407 edm::LogWarning(
"DTTSPhi") <<
"ignoreSecondTrack: step out of range: " <<
step <<
" no flag set!";
412 edm::LogWarning(
"DTTSPhi") <<
"ignoreSecondTrack: wrong TRACO number: " << tracon <<
" no flag set!";
423 itsmd = (itss - 1) / ntsstsmd + 1;
432 edm::LogWarning(
"DTTSPhi") <<
"getDTTSS: step out of range: " <<
step <<
" empty pointer returned!";
436 edm::LogWarning(
"DTTSPhi") <<
"getDTTSS: requested DTTSS not present: " <<
n <<
" (at step " <<
step <<
")" 437 <<
" empty pointer returned!";
447 edm::LogWarning(
"DTTSPhi") <<
"getDTTSM: step out of range: " <<
step <<
" empty pointer returned!";
451 edm::LogWarning(
"DTTSPhi") <<
"getDTTSM: requested DTTSM not present: " <<
n <<
" (at step " <<
step <<
")" 452 <<
" empty pointer returned!";
461 std::vector<DTChambPhSegm>::const_iterator
p;
463 if (
p->step() ==
step)
470 std::vector<DTChambPhSegm>::const_iterator
p;
472 if (
p->step() ==
step && ((
n == 1 &&
p->isFirst()) || (
n == 2 && !
p->isFirst())))
484 edm::LogWarning(
"DTTSPhi") <<
"LocalPosition called with wrong argument!";
494 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.