HighLAND
Interaction.hxx
1 #ifndef Interaction_h
2 #define Interaction_h
3 
4 #include <TLorentzVector.h>
5 #include "BaseDataClasses.hxx"
6 
7 //A class for grouping true trajectories together by the interaction
8 //that produced them. (Same parent, same 4-position.)
9 class Interaction{
10 
11 public:
12 
13  //Class variables.
14  //The PDG encoding of the parent particle.
15  Int_t parentPDG;
16 
17  //The ID of the parent particle.
18  Int_t parentID;
19 
20  //The 4-position of this interaction.
21  Float_t position[4];
22 
23  //A vector containing all the trajectories leaving this interaction.
24  std::vector<AnaTrueParticleB*> trajectories;
25 
26  // The parent
27  AnaTrueParticleB* parent;
28 
29  //Empty Constructor.
30  Interaction();
31 
32  //Constructor. Defined by the trajectory used to initialize it.
34 
35  //If given an AnaTrueParticle, checks whether it belongs to a given interaction.
36  //(i.e. whether its start 4-position is the same as the Interaction position.)
37  Bool_t IncludesTrajectory(AnaTrueParticleB*);
38 
39  // Add a trajectory to the interation
40  void AddTrajectory(AnaTrueParticleB* traj, AnaTrueParticleB* parent);
41 
42  //Count the number of particles of a given PDG value.
43  Int_t NumberOfParticleType(Int_t);
44 
45  //Count the number of pi0 from decay products.
46  Int_t NPiZeroFromDecayProducts();
47 
48  //Count the number of exotic particles.
49  Int_t CountExoticParticles();
50 
51  //Get all indices of the particles of a given PDG value in
52  //the trajectories vector.
53  std::vector<UInt_t> IndicesOfParticleType(Int_t);
54 
55 
56 };
57 
58 //=====Additional helper methods for dealing with interactions.========
59 
60 //For use in comparing two Interaction objects so can sort a vector of them according to the time
61 //they occurred at (from first to last.)
62 Bool_t CompareInteractions(Interaction a, Interaction b);
63 
64 //highland takes the 4-momentum InitMomentum and expresses it as a TVector3 direction and a double momentum.
65 //This converts that information back to a 4-vector. A 4-vector is needed to compute the
66 //invariant mass of pi0 decay photon pairs.
67 TLorentzVector GetFourMomentum(TVector3 direction, double momentum, Double_t mass);
68 
69 
70 #endif
Representation of a true Monte Carlo trajectory/particle.