From c37c6481eb4b83201421518191c241bc4e90e2a5 Mon Sep 17 00:00:00 2001 From: pulvir Date: Wed, 21 Feb 2007 14:33:30 +0000 Subject: [PATCH] removed eff-c++ warnings --- PWG2/RESONANCES/AliRsnAnalysis.cxx | 86 ++++++----- PWG2/RESONANCES/AliRsnAnalysis.h | 4 +- PWG2/RESONANCES/AliRsnDaughter.cxx | 165 ++++++++++------------ PWG2/RESONANCES/AliRsnDaughter.h | 71 ++++++---- PWG2/RESONANCES/AliRsnDaughterCut.cxx | 31 ++-- PWG2/RESONANCES/AliRsnDaughterCut.h | 49 ++----- PWG2/RESONANCES/AliRsnDaughterCutPair.cxx | 106 ++++++++++++++ PWG2/RESONANCES/AliRsnDaughterCutPair.h | 65 +++++++++ PWG2/RESONANCES/AliRsnEvent.cxx | 25 ++-- PWG2/RESONANCES/AliRsnEvent.h | 15 +- PWG2/RESONANCES/AliRsnReader.cxx | 34 +++-- PWG2/RESONANCES/AliRsnSelectorRL.cxx | 26 ++-- 12 files changed, 409 insertions(+), 268 deletions(-) create mode 100644 PWG2/RESONANCES/AliRsnDaughterCutPair.cxx create mode 100644 PWG2/RESONANCES/AliRsnDaughterCutPair.h diff --git a/PWG2/RESONANCES/AliRsnAnalysis.cxx b/PWG2/RESONANCES/AliRsnAnalysis.cxx index 0b611a82ba9..38606aec55a 100644 --- a/PWG2/RESONANCES/AliRsnAnalysis.cxx +++ b/PWG2/RESONANCES/AliRsnAnalysis.cxx @@ -33,42 +33,65 @@ #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 ©) : + 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); diff --git a/PWG2/RESONANCES/AliRsnAnalysis.h b/PWG2/RESONANCES/AliRsnAnalysis.h index 7acaa4c540a..3b4f57b9049 100644 --- a/PWG2/RESONANCES/AliRsnAnalysis.h +++ b/PWG2/RESONANCES/AliRsnAnalysis.h @@ -33,11 +33,11 @@ class AliRsnAnalysis : public TObject public: AliRsnAnalysis(); - AliRsnAnalysis(const AliRsnAnalysis ©) : TObject(copy) { } + AliRsnAnalysis(const AliRsnAnalysis ©); 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); diff --git a/PWG2/RESONANCES/AliRsnDaughter.cxx b/PWG2/RESONANCES/AliRsnDaughter.cxx index be2001aac8d..285fe6139e8 100644 --- a/PWG2/RESONANCES/AliRsnDaughter.cxx +++ b/PWG2/RESONANCES/AliRsnDaughter.cxx @@ -24,70 +24,70 @@ // author: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it) //------------------------------------------------------------------------- -#include - #include #include +#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 ©) : 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); diff --git a/PWG2/RESONANCES/AliRsnDaughter.h b/PWG2/RESONANCES/AliRsnDaughter.h index 1594671b87e..e2561106e12 100644 --- a/PWG2/RESONANCES/AliRsnDaughter.h +++ b/PWG2/RESONANCES/AliRsnDaughter.h @@ -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 ©); - + + 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=0&&iGetPt() < 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; } diff --git a/PWG2/RESONANCES/AliRsnDaughterCut.h b/PWG2/RESONANCES/AliRsnDaughterCut.h index 8068b17941a..9b2882031a7 100644 --- a/PWG2/RESONANCES/AliRsnDaughterCut.h +++ b/PWG2/RESONANCES/AliRsnDaughterCut.h @@ -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 index 00000000000..ee513f04650 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnDaughterCutPair.cxx @@ -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 + +#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 index 00000000000..577fa9859f1 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnDaughterCutPair.h @@ -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 diff --git a/PWG2/RESONANCES/AliRsnEvent.cxx b/PWG2/RESONANCES/AliRsnEvent.cxx index a2b0a18d9e0..5645bc0ae7a 100644 --- a/PWG2/RESONANCES/AliRsnEvent.cxx +++ b/PWG2/RESONANCES/AliRsnEvent.cxx @@ -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; } diff --git a/PWG2/RESONANCES/AliRsnEvent.h b/PWG2/RESONANCES/AliRsnEvent.h index 6fa534a8d31..56014d3ed58 100644 --- a/PWG2/RESONANCES/AliRsnEvent.h +++ b/PWG2/RESONANCES/AliRsnEvent.h @@ -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 diff --git a/PWG2/RESONANCES/AliRsnReader.cxx b/PWG2/RESONANCES/AliRsnReader.cxx index 113189bf346..376a33d85c3 100644 --- a/PWG2/RESONANCES/AliRsnReader.cxx +++ b/PWG2/RESONANCES/AliRsnReader.cxx @@ -52,7 +52,14 @@ 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 ©) : TObject(copy) +AliRsnReader::AliRsnReader(const AliRsnReader ©) : + 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 ©) diff --git a/PWG2/RESONANCES/AliRsnSelectorRL.cxx b/PWG2/RESONANCES/AliRsnSelectorRL.cxx index 73e72106b6f..1558c23a4de 100644 --- a/PWG2/RESONANCES/AliRsnSelectorRL.cxx +++ b/PWG2/RESONANCES/AliRsnSelectorRL.cxx @@ -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) -- 2.43.0