CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTSC Class Reference

#include <DTSC.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...
 
const 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 (const DTConfigSectColl *conf)
 Set configuration. More...
 
 ~DTSC ()
 Destructor. More...
 
 ~DTSC ()
 Destructor. More...
 

Private Attributes

std::vector< DTSectCollThCand * > _cand_th
 
DTConfigSectColl_config
 
const 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 41 of file DTSC.h.

Constructor & Destructor Documentation

◆ DTSC() [1/2]

DTSC::DTSC ( int  istat)

Constructor.

Definition at line 41 of file DTSC.cc.

41  : _ignoreSecondTrack(0), _stat(istat) {
42  // reserve the appropriate amount of space for vectors
43  // test _incand[0].reserve(DTConfigSectColl::NTSMSC);
44  // test_incand[1].reserve(DTConfigSectColl::NTSMSC);
45  // test _outcand.reserve(2);
46 }

◆ ~DTSC() [1/2]

DTSC::~DTSC ( )

Destructor.

Definition at line 51 of file DTSC.cc.

51 { clear(); }

References clear().

◆ DTSC() [2/2]

DTSC::DTSC ( DTConfigSectColl )

Constructor.

◆ ~DTSC() [2/2]

DTSC::~DTSC ( )

Destructor.

Member Function Documentation

◆ addCand()

void DTSC::addCand ( DTTSCand cand)

Add a TSM candidate to the Sect Coll, ifs is first/second track flag.

◆ addDTSectCollPhCand()

void DTSC::addDTSectCollPhCand ( DTSectCollPhCand cand)

Add a Sector Collector.

Definition at line 238 of file DTSC.cc.

238  {
239  int ifs = (cand->isFirst()) ? 0 : 1;
240 
241  _incand_ph[ifs].push_back(cand);
242 }

References _incand_ph.

Referenced by DTSectColl::addTSPhi().

◆ addPhCand()

void DTSC::addPhCand ( DTSectCollPhCand cand)

Add a TSM candidate to the Sect Coll, ifs is first/second track flag.

Definition at line 196 of file DTSC.cc.

196 { _incand_ph[(1 - cand->isFirst())].push_back(cand); }

References _incand_ph.

◆ addThCand()

void DTSC::addThCand ( DTSectCollThCand cand)

Add a Theta candidate to sect coll.

Definition at line 198 of file DTSC.cc.

198 { _cand_th.push_back(cand); }

References _cand_th.

Referenced by DTSectColl::addTSTheta().

◆ clear() [1/2]

void DTSC::clear ( )

Clear.

◆ clear() [2/2]

void DTSC::clear ( void  )

Clear.

Definition at line 57 of file DTSC.cc.

57  {
59 
60  for (int itk = 0; itk <= 1; itk++) {
61  _incand_ph[itk].clear();
62  }
63 
64  _outcand_ph.clear();
65  _cand_th.clear();
66 }

References _cand_th, _ignoreSecondTrack, _incand_ph, and _outcand_ph.

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

◆ config() [1/2]

DTConfigSectColl* DTSC::config ( void  ) const
inline

Configuration set.

Definition at line 74 of file DTSCCand.h.

74 { return _config; }

References _config.

◆ config() [2/2]

const DTConfigSectColl* DTSC::config ( void  ) const
inline

Configuration set.

Definition at line 82 of file DTSC.h.

82 { return _config; }

References _config.

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

◆ DTSectCollsort1() [1/2]

DTTSCand* DTSC::DTSectCollsort1 ( )

Sort 1.

◆ DTSectCollsort1() [2/2]

DTSectCollPhCand * DTSC::DTSectCollsort1 ( )

Phi Sort 1.

Definition at line 122 of file DTSC.cc.

