eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ND::TTruthTrajectoriesModule Class Reference

The eventAnalysis module responsible for saving information about the True Particles in an event from MC. More...

#include <TTruthTrajectoriesModule.hxx>

+ Inheritance diagram for ND::TTruthTrajectoriesModule:
+ Collaboration diagram for ND::TTruthTrajectoriesModule:

Classes

class  TTruthTrajectory
 Contains the truth information associated with a particle from Monte Carlo simulations. More...
 
class  TTruthTrajectoryPoint
 Contains the truth information for points along the particle trajectories generated during Monte Carlo simulations. More...
 

Public Member Functions

 TTruthTrajectoriesModule (const char *name="Trajectories", const char *title="True Trajectory information")
 
virtual ~TTruthTrajectoriesModule ()
 
virtual Bool_t Configure (std::string &option)
 Method for setting behaviour of module. More...
 
virtual void FillConfigTree (TTree *)
 
virtual bool FillTree (ND::TND280Event &)
 Called for each event, this method is the master method for retrieving and filling the Truth Trajectories information. More...
 
Int_t GetBufferSize ()
 ROOT output parameters, usually no need to touch. More...
 
std::string const GetCVSID () const
 
std::string const GetCVSTagName () const
 
std::string const GetDescription () const
 
std::string const GetDirectoryName () const
 Returns the name of the directory which the output of a particular module will be saved in. More...
 
Int_t GetMaximumNumberTrajectoriesPerEvent () const
 Getter for maximum number of trajectories saveable per event. More...
 
Double_t GetMinimumTrajectoryLengthToSave () const
 Getter for trajectory length save condition. More...
 
char const * GetName ()
 
TTree const * GetOutputTree () const
 The output tree. More...
 
Int_t GetSplitLevel ()
 ROOT output parameters, usually no need to touch. More...
 
char const * GetTitle ()
 
virtual EType GetTreeType () const
 Returns the type of tree, header, truth, or recon. More...
 
void Initialize (TTree *tree)
 
virtual void InitializeBranches ()
 Creates the necessary tree and branches for saving the Truth Trajectories information. More...
 
virtual Bool_t IsEnabled () const
 Whether the module is enable or not. More...
 
virtual Bool_t IsEnabledByDefault () const
 This method returns true - the module is always enabled by defult. More...
 
virtual bool IsFullEventWorthSaving (ND::TND280Event &event)
 Whether the module thinks it is worth saving the entire oaEvent event tree entry for this event. More...
 
virtual Bool_t IsUsedForPreselection () const
 Whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output. More...
 
void KillOutputTree ()
 
virtual void Print ()
 Prints a simple message describing the module. More...
 
virtual bool Process (ND::TND280Event &event)
 Gets the run and event IDs and calls FillTree with the event, and then actually calls fOutputTree->Fill. More...
 
virtual Bool_t ProcessFirstEvent (ND::TND280Event &)
 Called for the first event This method checks whether this event is a real-data event an if so throws an ND::EDataFile(). More...
 
virtual void SayAvailableOpts (std::string indent="")
 Subclasses should override this to let a user know what options are available. More...
 
void SetBufferSize (Int_t buffersize)
 ROOT output parameters, usually no need to touch. More...
 
virtual void SetDisabled ()
 Disables the module. More...
 
virtual void SetEnabled (Bool_t isenabled=true)
 Sets whether the module is enabled. More...
 
void SetInputDirectory (std::string dir)
 
void SetMaximumNumberTrajectoriesPerEvent (UInt_t n)
 Setter for maximum number of trajectories saveable per event. More...
 
void SetMinimumTrajectoryLengthToSave (Double_t mm)
 Getter for trajectory length save condition. [mm]. More...
 
void SetNameTitle (char const *name, char const *title)
 
void SetSaveOnlyP0DTrackerECALTrajectories (const Bool_t &yesorno=true)
 Controls whether just P0D/Tracker/ECal trajectories should be saved. More...
 
void SetSaveParentChain (const Bool_t &yesorno=true)
 Controls whether a trajectory that would ordinarily be saved will also save all its parent trajectories. More...
 
void SetSplitLevel (Int_t splitlevel)
 ROOT output parameters, usually no need to touch. More...
 
virtual void SetUsedForPreselection (Bool_t isused=true)
 Sets whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output. More...
 

Public Attributes

Int_t fNTraj
 Total number of trajectories saved from the event. More...
 
Int_t fNTrajBaryon
 Number of Charged Baryon Trajectories saved from the event. More...
 
