#include <L1Trigger/DTSectorCollector/interface/DTSC.h>
Public Member Functions | |
void | addCand (DTTSCand *cand) |
Add a TSM candidate to the Sect Coll, ifs is first/second track flag. | |
void | addDTSectCollPhCand (DTSectCollPhCand *cand) |
Add a Sector Collector. | |
void | addPhCand (DTSectCollPhCand *cand) |
Add a TSM candidate to the Sect Coll, ifs is first/second track flag. | |
void | addThCand (DTSectCollThCand *cand) |
Add a Theta candidate to sect coll. | |
void | clear () |
Clear. | |
void | clear () |
Clear. | |
DTConfigSectColl * | config () const |
Configuration set. | |
DTConfigSectColl * | config () const |
Configuration set. | |
DTSC (DTConfigSectColl *) | |
Constructor. | |
DTSC (int istat) | |
Constructor. | |
DTTSCand * | DTSectCollsort1 () |
Sort 1. | |
DTSectCollPhCand * | DTSectCollsort1 () |
Phi Sort 1. | |
DTTSCand * | DTSectCollsort2 () |
Sort 2. | |
DTSectCollPhCand * | DTSectCollsort2 () |
Phi Sort 2. | |
DTSectCollPhCand * | getDTSectCollPhCand (int ifs, unsigned n) const |
Return requested TSS candidate. | |
DTSectCollThCand * | getDTSectCollThCand (unsigned n) const |
Return requested Theta candidate. | |
DTTSCand * | getDTTSCand (int ifs, unsigned n) const |
Return requested TSS candidate. | |
DTTSCand * | getTrack (int n) const |
Return the requested track. | |
DTSectCollPhCand * | getTrackPh (int n) const |
Return the requested Phi track. | |
DTSectCollThCand * | getTrackTh (int n) const |
Return the requested Theta track. | |
const DTTracoTrigData * | getTracoT (int ifs, unsigned n) const |
Return requested TRACO trigger. | |
void | ignoreSecondTrack () |
Set a flag to skip sort2. | |
void | ignoreSecondTrack () |
Set a flag to skip sort2. | |
unsigned | nCand (int ifs) const |
Return the number of input tracks (first/second). | |
unsigned | nCandPh (int ifs) const |
Return the number of Phi input tracks (first/second). | |
unsigned | nCandTh () const |
Return the number of Theta input tracks. | |
int | nFirstT () const |
Return the number of input first tracks. | |
int | nFirstTPh () const |
Return the number of input first tracks. | |
int | nSecondT () const |
Return the number of input second tracks. | |
int | nSecondTPh () const |
Return the number of input second tracks. | |
int | nTracks () const |
Return the number of sorted tracks. | |
int | nTracksPh () const |
Return the number of output Phi tracks. | |
int | nTracksTh () const |
Return the number of output Theta tracks. | |
void | run () |
Run the Sector Collector algorithm. | |
void | run () |
Run the Sector Collector algorithm. | |
void | setConfig (DTConfigSectColl *conf) |
Set configuration. | |
~DTSC () | |
Destructor. | |
~DTSC () | |
Destructor. | |
Private Attributes | |
std::vector< DTSectCollThCand * > | _cand_th |
DTConfigSectColl * | _config |
DTConfigSectColl * | _config |
int | _ignoreSecondTrack |
std::vector< DTTSCand * > | _incand [2] |
std::vector< DTSectCollPhCand * > | _incand_ph [2] |
std::vector< DTTSCand * > | _outcand |
std::vector< DTSectCollPhCand * > | _outcand_ph |
int | _stat |
Implementation of Sector Collector trigger algorithm
S. Marcellini
Definition at line 43 of file DTSC.h.
DTSC::DTSC | ( | int | istat | ) |
Constructor.
Definition at line 42 of file DTSC.cc.
00042 : _ignoreSecondTrack(0) ,_stat(istat){ 00043 00044 // reserve the appropriate amount of space for vectors 00045 // test _incand[0].reserve(DTConfigSectColl::NTSMSC); 00046 // test_incand[1].reserve(DTConfigSectColl::NTSMSC); 00047 // test _outcand.reserve(2); 00048 00049 }
DTSC::~DTSC | ( | ) |
DTSC::DTSC | ( | DTConfigSectColl * | ) |
Constructor.
DTSC::~DTSC | ( | ) |
Destructor.
Add a TSM candidate to the Sect Coll, ifs is first/second track flag.
void DTSC::addDTSectCollPhCand | ( | DTSectCollPhCand * | cand | ) |
Add a Sector Collector.
Definition at line 303 of file DTSC.cc.
References _incand_ph, and DTSectCollPhCand::isFirst().
Referenced by DTSectColl::addTSPhi().
00303 { 00304 00305 int ifs = (cand->isFirst()) ? 0 : 1; 00306 00307 _incand_ph[ifs].push_back(cand); 00308 00309 }
void DTSC::addPhCand | ( | DTSectCollPhCand * | cand | ) |
Add a TSM candidate to the Sect Coll, ifs is first/second track flag.
Definition at line 235 of file DTSC.cc.
References _incand_ph, and DTSectCollPhCand::isFirst().
00235 { 00236 00237 _incand_ph[(1-cand->isFirst())].push_back(cand); 00238 00239 }
void DTSC::addThCand | ( | DTSectCollThCand * | cand | ) |
Add a Theta candidate to sect coll.
Definition at line 242 of file DTSC.cc.
References _cand_th.
Referenced by DTSectColl::addTSTheta().
00242 { 00243 00244 _cand_th.push_back(cand); 00245 00246 }
void DTSC::clear | ( | ) |
Clear.
Clear.
Definition at line 67 of file DTSC.cc.
References _cand_th, _ignoreSecondTrack, _incand_ph, and _outcand_ph.
Referenced by DTSectColl::localClear(), and ~DTSC().
00067 { 00068 00069 _ignoreSecondTrack=0; 00070 00071 for(int itk=0;itk<=1;itk++){ 00072 00073 _incand_ph[itk].clear(); 00074 } 00075 00076 _outcand_ph.clear(); 00077 _cand_th.clear(); 00078 00079 }
DTConfigSectColl* DTSC::config | ( | ) | const [inline] |
Configuration set.
Definition at line 75 of file DTSCCand.h.
References _config.
00075 { return _config; }
DTConfigSectColl* DTSC::config | ( | ) | const [inline] |
Configuration set.
Definition at line 87 of file DTSC.h.
References _config.
Referenced by DTSectCollPhCand::config(), DTSectCollThCand::config(), DTSectCollsort1(), and run().
00087 { return _config; }
DTTSCand* DTSC::DTSectCollsort1 | ( | ) |
Sort 1.
DTSectCollPhCand * DTSC::DTSectCollsort1 | ( | ) |
Phi Sort 1.
Definition at line 141 of file DTSC.cc.
References _incand_ph, _stat, begin, config(), p, DTSectCollPhCand::setBitsSectColl(), and DTSectCollPhCand::setSecondTrack().
Referenced by run().
00141 { 00142 00143 // Do a sort 1 00144 DTSectCollPhCand* best=0; 00145 DTSectCollPhCand* carry=0; 00146 std::vector<DTSectCollPhCand*>::iterator p; 00147 for(p=_incand_ph[0].begin(); p!=_incand_ph[0].end(); p++) { 00148 DTSectCollPhCand* curr=(*p); 00149 00150 curr->setBitsSectColl(); // SM sector collector set bits in dataword to make SC sorting 00151 00152 // NO Carry in Sector Collector sorting in default 00153 if(config()->SCGetCarryFlag(_stat)) { // get carry 00154 00155 if(best==0){ 00156 best=curr; 00157 } 00158 else if((*curr)<(*best)){ 00159 carry=best; 00160 best=curr; 00161 } 00162 else if(carry==0){ 00163 carry=curr; 00164 } 00165 else if((*curr)<(*carry)){ 00166 carry=curr; 00167 } 00168 00169 } 00170 else if(config()->SCGetCarryFlag(_stat)==0){ // no carry (default) 00171 if(best==0){ 00172 best=curr; 00173 } 00174 else if((*curr)<(*best)){ 00175 00176 best=curr; 00177 } 00178 00179 } 00180 00181 if(carry!=0 && config()->SCGetCarryFlag(_stat)) { // reassign carry to sort 2 candidates 00182 carry->setSecondTrack(); // change value of 1st/2nd track bit 00183 _incand_ph[1].push_back(carry); // add to list of 2nd track 00184 00185 } 00186 } 00187 00188 return best; 00189 00190 }
DTTSCand* DTSC::DTSectCollsort2 | ( | ) |
Sort 2.
DTSectCollPhCand * DTSC::DTSectCollsort2 | ( | ) |
Phi Sort 2.
Definition at line 194 of file DTSC.cc.
References _ignoreSecondTrack, _incand_ph, begin, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nTracksPh(), p, edm::second(), and DTSectCollPhCand::setBitsSectColl().
Referenced by run().
00194 { 00195 00196 // Check if there are second tracks 00197 00198 if(nTracksPh()<1){ 00199 std::cout << "DTSC::DTSectCollsort2: called with no first Phi track."; 00200 std::cout << " empty pointer returned!" << std::endl; 00201 return 0; 00202 } 00203 // If a first track at the following BX is present, ignore second tracks of any kind 00204 if(_ignoreSecondTrack){ 00205 00206 for(std::vector<DTSectCollPhCand*>::iterator p=_incand_ph[1].begin(); p!=_incand_ph[1].end(); p++) { 00207 00208 } 00209 return 0; 00210 } 00211 00212 // If no first tracks at the following BX, do a sort 2 00213 // DTSectCollCand* best=getTrack(1); ! not needed as lons as there is no comparison with best in sort 2 00214 DTSectCollPhCand* second=0; 00215 std::vector<DTSectCollPhCand*>::iterator p; 00216 for(p=_incand_ph[1].begin(); p!=_incand_ph[1].end(); p++) { 00217 DTSectCollPhCand* curr=(*p); 00218 curr->setBitsSectColl(); // SM sector collector set bits in dataword to make SC sorting 00219 00220 if(second==0){ 00221 second=curr; 00222 } 00223 else if((*curr)<(*second)){ 00224 second=curr; 00225 } 00226 00227 } 00228 00229 return second; 00230 00231 }
DTSectCollPhCand * DTSC::getDTSectCollPhCand | ( | int | ifs, | |
unsigned | n | |||
) | const |
Return requested TSS candidate.
Definition at line 270 of file DTSC.cc.
References _incand_ph, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nCandPh(), and p.
00270 { 00271 00272 if(ifs<1||ifs>2){ 00273 std::cout << "DTSC::getDTSectCollPhCand: wrong track number: " << ifs; 00274 std::cout << " empty pointer returned!" << std::endl; 00275 return 0; 00276 } 00277 if(n<1 || n>nCandPh(ifs)) { 00278 std::cout << "DTSC::getDTSectCollPhCand: requested trigger not present: " << n; 00279 std::cout << " empty pointer returned!" << std::endl; 00280 return 0; 00281 } 00282 00283 std::vector<DTSectCollPhCand*>::const_iterator p = _incand_ph[ifs-1].begin()+n-1; 00284 return (*p); 00285 00286 }
DTSectCollThCand * DTSC::getDTSectCollThCand | ( | unsigned | n | ) | const |
Return requested Theta candidate.
Definition at line 289 of file DTSC.cc.
References _cand_th, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nCandTh(), and p.
00289 { 00290 00291 if(n<1 || n>nCandTh()) { 00292 std::cout << "DTSC::getDTSectCollThCand: requested trigger not present: " << n; 00293 std::cout << " empty pointer returned!" << std::endl; 00294 return 0; 00295 } 00296 00297 std::vector<DTSectCollThCand*>::const_iterator p = _cand_th.begin()+n-1; 00298 return (*p); 00299 00300 }
DTSectCollPhCand * DTSC::getTrackPh | ( | int | n | ) | const |
Return the requested Phi track.
Definition at line 312 of file DTSC.cc.
References _outcand_ph, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nTracksPh(), and p.
Referenced by DTSectColl::runSectColl().
00312 { 00313 00314 if(n<1 || n>nTracksPh()) { 00315 std::cout << "DTSC::getTrackPh: requested track not present: " << n; 00316 std::cout << " empty pointer returned!" << std::endl; 00317 return 0; 00318 } 00319 00320 std::vector<DTSectCollPhCand*>::const_iterator p = _outcand_ph.begin()+n-1; 00321 00322 return (*p); 00323 00324 }
DTSectCollThCand * DTSC::getTrackTh | ( | int | n | ) | const |
Return the requested Theta track.
Definition at line 328 of file DTSC.cc.
References _cand_th, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), nTracksTh(), and p.
Referenced by DTSectColl::runSectColl().
00328 { 00329 00330 if(n<1 || n>nTracksTh()) { 00331 std::cout << "DTSC::getTrackTh: requested track not present: " << n; 00332 std::cout << " empty pointer returned!" << std::endl; 00333 return 0; 00334 } 00335 00336 std::vector<DTSectCollThCand*>::const_iterator p = _cand_th.begin()+n-1; 00337 00338 return (*p); 00339 00340 }
const DTTracoTrigData* DTSC::getTracoT | ( | int | ifs, | |
unsigned | n | |||
) | const |
Return requested TRACO trigger.
void DTSC::ignoreSecondTrack | ( | ) | [inline] |
Set a flag to skip sort2.
Definition at line 58 of file DTSCCand.h.
References _ignoreSecondTrack.
00058 { _ignoreSecondTrack=1; }
void DTSC::ignoreSecondTrack | ( | ) | [inline] |
Set a flag to skip sort2.
Definition at line 70 of file DTSC.h.
References _ignoreSecondTrack.
00070 { _ignoreSecondTrack=1; }
unsigned DTSC::nCand | ( | int | ifs | ) | const |
Return the number of input tracks (first/second).
unsigned DTSC::nCandPh | ( | int | ifs | ) | const |
Return the number of Phi input tracks (first/second).
Definition at line 250 of file DTSC.cc.
References _incand_ph, GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
Referenced by getDTSectCollPhCand().
00250 { 00251 00252 if(ifs<1||ifs>2){ 00253 std::cout << "DTSC::nCandPh: wrong track number: " << ifs; 00254 std::cout << " 0 returned!" << std::endl; 00255 return 0; 00256 } 00257 return _incand_ph[ifs-1].size(); 00258 00259 }
unsigned DTSC::nCandTh | ( | ) | const |
int DTSC::nFirstT | ( | ) | const [inline] |
Return the number of input first tracks.
Definition at line 81 of file DTSCCand.h.
References _incand.
00081 { return _incand[0].size(); }
int DTSC::nFirstTPh | ( | ) | const [inline] |
Return the number of input first tracks.
Definition at line 96 of file DTSC.h.
References _incand_ph.
Referenced by run().
00096 { return _incand_ph[0].size(); }
int DTSC::nSecondT | ( | ) | const [inline] |
Return the number of input second tracks.
Definition at line 84 of file DTSCCand.h.
References _incand.
00084 { return _incand[1].size(); }
int DTSC::nSecondTPh | ( | ) | const [inline] |
Return the number of input second tracks.
Definition at line 99 of file DTSC.h.
References _incand_ph.
Referenced by run().
00099 { return _incand_ph[1].size(); }
int DTSC::nTracks | ( | ) | const [inline] |
Return the number of sorted tracks.
Definition at line 93 of file DTSCCand.h.
References _outcand.
00093 { return _outcand.size(); }
int DTSC::nTracksPh | ( | ) | const [inline] |
Return the number of output Phi tracks.
Definition at line 108 of file DTSC.h.
References _outcand_ph.
Referenced by DTSectCollsort2(), and getTrackPh().
00108 { return _outcand_ph.size(); }
int DTSC::nTracksTh | ( | ) | const [inline] |
Return the number of output Theta tracks.
Definition at line 111 of file DTSC.h.
References _cand_th.
Referenced by getTrackTh().
00111 { return _cand_th.size(); }
Run the Sector Collector algorithm.
Definition at line 84 of file DTSC.cc.
References _incand_ph, _outcand_ph, begin, config(), GenMuonPlsPt100GeV_cfg::cout, debug, DTSectCollsort1(), DTSectCollsort2(), lat::endl(), first, nCandTh(), nFirstTPh(), nSecondTPh(), p, and edm::second().
Referenced by DTSectColl::runSectColl().
00084 { 00085 00086 if(config()->debug()){ 00087 std::cout << "DTSC::run: Processing DTSectColl: "; 00088 std::cout << nFirstTPh() << " first & " << nSecondTPh() << " second Phi tracks "; 00089 std::cout << " - "<< nCandTh() << " Theta tracks" << std::endl; 00090 00091 } 00092 00093 if(nFirstTPh()<1)return; // skip if no first tracks 00094 // 00095 // SORT 1 00096 // 00097 00098 // debugging 00099 if(config()->debug()){ 00100 std::cout << "Vector of first Phi tracks in DTSectColl: " << std::endl; 00101 std::vector<DTSectCollPhCand*>::const_iterator p; 00102 for(p=_incand_ph[0].begin(); p!=_incand_ph[0].end(); p++) { 00103 (*p)->print(); 00104 } 00105 } 00106 // end debugging 00107 00108 DTSectCollPhCand* first=DTSectCollsort1(); 00109 if(config()->debug()){ 00110 std::cout << "SC: DTSC::run: first Phi track is = " << first << std::endl; 00111 } 00112 if(first!=0) { 00113 _outcand_ph.push_back(first); 00114 00115 } 00116 if(nSecondTPh()<1)return; // skip if no second tracks 00117 00118 // 00119 // SORT 2 00120 // 00121 00122 // debugging 00123 if(config()->debug()){ 00124 std::vector<DTSectCollPhCand*>::const_iterator p; 00125 std::cout << "Vector of second Phi tracks in DTSectColl: " << std::endl; 00126 for(p=_incand_ph[1].begin(); p!=_incand_ph[1].end(); p++) { 00127 (*p)->print(); 00128 } 00129 } 00130 // end debugging 00131 00132 DTSectCollPhCand* second=DTSectCollsort2(); 00133 if(second!=0) { 00134 _outcand_ph.push_back(second); 00135 } 00136 00137 }
void DTSC::setConfig | ( | DTConfigSectColl * | conf | ) | [inline] |
Set configuration.
Definition at line 56 of file DTSC.h.
References _config.
Referenced by DTSectColl::setConfig().
00056 { _config=conf; };
std::vector<DTSectCollThCand*> DTSC::_cand_th [private] |
Definition at line 131 of file DTSC.h.
Referenced by addThCand(), clear(), getDTSectCollThCand(), getTrackTh(), nCandTh(), and nTracksTh().
DTConfigSectColl* DTSC::_config [private] |
Definition at line 102 of file DTSCCand.h.
DTConfigSectColl* DTSC::_config [private] |
int DTSC::_ignoreSecondTrack [private] |
Definition at line 134 of file DTSC.h.
Referenced by clear(), DTSectCollsort2(), and ignoreSecondTrack().
std::vector<DTTSCand*> DTSC::_incand[2] [private] |
std::vector<DTSectCollPhCand*> DTSC::_incand_ph[2] [private] |
Definition at line 125 of file DTSC.h.
Referenced by addDTSectCollPhCand(), addPhCand(), clear(), DTSectCollsort1(), DTSectCollsort2(), getDTSectCollPhCand(), nCandPh(), nFirstTPh(), nSecondTPh(), and run().
std::vector<DTTSCand*> DTSC::_outcand [private] |
std::vector<DTSectCollPhCand*> DTSC::_outcand_ph [private] |
int DTSC::_stat [private] |