CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
CSCTFTrackBuilder Class Reference

#include <CSCTFTrackBuilder.h>

Public Types

enum  { nEndcaps = 2, nSectors = 6 }
 
using Tokens = CSCTFSectorProcessor::Tokens
 

Public Member Functions

void buildTracks (const CSCCorrelatedLCTDigiCollection *, const CSCTriggerContainer< csctf::TrackStub > *, L1CSCTrackCollection *, CSCTriggerContainer< csctf::TrackStub > *)
 
 CSCTFTrackBuilder (const edm::ParameterSet &pset, bool TMB07, const L1MuTriggerScales *scales, const L1MuTriggerPtScale *ptScale)
 
void initialize (const edm::EventSetup &c, const Tokens &tokens)
 
 ~CSCTFTrackBuilder ()
 

Static Public Member Functions

static Tokens consumes (const edm::ParameterSet &pset, edm::ConsumesCollector iC)
 

Private Attributes

int m_maxBX
 
int m_minBX
 
CSCTFSectorProcessormy_SPs [nEndcaps][nSectors]
 

Detailed Description

Definition at line 19 of file CSCTFTrackBuilder.h.

Member Typedef Documentation

◆ Tokens

Definition at line 21 of file CSCTFTrackBuilder.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
nEndcaps 
nSectors 

Definition at line 28 of file CSCTFTrackBuilder.h.

28 { nEndcaps = 2, nSectors = 6 };

Constructor & Destructor Documentation

◆ CSCTFTrackBuilder()

CSCTFTrackBuilder::CSCTFTrackBuilder ( const edm::ParameterSet pset,
bool  TMB07,
const L1MuTriggerScales scales,
const L1MuTriggerPtScale ptScale 
)

Definition at line 17 of file CSCTFTrackBuilder.cc.

20  {
21  m_minBX = pset.getParameter<int>("MinBX");
22  m_maxBX = pset.getParameter<int>("MaxBX");
23 
24  for (int e = CSCDetId::minEndcapId(); e <= CSCDetId::maxEndcapId(); ++e) {
26  // All SPs work with the same configuration (impossible to make it more exclusive in this framework)
27  my_SPs[e - 1][s - 1] = new CSCTFSectorProcessor(e, s, pset, TMB07, scales, ptScale);
28  }
29  }
30 }

References MillePedeFileConverter_cfg::e, m_maxBX, m_minBX, CSCDetId::maxEndcapId(), CSCTriggerNumbering::maxTriggerSectorId(), CSCDetId::minEndcapId(), CSCTriggerNumbering::minTriggerSectorId(), my_SPs, muonDTDigis_cfi::pset, ptScale, and alignCSCRings::s.

◆ ~CSCTFTrackBuilder()

CSCTFTrackBuilder::~CSCTFTrackBuilder ( )

Member Function Documentation

◆ buildTracks()

void CSCTFTrackBuilder::buildTracks ( const CSCCorrelatedLCTDigiCollection lcts,
const CSCTriggerContainer< csctf::TrackStub > *  dtstubss,
L1CSCTrackCollection trkcoll,
CSCTriggerContainer< csctf::TrackStub > *  stubs_to_dt 
)

Hmmm how should I implement this??? Maybe change the L1Track to use stubs not LCTs?

Definition at line 50 of file CSCTFTrackBuilder.cc.