Int_t fNTrajLepton
 Number of Charged Lepton trajectories saved from the event. More...
 
Int_t fNTrajMeson
 Number of Charged Meson Trajectories saved from the event. More...
 
Int_t fNTrajOther
 Number of Any Other Trajectories saved from the event. More...
 
Int_t fNTrajOtherCharged
 Number of Other Charged Trajectories saved from the event. More...
 
Int_t fNTrajOtherNeutral
 Number of Other Neutral Trajectories saved from the event. More...
 
Int_t fNTrajPhoton
 Number of Photon Trajectories saved from the event. More...
 
TClonesArray * fTrajectories
 Clones array of ND::TTruthTrajectoriesModule::TTruthTrajectory sorted in ascending ID order. More...
 

Protected Types

enum  EType {
  kHeader = 0, kTruth, kRecon, kLowLevel,
  kNTypes
}
 

Protected Member Functions

virtual void InitializeModule ()
 Initialize Module, override if necessary. More...
 

Protected Attributes

Int_t fBufferSize
 Buffer Size for TBranch. More...
 
std::string fCVSID
 Defined if an official tagged version. More...
 
std::string fCVSTagName
 Defined if an official tagged version. More...
 
std::string fDescription
 A longish descrition of the analysis. More...
 
Int_t fEventID
 
Bool_t fFilledConfigTree
 
std::string fInputDirectory
 An input directory where analysis modules can search for extra files. More...
 
Bool_t fIsEnabled
 
Bool_t fIsMC
 
Bool_t fIsUsedForPreselection
 
std::string fName
 
TTree * fOutputTree
 
Int_t fPreselected
 
Int_t fRunID
 
Int_t fSplitLevel
 Split Level for TBranch. More...
 
Int_t fSubrunID
 
std::string fTitle
 

Private Member Functions

void FillSaveList (ND::THandle< ND::TG4TrajectoryContainer > trajectories)
 Fills a std::set (fSaveList) with the ID of every trajectory which should be saved for the current event. More...
 
void FillTraces (ND::TG4Trajectory *const traj, ND::TTruthTrajectoriesModule::TTruthTrajectory *trajToFill)
 Fills vectors of entry/exit positions and momenta of the trajectory for every subdetector traversed. More...
 
void FillTrajectoryPoints (ND::TG4Trajectory *const traj, ND::TTruthTrajectoriesModule::TTruthTrajectory *trajToFill)
 Fills the vector of trajectory points. More...
 
eventAnalysisEnums::EParticleCategory GetCategory (const ND::TG4Trajectory *const traj)
 Determines the EParticleCategory to which a trajectory belongs. More...
 
bool GetIsActive (const ND::TG4TrajectoryPoint &point, eventAnalysisEnums::ESubdetector det) const
 Determines if a TG4TrajectoryPoint is in the active region of the specified subdetector. More...
 
bool SaveTraj (ND::TG4Trajectory *const traj) const
 Returns true if a trajectory needs to be saved, and false oterwise. More...
 

Private Attributes

UInt_t fMaxNTrajectories
 The maximum number of trajectories that can be saved from a single event. More...
 
Double_t fMinLength
 Minimum Length of Trajectories that will be saved in mm. More...
 
std::set< Int_t > fSaveList
 List of the trajectory IDs which are to be saved from the current event. More...
 
Bool_t fSaveOnlyP0DTrackerECALTrajectories
 Whether to save all trajectories, or only those which intersect the P0D, Tracker or ECals. More...
 
Bool_t fSaveParentChain
 Whether saving a trajectory should also trigger the saving of all the trajectories in its parent chain. More...
 

Detailed Description

The eventAnalysis module responsible for saving information about the True Particles in an event from MC.

It saves a tree called "Trajectories" in the "TruthDir" directory of eventAnalysis files. The tree contains integers indicating how many trajectories were in the event, and a TClonesArray "Trajectories" which contains a TTruthTrajectory for every particle in the event which passed the module's criteria to be saved.

Definition at line 42 of file TTruthTrajectoriesModule.hxx.

Member Enumeration Documentation

enum ND::TAnalysisModuleBase::EType
protectedinherited
Enumerator
kHeader 
kTruth 
kRecon 
kLowLevel 
kNTypes 

Definition at line 54 of file TAnalysisModuleBase.hxx.

Constructor & Destructor Documentation

ND::TTruthTrajectoriesModule::TTruthTrajectoriesModule ( const char *  name = "Trajectories",
const char *  title = "True Trajectory information" 
)
ND::TTruthTrajectoriesModule::~TTruthTrajectoriesModule ( )
virtual

