Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
phys_tree/Particle.h
Go to the documentation of this file.
1 //
2 // File: Particle.h
3 // Created: Thu Oct 29 09:49:51 EDT 2009
4 // Creator: davidl (on Darwin Amelia.local 9.8.0 i386)
5 //
6 
7 #ifndef _Particle_
8 #define _Particle_
9 
10 #include <TObject.h>
11 #include <TVector3.h>
12 #include <TLorentzVector.h>
13 
14 class Particle:public TObject{
15 
16  public:
17 
18  Particle(){};
19  ~Particle(){};
20 
21  // Data members
22  TLorentzVector p; // paritcle 4-momentum
23  TVector3 x; // vertex position
24  Bool_t is_fiducial; // True if particle is in fiducial region based on particle type
25  Double_t chisq;
26  Int_t Ndof;
27  Double_t FOM_pid;
28 
29  // This is used to sort a TClonesArray of this type of object
30  Bool_t IsSortable(void) const { return kTRUE;}
31  Int_t Compare(const TObject *a) const{
32  Double32_t diff = ((Particle*)this)->p.E() - ((Particle*)a)->p.E();
33  Int_t idiff = diff>0.0 ? +1:(diff<0.0 ? -1:0);
34  return idiff;
35  }
36 
37  // Copy constructor
38  Particle& operator=(const Particle &prt){
39  this->p = prt.p;
40  this->x = prt.x;
41  this->is_fiducial = prt.is_fiducial;
42  this->chisq = prt.chisq;
43  this->Ndof = prt.Ndof;
44  this->FOM_pid = prt.FOM_pid;
45  return *this;
46  }
47 
48  private:
49  ClassDef(Particle,1);
50 
51 };
52 
53 #endif // _Particle_
ClassDef(Particle, 1)
TVector3 x
Bool_t IsSortable(void) const
Particle & operator=(const Particle &prt)
Double_t FOM_pid
Bool_t is_fiducial
TLorentzVector p
Int_t Compare(const TObject *a) const
Double_t chisq