CMS 3D CMS Logo

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

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

Classes

class  StrictWeakOrdering
 

Public Types

typedef std::pair< int,
math::XYZVectorD
MapVertexPosition
 this map contains association between vertex number and position More...
 
typedef std::vector< std::pair
< int, math::XYZVectorD > > 
MapVertexPositionVector
 
typedef std::map< int,
MapVertexPositionVector
MotherParticleToVertexMap
 
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 ()
 
int giveMotherNeeded (int i) const
 
void reset ()
 
void setCollapsePrimaryVertices (bool iSet)
 
void setLHCTransportLink (const edm::LHCTransportLinkContainer *thisLHCTlink)
 
 SimTrackManager (bool iCollapsePrimaryVertices=false)
 
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
 
const SimTrackManageroperator= (const SimTrackManager &)
 
void reallyStoreTracks (G4SimEvent *simEvent)
 
void resetGenID ()
 
void saveTrackAndItsBranch (TrackWithHistory *)
 this saves a track and all its parents looping over the non ordered vector More...
 
 SimTrackManager (const SimTrackManager &)
 

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::LHCTransportLinkContainer
theLHCTlink
 

Detailed Description

Description: Holds tracking information used by the sensitive detectors

Usage: <usage>

Definition at line 34 of file SimTrackManager.h.

Member Typedef Documentation

this map contains association between vertex number and position

Definition at line 46 of file SimTrackManager.h.

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

Definition at line 47 of file SimTrackManager.h.

Definition at line 48 of file SimTrackManager.h.

Definition at line 49 of file SimTrackManager.h.

Constructor & Destructor Documentation

SimTrackManager::SimTrackManager ( bool  iCollapsePrimaryVertices = false)

Definition at line 39 of file SimTrackManager.cc.

SimTrackManager::~SimTrackManager ( )
virtual

Definition at line 45 of file SimTrackManager.cc.

SimTrackManager::SimTrackManager ( const SimTrackManager )
private

Member Function Documentation

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

Definition at line 79 of file SimTrackManager.h.

References mapTkCaloStateInfo.

Referenced by EventAction::addTkCaloStateInfo().

81  {
82  std::map<uint32_t,std::pair<math::XYZVectorD,math::XYZTLorentzVectorD> >::const_iterator it =
83  mapTkCaloStateInfo.find(t);
84 
85  if (it == mapTkCaloStateInfo.end()) {
86  mapTkCaloStateInfo.insert(std::pair<uint32_t,std::pair<math::XYZVectorD,math::XYZTLorentzVectorD> >(t,p));
87  }
88  }
std::map< uint32_t, std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > > mapTkCaloStateInfo
void SimTrackManager::addTrack ( TrackWithHistory iTrack,
bool  inHistory,
bool  withAncestor 
)
inline

Definition at line 69 of file SimTrackManager.h.

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

Referenced by EventAction::addTrack().

69  {
70  std::pair<int, int> thePair(iTrack->trackID(),iTrack->parentID());
71  idsave.push_back(thePair);
72  if (inHistory) { m_trksForThisEvent->push_back(iTrack); }
73  if (withAncestor) {
74  std::pair<int,int> thisPair(iTrack->trackID(),0);
75  ancestorList.push_back(thisPair);
76  }
77  }
TrackContainer * m_trksForThisEvent
std::vector< std::pair< int, int > > idsave
unsigned int trackID() const
int parentID() const
std::vector< std::pair< int, int > > ancestorList
void SimTrackManager::cleanTkCaloStateInfoMap ( )

Definition at line 209 of file SimTrackManager.cc.

Referenced by EventAction::EndOfEventAction().

void SimTrackManager::cleanTracksWithHistory ( )

Definition at line 306 of file SimTrackManager.cc.

Referenced by EventAction::prepareForNewPrimary().

void SimTrackManager::cleanVertexMap ( )
private

Definition at line 202 of file SimTrackManager.cc.

void SimTrackManager::deleteTracks ( )

Definition at line 72 of file SimTrackManager.cc.

Referenced by EventAction::EndOfEventAction().

void SimTrackManager::fillMotherList ( )
private

Definition at line 270 of file SimTrackManager.cc.

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

Definition at line 165 of file SimTrackManager.cc.

int SimTrackManager::giveMotherNeeded ( int  i) const
inline