122  {
123  // Do a sort 1
124  DTSectCollPhCand* best = nullptr;
125  DTSectCollPhCand* carry = nullptr;
126  std::vector<DTSectCollPhCand*>::iterator p;
127  for (p = _incand_ph[0].begin(); p != _incand_ph[0].end(); p++) {
128  DTSectCollPhCand* curr = (*p);
129 
130  curr->setBitsSectColl(); // SM sector collector set bits in dataword to make SC sorting
131 
132  // NO Carry in Sector Collector sorting in default
133  if (config()->SCGetCarryFlag(_stat)) { // get carry
134 
135  if (best == nullptr) {
136  best = curr;
137  } else if ((*curr) < (*best)) {
138  carry = best;
139  best = curr;
140  } else if (carry == nullptr) {
141  carry = curr;
142  } else if ((*curr) < (*carry)) {
143  carry = curr;
144  }
145 
146  } else if (config()->SCGetCarryFlag(_stat) == 0) { // no carry (default)
147  if (best == nullptr) {
148  best = curr;
149  } else if ((*curr) < (*best)) {
150  best = curr;
151  }
152  }
153 
154  if (carry != nullptr && config()->SCGetCarryFlag(_stat)) { // reassign carry to sort 2 candidates
155  carry->setSecondTrack(); // change value of 1st/2nd track bit
156  _incand_ph[1].push_back(carry); // add to list of 2nd track
157  }
158  }
159 
160  return best;
161 }

References _incand_ph, _stat, config(), AlCaHLTBitMon_ParallelJobs::p, DTSectCollPhCand::setBitsSectColl(), and DTSectCollPhCand::setSecondTrack().

Referenced by run().

◆ DTSectCollsort2() [1/2]

DTTSCand* DTSC::DTSectCollsort2 ( )

Sort 2.

◆ DTSectCollsort2() [2/2]

DTSectCollPhCand * DTSC::DTSectCollsort2 ( )

Phi Sort 2.

Definition at line 163 of file DTSC.cc.

163  {
164  // Check if there are second tracks
165 
166  if (nTracksPh() < 1) {
167  std::cout << "DTSC::DTSectCollsort2: called with no first Phi track.";
168  std::cout << " empty pointer returned!" << std::endl;
169  return nullptr;
170  }
171  // If a first track at the following BX is present, ignore second tracks of any kind
172  if (_ignoreSecondTrack) {
173  for (std::vector<DTSectCollPhCand*>::iterator p = _incand_ph[1].begin(); p != _incand_ph[1].end(); p++) {
174  }
175  return nullptr;
176  }
177 
178  // If no first tracks at the following BX, do a sort 2
179  // DTSectCollCand* best=getTrack(1); ! not needed as lons as there is no comparison with best in sort 2
180  DTSectCollPhCand* second = nullptr;
181  std::vector<DTSectCollPhCand*>::iterator p;
182  for (p = _incand_ph[1].begin(); p != _incand_ph[1].end(); p++) {
183  DTSectCollPhCand* curr = (*p);
184  curr->setBitsSectColl(); // SM sector collector set bits in dataword to make SC sorting
185 
186  if (second == nullptr) {
187  second = curr;
188  } else if ((*curr) < (*second)) {
189  second = curr;
190  }
191  }
192 
193  return second;
194 }

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

Referenced by run().

◆ getDTSectCollPhCand()

DTSectCollPhCand * DTSC::getDTSectCollPhCand ( int  ifs,
unsigned  n 
) const

Return requested TSS candidate.

Definition at line 211 of file DTSC.cc.

211  {
212  if (ifs < 1 || ifs > 2) {
213  std::cout << "DTSC::getDTSectCollPhCand: wrong track number: " << ifs;
214  std::cout << " empty pointer returned!" << std::endl;
215  return nullptr;
216  }
217  if (n < 1 || n > nCandPh(ifs)) {
218  std::cout << "DTSC::getDTSectCollPhCand: requested trigger not present: " << n;
219  std::cout << " empty pointer returned!" << std::endl;
220  return nullptr;
221  }
222 
223  std::vector<DTSectCollPhCand*>::const_iterator p = _incand_ph[ifs - 1].begin() + n - 1;
224  return (*p);
225 }

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