Definition at line 43 of file TTruthTrajectoriesModule.cxx.

Member Function Documentation

Bool_t ND::TTruthTrajectoriesModule::Configure ( std::string &  option)
virtual

Method for setting behaviour of module.

Currently implemented options are: "saveall" - Save every trajectory longer than the minimum length regardless of where it occurred

Reimplemented from ND::TAnalysisModuleBase.

Definition at line 47 of file TTruthTrajectoriesModule.cxx.

void ND::TTruthTrajectoriesModule::FillSaveList ( ND::THandle< ND::TG4TrajectoryContainer >  trajectories)
private

Fills a std::set (fSaveList) with the ID of every trajectory which should be saved for the current event.

Definition at line 83 of file TTruthTrajectoriesModule.cxx.

Int_t ND::TAnalysisModuleBase::GetBufferSize ( )
inherited

ROOT output parameters, usually no need to touch.

Definition at line 123 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fBufferSize.

eventAnalysisEnums::EParticleCategory ND::TTruthTrajectoriesModule::GetCategory ( const ND::TG4Trajectory *const  traj)
private
std::string const ND::TAnalysisModuleBase::GetCVSID ( ) const
inherited

Definition at line 136 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fCVSID.

std::string const ND::TAnalysisModuleBase::GetCVSTagName ( ) const
inherited

Definition at line 135 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fCVSTagName.

std::string const ND::TAnalysisModuleBase::GetDescription ( ) const
inherited

Definition at line 134 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fDescription.

std::string const ND::TAnalysisModuleBase::GetDirectoryName ( ) const
inherited

Returns the name of the directory which the output of a particular module will be saved in.

Definition at line 22 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

Int_t ND::TTruthTrajectoriesModule::GetMaximumNumberTrajectoriesPerEvent ( ) const

Getter for maximum number of trajectories saveable per event.

Definition at line 71 of file TTruthTrajectoriesModule.hxx.

References fMaxNTrajectories.

Double_t ND::TTruthTrajectoriesModule::GetMinimumTrajectoryLengthToSave ( ) const

Getter for trajectory length save condition.

Definition at line 68 of file TTruthTrajectoriesModule.hxx.

References fMinLength.

TTree const* ND::TAnalysisModuleBase::GetOutputTree ( ) const
inherited

The output tree.

Definition at line 139 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fOutputTree.

Int_t ND::TAnalysisModuleBase::GetSplitLevel ( )
inherited

ROOT output parameters, usually no need to touch.

Definition at line 129 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fSplitLevel.

char const * ND::TAnalysisModuleBase::GetTitle ( )
inherited

Definition at line 118 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

virtual EType ND::TAnalysisTruthModuleBase::GetTreeType ( ) const
virtualinherited

Returns the type of tree, header, truth, or recon.

This is overridden in the derived base classes such as TAnalysisReconModuleBase, so users do not need to override it explicitly

Implements ND::TAnalysisModuleBase.

Definition at line 17 of file TAnalysisTruthModuleBase.hxx.

References ND::TAnalysisModuleBase::kTruth.

void ND::TAnalysisModuleBase::Initialize ( TTree *  tree)
inherited

Definition at line 37 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

void ND::TTruthTrajectoriesModule::InitializeBranches ( )
virtual

Creates the necessary tree and branches for saving the Truth Trajectories information.

Implements ND::TAnalysisModuleBase.

Definition at line 56 of file TTruthTrajectoriesModule.cxx.

virtual void ND::TAnalysisModuleBase::InitializeModule ( )
protectedvirtualinherited
virtual Bool_t ND::TAnalysisModuleBase::IsEnabled ( ) const
virtualinherited

Whether the module is enable or not.

Definition at line 84 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fIsEnabled.

Referenced by ND::TAnalysisLoop::Initialize(), and ND::TAnalysisLoop::operator()().

virtual Bool_t ND::TTruthTrajectoriesModule::IsEnabledByDefault ( ) const
virtual

This method returns true - the module is always enabled by defult.

Reimplemented from ND::TAnalysisModuleBase.

Definition at line 53 of file TTruthTrajectoriesModule.hxx.

bool ND::TAnalysisModuleBase::IsFullEventWorthSaving ( ND::TND280Event &  event)
virtualinherited

Whether the module thinks it is worth saving the entire oaEvent event tree entry for this event.

eventAnalysis can be used for event pre-selection in this way. Activated with the –oaEvent-preselection=<moduleclass>> command- line argument

