]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AOD/AliAODPWG4Particle.cxx
Fix on the setter of VZEROEqFactors
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODPWG4Particle.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id:   AliAODPWG4Particle.h $ */
17
18 //-------------------------------------------------------------------------
19 //     AOD objects class in use in the CaloTrackCorrelations
20 //     analysis pacackge ($ALICE_ROOT/PWGGA/CaloTrackCorrelations)
21 //
22 //     Author: Gustavo Conesa Balbastre - CNRS-LPSC-Grenoble
23 //-------------------------------------------------------------------------
24
25 //-- ROOT system --
26
27 //-- Analysis system
28 #include "AliAODPWG4Particle.h"
29
30 ClassImp(AliAODPWG4Particle)
31
32
33 //______________________________________________________________________________
34 AliAODPWG4Particle::AliAODPWG4Particle() :
35 AliVParticle(),
36 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
37 fCaloLabel(), fTrackLabel(),fDetector(""), fDetectorTag(0),
38 fDisp(0), fTof(0), fCharged(0), fDecayTag(-1),
39 fBadDist(0), fNLM(0), fM02(0),
40 fIsolated(0), fLeadingParticle(0),
41 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(-1)
42 {
43   // constructor
44   fCaloLabel [0] = -1;
45   fCaloLabel [1] = -1;
46   fTrackLabel[0] = -1;
47   fTrackLabel[1] = -1;
48   fTrackLabel[2] = -1;
49   fTrackLabel[3] = -1;
50 }
51
52 //______________________________________________________________________________
53 AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e):
54   AliVParticle(),
55 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
56 fCaloLabel(), fTrackLabel(),fDetector(""), fDetectorTag(0),
57 fDisp(0), fTof(0), fCharged(0), fDecayTag(-1),
58 fBadDist(0), fNLM(0), fM02(0),
59 fIsolated(0), fLeadingParticle(0),
60 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(-1)
61 {
62   // constructor
63   fMomentum = new TLorentzVector(px, py, pz, e);
64   
65   fCaloLabel [0] = -1;
66   fCaloLabel [1] = -1;
67   fTrackLabel[0] = -1;
68   fTrackLabel[1] = -1;  
69   fTrackLabel[2] = -1;
70   fTrackLabel[3] = -1;  
71 }
72
73 //______________________________________________________________________________
74 AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p):
75   AliVParticle(),
76 fMomentum(0),fPdg(-1), fTag(0), fLabel(-1),
77 fCaloLabel(), fTrackLabel(),fDetector(""), fDetectorTag(0),
78 fDisp(0), fTof(0), fCharged(0), fDecayTag(-1),
79 fBadDist(0), fNLM(0), fM02(0),
80 fIsolated(0), fLeadingParticle(0),
81 fTagged(0), fFidArea(0), fInputFileIndex(0),fBtag(-1)
82 {
83   // constructor
84   fMomentum = new TLorentzVector(p);
85   
86   fCaloLabel [0] = -1;
87   fCaloLabel [1] = -1;
88   fTrackLabel[0] = -1;
89   fTrackLabel[1] = -1;
90   fTrackLabel[2] = -1;
91   fTrackLabel[3] = -1;
92 }
93
94
95 //______________________________________________________________________________
96 AliAODPWG4Particle::~AliAODPWG4Particle() 
97 {
98   // destructor
99     delete fMomentum;
100 }
101
102 //______________________________________________________________________________
103 void AliAODPWG4Particle::Clear(const Option_t* /*opt*/) 
104 {
105   //clear
106   delete fMomentum;
107 }
108
109 //______________________________________________________________________________
110 AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) :
111   AliVParticle(part),
112   fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel),
113   fCaloLabel(), fTrackLabel(), fDetector(part.fDetector), fDetectorTag(part.fDetectorTag),
114   fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged), fDecayTag(part.fDecayTag),fBadDist(part.fBadDist),
115   fNLM(part.fNLM), fM02(part.fM02), fIsolated(part.fIsolated), fLeadingParticle(part.fLeadingParticle),
116   fTagged(part.fTagged), fFidArea(part.fFidArea), fInputFileIndex(part.fInputFileIndex),fBtag(part.fBtag)
117 {
118   // Copy constructor
119   fMomentum = new TLorentzVector(*part.fMomentum);
120   
121   fCaloLabel [0] = part.fCaloLabel[0];
122   fCaloLabel [1] = part.fCaloLabel[1];
123   fTrackLabel[0] = part.fTrackLabel[0];
124   fTrackLabel[1] = part.fTrackLabel[1];
125   fTrackLabel[2] = part.fTrackLabel[2];
126   fTrackLabel[3] = part.fTrackLabel[3];
127 }
128
129 //________________________________________________________________________________
130 AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle & part)
131 {
132   // Assignment operator
133   if(this!=&part)
134   {
135     fPdg   = part.fPdg;
136     fTag   = part.fTag;
137     fLabel = part.fLabel;
138     
139     fCaloLabel [0] = part.fCaloLabel[0];
140     fCaloLabel [1] = part.fCaloLabel[1];
141     fTrackLabel[0] = part.fTrackLabel[0];
142     fTrackLabel[1] = part.fTrackLabel[1];
143     
144     fDetectorTag = part.fDetectorTag;
145     fDetector = part.fDetector;
146     fDisp     = part.fDisp;
147     fTof      = part.fTof;
148     fCharged  = part.fCharged;
149     fBadDist  = part.fBadDist;
150     fDecayTag = part.fDecayTag;
151     
152     fNLM      = part.fNLM;
153     fM02      = part.fM02;
154     fIsolated = part.fIsolated;
155     fLeadingParticle =part.fLeadingParticle;
156
157     fBtag     = part.fBtag;
158     fFidArea  = part.fFidArea;
159     fTagged   = part.fTagged;
160     fInputFileIndex =  part.fInputFileIndex;
161
162     if (fMomentum ) delete fMomentum;
163     fMomentum = new TLorentzVector(*part.fMomentum);
164   }
165   
166   return *this;
167 }
168
169 //_______________________________________________________________
170 Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{
171   // returns true if particle satisfies given PID criterium
172         switch(ipid){
173     case 0: return kTRUE ; //No PID at all
174     case 1:
175           {
176             if (fPdg == pdgwanted) return kTRUE;
177             else return kFALSE; //Overall PID calculated with bayesian methods.
178           }
179     case 2: return fDisp ;   //only dispersion cut
180     case 3: return fTof ;    //Only TOF cut
181     case 4: return fCharged ;    //Only Charged cut
182     case 5: return fDisp && fTof ;  //Dispersion and TOF
183     case 6: return fDisp && fCharged ;  //Dispersion and Charged
184     case 7: return fTof  && fCharged ;  //TOF and Charged
185     case 8: return fDisp && fTof && fCharged ; // all 3 cuts
186     default: return kFALSE ; //Not known combination
187         }
188 }
189
190 //______________________________________________________________________________
191 void AliAODPWG4Particle::Print(Option_t* /*option*/) const 
192 {
193   // Print information of all data members
194   printf("Particle 4-vector:\n");
195   printf("     E  = %13.3f", E() );
196   printf("     Px = %13.3f", Px());
197   printf("     Py = %13.3f", Py());
198   printf("     Pz = %13.3f\n", Pz());
199   printf("PID bits :\n");
200   printf("     TOF        : %d",fTof);
201   printf("     Charged    : %d",fCharged);
202   printf("     Dispersion : %d\n",fDisp);
203   printf("PDG       : %d\n",fPdg);
204   printf("Tag       : %d\n",fTag); 
205   printf("Btag      : %d\n",fBtag);  
206   printf("Pi0 Tag   : %d\n",fDecayTag);
207   printf("Dist. to bad channel : %d\n",fBadDist);  
208   printf("Fid Area  : %d\n",fFidArea);  
209   printf("Input File Index : %d\n",fInputFileIndex);  
210   printf("Detector  : %d\n",fDetectorTag);
211   if(fIsolated)        printf("Isolated! \n");
212   if(fLeadingParticle) printf("Leading! \n");
213
214 }