◆ getDTSectCollThCand()

DTSectCollThCand * DTSC::getDTSectCollThCand ( unsigned  n) const

Return requested Theta candidate.

Definition at line 227 of file DTSC.cc.

227  {
228  if (n < 1 || n > nCandTh()) {
229  std::cout << "DTSC::getDTSectCollThCand: requested trigger not present: " << n;
230  std::cout << " empty pointer returned!" << std::endl;
231  return nullptr;
232  }
233 
234  std::vector<DTSectCollThCand*>::const_iterator p = _cand_th.begin() + n - 1;
235  return (*p);
236 }

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

◆ getDTTSCand()

DTTSCand* DTSC::getDTTSCand ( int  ifs,
unsigned  n 
) const

Return requested TSS candidate.

◆ getTrack()

DTTSCand* DTSC::getTrack ( int  n) const

Return the requested track.

◆ getTrackPh()

DTSectCollPhCand * DTSC::getTrackPh ( int  n) const

Return the requested Phi track.

Definition at line 244 of file DTSC.cc.

244  {
245  if (n < 1 || n > nTracksPh()) {
246  std::cout << "DTSC::getTrackPh: requested track not present: " << n;
247  std::cout << " empty pointer returned!" << std::endl;
248  return nullptr;
249  }
250 
251  std::vector<DTSectCollPhCand*>::const_iterator p = _outcand_ph.begin() + n - 1;
252 
253  return (*p);
254 }

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

Referenced by DTSectColl::runSectColl().

◆ getTrackTh()

DTSectCollThCand * DTSC::getTrackTh ( int  n) const

Return the requested Theta track.

Definition at line 256 of file DTSC.cc.

256  {
257  if (n < 1 || n > nTracksTh()) {
258  std::cout << "DTSC::getTrackTh: requested track not present: " << n;
259  std::cout << " empty pointer returned!" << std::endl;
260  return nullptr;
261  }
262 
263  std::vector<DTSectCollThCand*>::const_iterator p = _cand_th.begin() + n - 1;
264 
265  return (*p);
266 }

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

Referenced by DTSectColl::runSectColl().

◆ getTracoT()

const DTTracoTrigData* DTSC::getTracoT ( int  ifs,
unsigned  n 
) const

Return requested TRACO trigger.

◆ ignoreSecondTrack() [1/2]

void DTSC::ignoreSecondTrack ( )
inline

Set a flag to skip sort2.

Definition at line 57 of file DTSCCand.h.

57 { _ignoreSecondTrack=1; }

References _ignoreSecondTrack.

◆ ignoreSecondTrack() [2/2]

void DTSC::ignoreSecondTrack ( )
inline

Set a flag to skip sort2.

Definition at line 65 of file DTSC.h.

65 { _ignoreSecondTrack = 1; }

References _ignoreSecondTrack.

◆ nCand()

unsigned DTSC::nCand ( int  ifs) const

Return the number of input tracks (first/second)

◆ nCandPh()

unsigned DTSC::nCandPh ( int  ifs) const

Return the number of Phi input tracks (first/second)

Definition at line 200 of file DTSC.cc.

200  {
201  if (ifs < 1 || ifs > 2) {
202  std::cout << "DTSC::nCandPh: wrong track number: " << ifs;
203  std::cout << " 0 returned!" << std::endl;
204  return 0;
205  }
206  return _incand_ph[ifs - 1].size();
207 }

References _incand_ph, and gather_cfg::cout.

Referenced by getDTSectCollPhCand().

◆ nCandTh()

unsigned DTSC::nCandTh ( ) const

Return the number of Theta input tracks.

Definition at line 209 of file DTSC.cc.

209 { return _cand_th.size(); }

References _cand_th.

Referenced by getDTSectCollThCand(), and run().

◆ nFirstT()

int DTSC::nFirstT ( ) const
inline

