#include <SimG4Core/Application/interface/TrackingAction.h>
Public Member Functions | |
TrackWithHistory * | currentTrackWithHistory () |
G4TrackingManager * | getTrackManager () |
virtual void | PostUserTrackingAction (const G4Track *aTrack) |
virtual void | PreUserTrackingAction (const G4Track *aTrack) |
TrackingAction (EventAction *ea, const edm::ParameterSet &ps) | |
virtual | ~TrackingAction () |
Public Attributes | |
SimActivityRegistry::BeginOfTrackSignal | m_beginOfTrackSignal |
SimActivityRegistry::EndOfTrackSignal | m_endOfTrackSignal |
Private Attributes | |
TrackWithHistory * | currentTrack_ |
bool | detailedTiming |
EventAction * | eventAction_ |
int | trackMgrVerbose |
Definition at line 14 of file TrackingAction.h.
TrackingAction::TrackingAction | ( | EventAction * | ea, | |
const edm::ParameterSet & | ps | |||
) |
Definition at line 15 of file TrackingAction.cc.
00016 : eventAction_(e),currentTrack_(0), 00017 detailedTiming(p.getUntrackedParameter<bool>("DetailedTiming",false)), 00018 trackMgrVerbose(p.getUntrackedParameter<int>("G4TrackManagerVerbosity",0)){}
TrackingAction::~TrackingAction | ( | ) | [virtual] |
TrackWithHistory* TrackingAction::currentTrackWithHistory | ( | ) | [inline] |
Definition at line 21 of file TrackingAction.h.
References currentTrack_.
00021 { return currentTrack_; }
G4TrackingManager * TrackingAction::getTrackManager | ( | ) |
Definition at line 84 of file TrackingAction.cc.
References trackMgrVerbose.
Referenced by TrackingVerboseAction::update().
00085 { 00086 G4TrackingManager * theTrackingManager = 0; 00087 theTrackingManager = fpTrackingManager; 00088 theTrackingManager->SetVerboseLevel(trackMgrVerbose); 00089 return theTrackingManager; 00090 }
void TrackingAction::PostUserTrackingAction | ( | const G4Track * | aTrack | ) | [virtual] |
Definition at line 46 of file TrackingAction.cc.
References EventAction::addTkCaloStateInfo(), EventAction::addTrack(), TrackWithHistory::checkAtEnd(), currentTrack_, eventAction_, m_endOfTrackSignal, p, CurrentG4Track::postTracking(), TrackWithHistory::save(), EventAction::trackContainer(), x, y, and z.
Referenced by RunManager::abortEvent().
00047 { 00048 CurrentG4Track::postTracking(aTrack); 00049 if (eventAction_->trackContainer() != 0) 00050 { 00051 00052 TrackInformationExtractor extractor; 00053 if (extractor(aTrack).storeTrack()) 00054 { 00055 currentTrack_->save(); 00056 00057 math::XYZVectorD pos((aTrack->GetStep()->GetPostStepPoint()->GetPosition()).x(), 00058 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).y(), 00059 (aTrack->GetStep()->GetPostStepPoint()->GetPosition()).z()); 00060 math::XYZTLorentzVectorD mom; 00061 00062 uint32_t id = aTrack->GetTrackID(); 00063 00064 std::pair<math::XYZVectorD,math::XYZTLorentzVectorD> p(pos,mom); 00065 eventAction_->addTkCaloStateInfo(id,p); 00066 00067 } 00068 if (extractor(aTrack).isInHistory()) 00069 { 00070 currentTrack_->checkAtEnd(aTrack); // check with end-of-track information 00071 eventAction_->addTrack(currentTrack_, true); 00072 } 00073 else 00074 { 00075 eventAction_->addTrack(currentTrack_, false); 00076 delete currentTrack_; 00077 } 00078 } 00079 EndOfTrack et(aTrack); 00080 m_endOfTrackSignal(&et); 00081 currentTrack_ = 0; // reset for next track 00082 }
void TrackingAction::PreUserTrackingAction | ( | const G4Track * | aTrack | ) | [virtual] |
Definition at line 22 of file TrackingAction.cc.
References currentTrack_, m_beginOfTrackSignal, and CurrentG4Track::setTrack().
00023 { 00024 CurrentG4Track::setTrack(aTrack); 00025 00026 if (currentTrack_ != 0) 00027 throw SimG4Exception("TrackingAction: currentTrack is a mess..."); 00028 currentTrack_ = new TrackWithHistory(aTrack); 00029 00030 /* 00031 Trick suggested by Vladimir I. in order to debug with high 00032 level verbosity only a single problematic tracks 00033 */ 00034 00035 /* 00036 if ( aTrack->GetTrackID() == palce_here_the_trackid_of_problematic_tracks ) { 00037 G4UImanager::GetUIpointer()->ApplyCommand("/tracking/verbose 6"); 00038 } else if ( aTrack->GetTrackID() == place_here_the_trackid_of_following_track_to_donwgrade_the_severity ) { 00039 G4UImanager::GetUIpointer()->ApplyCommand("/tracking/verbose 0"); 00040 } 00041 */ 00042 BeginOfTrack bt(aTrack); 00043 m_beginOfTrackSignal(&bt); 00044 }
TrackWithHistory* TrackingAction::currentTrack_ [private] |
Definition at line 28 of file TrackingAction.h.
Referenced by currentTrackWithHistory(), PostUserTrackingAction(), and PreUserTrackingAction().
bool TrackingAction::detailedTiming [private] |
Definition at line 29 of file TrackingAction.h.
EventAction* TrackingAction::eventAction_ [private] |
Definition at line 24 of file TrackingAction.h.
Referenced by RunManager::initializeUserActions(), and PreUserTrackingAction().
Definition at line 25 of file TrackingAction.h.
Referenced by RunManager::initializeUserActions(), and PostUserTrackingAction().
int TrackingAction::trackMgrVerbose [private] |