]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
removed eff-c++ warnings
authorpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Feb 2007 14:33:30 +0000 (14:33 +0000)
committerpulvir <pulvir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Feb 2007 14:33:30 +0000 (14:33 +0000)
12 files changed:
PWG2/RESONANCES/AliRsnAnalysis.cxx
PWG2/RESONANCES/AliRsnAnalysis.h
PWG2/RESONANCES/AliRsnDaughter.cxx
PWG2/RESONANCES/AliRsnDaughter.h
PWG2/RESONANCES/AliRsnDaughterCut.cxx
PWG2/RESONANCES/AliRsnDaughterCut.h
PWG2/RESONANCES/AliRsnDaughterCutPair.cxx [new file with mode: 0644]
PWG2/RESONANCES/AliRsnDaughterCutPair.h [new file with mode: 0644]
PWG2/RESONANCES/AliRsnEvent.cxx
PWG2/RESONANCES/AliRsnEvent.h
PWG2/RESONANCES/AliRsnReader.cxx
PWG2/RESONANCES/AliRsnSelectorRL.cxx

index 0b611a82ba9bf41f28799307247833eed06ceb2c..38606aec55a1e08dd6c0b989c7826f4813af4904 100644 (file)
 
 #include "AliRsnDaughter.h"
 #include "AliRsnDaughterCut.h"
+#include "AliRsnDaughterCutPair.h"
 #include "AliRsnEvent.h"
 #include "AliRsnAnalysis.h"
 
 ClassImp(AliRsnAnalysis)
 
 //--------------------------------------------------------------------------------------------------------
-AliRsnAnalysis::AliRsnAnalysis() 
+AliRsnAnalysis::AliRsnAnalysis() :
+  TObject(),
+  fRejectFakes(kFALSE),
+  fNBins(0),
+  fHistoMin(0.0),
+  fHistoMax(0.0),
+  fTrueMotherPDG(0),
+  fMixPairDefs(0x0),
+  fMixHistograms(0x0),
+  fPairDefs(0x0),
+  fHistograms(0x0),
+  fPairCuts(0x0),
+  fEventsTree(0x0)
 {
 //
 // Constructor
 // Initializes all pointers and collections to NULL.
 //
-       fMixHistograms = 0;
-       fHistograms = 0;
-       fEventsTree = 0;
-       fMixPairDefs = 0;
-       fPairDefs = 0;
-       fPairCuts = 0;
-       
        Int_t i;
        for (i = 0; i < AliPID::kSPECIES; i++) fCuts[i] = 0;
 }
 //--------------------------------------------------------------------------------------------------------
-void AliRsnAnalysis::AddCutPair(AliRsnDaughterCut *cut)
+AliRsnAnalysis::AliRsnAnalysis(const AliRsnAnalysis &copy) : 
+  TObject(copy),
+  fRejectFakes(copy.fRejectFakes),
+  fNBins(copy.fNBins),
+  fHistoMin(copy.fHistoMin),
+  fHistoMax(copy.fHistoMax),
+  fTrueMotherPDG(copy.fTrueMotherPDG),
+  fMixPairDefs(0x0),
+  fMixHistograms(0x0),
+  fPairDefs(0x0),
+  fHistograms(0x0),
+  fPairCuts(0x0),
+  fEventsTree(0x0)
+{
+//
+// Copy constructor
+// Initializes all pointers and collections to NULL anyway,
+// but copies some settings from the argument.
+//
+       Int_t i;
+       for (i = 0; i < AliPID::kSPECIES; i++) fCuts[i] = 0;
+}
+//--------------------------------------------------------------------------------------------------------
+void AliRsnAnalysis::AddCutPair(AliRsnDaughterCutPair *cut)
 {
 //
 // Add a cut on pairs.
 // This cut is global for all pairs.
 //
-       if (!cut->IsPairCut()) {
-               Warning("AddCutPair", "This is a single cut, cannot be added");
-               return;
-       }
-       
        if (!fPairCuts) fPairCuts = new TObjArray(0);
-
        fPairCuts->AddLast(cut);
 }
 //--------------------------------------------------------------------------------------------------------