Definition at line 92 of file SimTrackManager.h.

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

92  {
93  int theResult = 0;
94  for (unsigned int itr=0; itr<idsave.size(); itr++) {
95  if ((idsave[itr]).first == i) { theResult = (idsave[itr]).second; break; }
96  }
97  return theResult ;
98  }
int i
Definition: DBlmapReader.cc:9
U second(std::pair< T, U > const &p)
std::vector< std::pair< int, int > > idsave
int SimTrackManager::idSavedTrack ( int  id) const
private

Definition at line 215 of file SimTrackManager.cc.

const SimTrackManager& SimTrackManager::operator= ( const SimTrackManager )
private
void SimTrackManager::reallyStoreTracks ( G4SimEvent simEvent)
private

Definition at line 125 of file SimTrackManager.cc.

void SimTrackManager::reset ( void  )

Definition at line 53 of file SimTrackManager.cc.

Referenced by EventAction::BeginOfEventAction().

void SimTrackManager::resetGenID ( )
private

Definition at line 389 of file SimTrackManager.cc.

void SimTrackManager::saveTrackAndItsBranch ( TrackWithHistory trkWHist)
private

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

Definition at line 82 of file SimTrackManager.cc.

void SimTrackManager::setCollapsePrimaryVertices ( bool  iSet)
inline

Definition at line 89 of file SimTrackManager.h.

References m_collapsePrimaryVertices.

Referenced by EventAction::EventAction().

89  {
91  }
bool m_collapsePrimaryVertices
void SimTrackManager::setLHCTransportLink ( const edm::LHCTransportLinkContainer thisLHCTlink)
inline

Definition at line 108 of file SimTrackManager.h.

References theLHCTlink.

108  {
109  theLHCTlink = thisLHCTlink;
110  }
const edm::LHCTransportLinkContainer * theLHCTlink
void SimTrackManager::storeTracks ( G4SimEvent simEvent)

Definition at line 106 of file SimTrackManager.cc.

Referenced by EventAction::EndOfEventAction().

const TrackContainer* SimTrackManager::trackContainer ( ) const
inline

Definition at line 55 of file SimTrackManager.h.

References m_trksForThisEvent.

Referenced by EventAction::trackContainer().

55  {
56  return m_trksForThisEvent;
57  }
TrackContainer * m_trksForThisEvent
bool SimTrackManager::trackExists ( unsigned int  i) const
inline

Definition at line 99 of file SimTrackManager.h.

References i, and m_trksForThisEvent.

99  {
100  bool flag = false;
101  for (unsigned int itr=0; itr<(*m_trksForThisEvent).size(); ++itr) {
102  if ((*m_trksForThisEvent)[itr]->trackID() == i) {
103  flag = true; break;
104  }
105  }
106  return flag;
107  }
int i
Definition: DBlmapReader.cc:9
TrackContainer * m_trksForThisEvent

Member Data Documentation

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

Definition at line 136 of file SimTrackManager.h.

Referenced by addTrack().

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

Definition at line 134 of file SimTrackManager.h.

Referenced by addTrack(), and giveMotherNeeded().

unsigned int SimTrackManager::lastHist
private

Definition at line 139 of file SimTrackManager.h.

unsigned int SimTrackManager::lastTrack
private

Definition at line 138 of file SimTrackManager.h.

bool SimTrackManager::m_collapsePrimaryVertices
private

Definition at line 132 of file SimTrackManager.h.

Referenced by setCollapsePrimaryVertices().

int SimTrackManager::m_nVertices
private

Definition at line 131 of file SimTrackManager.h.

bool SimTrackManager::m_SaveSimTracks
private

Definition at line 129 of file SimTrackManager.h.

TrackContainer* SimTrackManager::m_trksForThisEvent
private

Definition at line 128 of file SimTrackManager.h.

Referenced by addTrack(), trackContainer(), and trackExists().

MotherParticleToVertexMap SimTrackManager::m_vertexMap
private

Definition at line 130 of file SimTrackManager.h.

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

Definition at line 133 of file SimTrackManager.h.

Referenced by addTkCaloStateInfo().

const edm::LHCTransportLinkContainer* SimTrackManager::theLHCTlink
private

Definition at line 141 of file SimTrackManager.h.

Referenced by setLHCTransportLink().