54  {
55  std::vector<csc::L1Track> trks;
57 
59 
60  for (Citer = lcts->begin(); Citer != lcts->end(); Citer++) {
61  CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
62  CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
63 
64  for (; Diter != Dend; Diter++) {
65  csctf::TrackStub theStub((*Diter), (*Citer).first);
66  stub_list.push_back(theStub);
67  }
68  }
69 
70  // Now we append the track stubs the the DT Sector Collector
71  // after processing from the DT Receiver.
72 
73  // CSCTriggerContainer<csctf::TrackStub> dtstubs = my_dtrc->process(dttrig);
74  // stub_list.push_many(dtstubs);
75  stub_list.push_many(*dtstubss);
76 
77  // run each sector processor in the TF
78  for (int e = CSCDetId::minEndcapId(); e <= CSCDetId::maxEndcapId(); ++e) {
80  CSCTriggerContainer<csctf::TrackStub> current_e_s = stub_list.get(e, s);
81  int spReturnValue = my_SPs[e - 1][s - 1]->run(current_e_s);
82  if (spReturnValue == -1) //Major Error, returning with empty Coll's
83  {
84  trkcoll->clear();
85  stubs_to_dt->clear();
86  return;
87  } else if (spReturnValue) {
88  std::vector<csc::L1Track> theTracks = my_SPs[e - 1][s - 1]->tracks().get();
89  trks.insert(trks.end(), theTracks.begin(), theTracks.end());
90  }
91  stubs_to_dt->push_many(my_SPs[e - 1][s - 1]->dtStubs()); // send stubs whether or not we find a track!!!
92  }
93  }
94 
95  // Now to combine tracks with their track stubs and send them off.
96  trkcoll->resize(trks.size());
97  std::vector<csc::L1Track>::const_iterator titr = trks.begin();
98  L1CSCTrackCollection::iterator tcitr = trkcoll->begin();
99 
100  for (; titr != trks.end(); titr++) {
101  tcitr->first = (*titr);
102  std::vector<csctf::TrackStub> possible_stubs = my_SPs[titr->endcap() - 1][titr->sector() - 1]->filteredStubs();
103  std::vector<csctf::TrackStub>::const_iterator tkstbs = possible_stubs.begin();
104 
105  int me1ID = titr->me1ID();
106  int me2ID = titr->me2ID();
107  int me3ID = titr->me3ID();
108  int me4ID = titr->me4ID();
109  int mb1ID = titr->mb1ID();
110  int me1delay = titr->me1Tbin();
111  int me2delay = titr->me2Tbin();
112  int me3delay = titr->me3Tbin();
113  int me4delay = titr->me4Tbin();
114  int mb1delay = titr->mb1Tbin();
115  // BX analyzer: some stub could be delayed by BXA so that all the stubs will run through the core at the same BX;
116  // then there is a rule of "second earlies LCT": resulting track will be placed at BX of the "second earliest LCT";
117  // in the end there are two parameters in place: the delay by BXA w.r.t to the last LCT and track tbin assignment
118  std::map<int, std::list<int> > timeline;
119  if (me1ID)
120  timeline[me1delay].push_back(1);
121  if (me2ID)
122  timeline[me2delay].push_back(2);
123  if (me3ID)
124  timeline[me3delay].push_back(3);
125  if (me4ID)
126  timeline[me4delay].push_back(4);
127  int earliest_tbin = 0, second_earliest_tbin = 0;
128  for (int bx = 7; bx >= 0; bx--) {
129  std::list<int>::const_iterator iter = timeline[bx].begin();
130  while (iter != timeline[bx].end()) {
131  if (earliest_tbin == 0)
132  earliest_tbin = bx;
133  else if (second_earliest_tbin == 0)
134  second_earliest_tbin = bx;
135  iter++;
136  }
137  }
138  // Core's input was loaded in a relative time window BX=[0-7)
139  // To relate it to time window of tracks (centred at BX=0) we introduce a shift:
140  int shift = (m_maxBX + m_minBX) / 2 - m_minBX + m_minBX;
141  int me1Tbin = titr->bx() - me1delay + second_earliest_tbin + shift;
142  int me2Tbin = titr->bx() - me2delay + second_earliest_tbin + shift;
143  int me3Tbin = titr->bx() - me3delay + second_earliest_tbin + shift;
144  int me4Tbin = titr->bx() - me4delay + second_earliest_tbin + shift;
145  int mb1Tbin = titr->bx() - mb1delay + second_earliest_tbin + shift;
146 
147  for (; tkstbs != possible_stubs.end(); tkstbs++) {
148  switch (tkstbs->station()) {
149  case 1:
150  if ((tkstbs->getMPCLink() +
151  (3 * (CSCTriggerNumbering::triggerSubSectorFromLabels(CSCDetId(tkstbs->getDetId().rawId())) - 1))) ==
152  me1ID &&
153  me1ID != 0 && me1Tbin == tkstbs->BX()) {
154  tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
155  }
156  break;
157  case 2:
158  if (tkstbs->getMPCLink() == me2ID && me2ID != 0 && me2Tbin == tkstbs->BX()) {
159  tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
160  }
161  break;
162  case 3:
163  if (tkstbs->getMPCLink() == me3ID && me3ID != 0 && me3Tbin == tkstbs->BX()) {
164  tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
165  }
166  break;
167  case 4:
168  if (tkstbs->getMPCLink() == me4ID && me4ID != 0 && me4Tbin == tkstbs->BX()) {
169  tcitr->second.insertDigi(CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
170  }
171  break;
172  case 5:
173  if (tkstbs->getMPCLink() == mb1ID && mb1ID != 0 && mb1Tbin == tkstbs->BX()) {
175  }
176  break;
177  default:
178  edm::LogWarning("CSCTFTrackBuilder::buildTracks()")
179  << "SERIOUS ERROR: STATION " << tkstbs->station() << " NOT IN RANGE [1,5]\n";
180  };
181  }
182  tcitr++; // increment to next track in the collection
183  }
184 }