@@ -78,11 +101,6 @@ void AliRsnAnalysis::AddCutSingle(AliPID::EParticleType type, AliRsnDaughterCut
 // Add a cut on single particles.
 // This cut must be specified for each particle type.
 //
-       if (cut->IsPairCut()) {
-               Warning("AddCutSingle", "This is a pair cut, cannot be added");
-               return;
-       }
-       
        if (type >= AliPID::kElectron && type <= AliPID::kProton) {
                if (!fCuts[type]) fCuts[type] = new TObjArray(0);
                fCuts[type]->AddLast(cut);
@@ -436,8 +454,8 @@ Bool_t AliRsnAnalysis::PairCutCheck(AliRsnDaughter *track1, AliRsnDaughter *trac
        if (!fPairCuts) return kTRUE;
        
        TObjArrayIter iter(fPairCuts);
-       AliRsnDaughterCut *cut = 0;
-       while ( (cut = (AliRsnDaughterCut*)iter.Next()) ) {
+       AliRsnDaughterCutPair *cut = 0;
+       while ( (cut = (AliRsnDaughterCutPair*)iter.Next()) ) {
                if (!cut->Pass(track1, track2)) return kFALSE;
        }
        
@@ -445,22 +463,22 @@ Bool_t AliRsnAnalysis::PairCutCheck(AliRsnDaughter *track1, AliRsnDaughter *trac
 }
 //--------------------------------------------------------------------------------------------------------
 AliRsnAnalysis::AliPairDef::AliPairDef
-(AliPID::EParticleType p1, Char_t sign1, 
- AliPID::EParticleType p2, Char_t sign2, Int_t pdgMother, Bool_t onlyTrue)
+(AliPID::EParticleType p1, Char_t sign1, AliPID::EParticleType p2, Char_t sign2, Int_t pdgMother, Bool_t onlyTrue) :
+  TNamed(),
+  fOnlyTrue(onlyTrue),
+  fTrueMotherPDG(pdgMother),
+  fMass1(0.0),
+  fSign1(sign1),
+  fParticle1(p1),
+  fMass2(0.0),
+  fSign2(sign2),
+  fParticle2(p2)
 {
 //
 // Constructor for nested class
 //
-       fOnlyTrue = onlyTrue;
-       fTrueMotherPDG = 0;
-       if (fOnlyTrue) fTrueMotherPDG = pdgMother;
-       
-       fSign1 = sign1;
-       fParticle1 = p1;
-       
-       fSign2 = sign2;
-       fParticle2 = p2;
-       
+       if (!fOnlyTrue) fTrueMotherPDG = 0;
+               
        // instance a PDG database to recovery true masses of particles
        TDatabasePDG *db = TDatabasePDG::Instance();
        Int_t pdg1 = AliPID::ParticleCode((Int_t)p1);
index 7acaa4c540aec0134390f921e8dc8c0ac46f0dcd..3b4f57b904948fb073f4ccb2ccb452579170e01a 100644 (file)
@@ -33,11 +33,11 @@ class AliRsnAnalysis : public TObject
 public:
 
                 AliRsnAnalysis();
-                        AliRsnAnalysis(const AliRsnAnalysis &copy) : TObject(copy) { }
+                        AliRsnAnalysis(const AliRsnAnalysis &copy);
                         AliRsnAnalysis& operator=(const AliRsnAnalysis & /*copy*/) { return (*this); }
        virtual ~AliRsnAnalysis() {Clear();}
        
-       void     AddCutPair(AliRsnDaughterCut *cut);
+       void     AddCutPair(AliRsnDaughterCutPair *cut);
        void     AddCutSingle(AliPID::EParticleType type, AliRsnDaughterCut *cut);
        void     AddMixPairDef(AliPID::EParticleType p1, Char_t s1, AliPID::EParticleType p2, Char_t s2);
        void     AddPairDef(AliPID::EParticleType p1, Char_t s1, AliPID::EParticleType p2, Char_t s2, Bool_t onlyTrue = kFALSE);
index be2001aac8d149d58cd27d15c5fd59c66e4e071d..285fe6139e8cdc1bdd49bf650bd12d98045aff6d 100644 (file)
 // author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
 //-------------------------------------------------------------------------
 
-#include <Riostream.h>
-
 #include <TParticle.h>
 #include <TString.h>
 
+#include "AliLog.h"
 #include "AliESDtrack.h"
 #include "AliRsnDaughter.h"
 
 ClassImp(AliRsnDaughter)
 
 //--------------------------------------------------------------------------------------------------------
-AliRsnDaughter::AliRsnDaughter()
+AliRsnDaughter::AliRsnDaughter() :
+  TObject(),
+  fSign((Char_t)0),
+  fPDG((UShort_t)0),
+  fIndex((UShort_t)0),
+  fMass(0.0),
+  fLabel(-1),
+  fTruePDG((Short_t)0),
+  fMother(-1),
+  fMotherPDG((Short_t)0)
 {
 // 
 // Default constructor.
 // Its unique argument defines how many PID weights are allowed. 
 // Actually, it should be the same as AliESDtrack::kSPECIES (=5).
 // 
-       fSign = (Char_t)0;
-       fPDG = (UShort_t)0;
-       fIndex = (UShort_t)0;
-       
-       fP[0] = fP[1] = fP[2] = 0.0;
-       fV[0] = fV[1] = fV[2] = 0.0;
-       fMass = 0.0;
        
        Int_t i;
        for (i = 0; i < AliPID::kSPECIES; i++) {
+               if (i < 3) {
+                       fP[i] = 0.0;
+                       fV[i] = 0.0;
+               }
                fPIDwgt[i] = 0.0;
        }
-                       
-       fLabel = -1;
-       fTruePDG = 0;
-       fMother = -1;
-       fMotherPDG = 0;
 }
 //--------------------------------------------------------------------------------------------------------
-AliRsnDaughter::AliRsnDaughter(const AliRsnDaughter &copy) : TObject(copy)
+AliRsnDaughter::AliRsnDaughter(Int_t label, UShort_t index, Double_t *p, Double_t *v, Char_t sign) :
+  TObject(),
+  fSign(sign),
+  fPDG((UShort_t)0),
+  fIndex(index),
+  fMass(0.0),
+  fLabel(label),
+  fTruePDG((Short_t)0),
+  fMother(-1),
+  fMotherPDG((Short_t)0)
 {
 //
-// Copy constructor
+// [PRIVATE]
+// Constructor with arguments.
+// To create an object with all its standard data members filled (the ones coming from ESD)
 //
-       fSign = copy.fSign;
-       fPDG = copy.fPDG;
-       fIndex = copy.fIndex;
-       
        Int_t i;
-       for (i = 0; i < 3; i++) {
-               fP[i] = copy.fP[i];
-               fV[i] = copy.fV[i];
-       }
-       fMass = copy.fMass;
-       
        for (i = 0; i < AliPID::kSPECIES; i++) {
-               fPIDwgt[i] = copy.fPIDwgt[i];
+               if (i < 3) {
+                       fP[i] = p[i];
+                       fV[i] = v[i];
+               }
+               fPIDwgt[i] = 0.0;
        }
-               
-       fLabel = copy.fLabel;
-       fTruePDG = copy.fTruePDG;
-       fMother = copy.fMother;
-       fMotherPDG = copy.fMotherPDG;
 }
 //--------------------------------------------------------------------------------------------------------
-Bool_t AliRsnDaughter::Adopt(const AliESDtrack* esdTrack, Bool_t checkITSRefit)
+AliRsnDaughter * AliRsnDaughter::Adopt(AliESDtrack* esdTrack, Int_t index)
 {
 //
 // Copies reconstructed data from an AliESDtrack:
@@ -97,47 +97,28 @@ Bool_t AliRsnDaughter::Adopt(const AliESDtrack* esdTrack, Bool_t checkITSRefit)
 // - point of closest approach to primary vertex
 // - ESD pid weights
 // - track label (AliESDtrack::GetLabel())
-// 
-// Makes the following checks:
 //
-// - if argument 'checkITSRefit' is TRUE and the "ITS refit" flag is FALSE
-//   in the track, the "fIsOK" flag of (this) is set to "false" (track should be rejected)
-// - if the passed label is negative, track is considered as "fake", and 
-//   this info is kept to allow fake tracks exclusion when doing analysis
+// Given that it happened that tracks have exactly zero momentum and DCA point,
+// these quantities are checked and skipped when caught.
 //
-       // check for refit in the ITS (if requested)
-       if (checkITSRefit) {
-               if ( !(esdTrack->GetStatus() & AliESDtrack::kITSrefit) ) {
-                       return kFALSE;
-               }
-       }
+       Double_t p[3], v[3], pid[AliPID::kSPECIES];
        
-       // get sign and number of species allowed for PID
-       fSign = (Char_t)esdTrack->GetSign();
+       esdTrack->GetPxPyPz(p);
+       esdTrack->GetXYZ(v);
+       esdTrack->GetESDpid(pid);
        
-       // get (and check) momentum
-       esdTrack->GetPxPyPz(fP);
-       if (fP[0] == 0.0 || fP[1] == 0.0 || fP[2] == 0.0) {
-               return kFALSE;
-       }
-       
-       // get (and check) vertex
-       esdTrack->GetXYZ(fV);
-       if (fV[0] == 0.0 || fV[1] == 0.0 || fV[2] == 0.0) {
-               return kFALSE;
-       }
-       
-       // get label 
-       // (other kinematics informations are set to default and meaningless values)
-       fLabel = esdTrack->GetLabel();
+       if (p[0] == 0.0 || p[1] == 0.0 || p[2] == 0.0) return 0x0;
+       if (v[0] == 0.0 || v[1] == 0.0 || v[2] == 0.0) return 0x0;
+               
+       AliRsnDaughter *out = new AliRsnDaughter(esdTrack->GetLabel(), (UShort_t)index, p, v, (Char_t)esdTrack->GetSign());
        
-       // get PID weights
-       esdTrack->GetESDpid(fPIDwgt);
+       // store PID weights
+       out->SetPIDweights(pid);
        
-       return kTRUE;
+       return out;
 }
 //--------------------------------------------------------------------------------------------------------
-Bool_t AliRsnDaughter::Adopt(TParticle* particle)
+AliRsnDaughter * AliRsnDaughter::Adopt(TParticle* particle, Int_t label)
 {
 //
 // Copies data from a generated particle:
@@ -148,34 +129,38 @@ Bool_t AliRsnDaughter::Adopt(TParticle* particle)
 // - production vertex
 // - GEANT label of mother track
 //
-// When an AliRsnDaughter is copied from a TParticle, it is 
-// considered always good for analysis and never fake.
-//
+       Int_t    pdg;
+       Char_t   sign;
+       Double_t p[3], v[3];
+       
        // get particle sign form the sign of PDG code
-       Int_t pdg = particle->GetPdgCode();
+       pdg = particle->GetPdgCode();
        if (TMath::Abs(pdg) < 20) {
-               if (pdg > 0) fSign = -1; else fSign = 1;
+               if (pdg > 0) sign = -1; else sign = 1;
        }
        else if (TMath::Abs(pdg) < 3000) {
-               if (pdg > 0) fSign = 1; else fSign = -1;
+               if (pdg > 0) sign = 1; else sign = -1;
+       }
+       else {
+               return 0x0;
        }
        
-       // get momentum
-       fP[0] = particle->Px();
-       fP[1] = particle->Py();
-       fP[2] = particle->Pz();
+       p[0] = particle->Px();
+       p[1] = particle->Py();
+       p[2] = particle->Pz();
        
-       // get vertex
-       fV[0] = particle->Vx();
-       fV[1] = particle->Vy();
-       fV[2] = particle->Vz();
+       v[0] = particle->Vx();
+       v[1] = particle->Vy();
+       v[2] = particle->Vz();
+       
+       AliRsnDaughter *out = new AliRsnDaughter(label, (UShort_t)TMath::Abs(label), p, v, sign);
        
        // set simulation data
-       fPDG = fTruePDG = (Short_t)particle->GetPdgCode();
-       fMother = particle->GetFirstMother();
-       fMotherPDG = 0;
+       out->SetPDG(TMath::Abs(pdg));
+       out->SetTruePDG(TMath::Abs(pdg));
+       out->SetMother(particle->GetFirstMother());
        
-       return kTRUE;
+       return out;
 }
 //--------------------------------------------------------------------------------------------------------
 void AliRsnDaughter::Print(Option_t *option) const
@@ -226,7 +211,7 @@ void AliRsnDaughter::Print(Option_t *option) const
                output.Append(Form("PID wgts (e, mu, pi, K, p) = %f, %f, %f, %f, %f", fPIDwgt[0], fPIDwgt[1], fPIDwgt[2], fPIDwgt[3], fPIDwgt[4]));
        }
        
-       cout << output.Data() << endl;
+       AliInfo(output.Data());
 }
 //--------------------------------------------------------------------------------------------------------
 AliRsnDaughter AliRsnDaughter::Sum(AliRsnDaughter t1, AliRsnDaughter t2)
@@ -257,14 +242,6 @@ AliRsnDaughter AliRsnDaughter::Sum(AliRsnDaughter t1, AliRsnDaughter t2)
        Double_t pzTot = t1.GetPz() + t2.GetPz();
        Double_t mass  = TMath::Sqrt(etot*etot - pxTot*pxTot - pyTot*pyTot - pzTot*pzTot);
        
-       //TLorentzVector v1 = track1.Get4Momentum();
-       //TLorentzVector v2 = track2.Get4Momentum();
-       //TLorentzVector sm = v1 + v2;
-       //Double_t pxTot = sum.X();
-       //Double_t pyTot = sum.Y();
-       //Double_t pzTot = sum.Z();
-       //Double_t mass = sm.M();
-       
        out.SetPxPyPz(pxTot, pyTot, pzTot);
        out.SetMass(mass);
        
index 1594671b87e40b3a74fa5b2e441deaf8a6586931..e2561106e12293879d40136b371d02a46d9430ac 100644 (file)
@@ -5,12 +5,12 @@
 
 //-------------------------------------------------------------------------
 //                      Class AliRsnDaughter
-//  
+//
 //           A simple object which describes a reconstructed track
 //           with some references to its related generated particle
 //           and some facilities which could help in composing its
 //           4-momentum, for resonance study.
-// 
+//
 // author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
 //-------------------------------------------------------------------------
 
@@ -27,56 +27,69 @@ class AliESDtrack;
 class AliRsnDaughter : public TObject
 {
 public:
-                              AliRsnDaughter();
-                      AliRsnDaughter(const AliRsnDaughter &copy);
-                               
+       
+       AliRsnDaughter();
+       
        virtual       ~AliRsnDaughter() { }
-               
-       Bool_t         Adopt(TParticle* particle);
-       Bool_t         Adopt(const AliESDtrack* track, Bool_t checkRefit = kTRUE);
-       TVector3       Get3Momentum() const {TVector3 v(fP[0],fP[1],fP[2]); return v;}
-       TLorentzVector Get4Momentum() const     {TLorentzVector v(fP[0],fP[1],fP[2],GetEnergy()); return v;}
+       
+       // 4-momentum
        Double_t       GetEnergy() const {return TMath::Sqrt(fMass*fMass + GetP2());}
-       UShort_t       GetIndex() const {return fIndex;}
-       Int_t          GetLabel() const {return fLabel;}
        Double_t       GetMass() const {return fMass;}
-       Int_t          GetMother() const {return fMother;}
-       Short_t        GetMotherPDG() const {return fMotherPDG;}
-       UShort_t       GetPDG() const {return fPDG;}
-       Double_t       GetPIDweight(Int_t i) const {return ( (i>=0&&i<AliPID::kSPECIES)?fPIDwgt[i]:-1.0 );}
-       Char_t         GetSign() const {return fSign;}
        Double_t       GetP2() const {return fP[0]*fP[0] + fP[1]*fP[1] + fP[2]*fP[2];}
        Double_t       GetP() const  {return TMath::Sqrt(GetP2());}
        Double_t       GetPx() const {return fP[0];}
        Double_t       GetPy() const {return fP[1];}
        Double_t       GetPz() const {return fP[2];}
        Double_t       GetPt() const {return TMath::Sqrt(fP[0]*fP[0] + fP[1]*fP[1]);}
-       Short_t        GetTruePDG() const {return fTruePDG;}
-       TVector3       GetVertex() const {TVector3 v(fV[0],fV[1],fV[2]); return v;}
+       void           SetPxPyPz(Double_t px, Double_t py, Double_t pz) {fP[0] = px; fP[1] = py; fP[2] = pz;}
+       void           SetMass(Double_t m) {fMass = m;}
+       
+       // DCA vertex
        Double_t       GetVx() const {return fV[0];}
        Double_t       GetVy() const {return fV[1];}
        Double_t       GetVz() const {return fV[2];}
        Double_t       GetVt() const {return TMath::Sqrt(fV[0]*fV[0] + fV[1]*fV[1]);}
-       void           Print(Option_t *option = "") const;
+       void           SetVxVyVz(Double_t vx,Double_t vy,Double_t vz) {fV[0]=vx;fV[1]=vy;fV[2]=vz;}
+       
+       // charge sign
+       Char_t         GetSign() const {return fSign;}
+       void           SetSign(Char_t value) {fSign = value;}
+       void           SetSign(Int_t value) {fSign = (Char_t)value;}
+       
+       // PID
+       UShort_t       GetPDG() const {return fPDG;}
+       Double_t       GetPIDweight(Int_t i) const {return ( (i>=0&&i<AliPID::kSPECIES)?fPIDwgt[i]:-1.0 );}
+       void           SetPDG(Int_t pdg) {fPDG = (UShort_t)TMath::Abs(pdg);}
+       void           SetPDG(UShort_t pdg) {fPDG = TMath::Abs(pdg);}
+       void           SetPIDweights(const Double_t *pid) {Int_t i;for(i=0;i<AliPID::kSPECIES;i++)fPIDwgt[i]=pid[i];}
+       
+       // position in stack/ESD array
+       UShort_t       GetIndex() const {return fIndex;}
+       Int_t          GetLabel() const {return fLabel;}
        void           SetIndex(UShort_t value) {fIndex = value;}
        void           SetIndex(Int_t value) {fIndex = (UShort_t)value;}
        void           SetLabel(Int_t l) {fLabel = l;}
-       void           SetMass(Double_t m) {fMass = m;}
+       
+       // MC info (when available)
+       Int_t          GetMother() const {return fMother;}
+       Short_t        GetMotherPDG() const {return fMotherPDG;}
+       Short_t        GetTruePDG() const {return fTruePDG;}
        void           SetMother(Int_t l) {fMother = l;}
        void           SetMotherPDG(Short_t pdg) {fMotherPDG = pdg;}
-       void           SetPDG(UShort_t pdg) {fPDG = TMath::Abs(pdg);}
-       void           SetPDG(Int_t pdg) {fPDG = (UShort_t)TMath::Abs(pdg);}
-       void           SetPIDweights(const Double_t *pid) {Int_t i;for(i=0;i<AliPID::kSPECIES;i++)fPIDwgt[i]=pid[i];}
-       void           SetPxPyPz(Double_t px,Double_t py,Double_t pz) {fP[0]=px;fP[1]=py;fP[2]=pz;}
-       void           SetSign(Char_t value) {fSign = value;}
-       void           SetSign(Int_t value) {fSign = (Char_t)value;}
        void           SetTruePDG(Short_t pdg) {fTruePDG = pdg;}
-       void           SetVxVyVz(Double_t vx,Double_t vy,Double_t vz) {fV[0]=vx;fV[1]=vy;fV[2]=vz;}
        
-       static AliRsnDaughter Sum(AliRsnDaughter t1, AliRsnDaughter t2);
+       // print info
+       void           Print(Option_t *option = "") const;
+       
+       // static methods
+       static AliRsnDaughter * Adopt(AliESDtrack* track, Int_t index);
+       static AliRsnDaughter * Adopt(TParticle* particle, Int_t label);
+       static AliRsnDaughter   Sum(AliRsnDaughter t1, AliRsnDaughter t2);
        
 private:
        
+       AliRsnDaughter(Int_t label, UShort_t index, Double_t *p, Double_t *v, Char_t sign);
+       
        Char_t     fSign;                     // charge sign
        UShort_t   fPDG;                      // assigned PDG code from PID (0=undefined)
        UShort_t   fIndex;                    // reference index in AliESD container
index 81acb12199a661923c0605b99978fac71ff9022a..b2011f13d66b2cb83a9900ada97a76f581c0e1d8 100644 (file)
 ClassImp(AliRsnDaughterCut)
 
 //--------------------------------------------------------------------------------------------------------
-Bool_t AliRsnDaughterCut::Pass(AliRsnDaughter* /*track1*/, AliRsnDaughter* /*track2*/) const
+Bool_t AliRsnDaughterCut::Pass(AliRsnDaughter *track) const
 {
 // 
 // Virtual method for cut passing.
-// This function must be overridden and return kTRUE when cut is passed.
+// This function checks that passed argument is not NULL.
 // 
-       TObject::Error("Pass", "This method must be overridden!");
-       return kFALSE;
-}
-//--------------------------------------------------------------------------------------------------------
-Bool_t AliRsnDaughterCutPtSingle::Pass(AliRsnDaughter *track1, AliRsnDaughter* /*track2*/) const
-{
-// 
-// Cut on single track momentum.
-//
-       if (!track1) return kFALSE;
-       if (track1->GetPt() < fPtMin) return kFALSE;
-       if (track1->GetPt() > fPtMax) return kFALSE;
-       
+       if (!track) return kFALSE;
        return kTRUE;
 }
 //--------------------------------------------------------------------------------------------------------
-Bool_t AliRsnDaughterCutPtPair::Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const
+Bool_t AliRsnDaughterCutPt::Pass(AliRsnDaughter *track) const
 {
 // 
 // Cut on single track momentum.
-// 
-       if (!track1 || !track2) return kFALSE;
-       
-       AliRsnDaughter sum = AliRsnDaughter::Sum(*track1, *track2);
-       
-       if (sum.GetPt() < fPtMin) return kFALSE;
-       if (sum.GetPt() > fPtMax) return kFALSE;
+//
+       if (!AliRsnDaughterCut::Pass(track)) return kFALSE;
+       if (track->GetPt() < fPtMin) return kFALSE;
+       if (track->GetPt() > fPtMax) return kFALSE;
        
        return kTRUE;
 }
index 8068b17941ae06887d060b857371c8f1713a0ee9..9b2882031a7651e972ed951f50e95973271f5ecd 100644 (file)
@@ -23,53 +23,24 @@ class AliRsnDaughterCut : public TObject
 public:
                               AliRsnDaughterCut() {  }
        virtual       ~AliRsnDaughterCut() {  }
-       
-               Bool_t IsPairCut() const {return fPairCut;}
-       virtual Bool_t Pass(AliRsnDaughter *track1, AliRsnDaughter *track2 = 0) const;
-       
-protected:
-
-       Bool_t  fPairCut;  // this flag is TRUE for all pair cuts
-       
+       virtual Bool_t Pass(AliRsnDaughter *track) const;
+private:
        ClassDef(AliRsnDaughterCut,1)
 };
-
+//
 //-------------------------------------------------------------------------
-
-class AliRsnDaughterCutPtSingle : public AliRsnDaughterCut
+//
+class AliRsnDaughterCutPt : public AliRsnDaughterCut
 {
 public:
-                              AliRsnDaughterCutPtSingle(Double_t min, Double_t max) {fPairCut=kFALSE;fPtMin=min;fPtMax=max;}
-       virtual       ~AliRsnDaughterCutPtSingle()                           { }
-       
-       virtual Bool_t Pass(AliRsnDaughter *track1, AliRsnDaughter *track2 = 0) const;
-
-protected:
-
+                              AliRsnDaughterCutPt(Double_t min, Double_t max) : fPtMin(min),fPtMax(max) {}
+       virtual       ~AliRsnDaughterCutPt() {}
+       virtual Bool_t Pass(AliRsnDaughter *track) const;
+private:
        Double_t fPtMin; // smallest allowed Pt
        Double_t fPtMax; // largest allowed Pt
        
-       ClassDef(AliRsnDaughterCutPtSingle,1)
+       ClassDef(AliRsnDaughterCutPt,1)
 };
-       
-//-------------------------------------------------------------------------
-
-class AliRsnDaughterCutPtPair : public AliRsnDaughterCut
-{
-public:
-                              AliRsnDaughterCutPtPair(Double_t min, Double_t max) {fPairCut=kTRUE;fPtMin=min;fPtMax=max;}
-       virtual       ~AliRsnDaughterCutPtPair()                           { }
-       
-       virtual Bool_t Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const;
-
-protected:
-
-       Double_t fPtMin; // smallest allowed Pt
-       Double_t fPtMax; // largest allowed Pt
-       
-       ClassDef(AliRsnDaughterCutPtPair,1)
-};
-
-//-------------------------------------------------------------------------
 
 #endif
diff --git a/PWG2/RESONANCES/AliRsnDaughterCutPair.cxx b/PWG2/RESONANCES/AliRsnDaughterCutPair.cxx
new file mode 100644 (file)
index 0000000..ee513f0
--- /dev/null
@@ -0,0 +1,106 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+//-------------------------------------------------------------------------
+//                      Class AliRsnDaughterCut
+//                     -------------------------
+//           Implementation of track cuts for analysis.
+//           These cuts must be added to the AliRsnAnalysis
+//           object in order to make cut on single particles
+//           or on pairs of particles.
+// 
+// author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
+//-------------------------------------------------------------------------
+
+#include <Riostream.h>
+
+#include "AliRsnDaughter.h"
+#include "AliRsnDaughterCutPair.h"
+
+ClassImp(AliRsnDaughterCutPair)
+
+//--------------------------------------------------------------------------------------------------------
+Bool_t AliRsnDaughterCutPair::Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const
+{
+// 
+// Virtual method for cut passing.
+// This function checks only that the two arguments are not NULL.
+// 
+       if (!track1 || !track2) return kFALSE;
+       
+       return kTRUE;
+}
+//--------------------------------------------------------------------------------------------------------
+Bool_t AliRsnDaughterCutPairPt::Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const
+{
+// 
+// Cut on single track momentum.
+// 
+       if (!AliRsnDaughterCutPair::Pass(track1, track2)) return kFALSE;
+       
+       AliRsnDaughter sum = AliRsnDaughter::Sum(*track1, *track2);
+       
+       if (sum.GetPt() < fPtMin) return kFALSE;
+       if (sum.GetPt() > fPtMax) return kFALSE;
+       
+       return kTRUE;
+}
+//--------------------------------------------------------------------------------------------------------
+void AliRsnDaughterCutPairArmenteros::Compute(AliRsnDaughter *track1, AliRsnDaughter *track2, Double_t &qt, Double_t &alpha) const
+{
+//
+// Compute variables for Armenteros plot.
+// Put as separate method to allow some monitoring
+//
+       
+       if (!AliRsnDaughterCutPair::Pass(track1, track2)) return;
+       
+       AliRsnDaughter sum = AliRsnDaughter::Sum(*track1, *track2);
+       
+       // compute projection of both track momenta along mother's one
+       Double_t qLpos = 0.0, qLneg = 0.0, qL1 = 0.0;
+       if (track1->GetSign() > 0) {
+               qLpos = track1->GetPx()*sum.GetPx() + track1->GetPy()*sum.GetPy() + track1->GetPz()*sum.GetPz();
+               qLneg = track2->GetPx()*sum.GetPx() + track2->GetPy()*sum.GetPy() + track2->GetPz()*sum.GetPz();
+               qL1   = qLpos;
+       } else {
+               qLneg = track1->GetPx()*sum.GetPx() + track1->GetPy()*sum.GetPy() + track1->GetPz()*sum.GetPz();
+               qLpos = track2->GetPx()*sum.GetPx() + track2->GetPy()*sum.GetPy() + track2->GetPz()*sum.GetPz();
+               qL1   = qLneg;
+       }
+       qLpos /= sum.GetP();
+       qLneg /= sum.GetP();
+       
+       // compute Qt
+       qt = TMath::Sqrt(track1->GetP2() - qL1*qL1);
+       
+       // compute alpha
+       alpha = (qLpos - qLneg) / (qLpos + qLneg);
+}
+//--------------------------------------------------------------------------------------------------------
+Bool_t AliRsnDaughterCutPairArmenteros::Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const
+{
+// 
+// Check Armenteros variables
+//
+       if (!AliRsnDaughterCutPair::Pass(track1, track2)) return kFALSE;
+       
+       Double_t qt, alpha;
+       Compute(track1, track2, qt, alpha);
+       
+       if (qt < fQtMin || qt > fQtMax) return kFALSE;
+       if (alpha < fAlphaMin || alpha > fAlphaMax) return kFALSE;
+       return kTRUE;
+}
diff --git a/PWG2/RESONANCES/AliRsnDaughterCutPair.h b/PWG2/RESONANCES/AliRsnDaughterCutPair.h
new file mode 100644 (file)
index 0000000..577fa98
--- /dev/null
@@ -0,0 +1,65 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               *
+ **************************************************************************/
+
+//-------------------------------------------------------------------------
+//                      Class AliRsnDaughterCutPair
+//  
+//           Implementation of various cut which can be applied
+//           during resonance analysis. 
+//           First is the virtual base class.
+// 
+// author: A. Pulvirenti             (email: alberto.pulvirenti@ct.infn.it)
+//-------------------------------------------------------------------------
+
+#ifndef ALIRSNDAUGHTERCUTPAIR_H
+#define ALIRSNDAUGHTERCUTPAIR_H
+
+class AliRsnDaughter;
+
+class AliRsnDaughterCutPair : public TObject
+{
+public:
+                       AliRsnDaughterCutPair() {}
+       virtual        ~AliRsnDaughterCutPair() {}
+       virtual Bool_t  Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const;
+private:
+       ClassDef(AliRsnDaughterCutPair,1)
+};
+//     
+//-------------------------------------------------------------------------
+//
+class AliRsnDaughterCutPairPt : public AliRsnDaughterCutPair
+{
+public:
+                              AliRsnDaughterCutPairPt(Double_t min, Double_t max) : fPtMin(min),fPtMax(max) {}
+       virtual       ~AliRsnDaughterCutPairPt() {}
+       virtual Bool_t Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const;
+protected:
+       Double_t fPtMin; // smallest allowed Pt
+       Double_t fPtMax; // largest allowed Pt
+       
+       ClassDef(AliRsnDaughterCutPairPt,1)
+};
+//
+//-------------------------------------------------------------------------
+//
+class AliRsnDaughterCutPairArmenteros : public AliRsnDaughterCutPair
+{
+public:
+                              AliRsnDaughterCutPairArmenteros(Double_t qMin, Double_t qMax, Double_t aMin, Double_t aMax)
+                               : fQtMin(qMin),fQtMax(qMax),fAlphaMin(aMin),fAlphaMax(aMax) {}
+       virtual       ~AliRsnDaughterCutPairArmenteros() {}
+       virtual Bool_t Pass(AliRsnDaughter *track1, AliRsnDaughter *track2) const;
+               void   Compute(AliRsnDaughter *track1, AliRsnDaughter *track2, Double_t &qt, Double_t &alpha) const;
+private:
+       Double_t fQtMin;    // minimum Qt
+       Double_t fQtMax;    // minimum Qt
+       Double_t fAlphaMin; // minimum alpha
+       Double_t fAlphaMax; // minimum alpha
+       
+       ClassDef(AliRsnDaughterCutPairArmenteros,1)
+};
+
+#endif
index a2b0a18d9e04389d21175409a462416ec623cee6..5645bc0ae7abcd0f8bb42b69462616c58fa18231 100644 (file)
@@ -40,7 +40,9 @@ AliRsnEvent::AliRsnEvent() :
  fPVx(0.0),
  fPVy(0.0),
  fPVz(0.0),
- fMultiplicity(-1)
+ fMultiplicity(-1),
+ fPosNoPID(0x0),
+ fNegNoPID(0x0)
 {
 //
 // Default constructor
@@ -50,16 +52,16 @@ AliRsnEvent::AliRsnEvent() :
                fPos[i] = NULL;
                fNeg[i] = NULL;
        }
-       fPosNoPID = NULL;
-       fNegNoPID = NULL;
 }
 //--------------------------------------------------------------------------------------------------------
 AliRsnEvent::AliRsnEvent(const AliRsnEvent &event) :
  TObject((TObject)event),
- fPVx(event.fPVx), 
- fPVy(event.fPVy), 
+ fPVx(event.fPVx),
+ fPVy(event.fPVy),
  fPVz(event.fPVz),
- fMultiplicity(event.fMultiplicity)
+ fMultiplicity(event.fMultiplicity),
+ fPosNoPID(0x0),
+ fNegNoPID(0x0)
 {
 //
 // Copy constructor.
@@ -83,8 +85,8 @@ AliRsnEvent& AliRsnEvent::operator=(const AliRsnEvent &event)
 // Assignment operator.
 // Creates new instances of all collections to store a copy of all objects.
 //
-       fPVx = event.fPVx; 
-       fPVy = event.fPVy; 
+       fPVx = event.fPVx;
+       fPVy = event.fPVy;
        fPVz = event.fPVz;
        fMultiplicity = event.fMultiplicity;
 
@@ -101,14 +103,14 @@ AliRsnEvent& AliRsnEvent::operator=(const AliRsnEvent &event)
        
        return (*this);
 }
-//--------------------------------------------------------------------------------------------------------//--------------------------------------------------------------------------------------------------------
+//--------------------------------------------------------------------------------------------------------
 void AliRsnEvent::AddTrack(AliRsnDaughter track)
 {
 //
 // Stores a track into the correct array
 //
        // if sign is zero, track is not stored
-       Int_t sign = (Int_t)track.GetSign();
+       Char_t sign = track.GetSign();
        if (!sign) return;
        
        // if PDG code is assigned, track is stored in the corresponding collection
@@ -184,6 +186,9 @@ TClonesArray* AliRsnEvent::GetTracks(Char_t sign, AliPID::EParticleType type)
        if (itype >= 0 && itype < AliPID::kSPECIES) {
                if (sign == '+') return fPos[type]; else return fNeg[type];
        }
+       else if (type == AliPID::kUnknown) {
+               if (sign == '+') return fPosNoPID; else return fNegNoPID;
+       }
        else {
                return NULL;
        }
index 6fa534a8d31a05a6fe109aa476b255dd272d283a..56014d3ed58e17d4ba3e817cb9b408ee8aaa7aa4 100644 (file)
@@ -24,10 +24,11 @@ class AliRsnDaughter;
 class AliRsnEvent : public TObject
 {
 public:
-                      AliRsnEvent();
-                      AliRsnEvent(const AliRsnEvent& copy);
-                                  AliRsnEvent& operator=(const AliRsnEvent& copy);
-                        
+       
+       AliRsnEvent();
+       AliRsnEvent(const AliRsnEvent& copy);
+       AliRsnEvent& operator=(const AliRsnEvent& copy);
+       
        virtual       ~AliRsnEvent() {Clear("DELETE");}
        
        void           AddTrack(AliRsnDaughter track);
@@ -46,9 +47,9 @@ public:
 
 private:
 
-       Double_t       fPVx;                              // position of
-       Double_t       fPVy;                              // primary
-       Double_t       fPVz;                              // vertex
+       Double_t       fPVx;                      // position of
+       Double_t       fPVy;                      // primary
+       Double_t       fPVz;                      // vertex
        
        Int_t          fMultiplicity;             // global event multiplicity
 
index 113189bf346b9a39687b0ede00b48fd8e0bec463..376a33d85c3c229a9c6c276871989c5fc87db1e0 100644 (file)
 ClassImp(AliRsnReader)
 
 //--------------------------------------------------------------------------------------------------------
-AliRsnReader::AliRsnReader()
+AliRsnReader::AliRsnReader() :
+  TObject(),
+  fPIDMethod(kESDPID),
+  fPtLimit4PID(4.0),
+  fProbThreshold(0.0),
+  fMaxRadius(3.0),
+  fUseKineInfo(kFALSE),
+  fEvents(0x0)
 {
 //
 // Constructor.
@@ -61,35 +68,26 @@ AliRsnReader::AliRsnReader()
 // - rejection of non-ITS-refitted tracks
 // - maximum distance allowed from primary vertex = 3.0 cm (beam pipe)
 //
-       fPIDMethod = kESDPID;
        Int_t i;
        for (i = 0; i < AliPID::kSPECIES; i++) fPrior[i] = 1.0;
-       fPtLimit4PID = 4.0;    
-       fProbThreshold = 0.0;
-       fMaxRadius = 3.0;      // the beam pipe
-
-       fUseKineInfo = kFALSE;
-
-       fEvents = 0;
 }
 //--------------------------------------------------------------------------------------------------------
-AliRsnReader::AliRsnReader(const AliRsnReader &copy) : TObject(copy)
+AliRsnReader::AliRsnReader(const AliRsnReader &copy) : 
+  TObject(copy),
+  fPIDMethod(copy.fPIDMethod),
+  fPtLimit4PID(copy.fPtLimit4PID),
+  fProbThreshold(copy.fProbThreshold),
+  fMaxRadius(copy.fMaxRadius),
+  fUseKineInfo(copy.fUseKineInfo),
+  fEvents(0x0)
 {
 //
 // Copy constructor.
 // Initializes all working parameters to same values of another simlar object.
 // TTree data member is not created.
 //
-       fPIDMethod = copy.fPIDMethod;
        Int_t i;
        for (i = 0; i < AliPID::kSPECIES; i++) fPrior[i] = copy.fPrior[i];
-       fPtLimit4PID = copy.fPtLimit4PID;
-       fProbThreshold = copy.fProbThreshold;
-       fMaxRadius = copy.fMaxRadius;
-       
-       fUseKineInfo = copy.fUseKineInfo;
-
-       fEvents = 0;
 }
 //--------------------------------------------------------------------------------------------------------
 AliRsnReader& AliRsnReader::operator=(const AliRsnReader &copy)
index 73e72106b6f4d16fa538f7ae7e90ac9cdca7a786..1558c23a4dedabb9881a6b6e63806483a5e685fa 100644 (file)
@@ -59,7 +59,11 @@ AliRsnSelectorRL::AliRsnSelectorRL(TTree*) :
   fIsRunLoaderOpen(0),
   fRsnEventTree(0),
   fRsnEvent(0),
-  fRsnEventBranch(0)
+  fRsnEventBranch(0),
+  fPIDMethod(kESDPID),
+  fPtLimit4PID(4.0),
+  fProbThreshold(0.0),
+  fMaxRadius(3.0)
 {
 //
 // Constructor.
@@ -68,11 +72,8 @@ AliRsnSelectorRL::AliRsnSelectorRL(TTree*) :
 // - rejection of non-ITS-refitted tracks
 // - maximum distance allowed from primary vertex = 3.0 cm (beam pipe)
 //
-       fPIDMethod = kESDPID;
-       for (Int_t i = 0; i < AliPID::kSPECIES; i++) fPrior[i] = 1.0;
-       fPtLimit4PID = 4.0;
-       fProbThreshold = 0.0;
-       fMaxRadius = 3.0;      // the beam pipe
+       Int_t i;
+       for (i = 0; i < AliPID::kSPECIES; i++) fPrior[i] = 1.0;
 }
 
 AliRsnSelectorRL::~AliRsnSelectorRL() {
@@ -90,16 +91,17 @@ AliRsnSelectorRL::AliRsnSelectorRL(const AliRsnSelectorRL& obj) :
   fIsRunLoaderOpen(obj.fIsRunLoaderOpen),
   fRsnEventTree(obj.fRsnEventTree),
   fRsnEvent(obj.fRsnEvent),
-  fRsnEventBranch(obj.fRsnEventBranch)
+  fRsnEventBranch(obj.fRsnEventBranch),
+  fPIDMethod(obj.fPIDMethod),
+  fPtLimit4PID(obj.fPtLimit4PID),
+  fProbThreshold(obj.fProbThreshold),
+  fMaxRadius(obj.fMaxRadius)
 {
 //
 // Copy constructor
 //
-       fPIDMethod = obj.fPIDMethod;
-       for (Int_t i = 0; i < AliPID::kSPECIES; i++) fPrior[i] = obj.fPrior[i];
-       fPtLimit4PID = obj.fPtLimit4PID;
-       fProbThreshold = obj.fProbThreshold;
-       fMaxRadius = obj.fMaxRadius;
+       Int_t i;
+       for (i = 0; i < AliPID::kSPECIES; i++) fPrior[i] = obj.fPrior[i];
 }
 //--------------------------------------------------------------------------------------------------------
 AliRsnSelectorRL& AliRsnSelectorRL::operator=(const AliRsnSelectorRL& obj)