Return the number of input first tracks.

Definition at line 80 of file DTSCCand.h.

80 { return _incand[0].size(); }

References _incand.

◆ nFirstTPh()

int DTSC::nFirstTPh ( ) const
inline

Return the number of input first tracks.

Definition at line 91 of file DTSC.h.

91 { return _incand_ph[0].size(); }

References _incand_ph.

Referenced by run().

◆ nSecondT()

int DTSC::nSecondT ( ) const
inline

Return the number of input second tracks.

Definition at line 83 of file DTSCCand.h.

83 { return _incand[1].size(); }

References _incand.

◆ nSecondTPh()

int DTSC::nSecondTPh ( ) const
inline

Return the number of input second tracks.

Definition at line 94 of file DTSC.h.

94 { return _incand_ph[1].size(); }

References _incand_ph.

Referenced by run().

◆ nTracks()

int DTSC::nTracks ( ) const
inline

Return the number of sorted tracks.

Definition at line 92 of file DTSCCand.h.

92 { return _outcand.size(); }

References _outcand.

◆ nTracksPh()

int DTSC::nTracksPh ( ) const
inline

Return the number of output Phi tracks.

Definition at line 103 of file DTSC.h.

103 { return _outcand_ph.size(); }

References _outcand_ph.

Referenced by DTSectCollsort2(), and getTrackPh().

◆ nTracksTh()

int DTSC::nTracksTh ( ) const
inline

Return the number of output Theta tracks.

Definition at line 106 of file DTSC.h.

106 { return _cand_th.size(); }

References _cand_th.

Referenced by getTrackTh().

◆ run() [1/2]

void DTSC::run ( )

Run the Sector Collector algorithm.

◆ run() [2/2]

void DTSC::run ( )

Run the Sector Collector algorithm.

Definition at line 69 of file DTSC.cc.

69  {
70  if (config()->debug()) {
71  std::cout << "DTSC::run: Processing DTSectColl: ";
72  std::cout << nFirstTPh() << " first & " << nSecondTPh() << " second Phi tracks ";
73  std::cout << " - " << nCandTh() << " Theta tracks" << std::endl;
74  }
75 
76  if (nFirstTPh() < 1)
77  return; // skip if no first tracks
78  //
79  // SORT 1
80  //
81 
82  // debugging
83  if (config()->debug()) {
84  std::cout << "Vector of first Phi tracks in DTSectColl: " << std::endl;
85  std::vector<DTSectCollPhCand*>::const_iterator p;
86  for (p = _incand_ph[0].begin(); p != _incand_ph[0].end(); p++) {
87  (*p)->print();
88  }
89  }
90  // end debugging
91 
93  if (config()->debug()) {
94  std::cout << "SC: DTSC::run: first Phi track is = " << first << std::endl;
95  }
96  if (first != nullptr) {
97  _outcand_ph.push_back(first);
98  }
99  if (nSecondTPh() < 1)
100  return; // skip if no second tracks
101 
102  //
103  // SORT 2
104  //
105 
106  // debugging
107  if (config()->debug()) {
108  std::vector<DTSectCollPhCand*>::const_iterator p;
109  std::cout << "Vector of second Phi tracks in DTSectColl: " << std::endl;
110  for (p = _incand_ph[1].begin(); p != _incand_ph[1].end(); p++) {
111  (*p)->print();
112  }
113  }
114  // end debugging
115 
117  if (second != nullptr) {
118  _outcand_ph.push_back(second);
119  }
120 }

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

Referenced by DTSectColl::runSectColl().

◆ setConfig()

void DTSC::setConfig ( const DTConfigSectColl conf)
inline

Set configuration.

Definition at line 52 of file DTSC.h.

52 { _config = conf; };

References _config.

Referenced by DTSectColl::setConfig().

Member Data Documentation

◆ _cand_th

std::vector<DTSectCollThCand*> DTSC::_cand_th
private

Definition at line 125 of file DTSC.h.