Reimplemented in ND::TTrackerECALReconModule::OutputManager, ND::TReconPerformanceEvalModule, and ND::TTRExReconModule.

Definition at line 90 of file TAnalysisModuleBase.cxx.

virtual Bool_t ND::TAnalysisModuleBase::IsUsedForPreselection ( ) const
virtualinherited

Whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output.

Definition at line 93 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fIsUsedForPreselection.

Referenced by ND::TAnalysisLoop::Initialize(), and ND::TAnalysisLoop::operator()().

void ND::TAnalysisModuleBase::KillOutputTree ( )
inherited

Definition at line 140 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fOutputTree.

void ND::TAnalysisModuleBase::Print ( )
virtualinherited

Prints a simple message describing the module.

Should be overridden for more detail

Definition at line 99 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::Initialize().

bool ND::TAnalysisModuleBase::Process ( ND::TND280Event &  event)
virtualinherited

Gets the run and event IDs and calls FillTree with the event, and then actually calls fOutputTree->Fill.

Definition at line 77 of file TAnalysisModuleBase.cxx.

Referenced by ND::TAnalysisLoop::operator()().

Bool_t ND::TTruthTrajectoriesModule::ProcessFirstEvent ( ND::TND280Event &  event)
virtual

Called for the first event This method checks whether this event is a real-data event an if so throws an ND::EDataFile().

Otherwise it returns true.

Implements ND::TAnalysisModuleBase.

Definition at line 75 of file TTruthTrajectoriesModule.cxx.

bool ND::TTruthTrajectoriesModule::SaveTraj ( ND::TG4Trajectory *const  traj) const
private

Returns true if a trajectory needs to be saved, and false oterwise.

Definition at line 230 of file TTruthTrajectoriesModule.cxx.

virtual void ND::TAnalysisModuleBase::SayAvailableOpts ( std::string  indent = "")
virtualinherited

Subclasses should override this to let a user know what options are available.

Reimplemented in ND::TTrackerECALReconModule::OutputManager, ND::TGlobalReconModule, ND::TTagsModule, and ND::TBasicHeaderModule.

Definition at line 156 of file TAnalysisModuleBase.hxx.

void ND::TAnalysisModuleBase::SetBufferSize ( Int_t  buffersize)
inherited

ROOT output parameters, usually no need to touch.

Definition at line 126 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fBufferSize.

virtual void ND::TAnalysisModuleBase::SetDisabled ( )
virtualinherited

Disables the module.

Is called when an exception is thrown inside the module.

Definition at line 74 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::SetEnabled().

Referenced by ND::TAnalysisLoop::Initialize(), and ND::TAnalysisLoop::operator()().

virtual void ND::TAnalysisModuleBase::SetEnabled ( Bool_t  isenabled = true)
virtualinherited

Sets whether the module is enabled.

This only refer to modules which have been included for consideration by being instantiated in TAnalysisLoop.cxx or similar.

Definition at line 70 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fIsEnabled.

Referenced by ND::TAnalysisLoop::Initialize(), ND::TAnalysisModuleBase::SetDisabled(), and ND::TAnalysisLoop::SetOption().

void ND::TAnalysisModuleBase::SetInputDirectory ( std::string  dir)
inherited

Definition at line 158 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fInputDirectory.

void ND::TTruthTrajectoriesModule::SetMaximumNumberTrajectoriesPerEvent ( UInt_t  n)

Setter for maximum number of trajectories saveable per event.

Definition at line 79 of file TTruthTrajectoriesModule.hxx.

References fMaxNTrajectories.

void ND::TTruthTrajectoriesModule::SetMinimumTrajectoryLengthToSave ( Double_t  mm)

Getter for trajectory length save condition. [mm].

Definition at line 76 of file TTruthTrajectoriesModule.hxx.

References fMinLength.

void ND::TTruthTrajectoriesModule::SetSaveOnlyP0DTrackerECALTrajectories ( const Bool_t &  yesorno = true)

Controls whether just P0D/Tracker/ECal trajectories should be saved.

Definition at line 88 of file TTruthTrajectoriesModule.hxx.

References fSaveOnlyP0DTrackerECALTrajectories.

void ND::TTruthTrajectoriesModule::SetSaveParentChain ( const Bool_t &  yesorno = true)

Controls whether a trajectory that would ordinarily be saved will also save all its parent trajectories.

Definition at line 83 of file TTruthTrajectoriesModule.hxx.

References fSaveParentChain.

void ND::TAnalysisModuleBase::SetSplitLevel ( Int_t  splitlevel)
inherited
virtual void ND::TAnalysisModuleBase::SetUsedForPreselection ( Bool_t  isused = true)
virtualinherited

