9 #ifndef TTruthTrajectoriesModule_hxx_seen
10 #define TTruthTrajectoriesModule_hxx_seen
16 #include <TClonesArray.h>
17 #include <TLorentzVector.h>
20 #include <TG4Trajectory.hxx>
21 #include <TND280Event.hxx>
31 class TTruthTrajectoriesModule;
32 OA_EXCEPTION(EeventAnalysisInfiniteLoop, EeventAnalysis);
48 const char *title =
"True Trajectory information");
65 virtual Bool_t
Configure(std::string &option);
98 virtual bool FillTree(ND::TND280Event &);
103 void FillSaveList(ND::THandle<ND::TG4TrajectoryContainer> trajectories);
108 ND::TG4Trajectory *
const traj,
113 void FillTraces(ND::TG4Trajectory *
const traj,
119 bool GetIsActive(
const ND::TG4TrajectoryPoint &point,
124 const ND::TG4Trajectory *
const traj);
127 bool SaveTraj(ND::TG4Trajectory *
const traj)
const;
289 std::vector<ND::TTruthTrajectoriesModule::TTruthTrajectoryPoint>
Points;
void SetMaximumNumberTrajectoriesPerEvent(UInt_t n)
Setter for maximum number of trajectories saveable per event.
Int_t PDG
Particle PDG code.
virtual Bool_t Configure(std::string &option)
Method for setting behaviour of module.
OA_EXCEPTION(EeventAnalysis, EoaCore)
Generate a base exception for the Analysis library.
std::vector< bool > TraceInActive
Vector of booleans indicating whether the particle went through an active part of the corresponding s...
Bool_t fSaveOnlyP0DTrackerECALTrajectories
Whether to save all trajectories, or only those which intersect the P0D, Tracker or ECals...
ClassDef(ND::TTruthTrajectoriesModule::TTruthTrajectoryPoint, 1)
Int_t fNTrajPhoton
Number of Photon Trajectories saved from the event.
Int_t ParentID
Parent particle's Trajectory ID.
std::vector< ND::TTruthTrajectoriesModule::TTruthTrajectoryPoint > Points
The trajectory points where interactions occured along the trajectory.
eventAnalysisEnums::EParticleCategory GetCategory(const ND::TG4Trajectory *const traj)
Determines the EParticleCategory to which a trajectory belongs.
Int_t ID
Trajectory's ID number.
std::vector< TVector3 > TraceExitMomentum
Vector of TVector3s that stores the exit momentum of the particle in each subdetector it encounters...
Bool_t IsSortable() const
Returns true - flagging the object as being sortable.
double Mass
Mass of the particle [MeV].
TLorentzVector InitMomentum
The Initial momentum of the particle at creation [MeV].
void SetSaveParentChain(const Bool_t &yesorno=true)
Controls whether a trajectory that would ordinarily be saved will also save all its parent trajectori...
Float_t MomentumX
The X momentum of the particle leaving the trajectory point [MeV].
Float_t PositionT
The time of the trajectory point [ns].
Contains the truth information for points along the particle trajectories generated during Monte Carl...
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 ev...
virtual ~TTruthTrajectory()
Int_t fNTraj
Total number of trajectories saved from the event.
Float_t MomentumY
The Y momentum of the particle leaving the trajectory point [MeV].
std::vector< TLorentzVector > TraceEntrancePosition
Vector of TLorentzVectors that stores the entrance position of the particle in each subdetector it en...
Int_t Charge
Charge in units of |e|/3. (e.g. an electron has charge -3)
virtual bool FillTree(ND::TND280Event &)
Called for each event, this method is the master method for retrieving and filling the Truth Trajecto...
virtual ~TTruthTrajectoriesModule()
std::set< Int_t > fSaveList
List of the trajectory IDs which are to be saved from the current event.
Contains the truth information associated with a particle from Monte Carlo simulations.
virtual void InitializeBranches()
Creates the necessary tree and branches for saving the Truth Trajectories information.
std::string Name
Particle name.
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...
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...
Int_t PrimaryID
ID of the primary particle at the top of this particle's parent chain.
Int_t fNTrajOther
Number of Any Other Trajectories saved from the event.
Float_t PositionY
The Y position of the trajectory point [mm].
std::vector< TVector3 > TraceEntranceMomentum
Vector of TVector3s that stores the entrance momentum of the particle in each subdetector it encounte...
Int_t fNTrajOtherCharged
Number of Other Charged Trajectories saved from the event.
std::vector< TLorentzVector > TraceExitPosition
Vector of TLorentzVectors that stores the exit position of the particle in each subdetector it encoun...
virtual Bool_t IsEnabledByDefault() const
This method returns true - the module is always enabled by defult.
void SetMinimumTrajectoryLengthToSave(Double_t mm)
Getter for trajectory length save condition. [mm].
Double_t GetMinimumTrajectoryLengthToSave() const
Getter for trajectory length save condition.
A base class for analysis output modules which contain event truth information.
void FillTrajectoryPoints(ND::TG4Trajectory *const traj, ND::TTruthTrajectoriesModule::TTruthTrajectory *trajToFill)
Fills the vector of trajectory points.
Int_t ProcessType
The process type that caused the Monte Carlo to generate this point.
void SetSaveOnlyP0DTrackerECALTrajectories(const Bool_t &yesorno=true)
Controls whether just P0D/Tracker/ECal trajectories should be saved.
bool GetIsActive(const ND::TG4TrajectoryPoint &point, eventAnalysisEnums::ESubdetector det) const
Determines if a TG4TrajectoryPoint is in the active region of the specified subdetector.
Int_t Category
Classifier of the particle type.
TLorentzVector FinalPosition
Final Position at which the particle stopped or left the simulation [mm].
The eventAnalysis module responsible for saving information about the True Particles in an event from...
Int_t fNTrajLepton
Number of Charged Lepton trajectories saved from the event.
std::vector< Int_t > TraceSubdetectors
Vector of integer subdetector codes indicating which subdetectors the particle travelled through...
UInt_t fMaxNTrajectories
The maximum number of trajectories that can be saved from a single event.
Int_t GetMaximumNumberTrajectoriesPerEvent() const
Getter for maximum number of trajectories saveable per event.
Float_t PositionX
The X position of the trajectory point [mm].
Int_t fNTrajMeson
Number of Charged Meson Trajectories saved from the event.
TLorentzVector InitPosition
Initial Position at which the particle was created [mm].
TTruthTrajectoriesModule(const char *name="Trajectories", const char *title="True Trajectory information")
Float_t PositionZ
The Z position of the trajectory point [mm].
ClassDef(ND::TTruthTrajectoriesModule::TTruthTrajectory, 2)
bool SaveTraj(ND::TG4Trajectory *const traj) const
Returns true if a trajectory needs to be saved, and false oterwise.
Int_t fNTrajBaryon
Number of Charged Baryon Trajectories saved from the event.
Int_t Compare(const TObject *obj) const
Comparison function of trajectory IDs so that a TClonesArray can be sorted in ascending ID order...
Int_t fNTrajOtherNeutral
Number of Other Neutral Trajectories saved from the event.
Float_t MomentumZ
The Z position of the particle leaving the trajectory point [MeV].
Double_t fMinLength
Minimum Length of Trajectories that will be saved in mm.
Bool_t fSaveParentChain
Whether saving a trajectory should also trigger the saving of all the trajectories in its parent chai...
TClonesArray * fTrajectories
Clones array of ND::TTruthTrajectoriesModule::TTruthTrajectory sorted in ascending ID order...