Referenced by addThCand(), clear(), getDTSectCollThCand(), getTrackTh(), nCandTh(), and nTracksTh().

◆ _config [1/2]

DTConfigSectColl* DTSC::_config
private

Definition at line 101 of file DTSCCand.h.

◆ _config [2/2]

const DTConfigSectColl* DTSC::_config
private

Definition at line 116 of file DTSC.h.

Referenced by config(), and setConfig().

◆ _ignoreSecondTrack

int DTSC::_ignoreSecondTrack
private

Definition at line 128 of file DTSC.h.

Referenced by clear(), DTSectCollsort2(), and ignoreSecondTrack().

◆ _incand

std::vector<DTTSCand*> DTSC::_incand[2]
private

Definition at line 104 of file DTSCCand.h.

Referenced by nFirstT(), and nSecondT().

◆ _incand_ph

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

◆ _outcand

std::vector<DTTSCand*> DTSC::_outcand
private

Definition at line 107 of file DTSCCand.h.

Referenced by nTracks().

◆ _outcand_ph

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

Definition at line 122 of file DTSC.h.

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

◆ _stat

int DTSC::_stat
private

Definition at line 131 of file DTSC.h.

Referenced by plotting.Plot::_setStats(), and DTSectCollsort1().

DTSC::_ignoreSecondTrack
int _ignoreSecondTrack
Definition: DTSC.h:128
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
DTSectCollPhCand::setBitsSectColl
void setBitsSectColl()
Set the bits for DTTSM analysis.
Definition: DTSectCollPhCand.cc:69
DTSectCollPhCand
Definition: DTSectCollPhCand.h:32
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DTSC::nFirstTPh
int nFirstTPh() const
Return the number of input first tracks.
Definition: DTSC.h:91
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
DTSC::DTSectCollsort1
DTSectCollPhCand * DTSectCollsort1()
Phi Sort 1.
Definition: DTSC.cc:122
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DTSC::_config
const DTConfigSectColl * _config
Definition: DTSC.h:116
DTSC::clear
void clear()
Clear.
Definition: DTSC.cc:57
DTSC::nSecondTPh
int nSecondTPh() const
Return the number of input second tracks.
Definition: DTSC.h:94
debug
#define debug
Definition: HDRShower.cc:19
DTSC::config
const DTConfigSectColl * config() const
Configuration set.
Definition: DTSC.h:82
DTSC::_outcand
std::vector< DTTSCand * > _outcand
Definition: DTSCCand.h:107
DTSC::_stat
int _stat
Definition: DTSC.h:131
DTSC::_incand_ph
std::vector< DTSectCollPhCand * > _incand_ph[2]
Definition: DTSC.h:119
DTSC::DTSectCollsort2
DTSectCollPhCand * DTSectCollsort2()
Phi Sort 2.
Definition: DTSC.cc:163
cand
Definition: decayParser.h:32
DTSC::_cand_th
std::vector< DTSectCollThCand * > _cand_th
Definition: DTSC.h:125
DTSectCollPhCand::setSecondTrack
void setSecondTrack()
Set the first track bit to second track (used for carry)
Definition: DTSectCollPhCand.h:61
DTSC::nTracksPh
int nTracksPh() const
Return the number of output Phi tracks.
Definition: DTSC.h:103
DTSC::nTracksTh
int nTracksTh() const
Return the number of output Theta tracks.
Definition: DTSC.h:106
DTSC::nCandTh
unsigned nCandTh() const
Return the number of Theta input tracks.
Definition: DTSC.cc:209
DTSC::_outcand_ph
std::vector< DTSectCollPhCand * > _outcand_ph
Definition: DTSC.h:122
DTSC::nCandPh
unsigned nCandPh(int ifs) const
Return the number of Phi input tracks (first/second)
Definition: DTSC.cc:200
DTSC::_incand
std::vector< DTTSCand * > _incand[2]
Definition: DTSCCand.h:104