]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fixed the behaviour of these classes
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jun 2009 17:33:09 +0000 (17:33 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jun 2009 17:33:09 +0000 (17:33 +0000)
PWG2/RESONANCES/AliRsnCutBetheBloch.cxx
PWG2/RESONANCES/AliRsnCutBetheBloch.h

index 7bcc0832d993babe572134267ec8566077af8069..251cf0ca0653346b179c952ed7c4921f8e322b90 100644 (file)
@@ -29,8 +29,8 @@ ClassImp(AliRsnCutBetheBloch)
 AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
   AliRsnCut(),
   fCorrect(kTRUE),
 AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
   AliRsnCut(),
   fCorrect(kTRUE),
-  fMass(1.0),
-  fMIP(50.0)
+  fMIP(50.0),
+  fType(AliPID::kUnknown)
 {
 //
 // Default constructor.
 {
 //
 // Default constructor.
@@ -39,32 +39,13 @@ AliRsnCutBetheBloch::AliRsnCutBetheBloch() :
   fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
 }
 
   fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
 }
 
-//_________________________________________________________________________________________________
-AliRsnCutBetheBloch::AliRsnCutBetheBloch
-(const char *name, Double_t fractionRange, Double_t mass, Double_t mip, Bool_t correct) :
-  AliRsnCut(name, -fractionRange, fractionRange),
-  fCorrect(correct),
-  fMass(mass),
-  fMIP(mip)
-{
-//
-// Main constructor.
-// the cut range is the relative fraction of the value:
-// BB*(1-fraction) < TPC < BB*(1+fraction)
-// which means:
-// -fraction < (TPC - BB)/BB < fraction
-//
-
-  fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
-}
-
 //_________________________________________________________________________________________________
 AliRsnCutBetheBloch::AliRsnCutBetheBloch
 (const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip, Bool_t correct) :
   AliRsnCut(name, -fractionRange, fractionRange),
   fCorrect(correct),
 //_________________________________________________________________________________________________
 AliRsnCutBetheBloch::AliRsnCutBetheBloch
 (const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip, Bool_t correct) :
   AliRsnCut(name, -fractionRange, fractionRange),
   fCorrect(correct),
-  fMass(0.0),
-  fMIP(mip)
+  fMIP(mip),
+  fType(type)
 {
 //
 // Main constructor.
 {
 //
 // Main constructor.
@@ -74,7 +55,6 @@ AliRsnCutBetheBloch::AliRsnCutBetheBloch
 // -fraction < (TPC - BB)/BB < fraction
 //
 
 // -fraction < (TPC - BB)/BB < fraction
 //
 
-  SetMass(type);
   fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
 }
 
   fConst[0] = fConst[1] = fConst[2] = fConst[3] = fConst[4] = 0.0;
 }
 
@@ -92,7 +72,10 @@ Double_t AliRsnCutBetheBloch::BetheBloch(AliRsnDaughter *track)
 // The value is computed in MIP units, multiplied by 50 to have it in energy.
 //
 
 // The value is computed in MIP units, multiplied by 50 to have it in energy.
 //
 
-  Double_t betaGamma = track->P() / fMass;
+  AliPID pid;
+  Double_t mass = pid.ParticleMass(fType);
+
+  Double_t betaGamma = track->P() / mass;
   Double_t beta = betaGamma / TMath::Sqrt(1.0 + betaGamma * betaGamma);
   Double_t aa = TMath::Power(beta, fConst[3]);
   Double_t bb = TMath::Power(1.0 / betaGamma, fConst[4]);
   Double_t beta = betaGamma / TMath::Sqrt(1.0 + betaGamma * betaGamma);
   Double_t aa = TMath::Power(beta, fConst[3]);
   Double_t bb = TMath::Power(1.0 / betaGamma, fConst[4]);
@@ -125,6 +108,10 @@ Bool_t AliRsnCutBetheBloch::IsSelected(ETarget tgt, AliRsnDaughter *track)
     return kTRUE;
   }
 
     return kTRUE;
   }
 
+  // if the required PID of the track is not the same as the
+  // reference of the cut, the cut is automatically skipped
+  if (track->RequiredPID() != fType) return kTRUE;
+
   // retrieve the TPC signal
   AliVParticle *vpart = track->GetRef();
   AliESDtrack *esd = dynamic_cast<AliESDtrack*>(vpart);
   // retrieve the TPC signal
   AliVParticle *vpart = track->GetRef();
   AliESDtrack *esd = dynamic_cast<AliESDtrack*>(vpart);
index 11d4322c0057661f8678ff5b370afe42043b1bfb..83fe31d89eda441174634176d3dd06f2711f18ef 100644 (file)
@@ -20,11 +20,9 @@ class AliRsnCutBetheBloch : public AliRsnCut
  public:
 
   AliRsnCutBetheBloch();
  public:
 
   AliRsnCutBetheBloch();
-  AliRsnCutBetheBloch(const char *name, Double_t fractionRange, Double_t mass, Double_t mip = 50.0, Bool_t correct = kTRUE);
   AliRsnCutBetheBloch(const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip = 50.0, Bool_t correct = kTRUE);
 
   AliRsnCutBetheBloch(const char *name, Double_t fractionRange, AliPID::EParticleType type, Double_t mip = 50.0, Bool_t correct = kTRUE);
 
-  void           SetMass(Double_t mass) {fMass = mass;}
-  void           SetMass(AliPID::EParticleType type) {AliPID pid; fMass = pid.ParticleMass(type);}
+  void           SetType(AliPID::EParticleType type) {fType = type;}
   void           SetMIP(Double_t mip) {fMIP = mip;}
   void           SetCalibConstant(Int_t i, Double_t value) {if (i>=0&&i<5) fConst[i] = value;}
   Double_t       BetheBloch(AliRsnDaughter *track);
   void           SetMIP(Double_t mip) {fMIP = mip;}
   void           SetCalibConstant(Int_t i, Double_t value) {if (i>=0&&i<5) fConst[i] = value;}
   Double_t       BetheBloch(AliRsnDaughter *track);
@@ -36,10 +34,10 @@ class AliRsnCutBetheBloch : public AliRsnCut
 
 protected:
 
 
 protected:
 
-  Bool_t   fCorrect;   // apply or not the saturation corrections
-  Double_t fMass;      // mass hypothesis
-  Double_t fMIP;       // MIP normalization
-  Double_t fConst[5];  // calibration constants
+  Bool_t                fCorrect;   // apply or not the saturation corrections
+  Double_t              fMIP;       // MIP normalization
+  Double_t              fConst[5];  // calibration constants
+  AliPID::EParticleType fType;      // reference particle type
 
   ClassDef(AliRsnCutBetheBloch, 1)
 };
 
   ClassDef(AliRsnCutBetheBloch, 1)
 };