53 for(
int istat=0;istat<4;istat++){
55 _tsc[istep][istat] =
new DTSC(istat+1);
58 for (
int istat=0;istat<5;istat++)
_tsphi[istat]=
nullptr;
59 for (
int istat=0;istat<3;istat++)
_tstheta[istat]=
nullptr;
70 for(
int istat=0;istat<4;istat++){
72 delete _tsc[istep][istat];
87 for(
int istat=0;istat<4;istat++){
93 for(
int iph=0;iph<2;++iph){
94 std::vector<DTSectCollPhCand*>::const_iterator phbi =
_incand_ph[iph].begin();
95 std::vector<DTSectCollPhCand*>::const_iterator phei =
_incand_ph[iph].end();
96 for ( std::vector<DTSectCollPhCand*>::const_iterator iphit = phbi;iphit!= phei;++iphit)
103 std::vector<DTSectCollThCand*>::const_iterator thb =
_incand_th.begin();
104 std::vector<DTSectCollThCand*>::const_iterator the =
_incand_th.end();
105 for ( std::vector<DTSectCollThCand*>::const_iterator ithit = thb;ithit!= the;++ithit)
118 for(
int istat=0;istat<4;istat++){
145 std::cout <<
"DTSectColl::addTU: Trying to add tru " << tru
147 <<
" Skipping insertion" << std::endl;
151 if (stat<1 || stat >5) {
152 std::cout <<
"DTSectColl::addTU: Wrong station number Skipping insertion" << std::endl;
192 std::vector<DTChambPhSegm>::const_iterator
p;
193 std::vector<DTChambPhSegm>::const_iterator pend;
195 for(
int istat=1;istat<5;istat++){
198 int step = p->step();
199 int fs = (p->isFirst()) ? 1 : 2 ;
205 if(!(
_tsphi[4]==
nullptr)){
208 int step = p->step();
209 int fs = (p->isFirst()) ? 1 : 2 ;
214 std::vector<DTChambThSegm>::const_iterator pth;
215 std::vector<DTChambThSegm>::const_iterator pthend;
217 for(
int istat=1;istat<4;istat++){
220 int step = pth->step();
233 std::cout <<
"DTSectColl::addTSPhi: step out of range: " <<
step;
234 std::cout <<
" trigger not added!" << std::endl;
238 if(istat<1 || istat>4){
239 std::cout <<
"DTSectColl::addTSPhi: station out of SC range: " << istat;
240 std::cout <<
" trigger not added!" << std::endl;
246 std::cout <<
"DTSectColl::addTSPhi --> code = 0 ! ";
247 std::cout <<
" trigger not added!" << std::endl;
265 std::cout <<
" (first track)" << std::endl;
267 std::cout <<
" (second track)" << std::endl;
277 std::cout <<
"DTSectColl::addTSTheta: step out of range: " <<
step;
278 std::cout <<
" trigger not added!" << std::endl;
282 if(istat<1 || istat>5){
283 std::cout <<
"DTSectColl::addTSTheta: station out of SC range: " << istat;
284 std::cout <<
" trigger not added!" << std::endl;
294 if (is_empty==
true) {
295 std::cout <<
"DTSectColl::addTSTheta --> no position bit equal to 1 ! ";
296 std::cout <<
" trigger not added!" << std::endl;
312 std::cout <<
"DTSectColl::addTSTheta at step " << step << std::endl;
322 std::cout <<
"DTSectColl::getDTSC: step out of range: " <<
step;
323 std::cout <<
" empty pointer returned!" << std::endl;
327 if(istat<1 || istat>4){
328 std::cout <<
"DTSectColl::getDTSC: station out of SC range: " << istat;
329 std::cout <<
" emty pointer returned!" << std::endl;
341 for(
int istat=0;istat<4;istat++){
375 std::cout <<
"====================================================" << std::endl;
376 std::cout <<
" Sect Coll segments " << std::endl;
378 std:: cout <<
" ***Phi Segments*** " << std:: endl;
379 std::vector<DTSectCollPhSegm>::const_iterator pph;
385 std:: cout <<
" **Theta Segments** " << std:: endl;
386 std::vector<DTSectCollThSegm>::const_iterator pth;
391 std::cout <<
"====================================================" << std::endl;
403 std::cout <<
"DTSectColl::getDTSectCollPhCand: wrong track number: " << ifs;
404 std::cout <<
" empty pointer returned!" << std::endl;
408 std::cout <<
"DTSectColl::getDTSectCollPhCand: requested trigger not present: " <<
n;
409 std::cout <<
" empty pointer returned!" << std::endl;
413 std::vector<DTSectCollPhCand*>::const_iterator
p =
_incand_ph[ifs-1].begin()+n-1;
422 std::cout <<
"DTSectColl::getDTSectCollThCand: requested trigger not present: " <<
n;
423 std::cout <<
" empty pointer returned!" << std::endl;
427 std::vector<DTSectCollThCand*>::const_iterator
p =
_incand_th.begin()+n-1;
437 std::cout <<
"DTSectColl::getTrackPh: requested track not present: " <<
n;
438 std::cout <<
" empty pointer returned!" << std::endl;
442 std::vector<DTSectCollPhCand*>::const_iterator
p =
_outcand_ph.begin()+n-1;
451 std::cout <<
"DTSectColl::getTrackTh: requested track not present: " <<
n;
452 std::cout <<
" empty pointer returned!" << std::endl;
456 std::vector<DTSectCollThCand*>::const_iterator
p =
_outcand_th.begin()+n-1;
466 std::cout <<
"DTSectColl::nCandPh: wrong track number: " << ifs;
467 std::cout <<
" 0 returned!" << std::endl;
486 std::vector<DTSectCollPhSegm>::const_iterator
p;
489 if(p->step()==
step)n++;
500 std::vector<DTSectCollThSegm>::const_iterator
p;
503 if(p->step()==
step)n++;
514 std::vector<DTSectCollPhSegm>::const_iterator
p;
517 if(p->step()==step&&((n==1&&p->isFirst())||(n==2&&!p->isFirst())))
528 std::vector<DTSectCollThSegm>::const_iterator
p;
int nTracksPh() const
Return the number of output Phi tracks.
DTSectCollThCand * getDTSectCollThCand(unsigned n) const
Get a Candidate for Sector Collector.
const DTChambPhSegm * tsTr() const
Return associated TSPhi trigger.
DTSectCollThCand * getTrackTh(int n) const
Return the requested Theta track.
const DTConfigSectColl * getDTConfigSectColl(DTSectCollId) const
Get desired SectorCollector configuration.
int CoarseSync() const
Return the Coarse Sync Parameter.
DTSectCollId SectCollId()
Return the Sector Collector Id.
DTTSTheta * TSThTrigs() const
Return the chamber Trigger Server (Theta)
std::vector< DTSectCollThCand * > _incand_th
~DTSectColl() override
Destructor.
const DTChambThSegm * tsTr() const
Return associated TSTheta trigger.
std::vector< DTSectCollThCand * > _outcand_th
int nSegmTh(int step)
Return number of DTSectCollTheta segments (SC step)
DTTSPhi * TSPhTrigs() const
Return the chamber Trigger Server (Phi)
std::vector< DTSectCollPhCand * > _outcand_ph
unsigned nCandTh() const
Return the number of Theta input tracks.
DTSectCollThCand * getTrackTh(int n) const
Return the requested Theta track.
void addTSPhi(int step, const DTChambPhSegm *tsmsegm, int ifs, int istat)
Add a TSM candidate (step is TSM step not SC one)
DTSC * _tsc[DTConfigSectColl::NSTEPL-DTConfigSectColl::NSTEPF+1][DTConfigSectColl::NDTSC]
DTTSTheta * _tstheta[DTConfigSectColl::NTSTSC]
unsigned nCandPh(int ifs) const
Return the number of Phi input tracks (first/second)
int oldCode() const
Return trigger code (10*inner_code+outer_code; X_code=1,2,3,4,8)
int position(const int i) const
Return the position for a given set of 7 BTI.
void loadSectColl()
Load a Sector Collector.
int nSegmPh(int step)
Return number of DTSectCollPhi segments (SC step)
void addDTSectCollPhCand(DTSectCollPhCand *cand)
Add a Sector Collector.
void addTSTheta(int step, const DTChambThSegm *tsmsegm, int istat)
Add a TS Theta candidate (step is TSTheta step not sc one)
void addThCand(DTSectCollThCand *cand)
Add a Theta candidate to sect coll.
int CoarseSync() const
Return the Coarse Sync Parameter.
DTTSPhi * _tsphi[DTConfigSectColl::NTSPSC]
static const int NSTEPL
Constants: first and last step to start trigger finding.
int nTracksTh() const
Return the number of output Theta tracks.
DTSectCollPhCand * getTrackPh(int n) const
Return the requested Phi track.
DTSectCollPhCand * getTrackPh(int n) const
Return the requested Phi track.
void addTU(DTSCTrigUnit *tru)
Add a Trigger Unit to the Sector Collector.
void run()
Run the Sector Collector algorithm.
int station() const
Return station number.
const DTSectCollThSegm * SectCollThSegment(int step)
Return requested Sector Collector Theta Segment.
DTSC * getDTSC(int step, int istat) const
Get a Sector Collector (step is TS one)
const_iterator begin() const
Get first cache element.
const DTConfigSectColl * _config
const DTConfigSectColl * config() const
Configuration.
void runSectColl()
Run Sector Collector.
DTSectColl(DTSectCollId id)
Constructor.
void setConfig(const DTConfigSectColl *conf)
Set configuration.
std::vector< DTSectCollPhCand * > _incand_ph[2]
void setConfig(const DTConfigManager *conf)
Set configuration.
const DTSectCollPhSegm * SectCollPhSegment(int step, unsigned n)
Return requested Sector Collector Phi Segment 1st/2nd.
void localClear()
Local Clear.
int wheel() const
Return wheel number.
int sector() const
Return sector number.
DTSectCollPhCand * getDTSectCollPhCand(int ifs, unsigned n) const
Get a Phi Candidate for Sector Collector.
const_iterator end() const
Get last cache element.