Sets whether the module should call IsFullEventWorthSaving() function for each event, to decide if the full oaEvent info for that event should be saved in the output.

Definition at line 79 of file TAnalysisModuleBase.hxx.

References ND::TAnalysisModuleBase::fIsUsedForPreselection.

Referenced by ND::TAnalysisLoop::SetOption().

Member Data Documentation

Int_t ND::TAnalysisModuleBase::fEventID
protectedinherited

Definition at line 198 of file TAnalysisModuleBase.hxx.

Bool_t ND::TAnalysisModuleBase::fFilledConfigTree
protectedinherited
std::string ND::TAnalysisModuleBase::fInputDirectory
protectedinherited

An input directory where analysis modules can search for extra files.

Definition at line 201 of file TAnalysisModuleBase.hxx.

Referenced by ND::TAnalysisModuleBase::SetInputDirectory().

Bool_t ND::TAnalysisModuleBase::fIsUsedForPreselection
protectedinherited
UInt_t ND::TTruthTrajectoriesModule::fMaxNTrajectories
private

The maximum number of trajectories that can be saved from a single event.

Initialised by the constructor.

Definition at line 132 of file TTruthTrajectoriesModule.hxx.

Referenced by GetMaximumNumberTrajectoriesPerEvent(), and SetMaximumNumberTrajectoriesPerEvent().

Double_t ND::TTruthTrajectoriesModule::fMinLength
private

Minimum Length of Trajectories that will be saved in mm.

All primary particles will be saved regardless of this.

Definition at line 136 of file TTruthTrajectoriesModule.hxx.

Referenced by GetMinimumTrajectoryLengthToSave(), and SetMinimumTrajectoryLengthToSave().

std::string ND::TAnalysisModuleBase::fName
protectedinherited

Definition at line 203 of file TAnalysisModuleBase.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTraj

Total number of trajectories saved from the event.

Definition at line 151 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajBaryon

Number of Charged Baryon Trajectories saved from the event.

Definition at line 157 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajLepton

Number of Charged Lepton trajectories saved from the event.

Definition at line 154 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajMeson

Number of Charged Meson Trajectories saved from the event.

Definition at line 160 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajOther

Number of Any Other Trajectories saved from the event.

Definition at line 172 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajOtherCharged

Number of Other Charged Trajectories saved from the event.

[branch]

Definition at line 166 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajOtherNeutral

Number of Other Neutral Trajectories saved from the event.

Definition at line 169 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TTruthTrajectoriesModule::fNTrajPhoton

Number of Photon Trajectories saved from the event.

Definition at line 163 of file TTruthTrajectoriesModule.hxx.

Int_t ND::TAnalysisModuleBase::fPreselected
protectedinherited

Definition at line 199 of file TAnalysisModuleBase.hxx.

Int_t ND::TAnalysisModuleBase::fRunID
protectedinherited

Definition at line 196 of file TAnalysisModuleBase.hxx.

std::set<Int_t> ND::TTruthTrajectoriesModule::fSaveList
private

List of the trajectory IDs which are to be saved from the current event.

Definition at line 147 of file TTruthTrajectoriesModule.hxx.

Bool_t ND::TTruthTrajectoriesModule::fSaveOnlyP0DTrackerECALTrajectories
private

Whether to save all trajectories, or only those which intersect the P0D, Tracker or ECals.

Definition at line 140 of file TTruthTrajectoriesModule.hxx.

Referenced by SetSaveOnlyP0DTrackerECALTrajectories().

Bool_t ND::TTruthTrajectoriesModule::fSaveParentChain
private

Whether saving a trajectory should also trigger the saving of all the trajectories in its parent chain.

Definition at line 144 of file TTruthTrajectoriesModule.hxx.

Referenced by SetSaveParentChain().

Int_t ND::TAnalysisModuleBase::fSubrunID
protectedinherited

Definition at line 197 of file TAnalysisModuleBase.hxx.

std::string ND::TAnalysisModuleBase::fTitle
protectedinherited

Definition at line 204 of file TAnalysisModuleBase.hxx.

TClonesArray* ND::TTruthTrajectoriesModule::fTrajectories

Clones array of ND::TTruthTrajectoriesModule::TTruthTrajectory sorted in ascending ID order.

Definition at line 176 of file TTruthTrajectoriesModule.hxx.


The documentation for this class was generated from the following files:

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:44:04 for eventAnalysis by doxygen 1.8.5