]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/FLOW/AliFlowTasks/AliFlowBayesianPID.h
pid updates
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowTasks / AliFlowBayesianPID.h
index c08ddaa417404fa0646163e99b153a08147832b1..5bf81138f4ae26ca4bf70348f11fef6a841a44d8 100644 (file)
@@ -60,15 +60,19 @@ for data starting from the PbPb pass2 reconstruction
 class AliFlowBayesianPID : public AliPIDResponse {
  public:
   AliFlowBayesianPID(AliESDpid *esdpid=NULL); 
-  virtual ~AliFlowBayesianPID() {};
+  virtual ~AliFlowBayesianPID();
   
   // virtual method of AliPIDResponse
-  virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const {if(vtrack || type) printf("Don't call AliFlowBayesianPID::NumberOfSigmasTOF method\n"); return 0.0;} // do not use it
+  virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const {if(vtrack) printf("Don't call AliFlowBayesianPID::NumberOfSigmasTOF method (%i)\n",type); return 0.0;} // do not use it
 
   // setter
   void SetMC(Bool_t flag = kTRUE){fIsMC=flag;} // actually do nothing
   void SetDetResponse(AliESDEvent *esd,Float_t centrality=-1.0,EStartTimeType_t flagStart=AliESDpid::kTOF_T0,Bool_t recomputeT0TOF=kFALSE);
   void SetNewTrackParam(Bool_t flag=kTRUE){fNewTrackParam=flag;};
+  void SetDetAND(Int_t idet){if(idet < fNdetectors && idet >= 0) fMaskAND[idet] = kTRUE;};
+  void SetDetOR(Int_t idet){if(idet < fNdetectors && idet >= 0) fMaskOR[idet] = kTRUE;};
+  void ResetDetAND(Int_t idet){if(idet < fNdetectors && idet >= 0) fMaskAND[idet] = kFALSE;};
+  void ResetDetOR(Int_t idet){if(idet < fNdetectors && idet >= 0) fMaskOR[idet] = kFALSE;};
 
   // getter
   AliESDpid* GetESDpid(){return fPIDesd;};
@@ -82,10 +86,13 @@ class AliFlowBayesianPID : public AliPIDResponse {
   Float_t GetTOFMismProb(){return fProbTofMism;};
   Float_t GetMassOverZ(){return fMassTOF;};
   Float_t GetZ(){return fZ;};
+  Bool_t GetDetANDstatus(Int_t idet){if(idet < fNdetectors && idet >= 0){return fMaskAND[idet];} else{return kFALSE;} };
+  Bool_t GetDetORstatus(Int_t idet){if(idet < fNdetectors && idet >= 0){return fMaskOR[idet];} else{return kFALSE;} };
+  Bool_t GetCurrentMask(Int_t idet){if(idet < fNdetectors && idet >= 0){return fMaskCurrent[idet];} else{return kFALSE;} };
 
   // methods for Bayesina Combined PID
-  void ComputeWeights(AliESDtrack *t,Float_t centr=-1.0);
-  void ComputeProb(AliESDtrack *t,Float_t centr=-1.0);
+  void ComputeWeights(const AliESDtrack *t,Float_t centr=-1.0);
+  void ComputeProb(const AliESDtrack *t,Float_t centr=-1.0);
 
   void SetTOFres(Float_t res){fTOFres=res;};
 
@@ -93,19 +100,19 @@ class AliFlowBayesianPID : public AliPIDResponse {
   void SetPriors();
 
   static const Int_t fNdetectors = 2;
+  static const Int_t fNspecies = 8;// 0=el, 1=mu, 2=pi, 3=ka, 4=pr, 5=deuteron, 6=triton, 7=He3 
+  static TH2D* hPriors[fNspecies]; // histo with priors (hardcoded)
+  static TSpline3 *fMism; // function for mismatch
+  static AliTOFGeometry *fTofGeo; // TOF geometry needed to reproduce mismatch shape
 
   AliESDpid *fPIDesd;//ESDpid object
   TDatabasePDG *fDB; // Database pdg
-  Double_t fMass[5]; // mass for el(0),mu(1),pi(2),K(3),p(4)
-  TH2D* hPriors[5]; // histo with priors (hardcoded)
+  Double_t fMass[fNspecies]; // mass for el(0),mu(1),pi(2),K(3),p(4)
 
   Bool_t fNewTrackParam; // switch for new tracking resolution TOF parameterization
   Bool_t fIsMC; // switch if MC data
   Float_t fTOFres; // TOF res needed only if T0-TOF should be recomputed
 
-  TSpline3 *fMism; // function for mismatch
-  AliTOFGeometry *fTofGeo; // TOF geometry needed to reproduce mismatch shape
-
   AliFlowBayesianPID(const AliFlowBayesianPID&); // not implemented
   AliFlowBayesianPID& operator=(const AliFlowBayesianPID&); // not implemented 
 
@@ -114,13 +121,16 @@ class AliFlowBayesianPID : public AliPIDResponse {
 
   AliTOFT0maker *fTOFmaker; //TOF-T0 maker object
 
-  Float_t fWeights[fNdetectors][5]; // weights: 0=tpc,1=tof
-  Float_t fProb[5],fWTofMism,fProbTofMism; // Bayesian Combined PID + mismatch weights and probability 
+  Float_t fWeights[fNdetectors][fNspecies]; // weights: 0=tpc,1=tof
+  Float_t fProb[fNspecies],fWTofMism,fProbTofMism; // Bayesian Combined PID + mismatch weights and probability 
 
   Float_t fZ,fMassTOF; //measured charge(Z) and mass/Z
   TF1 *fBBdata; // Bethe Bloch function (needed to compute the charge of the particle)
 
-  ClassDef(AliFlowBayesianPID, 2); // example of analysis
+  Bool_t fMaskAND[fNdetectors],fMaskOR[fNdetectors],fMaskCurrent[fNdetectors]; // mask detector should be used
+
+  ClassDef(AliFlowBayesianPID, 4); // example of analysis
 };
 
 #endif
+