CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SimTrackManager Class Reference

#include <SimG4Core/Notification/interface/SimTrackManager.h>

Classes

class  StrictWeakOrdering
 

Public Types

typedef std::pair< int, math::XYZVectorDMapVertexPosition
 this map contains association between vertex number and position More...
 
typedef std::vector< std::pair< int, math::XYZVectorD > > MapVertexPositionVector
 
typedef std::map< int, MapVertexPositionVectorMotherParticleToVertexMap
 
typedef MotherParticleToVertexMap VertexMap
 

Public Member Functions

void addTkCaloStateInfo (uint32_t t, const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &p)
 
void addTrack (TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
 
void cleanTkCaloStateInfoMap ()
 
void cleanTracksWithHistory ()
 
void deleteTracks ()
 
TrackWithHistorygetTrackByID (unsigned int trackID, bool strict=false) const
 
int giveMotherNeeded (int i) const
 
const SimTrackManageroperator= (const SimTrackManager &)=delete
 
void reset ()
 
void setCollapsePrimaryVertices (bool iSet)
 
void setLHCTransportLink (const edm::LHCTransportLinkContainer *thisLHCTlink)
 
 SimTrackManager (bool iCollapsePrimaryVertices=false)
 
 SimTrackManager (const SimTrackManager &)=delete
 
void storeTracks (G4SimEvent *simEvent)
 
const TrackContainertrackContainer () const
 
bool trackExists (unsigned int i) const
 
virtual ~SimTrackManager ()
 

Private Member Functions

void cleanVertexMap ()
 
void fillMotherList ()
 
int getOrCreateVertex (TrackWithHistory *, int, G4SimEvent *simEvent)
 
int idSavedTrack (int) const
 
void reallyStoreTracks (G4SimEvent *simEvent)
 
void resetGenID ()
 
void saveTrackAndItsBranch (TrackWithHistory *)
 this saves a track and all its parents looping over the non ordered vector More...
 

Private Attributes

std::vector< std::pair< int, int > > ancestorList
 
std::vector< std::pair< int, int > > idsave
 
unsigned int lastHist
 
unsigned int lastTrack
 
bool m_collapsePrimaryVertices
 
int m_nVertices
 
bool m_SaveSimTracks
 
TrackContainerm_trksForThisEvent
 
MotherParticleToVertexMap m_vertexMap
 
std::map< uint32_t, std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > > mapTkCaloStateInfo
 
const edm::LHCTransportLinkContainertheLHCTlink
 

Detailed Description

Description: Holds tracking information used by the sensitive detectors

Usage: <usage>

Definition at line 35 of file SimTrackManager.h.

Member Typedef Documentation

◆ MapVertexPosition

this map contains association between vertex number and position

Definition at line 43 of file SimTrackManager.h.

◆ MapVertexPositionVector

typedef std::vector<std::pair<int, math::XYZVectorD> > SimTrackManager::MapVertexPositionVector

Definition at line 44 of file SimTrackManager.h.

◆ MotherParticleToVertexMap

Definition at line 45 of file SimTrackManager.h.

◆ VertexMap

Definition at line 46 of file SimTrackManager.h.

Constructor & Destructor Documentation

◆ SimTrackManager() [1/2]

SimTrackManager::SimTrackManager ( bool  iCollapsePrimaryVertices = false)

Definition at line 28 of file SimTrackManager.cc.

29  : m_trksForThisEvent(nullptr),
30  m_nVertices(0),
31  m_collapsePrimaryVertices(iCollapsePrimaryVertices),
32  lastTrack(0),
33  lastHist(0),
34  theLHCTlink(nullptr) {}

◆ ~SimTrackManager()

SimTrackManager::~SimTrackManager ( )
virtual

Definition at line 36 of file SimTrackManager.cc.

36  {
37  if (m_trksForThisEvent != nullptr)
38  deleteTracks();
39 }

References deleteTracks(), and m_trksForThisEvent.

◆ SimTrackManager() [2/2]

SimTrackManager::SimTrackManager ( const SimTrackManager )
delete

Member Function Documentation

◆ addTkCaloStateInfo()

void SimTrackManager::addTkCaloStateInfo ( uint32_t  t,
const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &  p 
)
inline

Definition at line 75 of file SimTrackManager.h.

75  {
76  std::map<uint32_t, std::pair<math::XYZVectorD, math::XYZTLorentzVectorD> >::const_iterator it =
77  mapTkCaloStateInfo.find(t);
78 
79  if (it == mapTkCaloStateInfo.end()) {
80  mapTkCaloStateInfo.insert(std::pair<uint32_t, std::pair<math::XYZVectorD, math::XYZTLorentzVectorD> >(t, p));
81  }
82  }

References mapTkCaloStateInfo, AlCaHLTBitMon_ParallelJobs::p, and submitPVValidationJobs::t.

Referenced by EventAction::addTkCaloStateInfo().

◆ addTrack()

void SimTrackManager::addTrack ( TrackWithHistory iTrack,
bool  inHistory,
bool  withAncestor 
)
inline

Definition at line 63 of file SimTrackManager.h.

63  {
64  std::pair<int, int> thePair(iTrack->trackID(), iTrack->parentID());
65  idsave.push_back(thePair);
66  if (inHistory) {
67  m_trksForThisEvent->push_back(iTrack);
68  }
69  if (withAncestor) {
70  std::pair<int, int> thisPair(iTrack->trackID(), 0);
71  ancestorList.push_back(thisPair);
72  }
73  }

References ancestorList, idsave, m_trksForThisEvent, TrackWithHistory::parentID(), and TrackWithHistory::trackID().

Referenced by EventAction::addTrack().

◆ cleanTkCaloStateInfoMap()

void SimTrackManager::cleanTkCaloStateInfoMap ( )

Definition at line 197 of file SimTrackManager.cc.

197  {
198  mapTkCaloStateInfo.clear();
199  std::map<uint32_t, std::pair<math::XYZVectorD, math::XYZTLorentzVectorD> >().swap(mapTkCaloStateInfo);
200 }

References mapTkCaloStateInfo, and edm::swap().

Referenced by EventAction::EndOfEventAction(), and reset().

◆ cleanTracksWithHistory()

void SimTrackManager::cleanTracksWithHistory ( )

Definition at line 293 of file SimTrackManager.cc.

293  {
294  if ((*m_trksForThisEvent).empty() && idsave.empty()) {
295  return;
296  }
297 
298 #ifdef DebugLog
299  LogDebug("SimTrackManager") << "SimTrackManager::cleanTracksWithHistory has " << idsave.size()
300  << " mother-daughter relationships stored with lastTrack = " << lastTrack;
301 #endif
302 
303  if (lastTrack > 0 && lastTrack >= (*m_trksForThisEvent).size()) {
304  lastTrack = 0;
305  edm::LogError("SimTrackManager") << " SimTrackManager::cleanTracksWithHistory track index corrupted";
306  }
307 
308  stable_sort(m_trksForThisEvent->begin() + lastTrack, m_trksForThisEvent->end(), trkIDLess());
309 
310  stable_sort(idsave.begin(), idsave.end());
311 
312 #ifdef DebugLog
313  LogDebug("SimTrackManager") << " SimTrackManager::cleanTracksWithHistory knows " << m_trksForThisEvent->size()
314  << " tracks with history before branching";
315  for (unsigned int it = 0; it < (*m_trksForThisEvent).size(); it++) {
316  LogDebug("SimTrackManager") << " 1 - Track in position " << it << " G4 track number "
317  << (*m_trksForThisEvent)[it]->trackID() << " mother "
318  << (*m_trksForThisEvent)[it]->parentID() << " status "
319  << (*m_trksForThisEvent)[it]->saved();
320  }
321 #endif
322 
323  for (unsigned int it = lastTrack; it < m_trksForThisEvent->size(); it++) {
324  TrackWithHistory* t = (*m_trksForThisEvent)[it];
325  if (t->saved()) {
327  }
328  }
329  unsigned int num = lastTrack;
330  for (unsigned int it = lastTrack; it < m_trksForThisEvent->size(); it++) {
331  TrackWithHistory* t = (*m_trksForThisEvent)[it];
332  int g4ID = t->trackID();
333  if (t->saved() == true) {
334  if (it > num)
335  (*m_trksForThisEvent)[num] = t;
336  num++;
337  for (unsigned int itr = 0; itr < idsave.size(); itr++) {
338  if ((idsave[itr]).first == g4ID) {
339  (idsave[itr]).second = g4ID;
340  break;
341  }
342  }
343  } else {
344  delete t;
345  }
346  }
347 
348  (*m_trksForThisEvent).resize(num);
349 
350 #ifdef DebugLog
351  LogDebug("SimTrackManager") << " AFTER CLEANING, I GET " << (*m_trksForThisEvent).size()
352  << " tracks to be saved persistently";
353  for (unsigned int it = 0; it < (*m_trksForThisEvent).size(); it++) {
354  LogDebug("SimTrackManager") << " Track in position " << it << " G4 track number "
355  << (*m_trksForThisEvent)[it]->trackID() << " mother "
356  << (*m_trksForThisEvent)[it]->parentID() << " Status "
357  << (*m_trksForThisEvent)[it]->saved() << " id "
358  << (*m_trksForThisEvent)[it]->particleID()
359  << " E(MeV)= " << (*m_trksForThisEvent)[it]->totalEnergy();
360  }
361 #endif
362 
363  fillMotherList();
364 
365  lastTrack = (*m_trksForThisEvent).size();
366 }

References fillMotherList(), idsave, lastTrack, LogDebug, m_trksForThisEvent, EgammaValidation_cff::num, saveTrackAndItsBranch(), edm::second(), and submitPVValidationJobs::t.

Referenced by EventAction::prepareForNewPrimary(), and storeTracks().

◆ cleanVertexMap()

void SimTrackManager::cleanVertexMap ( )
private

Definition at line 191 of file SimTrackManager.cc.

191  {
192  m_vertexMap.clear();
194  m_nVertices = 0;
195 }

References m_nVertices, and m_vertexMap.

Referenced by reset().

◆ deleteTracks()

void SimTrackManager::deleteTracks ( )

Definition at line 62 of file SimTrackManager.cc.

62  {
63  for (unsigned int i = 0; i < m_trksForThisEvent->size(); i++) {
64  delete (*m_trksForThisEvent)[i];
65  }
66  delete m_trksForThisEvent;
67  m_trksForThisEvent = nullptr;
68 }

References mps_fire::i, and m_trksForThisEvent.

Referenced by EventAction::EndOfEventAction(), and ~SimTrackManager().

◆ fillMotherList()

void SimTrackManager::fillMotherList ( )
private

Definition at line 261 of file SimTrackManager.cc.

261  {
262  if (!ancestorList.empty() && lastHist > ancestorList.size()) {
263  lastHist = ancestorList.size();
264  edm::LogError("SimTrackManager") << " SimTrackManager::fillMotherList track index corrupted";
265  }
266  /*
267  std::cout << "### SimTrackManager::fillMotherList: "
268  << idsave.size() << " saved; ancestor: " << lastHist
269  << " " << ancestorList.size() << std::endl;
270  for (unsigned int i = 0; i< idsave.size(); ++i) {
271  std::cout << " ISV: Track ID = " << (idsave[i]).first
272  << " Mother ID = " << (idsave[i]).second << std::endl;
273  }
274  */
275  for (unsigned int n = lastHist; n < ancestorList.size(); n++) {
276  int theMotherId = idSavedTrack((ancestorList[n]).first);
277  ancestorList[n].second = theMotherId;
278  /*
279  std::cout << " ANC: Track ID = " << (ancestorList[n]).first
280  << " Mother ID = " << (ancestorList[n]).second << std::endl;
281  */
282 #ifdef DebugLog
283  LogDebug("SimTrackManager") << "Track ID = " << (ancestorList[n]).first
284  << " Mother ID = " << (ancestorList[n]).second;
285 #endif
286  }
287 
288  lastHist = ancestorList.size();
289 
290  idsave.clear();
291 }

References ancestorList, first, idsave, idSavedTrack(), lastHist, LogDebug, and dqmiodumpmetadata::n.

Referenced by cleanTracksWithHistory().

◆ getOrCreateVertex()

int SimTrackManager::getOrCreateVertex ( TrackWithHistory trkH,
int  iParentID,
G4SimEvent simEvent 
)
private

Definition at line 153 of file SimTrackManager.cc.

153  {
154  int parent = iParentID;
155  int check = -1;
156 
157  for (std::vector<TrackWithHistory*>::const_iterator it = (*m_trksForThisEvent).begin();
158  it != (*m_trksForThisEvent).end();
159  it++) {
160  if ((*it)->trackID() == uint32_t(parent)) {
161  check = 0;
162  break;
163  }
164  }
165 
166  if (check == -1) {
167  parent = -1;
168  }
169 
170  VertexMap::const_iterator iterator = m_vertexMap.find(parent);
171  if (iterator != m_vertexMap.end()) {
172  // loop over saved vertices
173  for (unsigned int k = 0; k < m_vertexMap[parent].size(); k++) {
174  if (sqrt((trkH->vertexPosition() - (((m_vertexMap[parent])[k]).second)).Mag2()) < 0.001) {
175  return (((m_vertexMap[parent])[k]).first);
176  }
177  }
178  }
179 
180  unsigned int ptype = 0;
181  const G4VProcess* pr = trkH->creatorProcess();
182  if (pr) {
183  ptype = pr->GetProcessSubType();
184  }
185  simEvent->add(new G4SimVertex(trkH->vertexPosition(), trkH->globalTime(), parent, ptype));
187  m_nVertices++;
188  return (m_nVertices - 1);
189 }

References G4SimEvent::add(), RPCNoise_example::check, TrackWithHistory::creatorProcess(), first, TrackWithHistory::globalTime(), dqmdumpme::k, m_nVertices, m_vertexMap, class-composition::parent, OfflineHarvestingSequence_cosmic::ptype, mathSSE::sqrt(), and TrackWithHistory::vertexPosition().

Referenced by reallyStoreTracks().

◆ getTrackByID()

TrackWithHistory* SimTrackManager::getTrackByID ( unsigned int  trackID,
bool  strict = false 
) const
inline

Definition at line 104 of file SimTrackManager.h.

104  {
105  bool trackFound = false;
107  if (m_trksForThisEvent == nullptr) {
108  throw cms::Exception("Unknown", "SimTrackManager") << "m_trksForThisEvent is a nullptr, cannot get any track!";
109  }
110  for (unsigned int itr = 0; itr < (*m_trksForThisEvent).size(); ++itr) {
111  if ((*m_trksForThisEvent)[itr]->trackID() == trackID) {
112  track = (*m_trksForThisEvent)[itr];
113  trackFound = true;
114  break;
115  }
116  }
117  if (!trackFound) {
118  if (strict) {
119  throw cms::Exception("Unknown", "SimTrackManager")
120  << "Attempted to get track " << trackID << " from SimTrackManager, but it's not in m_trksForThisEvent ("
121  << (*m_trksForThisEvent).size() << " tracks in m_trksForThisEvent)"
122  << "\n";
123  }
124  return nullptr;
125  }
126  return track;
127  }

References Exception, m_trksForThisEvent, and HLT_FULL_cff::track.

Referenced by EventAction::getTrackByID(), and CaloSD::hitBookkeepingFineCalo().

◆ giveMotherNeeded()

int SimTrackManager::giveMotherNeeded ( int  i) const
inline

Definition at line 84 of file SimTrackManager.h.

84  {
85  int theResult = 0;
86  for (unsigned int itr = 0; itr < idsave.size(); itr++) {
87  if ((idsave[itr]).first == i) {
88  theResult = (idsave[itr]).second;
89  break;
90  }
91  }
92  return theResult;
93  }

References mps_fire::i, idsave, and edm::second().

Referenced by CaloSD::saveHit().

◆ idSavedTrack()

int SimTrackManager::idSavedTrack ( int  id) const
private

Definition at line 202 of file SimTrackManager.cc.

202  {
203  int idMother = id;
204  if (id > 0) {
205  unsigned int n = idsave.size();
206  if (0 < n) {
207  int jmax = n - 1;
208  int j, id1;
209 
210  // first loop forward
211  bool notFound = true;
212  for (j = 0; j <= jmax; ++j) {
213  if ((idsave[j]).first == idMother) {
214  id1 = (idsave[j]).second;
215  if (0 == id1 || id1 == idMother) {
216  return id1;
217  }
218  jmax = j - 1;
219  idMother = id1;
220  notFound = false;
221  break;
222  }
223  }
224  if (notFound) {
225  return 0;
226  }
227 
228  // recursive loop
229  do {
230  notFound = true;
231  // search ID scan backward
232  for (j = jmax; j >= 0; --j) {
233  if ((idsave[j]).first == idMother) {
234  id1 = (idsave[j]).second;
235  if (0 == id1 || id1 == idMother) {
236  return id1;
237  }
238  jmax = j - 1;
239  idMother = id1;
240  notFound = false;
241  break;
242  }
243  }
244  if (notFound) {
245  // ID not in the list of saved track - look into ancestors
246  jmax = ancestorList.size() - 1;
247  for (j = jmax; j >= 0; --j) {
248  if ((ancestorList[j]).first == idMother) {
249  idMother = (ancestorList[j]).second;
250  return idMother;
251  }
252  }
253  return 0;
254  }
255  } while (!notFound);
256  }
257  }
258  return idMother;
259 }

References ancestorList, first, triggerObjects_cff::id, globals_cff::id1, idsave, dqmiolumiharvest::j, dqmiodumpmetadata::n, notFound, and edm::second().

Referenced by fillMotherList().

◆ operator=()

const SimTrackManager& SimTrackManager::operator= ( const SimTrackManager )
delete

◆ reallyStoreTracks()

void SimTrackManager::reallyStoreTracks ( G4SimEvent simEvent)
private

Definition at line 109 of file SimTrackManager.cc.

109  {
110  // loop over the (now ordered) vector and really save the tracks
111 #ifdef DebugLog
112  LogDebug("SimTrackManager") << "Inside the reallyStoreTracks method object to be stored = "
113  << m_trksForThisEvent->size();
114 #endif
115 
116  for (unsigned int it = 0; it < m_trksForThisEvent->size(); it++) {
117  TrackWithHistory* trkH = (*m_trksForThisEvent)[it];
118  // at this stage there is one vertex per track,
119  // so the vertex id of track N is also N
120  int ivertex = -1;
121  int ig;
122 
123  math::XYZVectorD pm(0., 0., 0.);
124  unsigned int iParentID = trkH->parentID();
125  for (unsigned int iit = 0; iit < m_trksForThisEvent->size(); ++iit) {
126  if ((*m_trksForThisEvent)[iit]->trackID() == iParentID) {
127  pm = (*m_trksForThisEvent)[iit]->momentum();
128  break;
129  }
130  }
131  ig = trkH->genParticleID();
132  ivertex = getOrCreateVertex(trkH, iParentID, simEvent);
133  std::map<uint32_t, std::pair<math::XYZVectorD, math::XYZTLorentzVectorD> >::const_iterator cit =
134  mapTkCaloStateInfo.find(trkH->trackID());
135  std::pair<math::XYZVectorD, math::XYZTLorentzVectorD> tcinfo;
136  if (cit != mapTkCaloStateInfo.end()) {
137  tcinfo = cit->second;
138  }
139  G4SimTrack* g4simtrack = new G4SimTrack(trkH->trackID(),
140  trkH->particleID(),
141  trkH->momentum(),
142  trkH->totalEnergy(),
143  ivertex,
144  ig,
145  pm,
146  tcinfo.first,
147  tcinfo.second);
148  g4simtrack->copyCrossedBoundaryVars(trkH);
149  simEvent->add(g4simtrack);
150  }
151 }

References G4SimEvent::add(), G4SimTrack::copyCrossedBoundaryVars(), TrackWithHistory::genParticleID(), getOrCreateVertex(), LogDebug, m_trksForThisEvent, mapTkCaloStateInfo, TrackWithHistory::momentum(), TrackWithHistory::parentID(), TrackWithHistory::particleID(), TrackWithHistory::totalEnergy(), and TrackWithHistory::trackID().

Referenced by storeTracks().

◆ reset()

void SimTrackManager::reset ( void  )

Definition at line 44 of file SimTrackManager.cc.

44  {
45  if (m_trksForThisEvent == nullptr) {
47  } else {
48  for (unsigned int i = 0; i < m_trksForThisEvent->size(); i++) {
49  delete (*m_trksForThisEvent)[i];
50  }
51  delete m_trksForThisEvent;
53  }
56  std::vector<std::pair<int, int> >().swap(idsave);
57  ancestorList.clear();
58  lastTrack = 0;
59  lastHist = 0;
60 }

References ancestorList, cleanTkCaloStateInfoMap(), cleanVertexMap(), mps_fire::i, idsave, lastHist, lastTrack, m_trksForThisEvent, and edm::swap().

Referenced by EventAction::BeginOfEventAction().

◆ resetGenID()

void SimTrackManager::resetGenID ( )
private

Definition at line 368 of file SimTrackManager.cc.

368  {
369  if (theLHCTlink == nullptr)
370  return;
371 
372  for (unsigned int it = 0; it < m_trksForThisEvent->size(); it++) {
373  TrackWithHistory* trkH = (*m_trksForThisEvent)[it];
374  int genParticleID_ = trkH->genParticleID();
375  if (genParticleID_ == -1) {
376  continue;
377  } else {
378  for (unsigned int itrlink = 0; itrlink < (*theLHCTlink).size(); itrlink++) {
379  if ((*theLHCTlink)[itrlink].afterHector() == genParticleID_) {
380  trkH->setGenParticleID((*theLHCTlink)[itrlink].beforeHector());
381  continue;
382  }
383  }
384  }
385  }
386 
387  theLHCTlink = nullptr;
388 }

References TrackWithHistory::genParticleID(), m_trksForThisEvent, TrackWithHistory::setGenParticleID(), and theLHCTlink.

Referenced by storeTracks().

◆ saveTrackAndItsBranch()

void SimTrackManager::saveTrackAndItsBranch ( TrackWithHistory trkWHist)
private

this saves a track and all its parents looping over the non ordered vector

Definition at line 71 of file SimTrackManager.cc.

71  {
72  using namespace std;
73  TrackWithHistory* trkH = trkWHist;
74  if (trkH == nullptr) {
75  edm::LogError("SimTrackManager") << " SimTrackManager::saveTrackAndItsBranch got 0 pointer ";
76  throw cms::Exception("SimTrackManager::saveTrackAndItsBranch") << " cannot handle hits for tracking";
77  }
78  trkH->save();
79  unsigned int parent = trkH->parentID();
80 
81  TrackContainer::const_iterator tk_itr = std::lower_bound(
82  (*m_trksForThisEvent).begin(), (*m_trksForThisEvent).end(), parent, SimTrackManager::StrictWeakOrdering());
83 
84  TrackWithHistory* tempTk = *tk_itr;
85 
86  if (tk_itr != m_trksForThisEvent->end() && (*tk_itr)->trackID() == parent) {
87  saveTrackAndItsBranch(tempTk);
88  }
89 }

References Exception, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, m_trksForThisEvent, class-composition::parent, TrackWithHistory::parentID(), and TrackWithHistory::save().

Referenced by cleanTracksWithHistory().

◆ setCollapsePrimaryVertices()

void SimTrackManager::setCollapsePrimaryVertices ( bool  iSet)
inline

Definition at line 83 of file SimTrackManager.h.

83 { m_collapsePrimaryVertices = iSet; }

References m_collapsePrimaryVertices.

Referenced by EventAction::EventAction().

◆ setLHCTransportLink()

void SimTrackManager::setLHCTransportLink ( const edm::LHCTransportLinkContainer thisLHCTlink)
inline

Definition at line 128 of file SimTrackManager.h.

128 { theLHCTlink = thisLHCTlink; }

References theLHCTlink.

◆ storeTracks()

void SimTrackManager::storeTracks ( G4SimEvent simEvent)

Definition at line 91 of file SimTrackManager.cc.

91  {
93 
94  // fill the map with the final mother-daughter relationship
95  idsave.swap(ancestorList);
96  stable_sort(idsave.begin(), idsave.end());
97 
98  std::vector<std::pair<int, int> >().swap(ancestorList);
99 
100  // to get a backward compatible order
101  stable_sort(m_trksForThisEvent->begin(), m_trksForThisEvent->end(), trkIDLess());
102 
103  // to reset the GenParticle ID of a SimTrack to its pre-LHCTransport value
104  resetGenID();
105 
106  reallyStoreTracks(simEvent);
107 }

References ancestorList, cleanTracksWithHistory(), idsave, m_trksForThisEvent, reallyStoreTracks(), resetGenID(), and edm::swap().

Referenced by EventAction::EndOfEventAction().

◆ trackContainer()

const TrackContainer* SimTrackManager::trackContainer ( ) const
inline

Definition at line 52 of file SimTrackManager.h.

52 { return m_trksForThisEvent; }

References m_trksForThisEvent.

Referenced by EventAction::trackContainer(), and CaloSD::update().

◆ trackExists()

bool SimTrackManager::trackExists ( unsigned int  i) const
inline

Definition at line 94 of file SimTrackManager.h.

94  {
95  bool flag = false;
96  for (unsigned int itr = 0; itr < (*m_trksForThisEvent).size(); ++itr) {
97  if ((*m_trksForThisEvent)[itr]->trackID() == i) {
98  flag = true;
99  break;
100  }
101  }
102  return flag;
103  }

References RemoveAddSevLevel::flag, mps_fire::i, and m_trksForThisEvent.

Referenced by CaloSD::saveHit(), and EventAction::trackExists().

Member Data Documentation

◆ ancestorList

std::vector<std::pair<int, int> > SimTrackManager::ancestorList
private

Definition at line 154 of file SimTrackManager.h.

Referenced by addTrack(), fillMotherList(), idSavedTrack(), reset(), and storeTracks().

◆ idsave

std::vector<std::pair<int, int> > SimTrackManager::idsave
private

◆ lastHist

unsigned int SimTrackManager::lastHist
private

Definition at line 157 of file SimTrackManager.h.

Referenced by fillMotherList(), and reset().

◆ lastTrack

unsigned int SimTrackManager::lastTrack
private

Definition at line 156 of file SimTrackManager.h.

Referenced by cleanTracksWithHistory(), and reset().

◆ m_collapsePrimaryVertices

bool SimTrackManager::m_collapsePrimaryVertices
private

Definition at line 150 of file SimTrackManager.h.

Referenced by setCollapsePrimaryVertices().

◆ m_nVertices

int SimTrackManager::m_nVertices
private

Definition at line 149 of file SimTrackManager.h.

Referenced by cleanVertexMap(), and getOrCreateVertex().

◆ m_SaveSimTracks

bool SimTrackManager::m_SaveSimTracks
private

Definition at line 147 of file SimTrackManager.h.

◆ m_trksForThisEvent

TrackContainer* SimTrackManager::m_trksForThisEvent
private

◆ m_vertexMap

MotherParticleToVertexMap SimTrackManager::m_vertexMap
private

Definition at line 148 of file SimTrackManager.h.

Referenced by cleanVertexMap(), and getOrCreateVertex().

◆ mapTkCaloStateInfo

std::map<uint32_t, std::pair<math::XYZVectorD, math::XYZTLorentzVectorD> > SimTrackManager::mapTkCaloStateInfo
private

◆ theLHCTlink

const edm::LHCTransportLinkContainer* SimTrackManager::theLHCTlink
private

Definition at line 159 of file SimTrackManager.h.

Referenced by resetGenID(), and setLHCTransportLink().

TrackWithHistory::genParticleID
int genParticleID() const
Definition: TrackWithHistory.h:31
TrackWithHistory::globalTime
double globalTime() const
Definition: TrackWithHistory.h:35
SimTrackManager::m_trksForThisEvent
TrackContainer * m_trksForThisEvent
Definition: SimTrackManager.h:146
mps_fire.i
i
Definition: mps_fire.py:428
G4SimVertex
Definition: G4SimVertex.h:9
SimTrackManager::m_vertexMap
MotherParticleToVertexMap m_vertexMap
Definition: SimTrackManager.h:148
G4SimEvent::add
void add(G4SimTrack *t)
Definition: G4SimEvent.h:33
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
SimTrackManager::cleanVertexMap
void cleanVertexMap()
Definition: SimTrackManager.cc:191
TrackWithHistory::parentID
int parentID() const
Definition: TrackWithHistory.h:30
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SimTrackManager::mapTkCaloStateInfo
std::map< uint32_t, std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > > mapTkCaloStateInfo
Definition: SimTrackManager.h:151
trkIDLess
Definition: SimTrackManager.h:162
globals_cff.id1
id1
Definition: globals_cff.py:33
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
TrackWithHistory
Definition: TrackWithHistory.h:16
OfflineHarvestingSequence_cosmic.ptype
ptype
Definition: OfflineHarvestingSequence_cosmic.py:7
SimTrackManager::StrictWeakOrdering
Definition: SimTrackManager.h:37
SimTrackManager::MapVertexPosition
std::pair< int, math::XYZVectorD > MapVertexPosition
this map contains association between vertex number and position
Definition: SimTrackManager.h:43
SimTrackManager::lastHist
unsigned int lastHist
Definition: SimTrackManager.h:157
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
SimTrackManager::resetGenID
void resetGenID()
Definition: SimTrackManager.cc:368
SimTrackManager::theLHCTlink
const edm::LHCTransportLinkContainer * theLHCTlink
Definition: SimTrackManager.h:159
SimTrackManager::reallyStoreTracks
void reallyStoreTracks(G4SimEvent *simEvent)
Definition: SimTrackManager.cc:109
G4SimTrack
Definition: G4SimTrack.h:11
SimTrackManager::m_collapsePrimaryVertices
bool m_collapsePrimaryVertices
Definition: SimTrackManager.h:150
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
SimTrackManager::lastTrack
unsigned int lastTrack
Definition: SimTrackManager.h:156
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SimTrackManager::deleteTracks
void deleteTracks()
Definition: SimTrackManager.cc:62
TrackWithHistory::save
void save()
Definition: TrackWithHistory.h:27
dqmdumpme.k
k
Definition: dqmdumpme.py:60
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
SimTrackManager::getOrCreateVertex
int getOrCreateVertex(TrackWithHistory *, int, G4SimEvent *simEvent)
Definition: SimTrackManager.cc:153
math::XYZVectorD
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
TrackWithHistory::vertexPosition
const math::XYZVectorD & vertexPosition() const
Definition: TrackWithHistory.h:34
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
SimTrackManager::ancestorList
std::vector< std::pair< int, int > > ancestorList
Definition: SimTrackManager.h:154
SimTrackManager::MotherParticleToVertexMap
std::map< int, MapVertexPositionVector > MotherParticleToVertexMap
Definition: SimTrackManager.h:45
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:32
SimTrackManager::cleanTkCaloStateInfoMap
void cleanTkCaloStateInfoMap()
Definition: SimTrackManager.cc:197
SimTrackManager::idsave
std::vector< std::pair< int, int > > idsave
Definition: SimTrackManager.h:152
SimTrackManager::cleanTracksWithHistory
void cleanTracksWithHistory()
Definition: SimTrackManager.cc:293
notFound
static const GlobalPoint notFound(0, 0, 0)
SimTrackManager::saveTrackAndItsBranch
void saveTrackAndItsBranch(TrackWithHistory *)
this saves a track and all its parents looping over the non ordered vector
Definition: SimTrackManager.cc:71
TrackWithHistory::setGenParticleID
void setGenParticleID(int i)
Definition: TrackWithHistory.h:42
TrackWithHistory::totalEnergy
double totalEnergy() const
Definition: TrackWithHistory.h:33
SimTrackManager::m_nVertices
int m_nVertices
Definition: SimTrackManager.h:149
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
TrackWithHistory::trackID
unsigned int trackID() const
Definition: TrackWithHistory.h:28
TrackContainer
std::vector< TrackWithHistory * > TrackContainer
Definition: TrackContainer.h:8
std
Definition: JetResolutionObject.h:76
G4SimTrack::copyCrossedBoundaryVars
void copyCrossedBoundaryVars(const TrackWithHistory *track)
Definition: G4SimTrack.h:77
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
SimTrackManager::fillMotherList
void fillMotherList()
Definition: SimTrackManager.cc:261
TrackWithHistory::creatorProcess
const G4VProcess * creatorProcess() const
Definition: TrackWithHistory.h:38
Exception
Definition: hltDiff.cc:245
TrackWithHistory::momentum
const math::XYZVectorD & momentum() const
Definition: TrackWithHistory.h:32
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
class-composition.parent
parent
Definition: class-composition.py:98
SimTrackManager::idSavedTrack
int idSavedTrack(int) const
Definition: SimTrackManager.cc:202
TrackWithHistory::particleID
int particleID() const
Definition: TrackWithHistory.h:29
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117