References l1GtPatternGenerator_cfi::bx, CSCTriggerContainer< T >::clear(), MillePedeFileConverter_cfg::e, mps_fire::end, CSCTFSectorProcessor::filteredStubs(), CSCTriggerContainer< T >::get(), m_maxBX, m_minBX, CSCDetId::maxEndcapId(), CSCTriggerNumbering::maxTriggerSectorId(), CSCDetId::minEndcapId(), CSCTriggerNumbering::minTriggerSectorId(), my_SPs, CSCTriggerContainer< T >::push_back(), CSCTriggerContainer< T >::push_many(), CSCTFSectorProcessor::run(), alignCSCRings::s, edm::shift, CSCTFSectorProcessor::tracks(), CSCTriggerNumbering::triggerSubSectorFromLabels(), and hltEgammaHLTExtra_cfi::trks.

◆ consumes()

static Tokens CSCTFTrackBuilder::consumes ( const edm::ParameterSet pset,
edm::ConsumesCollector  iC 
)
inlinestatic

Definition at line 22 of file CSCTFTrackBuilder.h.

22  {
24  }

References CSCTFSectorProcessor::consumes(), and muonDTDigis_cfi::pset.

◆ initialize()

void CSCTFTrackBuilder::initialize ( const edm::EventSetup c,
const Tokens tokens 
)

Member Data Documentation

◆ m_maxBX

int CSCTFTrackBuilder::m_maxBX
private

Definition at line 44 of file CSCTFTrackBuilder.h.

Referenced by buildTracks(), and CSCTFTrackBuilder().

◆ m_minBX

int CSCTFTrackBuilder::m_minBX
private

Definition at line 44 of file CSCTFTrackBuilder.h.

Referenced by buildTracks(), and CSCTFTrackBuilder().

◆ my_SPs

CSCTFSectorProcessor* CSCTFTrackBuilder::my_SPs[nEndcaps][nSectors]
private

Definition at line 43 of file CSCTFTrackBuilder.h.

Referenced by buildTracks(), CSCTFTrackBuilder(), initialize(), and ~CSCTFTrackBuilder().

CSCTriggerContainer::clear
void clear()
Definition: CSCTriggerContainer.h:57
CSCTFTrackBuilder::m_minBX
int m_minBX
Definition: CSCTFTrackBuilder.h:44
CSCTFSectorProcessor
KK.
Definition: CSCTFSectorProcessor.h:28
CSCTFSectorProcessor::tracks
CSCTriggerContainer< csc::L1Track > tracks() const
Definition: CSCTFSectorProcessor.h:54
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCTriggerNumbering::triggerSubSectorFromLabels
static int triggerSubSectorFromLabels(int station, int chamber)
Definition: CSCTriggerNumbering.cc:105
CSCTriggerNumbering::maxTriggerSectorId
static int maxTriggerSectorId()
Definition: CSCTriggerNumbering.h:112
CSCTriggerContainer::push_many
void push_many(const std::vector< T > &data)
Definition: CSCTriggerContainer.h:52
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
csctf::TrackStub
Definition: TrackStub.h:22
MuonDigiCollection::const_iterator
std::vector< DigiType >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CSCTFTrackBuilder::nSectors
Definition: CSCTFTrackBuilder.h:28
CSCDetId::minEndcapId
static int minEndcapId()
Definition: CSCDetId.h:234
mps_fire.end
end
Definition: mps_fire.py:242
CSCTFSectorProcessor::run
int run(const CSCTriggerContainer< csctf::TrackStub > &)
Definition: CSCTFSectorProcessor.cc:690
CSCTFTrackBuilder::m_maxBX
int m_maxBX
Definition: CSCTFTrackBuilder.h:44
CSCDetId
Definition: CSCDetId.h:26
CSCTFTrackBuilder::nEndcaps
Definition: CSCTFTrackBuilder.h:28
CSCTFSectorProcessor::consumes
static Tokens consumes(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
Definition: CSCTFSectorProcessor.cc:14
CSCTriggerNumbering::minTriggerSectorId
static int minTriggerSectorId()
Definition: CSCTriggerNumbering.h:113
CSCDetId::maxEndcapId
static int maxEndcapId()
Definition: CSCDetId.h:235
ptScale
const std::vector< double > ptScale
Definition: Utilities.cc:33
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
CSCTriggerContainer< csctf::TrackStub >
CSCTriggerContainer::push_back
void push_back(const T &data)
Definition: CSCTriggerContainer.h:51
CSCTFSectorProcessor::filteredStubs
std::vector< csctf::TrackStub > filteredStubs() const
Definition: CSCTFSectorProcessor.h:55
hltEgammaHLTExtra_cfi.trks
trks
Definition: hltEgammaHLTExtra_cfi.py:43
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
CSCTFTrackBuilder::my_SPs
CSCTFSectorProcessor * my_SPs[nEndcaps][nSectors]
Definition: CSCTFTrackBuilder.h:43
DigiContainerIterator
Definition: MuonDigiCollection.h:30
CSCTFSectorProcessor::initialize
void initialize(const edm::EventSetup &c, const Tokens &tokens)
KK.
Definition: CSCTFSectorProcessor.cc:189
CSCTriggerContainer::get
std::vector< T > get() const
Definition: CSCTriggerContainer.h:83
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37