CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
DTSC Class Reference

#include <DTSC.h>

Classes

class  h
 

Public Member Functions

void addCand (DTTSCand *cand)
 Add a TSM candidate to the Sect Coll, ifs is first/second track flag. More...
 
void addDTSectCollPhCand (DTSectCollPhCand *cand)
 Add a Sector Collector. More...
 
void addPhCand (DTSectCollPhCand *cand)
 Add a TSM candidate to the Sect Coll, ifs is first/second track flag. More...
 
void addThCand (DTSectCollThCand *cand)
 Add a Theta candidate to sect coll. More...
 
void clear ()
 Clear. More...
 
void clear ()
 Clear. More...
 
DTConfigSectCollconfig () const
 Configuration set. More...
 
DTConfigSectCollconfig () const
 Configuration set. More...
 
 DTSC (DTConfigSectColl *)
 Constructor. More...
 
 DTSC (int istat)
 Constructor. More...
 
DTTSCandDTSectCollsort1 ()
 Sort 1. More...
 
DTSectCollPhCandDTSectCollsort1 ()
 Phi Sort 1. More...
 
DTTSCandDTSectCollsort2 ()
 Sort 2. More...
 
DTSectCollPhCandDTSectCollsort2 ()
 Phi Sort 2. More...
 
DTSectCollPhCandgetDTSectCollPhCand (int ifs, unsigned n) const
 Return requested TSS candidate. More...
 
DTSectCollThCandgetDTSectCollThCand (unsigned n) const
 Return requested Theta candidate. More...
 
DTTSCandgetDTTSCand (int ifs, unsigned n) const
 Return requested TSS candidate. More...
 
DTTSCandgetTrack (int n) const
 Return the requested track. More...
 
DTSectCollPhCandgetTrackPh (int n) const
 Return the requested Phi track. More...
 
DTSectCollThCandgetTrackTh (int n) const
 Return the requested Theta track. More...
 
const DTTracoTrigDatagetTracoT (int ifs, unsigned n) const
 Return requested TRACO trigger. More...
 
void ignoreSecondTrack ()
 Set a flag to skip sort2. More...
 
void ignoreSecondTrack ()
 Set a flag to skip sort2. More...
 
unsigned nCand (int ifs) const
 Return the number of input tracks (first/second) More...
 
unsigned nCandPh (int ifs) const
 Return the number of Phi input tracks (first/second) More...
 
unsigned nCandTh () const
 Return the number of Theta input tracks. More...
 
int nFirstT () const
 Return the number of input first tracks. More...
 
int nFirstTPh () const
 Return the number of input first tracks. More...
 
int nSecondT () const
 Return the number of input second tracks. More...
 
int nSecondTPh () const
 Return the number of input second tracks. More...
 
int nTracks () const
 Return the number of sorted tracks. More...
 
int nTracksPh () const
 Return the number of output Phi tracks. More...
 
int nTracksTh () const
 Return the number of output Theta tracks. More...
 
void run ()
 Run the Sector Collector algorithm. More...
 
void run ()
 Run the Sector Collector algorithm. More...
 
void setConfig (DTConfigSectColl *conf)
 Set configuration. More...
 
 ~DTSC ()
 Destructor. More...
 
 ~DTSC ()
 Destructor. More...
 

Private Attributes

std::vector< DTSectCollThCand * > _cand_th
 
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
 

Detailed Description

Definition at line 43 of file DTSC.h.

Constructor & Destructor Documentation

DTSC::DTSC ( int  istat)

Constructor.

Definition at line 42 of file DTSC.cc.

42  : _ignoreSecondTrack(0) ,_stat(istat){
43 
44  // reserve the appropriate amount of space for vectors
45  // test _incand[0].reserve(DTConfigSectColl::NTSMSC);
46  // test_incand[1].reserve(DTConfigSectColl::NTSMSC);
47  // test _outcand.reserve(2);
48 
49 }
int _stat
Definition: DTSC.h:137
int _ignoreSecondTrack
Definition: DTSC.h:134
DTSC::~DTSC ( )

Destructor.

Definition at line 55 of file DTSC.cc.

References clear().

55  {
56 
57  clear();
58 
59 }
void clear()
Clear.
Definition: DTSC.cc:67
DTSC::DTSC ( DTConfigSectColl )

Constructor.

DTSC::~DTSC ( )

Destructor.

Member Function Documentation

void DTSC::addCand ( DTTSCand cand)

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().

303  {
304 
305  int ifs = (cand->isFirst()) ? 0 : 1;
306 
307  _incand_ph[ifs].push_back(cand);
308 
309 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
int isFirst() const
Return first/second track bit value.
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().

235  {
236 
237  _incand_ph[(1-cand->isFirst())].push_back(cand);
238 
239 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
int isFirst() const
Return first/second track bit value.
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().

242  {
243 
244  _cand_th.push_back(cand);
245 
246 }
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:131
void DTSC::clear ( )

Clear.

void DTSC::clear ( void  )

Clear.

Definition at line 67 of file DTSC.cc.

References _cand_th, _ignoreSecondTrack, _incand_ph, and _outcand_ph.

Referenced by DTSectColl::localClear(), and ~DTSC().

67  {
68 
70 
71  for(int itk=0;itk<=1;itk++){
72 
73  _incand_ph[itk].clear();
74  }
75 
76  _outcand_ph.clear();
77  _cand_th.clear();
78 
79 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:131
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSC.h:128
int _ignoreSecondTrack
Definition: DTSC.h:134
DTConfigSectColl* DTSC::config ( void  ) const
inline

Configuration set.

Definition at line 75 of file DTSCCand.h.

References _config.

75 { return _config; }
DTConfigSectColl * _config
Definition: DTSC.h:122
DTConfigSectColl* DTSC::config ( void  ) const
inline

Configuration set.

Definition at line 87 of file DTSC.h.

References _config.

Referenced by DTSectCollThCand::config(), DTSectCollPhCand::config(), DTSectCollsort1(), and run().

87 { return _config; }
DTConfigSectColl * _config
Definition: DTSC.h:122
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(), AlCaHLTBitMon_ParallelJobs::p, DTSectCollPhCand::setBitsSectColl(), and DTSectCollPhCand::setSecondTrack().

Referenced by run().

141  {
142 
143  // Do a sort 1
144  DTSectCollPhCand* best=0;
145  DTSectCollPhCand* carry=0;
146  std::vector<DTSectCollPhCand*>::iterator p;
147  for(p=_incand_ph[0].begin(); p!=_incand_ph[0].end(); p++) {
148  DTSectCollPhCand* curr=(*p);
149 
150  curr->setBitsSectColl(); // SM sector collector set bits in dataword to make SC sorting
151 
152  // NO Carry in Sector Collector sorting in default
153  if(config()->SCGetCarryFlag(_stat)) { // get carry
154 
155  if(best==0){
156  best=curr;
157  }
158  else if((*curr)<(*best)){
159  carry=best;
160  best=curr;
161  }
162  else if(carry==0){
163  carry=curr;
164  }
165  else if((*curr)<(*carry)){
166  carry=curr;
167  }
168 
169  }
170  else if(config()->SCGetCarryFlag(_stat)==0){ // no carry (default)
171  if(best==0){
172  best=curr;
173  }
174  else if((*curr)<(*best)){
175 
176  best=curr;
177  }
178 
179  }
180 
181  if(carry!=0 && config()->SCGetCarryFlag(_stat)) { // reassign carry to sort 2 candidates
182  carry->setSecondTrack(); // change value of 1st/2nd track bit
183  _incand_ph[1].push_back(carry); // add to list of 2nd track
184 
185  }
186  }
187 
188  return best;
189 
190 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
int _stat
Definition: DTSC.h:137
void setBitsSectColl()
Set the bits for DTTSM analysis.
DTConfigSectColl * config() const
Configuration set.
Definition: DTSC.h:87
#define begin
Definition: vmac.h:31
void setSecondTrack()
Set the first track bit to second track (used for carry)
DTTSCand* DTSC::DTSectCollsort2 ( )

Sort 2.

DTSectCollPhCand * DTSC::DTSectCollsort2 ( )

Phi Sort 2.

Definition at line 194 of file DTSC.cc.

References _ignoreSecondTrack, _incand_ph, begin, gather_cfg::cout, nTracksPh(), AlCaHLTBitMon_ParallelJobs::p, edm::second(), and DTSectCollPhCand::setBitsSectColl().

Referenced by run().

194  {
195 
196  // Check if there are second tracks
197 
198  if(nTracksPh()<1){
199  std::cout << "DTSC::DTSectCollsort2: called with no first Phi track.";
200  std::cout << " empty pointer returned!" << std::endl;
201  return 0;
202  }
203  // If a first track at the following BX is present, ignore second tracks of any kind
204  if(_ignoreSecondTrack){
205 
206  for(std::vector<DTSectCollPhCand*>::iterator p=_incand_ph[1].begin(); p!=_incand_ph[1].end(); p++) {
207 
208  }
209  return 0;
210  }
211 
212  // If no first tracks at the following BX, do a sort 2
213  // DTSectCollCand* best=getTrack(1); ! not needed as lons as there is no comparison with best in sort 2
215  std::vector<DTSectCollPhCand*>::iterator p;
216  for(p=_incand_ph[1].begin(); p!=_incand_ph[1].end(); p++) {
217  DTSectCollPhCand* curr=(*p);
218  curr->setBitsSectColl(); // SM sector collector set bits in dataword to make SC sorting
219 
220  if(second==0){
221  second=curr;
222  }
223  else if((*curr)<(*second)){
224  second=curr;
225  }
226 
227  }
228 
229  return second;
230 
231 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
void setBitsSectColl()
Set the bits for DTTSM analysis.
U second(std::pair< T, U > const &p)
int _ignoreSecondTrack
Definition: DTSC.h:134
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSC.h:108
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:121
DTSectCollPhCand * DTSC::getDTSectCollPhCand ( int  ifs,
unsigned  n 
) const

Return requested TSS candidate.

Definition at line 270 of file DTSC.cc.

References _incand_ph, gather_cfg::cout, n, nCandPh(), and AlCaHLTBitMon_ParallelJobs::p.

270  {
271 
272  if(ifs<1||ifs>2){
273  std::cout << "DTSC::getDTSectCollPhCand: wrong track number: " << ifs;
274  std::cout << " empty pointer returned!" << std::endl;
275  return 0;
276  }
277  if(n<1 || n>nCandPh(ifs)) {
278  std::cout << "DTSC::getDTSectCollPhCand: requested trigger not present: " << n;
279  std::cout << " empty pointer returned!" << std::endl;
280  return 0;
281  }
282 
283  std::vector<DTSectCollPhCand*>::const_iterator p = _incand_ph[ifs-1].begin()+n-1;
284  return (*p);
285 
286 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
unsigned nCandPh(int ifs) const
Return the number of Phi input tracks (first/second)
Definition: DTSC.cc:250
tuple cout
Definition: gather_cfg.py:121
DTSectCollThCand * DTSC::getDTSectCollThCand ( unsigned  n) const

Return requested Theta candidate.

Definition at line 289 of file DTSC.cc.

References _cand_th, gather_cfg::cout, n, nCandTh(), and AlCaHLTBitMon_ParallelJobs::p.

289  {
290 
291  if(n<1 || n>nCandTh()) {
292  std::cout << "DTSC::getDTSectCollThCand: requested trigger not present: " << n;
293  std::cout << " empty pointer returned!" << std::endl;
294  return 0;
295  }
296 
297  std::vector<DTSectCollThCand*>::const_iterator p = _cand_th.begin()+n-1;
298  return (*p);
299 
300 }
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:131
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSC.cc:262
tuple cout
Definition: gather_cfg.py:121
DTTSCand* DTSC::getDTTSCand ( int  ifs,
unsigned  n 
) const

Return requested TSS candidate.

DTTSCand* DTSC::getTrack ( int  n) const

Return the requested track.

DTSectCollPhCand * DTSC::getTrackPh ( int  n) const

Return the requested Phi track.

Definition at line 312 of file DTSC.cc.

References _outcand_ph, gather_cfg::cout, n, nTracksPh(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTSectColl::runSectColl().

312  {
313 
314  if(n<1 || n>nTracksPh()) {
315  std::cout << "DTSC::getTrackPh: requested track not present: " << n;
316  std::cout << " empty pointer returned!" << std::endl;
317  return 0;
318  }
319 
320  std::vector<DTSectCollPhCand*>::const_iterator p = _outcand_ph.begin()+n-1;
321 
322  return (*p);
323 
324 }
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSC.h:128
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSC.h:108
tuple cout
Definition: gather_cfg.py:121
DTSectCollThCand * DTSC::getTrackTh ( int  n) const

Return the requested Theta track.

Definition at line 328 of file DTSC.cc.

References _cand_th, gather_cfg::cout, n, nTracksTh(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTSectColl::runSectColl().

328  {
329 
330  if(n<1 || n>nTracksTh()) {
331  std::cout << "DTSC::getTrackTh: requested track not present: " << n;
332  std::cout << " empty pointer returned!" << std::endl;
333  return 0;
334  }
335 
336  std::vector<DTSectCollThCand*>::const_iterator p = _cand_th.begin()+n-1;
337 
338  return (*p);
339 
340 }
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:131
int nTracksTh() const
Return the number of output Theta tracks.
Definition: DTSC.h:111
tuple cout
Definition: gather_cfg.py:121
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.

58 { _ignoreSecondTrack=1; }
int _ignoreSecondTrack
Definition: DTSC.h:134
void DTSC::ignoreSecondTrack ( )
inline

Set a flag to skip sort2.

Definition at line 70 of file DTSC.h.

References _ignoreSecondTrack.

70 { _ignoreSecondTrack=1; }
int _ignoreSecondTrack
Definition: DTSC.h:134
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, and gather_cfg::cout.

Referenced by getDTSectCollPhCand().

250  {
251 
252  if(ifs<1||ifs>2){
253  std::cout << "DTSC::nCandPh: wrong track number: " << ifs;
254  std::cout << " 0 returned!" << std::endl;
255  return 0;
256  }
257  return _incand_ph[ifs-1].size();
258 
259 }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
tuple cout
Definition: gather_cfg.py:121
unsigned DTSC::nCandTh ( ) const

Return the number of Theta input tracks.

Definition at line 262 of file DTSC.cc.

References _cand_th.

Referenced by getDTSectCollThCand(), and run().

262  {
263 
264  return _cand_th.size();
265 
266 }
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:131
int DTSC::nFirstT ( ) const
inline

Return the number of input first tracks.

Definition at line 81 of file DTSCCand.h.

References _incand.

81 { return _incand[0].size(); }
std::vector< DTTSCand * > _incand[2]
Definition: DTSCCand.h:105
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().

96 { return _incand_ph[0].size(); }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
int DTSC::nSecondT ( ) const
inline

Return the number of input second tracks.

Definition at line 84 of file DTSCCand.h.

References _incand.

84 { return _incand[1].size(); }
std::vector< DTTSCand * > _incand[2]
Definition: DTSCCand.h:105
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().

99 { return _incand_ph[1].size(); }
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
int DTSC::nTracks ( ) const
inline

Return the number of sorted tracks.

Definition at line 93 of file DTSCCand.h.

References _outcand.

93 { return _outcand.size(); }
std::vector< DTTSCand * > _outcand
Definition: DTSCCand.h:108
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().

108 { return _outcand_ph.size(); }
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSC.h:128
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().

111 { return _cand_th.size(); }
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:131
void DTSC::run ( )

Run the Sector Collector algorithm.

void DTSC::run ( void  )

Run the Sector Collector algorithm.

Definition at line 84 of file DTSC.cc.

References _incand_ph, _outcand_ph, begin, config(), gather_cfg::cout, debug, DTSectCollsort1(), DTSectCollsort2(), first, nCandTh(), nFirstTPh(), nSecondTPh(), AlCaHLTBitMon_ParallelJobs::p, and edm::second().

Referenced by DTSectColl::runSectColl().

84  {
85 
86  if(config()->debug()){
87  std::cout << "DTSC::run: Processing DTSectColl: ";
88  std::cout << nFirstTPh() << " first & " << nSecondTPh() << " second Phi tracks ";
89  std::cout << " - "<< nCandTh() << " Theta tracks" << std::endl;
90 
91  }
92 
93  if(nFirstTPh()<1)return; // skip if no first tracks
94  //
95  // SORT 1
96  //
97 
98  // debugging
99  if(config()->debug()){
100  std::cout << "Vector of first Phi tracks in DTSectColl: " << std::endl;
101  std::vector<DTSectCollPhCand*>::const_iterator p;
102  for(p=_incand_ph[0].begin(); p!=_incand_ph[0].end(); p++) {
103  (*p)->print();
104  }
105  }
106  // end debugging
107 
109  if(config()->debug()){
110  std::cout << "SC: DTSC::run: first Phi track is = " << first << std::endl;
111  }
112  if(first!=0) {
113  _outcand_ph.push_back(first);
114 
115  }
116  if(nSecondTPh()<1)return; // skip if no second tracks
117 
118  //
119  // SORT 2
120  //
121 
122  // debugging
123  if(config()->debug()){
124  std::vector<DTSectCollPhCand*>::const_iterator p;
125  std::cout << "Vector of second Phi tracks in DTSectColl: " << std::endl;
126  for(p=_incand_ph[1].begin(); p!=_incand_ph[1].end(); p++) {
127  (*p)->print();
128  }
129  }
130  // end debugging
131 
133  if(second!=0) {
134  _outcand_ph.push_back(second);
135  }
136 
137 }
int nFirstTPh() const
Return the number of input first tracks.
Definition: DTSC.h:96
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:125
DTSectCollPhCand * DTSectCollsort2()
Phi Sort 2.
Definition: DTSC.cc:194
U second(std::pair< T, U > const &p)
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSC.h:128
bool first
Definition: L1TdeRCT.cc:94
DTSectCollPhCand * DTSectCollsort1()
Phi Sort 1.
Definition: DTSC.cc:141
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSC.cc:262
DTConfigSectColl * config() const
Configuration set.
Definition: DTSC.h:87
int nSecondTPh() const
Return the number of input second tracks.
Definition: DTSC.h:99
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:121
#define debug
Definition: MEtoEDMFormat.h:34
void DTSC::setConfig ( DTConfigSectColl conf)
inline

Set configuration.

Definition at line 56 of file DTSC.h.

References _config, and dbtoconf::conf.

Referenced by DTSectColl::setConfig().

56 { _config=conf; };
DTConfigSectColl * _config
Definition: DTSC.h:122
tuple conf
Definition: dbtoconf.py:185

Member Data Documentation

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 122 of file DTSC.h.

Referenced by config(), and setConfig().

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

Definition at line 105 of file DTSCCand.h.

Referenced by nFirstT(), and nSecondT().

std::vector<DTSectCollPhCand*> DTSC::_incand_ph[2]
private
std::vector<DTTSCand*> DTSC::_outcand
private

Definition at line 108 of file DTSCCand.h.

Referenced by nTracks().

std::vector<DTSectCollPhCand*> DTSC::_outcand_ph
private

Definition at line 128 of file DTSC.h.

Referenced by clear(), getTrackPh(), nTracksPh(), and run().

int DTSC::_stat
private

Definition at line 137 of file DTSC.h.

Referenced by DTSectCollsort1().