// Default destructor
//
}
-//_____________________________________________________________________________
-void AliACORDEv0::BuildGeometry()
-{
-
- // not needed anymore
-
-}
//_____________________________________________________________________________
void AliACORDEv0::CreateGeometry()
virtual Int_t IsVersion() const { return 1; }
virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
- virtual void BuildGeometry();
virtual void CreateGeometry();
virtual void Init();
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-/////////////////////////////////////////////////////////////
-//
-// base class for AOD containers
-//
-/////////////////////////////////////////////////////////////
-
-#include <TROOT.h>
-#include <TParticle.h>
-#include <TClass.h>
-#include <TString.h>
-
-#include "AliAOD.h"
-#include "AliAODParticle.h"
-#include "AliTrackPoints.h"
-
-ClassImp(AliAOD)
-
-AliAOD::AliAOD():
- fParticles(0x0),
- fIsRandomized(kFALSE),
- fPrimaryVertexX(0.0),
- fPrimaryVertexY(0.0),
- fPrimaryVertexZ(0.0),
- fParticleClass(0x0)
-{
- //ctor
-// Info("AliAOD()","Entered");
-// SetOwner(kTRUE);
-// Info("AliAOD()","Exited");
-}
-/**************************************************************************/
-
-AliAOD::AliAOD(const AliAOD& in):
- TObject(in),
- fParticles((TClonesArray*)in.fParticles->Clone()),
- fIsRandomized(in.fIsRandomized),
- fPrimaryVertexX(fPrimaryVertexX),
- fPrimaryVertexY(in.fPrimaryVertexY),
- fPrimaryVertexZ(in.fPrimaryVertexZ),
- fParticleClass(in.fParticleClass)
-{
-//copy constructor
-}
-/**************************************************************************/
-
-AliAOD& AliAOD::operator=(const AliAOD& in)
-{
-//assigment operator
-
- if (this == &in ) return *this;
-
- delete fParticles;
- fParticles = (TClonesArray*)in.fParticles->Clone();
- fIsRandomized = in.fIsRandomized ;
- fPrimaryVertexX = in.fPrimaryVertexX ;
- fPrimaryVertexY = in.fPrimaryVertexY ;
- fPrimaryVertexZ = in.fPrimaryVertexZ ;
- fParticleClass = in.fParticleClass ; //althought it is pointer, this points to object in class list of gROOT
- return *this;
-}
-/**************************************************************************/
-
-AliAOD::~AliAOD()
-{
- //Destructor
- //fParticleClass does not belong to AliAOD -> Do not delete it
- delete fParticles;
-
-}
-/**************************************************************************/
-
-void AliAOD::CopyData(AliAOD* aod)
-{
- //Copys all data from aod, but leaves local type of particles
- if (aod == 0x0) return;
- if (aod == this) return;
-
- AliAOD& in = *this;
-
- fIsRandomized = in.fIsRandomized ;
- fPrimaryVertexX = in.fPrimaryVertexX ;
- fPrimaryVertexY = in.fPrimaryVertexY ;
- fPrimaryVertexZ = in.fPrimaryVertexZ ;
- fParticleClass = in.fParticleClass ; //althought it is pointer, this points to object in class list of gROOT
-
-
- if (in.fParticles == 0x0)
- {//if in obj has null fParticles we delete ours
- delete fParticles;
- fParticles = 0x0;
- }
- else
- {
- if (fParticles)
- { //if ours particles were already created
- if (fParticles->GetClass() != in.fParticles->GetClass())
- {//if in obj has
- delete fParticles;
- fParticles = (TClonesArray*)in.fParticles->Clone();
- }
- else
- {
- //it should be faster than cloning
- Int_t inentr = in.fParticles->GetEntriesFast();
- Int_t curentr = fParticles->GetEntriesFast();
-
- TClonesArray& arr = *fParticles;
-
- //we have to take care about different sizes of arrays
- if ( curentr < inentr )
- {
- for (Int_t i = 0; i < curentr; i++)
- {
- TObject& inobj = *(in.fParticles->At(i));
- TObject& obj = *(fParticles->At(i));
- obj = inobj;
- }
-
- TClass* partclass = GetParticleClass();
- if (partclass == 0x0)
- {
- Fatal("CopyData","Can not get particle class");
- return;//pro forma
- }
-
- for (Int_t i = curentr; i < inentr; i++)
- {
- TObject& inobj = *(in.fParticles->At(i));
- TObject& obj = *((TObject*)(partclass->New(arr[i])));
- obj = inobj;
- }
- }
- else
- {
- for (Int_t i = 0; i < inentr; i++)
- {
- TObject& inobj = *(in.fParticles->At(i));
- TObject& obj = *(fParticles->At(i));
- obj = inobj;
- }
-
- for (Int_t i = curentr ; i >= inentr ; i--)
- {
- fParticles->RemoveAt(i);
- }
- }
- }
- }
- else
- {
- fParticles = (TClonesArray*)in.fParticles->Clone();
- }
- }
-
-}
-/**************************************************************************/
-
-void AliAOD::SetParticleClassName(const char* classname)
-{
-//Sets type of particle that is going to be stored
- if (gROOT == 0x0) Fatal("SetParticleClassName","ROOT System not initialized");
- TClass* pclass = gROOT->GetClass(classname);
- if ( pclass == 0x0 )
- {
- Error("SetParticleClass","Can not get TClass for class named %s",classname);
- return;
- }
- SetParticleClass(pclass);
-}
-/**************************************************************************/
-
-void AliAOD::SetParticleClass(TClass* pclass)
-{
-//Sets type of particle that is going to be stored
-
- if ( pclass == 0x0 )
- {
- Error("SetParticleClass","Parameter is NULL.");
- return;
- }
-
- if ( pclass->InheritsFrom("AliVAODParticle") == kFALSE )
- {
- Error("SetParticleClass","Class named %s does not inherit from AliVAODParticle",pclass->GetName());
- return;
- }
- if (pclass != fParticleClass)
- {
- fParticleClass = pclass;
- if (fParticleClass) delete fParticles;
- fParticles = new TClonesArray(fParticleClass);
- }
-}
-/**************************************************************************/
-TClass* AliAOD::GetParticleClass()
-{
-//returns TClass of particle class
- if (fParticleClass) return fParticleClass;
-
- if (fParticles == 0x0) return 0x0;
-
- fParticleClass = fParticles->GetClass();
- return fParticleClass;
-}
-
-/**************************************************************************/
-
-void AliAOD::AddParticle(TParticle* part, Int_t idx)
-{
- //Adds TParticle to event
- if (part == 0x0)
- {
- Error("AddParticle(TParticle*,Int_t)","pointer to particle is NULL");
- return;
- }
-
- if (fParticles == 0x0) SetParticleClassName("AliAODParticle");
- AddParticle( new AliAODParticle(*part,idx) );
-}
-/**************************************************************************/
-
-void AliAOD::AddParticle(AliVAODParticle* particle)
-{
- //add particle to AOD
- //MAKES ITS OWN COPY OF THE PARTICLE!!! (AOD is not going to keep and delete input pointer)
-
- if (fParticles == 0x0) SetParticleClassName("AliAODParticle");
-
- Int_t idx = fParticles->GetLast() + 1;
- TClonesArray& arr = *fParticles;
-
- TClass* partclass = GetParticleClass();
- if (partclass == 0x0)
- {
- Error("AddParticle(AliVAODParticle*)","Can not get particle class");
- return;
- }
-
- AliVAODParticle* pp = (AliVAODParticle*)partclass->New(arr[idx]);
- pp->operator=(*particle);
-
-}
-/**************************************************************************/
-
-void AliAOD::AddParticle(Int_t pdg, Int_t idx,
- Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time)
-{
- //adds particle to event (standard AOD class)
-
- if (fParticles == 0x0) SetParticleClassName("AliAODParticle");
-
- Int_t newpartidx = fParticles->GetLast() + 1;
- TClonesArray& arr = *fParticles;
-
- TClass* partclass = GetParticleClass();
- if (partclass == 0x0)
- {
- Error("AddParticle(Int_t,...)","Can not get particle class");
- return;
- }
-
- AliVAODParticle* p = (AliVAODParticle*)partclass->New(arr[newpartidx]);
-
- p->SetPdgCode(pdg);
- p->SetUID(idx);
- p->SetMomentum(px,py,pz,etot);
- p->SetProductionVertex(vx,vy,vz,time);
-
-}
-/**************************************************************************/
-
-void AliAOD::SwapParticles(Int_t i, Int_t j)
-{
-//swaps particles positions; used by AliHBTEvent::Blend
- if ( (i<0) || (i>=GetNumberOfParticles()) ) return;
- if ( (j<0) || (j>=GetNumberOfParticles()) ) return;
-
-
- TClass* partclass = GetParticleClass();
- if (partclass == 0x0)
- {
- Error("SwapParticles","Can not get particle class");
- return;
- }
-
- AliVAODParticle* tmpobj = (AliVAODParticle*)partclass->New();
- AliVAODParticle& tmp = *tmpobj;
- AliVAODParticle& first = *(GetParticle(i));
- AliVAODParticle& second = *(GetParticle(j));
-
- tmp = first;
- first = second;
- second = tmp;
- delete tmpobj;
-}
-/**************************************************************************/
-
-void AliAOD::Reset()
-{
- //deletes all particles from the event
- if (fParticles) fParticles->Clear("C");
-
- fIsRandomized = kFALSE;
-}
-/**************************************************************************/
-
-void AliAOD::GetPrimaryVertex(Double_t&x, Double_t&y, Double_t&z)
-{
-//returns positions of the primary vertex
- x = fPrimaryVertexX;
- y = fPrimaryVertexY;
- z = fPrimaryVertexZ;
-}
-/**************************************************************************/
-
-void AliAOD::SetPrimaryVertex(Double_t x, Double_t y, Double_t z)
-{
-//Sets positions of the primary vertex
- fPrimaryVertexX = x;
- fPrimaryVertexY = y;
- fPrimaryVertexZ = z;
-}
-/**************************************************************************/
-
-Int_t AliAOD::GetNumberOfCharged(Double_t etamin, Double_t etamax) const
-{
- //reurns number of charged particles within given pseudorapidity range
- Int_t n = 0;
- Int_t npart = GetNumberOfParticles();
- for (Int_t i = 0; i < npart; i++)
- {
- AliVAODParticle* p = GetParticle(i);
- Double_t eta = p->Eta();
- if ( (eta < etamin) || (eta > etamax) ) continue;
- if (p->Charge() != 0.0) n++;
- }
- return n;
-}
-/**************************************************************************/
-
-void AliAOD::Move(Double_t x, Double_t y, Double_t z)
-{
- //moves all spacial coordinates about this vector
- // vertex
- // track points
- // and whatever will be added to AOD and AOD particles that is a space coordinate
-
- fPrimaryVertexX += x;
- fPrimaryVertexY += y;
- fPrimaryVertexZ += z;
-
- Int_t npart = GetNumberOfParticles();
- for (Int_t i = 0; i < npart; i++)
- {
- AliVAODParticle* p = GetParticle(i);
- AliTrackPoints* tp = p->GetTPCTrackPoints();
- if (tp) tp->Move(x,y,z);
- tp = p->GetITSTrackPoints();
- if (tp) tp->Move(x,y,z);
- }
-}
-/**************************************************************************/
-
-void AliAOD::Print(const Option_t* /*option*/) const
-{
- //Prints AOD
- TString ts;
- TString msg("\n");
- msg+="Particle Class: ";
- if (fParticleClass)
- {
- msg+=fParticleClass->GetName();
- }
- else
- {
- msg+="Not specified yet";
- }
- msg += "\n";
- msg += "Vertex position X: ";
- msg += fPrimaryVertexX;
- msg += " Y:" ;
- msg += fPrimaryVertexY;
- msg += " Z:";
- msg += fPrimaryVertexZ;
- msg += "\n";
-
- msg += "Randomized: ";
- msg += fIsRandomized;
- msg += "\n";
-
- Info("Print","%s",msg.Data());
-
- Int_t npart = GetNumberOfParticles();
- Info("Print","Npart: %d",npart);
- for (Int_t i = 0; i < npart; i++)
- {
- Info("Print","Getting particle %d",i);
- AliVAODParticle* p = GetParticle(i);
- Info("Print","Printing particle %d, address %#x",i,p);
- p->Dump();
- p->Print();
- Info("Print","particle %d printed",i);
- }
-}
-
-void AliAOD::SetOwner(Bool_t /*owner*/)
-{
-//Sets the ownership of particles: if particles should be also deleted if AOD is deleted/reseted
-//Since fParticles is Clones and not Object Array, it is always the owner and this method does not have sense
-
- MayNotUse("SetOwner");
- //if fParticles->SetOwner(owner);
-
-}
+++ /dev/null
-#ifndef ALIAOD_H
-#define ALIAOD_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-/////////////////////////////////////////////////////////////
-//
-// base class for AOD containers
-//
-/////////////////////////////////////////////////////////////
-
-#include <TObject.h>
-#include <TClonesArray.h>
-#include "AliVAODParticle.h"
-
-class TParticle;
-
-class AliAOD: public TObject {
-public:
- AliAOD();
- virtual ~AliAOD();
-
- AliAOD(const AliAOD& in);
- virtual AliAOD& operator=(const AliAOD& in);
- virtual void CopyData(AliAOD* aod);//Copys all data from aod, but leaves local type of particles
-
- virtual TClonesArray* GetParticles() const {return fParticles;}
- virtual void SetParticleClassName(const char* classname);
- virtual void SetParticleClass(TClass* pclass);
-
- virtual Int_t GetNumberOfParticles() const {return (fParticles)?fParticles->GetEntriesFast():0;}
- virtual AliVAODParticle* GetParticle(Int_t index) const {return (fParticles)?(AliVAODParticle*)fParticles->At(index):0x0;}
- virtual void AddParticle(AliVAODParticle* particle);
- virtual void AddParticle(TParticle* part, Int_t idx); //adds particle to the event
- virtual void AddParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time);
-
- virtual void Reset();
-
- void SwapParticles(Int_t i, Int_t j);//swaps particles positions; used by AliReader::Blend
- Bool_t IsRandomized() const {return fIsRandomized;}
- void SetRandomized(Bool_t flag = kTRUE){fIsRandomized = flag;}
-
- void GetPrimaryVertex(Double_t&x, Double_t&y, Double_t&z);
- void SetPrimaryVertex(Double_t x, Double_t y, Double_t z);
-
- Int_t GetNumberOfCharged(Double_t etamin = -10.0, Double_t etamax = 10.0) const;
- void Move(Double_t x, Double_t y, Double_t z);//moves all spacial coordinates about this vector
- virtual void SetOwner(Bool_t owner);
- virtual void Print(const Option_t* /*option*/ = "") const;
- TClass* GetParticleClass();
-private:
- TClonesArray *fParticles; // array of AOD particles, AliAOD is owner of particles
- Bool_t fIsRandomized;//flag indicating if positions of particles were randomized - used by HBTAN
- Double_t fPrimaryVertexX;//X position of the primary vertex
- Double_t fPrimaryVertexY;//Y position of the primary vertex
- Double_t fPrimaryVertexZ;//Z position of the primary vertex
- TClass* fParticleClass;//!object that defines type of the particle
-
- ClassDef(AliAOD,1) // base class for AOD containers
-};
-
-#endif
+++ /dev/null
-#include "AliAODPair.h"
-//_________________________________________________________________________
-///////////////////////////////////////////////////////////////////////////
-//
-// class AliAODPair
-//
-// class implements pair of particles and taking care of caluclation (almost)
-// all of pair properties (Qinv, InvMass,...)
-//
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
-//
-////////////////////////////////////////////////////////////////////////////
-
-#include "AliVAODParticle.h"
-#include "AliTrackPoints.h"
-ClassImp(AliAODPair)
-
-/************************************************************************/
-AliAODPair::AliAODPair(Bool_t rev):
- fPart1(0x0),
- fPart2(0x0),
- fSwappedPair(0x0),
- fQSideLCMS(0.0),
- fQSideLCMSNotCalc(kTRUE),
- fQOutLCMS(0.0),
- fQOutLCMSNotCalc(kTRUE),
- fQLongLCMS(0.0),
- fQLongLCMSNotCalc(kTRUE),
- fQtLCMS(0.0),
- fQtLCMSNotCalc(kTRUE),
- fQt(0.0),
- fQtNotCalc(kTRUE),
- fQInv(0.0),
- fQInvNotCalc(kTRUE),
- fInvMass(0.0),
- fInvMassNotCalc(kTRUE),
- fKt(0.0),
- fKtNotCalc(kTRUE),
- fKStar(0.0),
- fKStarNotCalc(kTRUE),
- fKStarOut(0.0),
- fKStarSide(0.0),
- fKStarLong(0.0),
- fKStarCompNotCalc(kTRUE),
- fPInv(0.0),
- fQSide(0.0),
- fOut(0.0),
- fQLong(0.0),
- fMt(0.0),
- fMtNotCalc(kTRUE),
- fInvMassSqr(0.0),
- fMassSqrNotCalc(kTRUE),
- fQInvL(0.0),
- fQInvLNotCalc(kTRUE),
- fAvarageDistance(0.0),
- fAvarageDistanceNotCalc(kTRUE),
- fPxSum(0.0),
- fPySum(0.0),
- fPzSum(0.0),
- fESum(0.0),
- fSumsNotCalc(kTRUE),
- fPxDiff(0.0),
- fPyDiff(0.0),
- fPzDiff(0.0),
- fEDiff(0.0),
- fDiffsNotCalc(kTRUE),
- fGammaLCMS(0.0),
- fGammaLCMSNotCalc(kTRUE),
- fChanged(kTRUE)
- {
-//value of rev defines if it is Swapped
-//if you pass kTRUE swpaped pair will NOT be created
-//though you wont be able to get the swaped pair from this pair
-
- if(!rev) fSwappedPair = new AliAODPair(kTRUE); //if false create swaped pair
-
- }
-/************************************************************************/
-
-AliAODPair::AliAODPair(AliVAODParticle* part1, AliVAODParticle* part2, Bool_t rev):
- fPart1(part1),
- fPart2(part2),
- fSwappedPair(0x0),
- fQSideLCMS(0.0),
- fQSideLCMSNotCalc(kTRUE),
- fQOutLCMS(0.0),
- fQOutLCMSNotCalc(kTRUE),
- fQLongLCMS(0.0),
- fQLongLCMSNotCalc(kTRUE),
- fQtLCMS(0.0),
- fQtLCMSNotCalc(kTRUE),
- fQt(0.0),
- fQtNotCalc(kTRUE),
- fQInv(0.0),
- fQInvNotCalc(kTRUE),
- fInvMass(0.0),
- fInvMassNotCalc(kTRUE),
- fKt(0.0),
- fKtNotCalc(kTRUE),
- fKStar(0.0),
- fKStarNotCalc(kTRUE),
- fKStarOut(0.0),
- fKStarSide(0.0),
- fKStarLong(0.0),
- fKStarCompNotCalc(kTRUE),
- fPInv(0.0),
- fQSide(0.0),
- fOut(0.0),
- fQLong(0.0),
- fMt(0.0),
- fMtNotCalc(kTRUE),
- fInvMassSqr(0.0),
- fMassSqrNotCalc(kTRUE),
- fQInvL(0.0),
- fQInvLNotCalc(kTRUE),
- fAvarageDistance(0.0),
- fAvarageDistanceNotCalc(kTRUE),
- fPxSum(0.0),
- fPySum(0.0),
- fPzSum(0.0),
- fESum(0.0),
- fSumsNotCalc(kTRUE),
- fPxDiff(0.0),
- fPyDiff(0.0),
- fPzDiff(0.0),
- fEDiff(0.0),
- fDiffsNotCalc(kTRUE),
- fGammaLCMS(0.0),
- fGammaLCMSNotCalc(kTRUE),
- fChanged(kTRUE)
- {
-//value of rev defines if it is Swapped
-//if you pass kTRUE swpaped pair will NOT be created
-//though you wont be able to get the swaped pair from this pair
-
- if(!rev) fSwappedPair = new AliAODPair(part2,part1,kTRUE); //if false create swaped pair
-
- }
-/************************************************************************/
-AliAODPair::AliAODPair(const AliAODPair& in):
- TObject(in),
- fPart1(0x0),
- fPart2(0x0),
- fSwappedPair(0x0),
- fQSideLCMS(0.0),
- fQSideLCMSNotCalc(kTRUE),
- fQOutLCMS(0.0),
- fQOutLCMSNotCalc(kTRUE),
- fQLongLCMS(0.0),
- fQLongLCMSNotCalc(kTRUE),
- fQtLCMS(0.0),
- fQtLCMSNotCalc(kTRUE),
- fQt(0.0),
- fQtNotCalc(kTRUE),
- fQInv(0.0),
- fQInvNotCalc(kTRUE),
- fInvMass(0.0),
- fInvMassNotCalc(kTRUE),
- fKt(0.0),
- fKtNotCalc(kTRUE),
- fKStar(0.0),
- fKStarNotCalc(kTRUE),
- fKStarOut(0.0),
- fKStarSide(0.0),
- fKStarLong(0.0),
- fKStarCompNotCalc(kTRUE),
- fPInv(0.0),
- fQSide(0.0),
- fOut(0.0),
- fQLong(0.0),
- fMt(0.0),
- fMtNotCalc(kTRUE),
- fInvMassSqr(0.0),
- fMassSqrNotCalc(kTRUE),
- fQInvL(0.0),
- fQInvLNotCalc(kTRUE),
- fAvarageDistance(0.0),
- fAvarageDistanceNotCalc(kTRUE),
- fPxSum(0.0),
- fPySum(0.0),
- fPzSum(0.0),
- fESum(0.0),
- fSumsNotCalc(kTRUE),
- fPxDiff(0.0),
- fPyDiff(0.0),
- fPzDiff(0.0),
- fEDiff(0.0),
- fDiffsNotCalc(kTRUE),
- fGammaLCMS(0.0),
- fGammaLCMSNotCalc(kTRUE),
- fChanged(kTRUE)
-{
- //cpy constructor
- in.Copy(*this);
-}
-/************************************************************************/
-
-AliAODPair& AliAODPair::operator=(const AliAODPair& in)
-{
- //Assigment operator
- in.Copy(*this);
- return *this;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetInvMass()
-{
-//Returns qinv value for a pair
- if(fInvMassNotCalc)
- {
- CalculateInvMassSqr(); //method is inline so we not waste th time for jumping into method
-
- if(fInvMassSqr<0) fInvMass = TMath::Sqrt(-fInvMassSqr);
- else fInvMass = TMath::Sqrt(fInvMassSqr);
-
- fInvMassNotCalc = kFALSE;
- }
- return fInvMass;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetQSideLCMS()
-{
-//return Q Side in Central Of Mass System in Longitudialy Comoving Frame
-
- if (fQSideLCMSNotCalc)
- {
- fQSideLCMS = (fPart1->Px()*fPart2->Py()-fPart2->Px()*fPart1->Py())/GetKt();
- fQSideLCMSNotCalc = kFALSE;
- }
- return fQSideLCMS;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetQOutLCMS()
-{
- //caculates Qout in Center Of Mass Longitudionally Co-Moving
- if(fQOutLCMSNotCalc)
- {
- CalculateSums();
- CalculateDiffs();
-
- if (fPart1->Mass() != fPart2->Mass())
- {
-/*
- //STAR algorithm
- Double_t beta = fPzSum/fESum;
- Double_t gamma = GetGammaToLCMS();
- Double_t el = gamma * (fPart1->E() - beta * fPart1->Pz());
- Double_t x = ( fPart1->Px()*fPxSum + fPart1->Py()*fPySum) / ( 2.0*GetKt() );
- beta = 2.0*GetKt()/GetMt();
- gamma = GetMt()/GetQInv();
- fQOutLCMS = gamma * (x - beta * el);
-*/
-
- //beta=fPzSum/fESum; // Longit. V == beta
- Double_t beta=fPzSum/fESum;
- Double_t gamma = GetGammaToLCMS();
-
- Double_t cosphi=fPxSum/(2.0*GetKt()); // cos(phi)
- Double_t sinphi=fPySum/(2.0*GetKt()); // sin(phi)
-
-// ROTATE(part1Px,part1Py,SPHI,CPHI,part1Px,part1Py);//ROT8
-// ROTATE(part2Px,part2Py,SPHI,CPHI,part2Px,part2Py);//ROT8
- Double_t tmp;
- tmp = fPart1->Px()*cosphi + fPart1->Py()*sinphi;
- Double_t part1Py = fPart1->Py()*cosphi - fPart1->Px()*sinphi;
- Double_t part1Px = tmp;
-
- tmp = fPart2->Px()*cosphi + fPart2->Py()*sinphi;
- Double_t part2Py = fPart2->Py()*cosphi - fPart2->Px()*sinphi;
- Double_t part2Px = tmp;
-
-
-// LTR(part1Pz,E1,beta,GetGammaToLCMS(),part1Pz,E1a);
-// LTR(part2Pz,E2,beta,GetGammaToLCMS(),part2Pz,E2a);
- Double_t part1Pz=gamma*(fPart1->Pz()-beta*fPart1->E());
- Double_t part2Pz=gamma*(fPart2->Pz()-beta*fPart2->E());
-
- Double_t part1P2=part1Px*part1Px+part1Py*part1Py+part1Pz*part1Pz;
- Double_t part2P2=part2Px*part2Px+part2Py*part2Py+part2Pz*part2Pz;
- Double_t part1E=TMath::Sqrt(fPart1->Mass()*fPart1->Mass()+part1P2);
- Double_t part2E=TMath::Sqrt(fPart2->Mass()*fPart2->Mass()+part2P2);
- Double_t sumE=part1E+part2E;
- Double_t sumPx=part1Px+part2Px;
- Double_t sumPy=part1Py+part2Py;
- Double_t sumPZ=part1Pz+part2Pz;
- Double_t sumP2=sumPx*sumPx+sumPy*sumPy+sumPZ*sumPZ;
-
- Double_t relmass=TMath::Sqrt(sumE*sumE-sumP2);
- Double_t hf = (fPart1->Mass()*fPart1->Mass() - fPart2->Mass()*fPart2->Mass())/(relmass*relmass);
- fQOutLCMS=(part1Px-part2Px);//== id
- fQOutLCMS=fQOutLCMS-sumPx*hf; //sumPx == fPxSum ale po rotacji i transf
- }
- else
- {
- Double_t k2 = fPxSum*fPxDiff+fPySum*fPyDiff;
- fQOutLCMS = 0.5*k2/GetKt();
- // if (non-id) fQOutLCMS=fQOutLCMS - sumPx*HF;
- }
-
-
- fQOutLCMSNotCalc = kFALSE;
- }
- return fQOutLCMS;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetQLongLCMS()
-{
- //return Q Long in Central Of Mass System in Longitudialy Comoving Frame
- if (fQLongLCMSNotCalc)
- {
- CalculateSums();
- CalculateDiffs();
- Double_t beta = fPzSum/fESum;
- fQLongLCMS = GetGammaToLCMS() * ( fPzDiff - beta*fEDiff );
- fQLongLCMSNotCalc = kFALSE;
- }
- return fQLongLCMS;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetQtLCMS()
-{
- //returns Q transverse CMS longitudionally co-moving
- if (fQtLCMSNotCalc)
- {
- fQtLCMS = TMath::Hypot(GetQOutLCMS(),GetQSideLCMS());
- fQtLCMSNotCalc = kFALSE;
- }
- return fQtLCMS;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetQt()
-{
- //returns Q transverse CMS longitudionally co-moving
- if (fQtNotCalc)
- {
- CalculateSums();
- CalculateDiffs();
-
- Double_t dotprod = fPxSum*fPxDiff + fPySum*fPyDiff + fPzSum*fPzDiff;
- Double_t klen = fPxSum*fPxSum + fPySum*fPySum + fPzSum*fPzSum;
- klen = TMath::Sqrt(klen);
- Double_t qlen = fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff;
- qlen = TMath::Sqrt(qlen);
- Double_t tmp = klen*qlen;
- if (tmp == 0.0)
- {
- fQt = 10e5;
- fQtNotCalc = kFALSE;
- return fQt;
- }
- Double_t cosopenangle = dotprod/tmp;
- Double_t sinopenangle = TMath::Sqrt(1.0 - cosopenangle*cosopenangle);
-
- fQt = sinopenangle*qlen;
- fQtNotCalc = kFALSE;
- }
- return fQt;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetKt()
-{
- //calculates the evarage momentum of the pair
- if(fKtNotCalc)
- {
- CalculateSums();
- fKt = 0.5*TMath::Hypot(fPxSum,fPySum);
- fKtNotCalc = kFALSE;
- }
- return fKt;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetKStar()
-{
- //calculates invariant velocity difference
- if (fKStarNotCalc)
- {
- CalculateSums();
-
- Double_t ptrans = fPxSum*fPxSum + fPySum*fPySum;
- Double_t mtrans = fESum*fESum - fPzSum*fPzSum;
- if (ptrans > mtrans)
- {
- Error("GetKStar","Tranverse momentum bigger than transverse mass. Not normal for on-shell particles");
- Error("GetKStar","Particle1:");
- fPart1->Print();
- Error("GetKStar","Particle2:");
- fPart2->Print();
- Error("GetKStar","");
-
- fKStar = 10e5;
- fKStarNotCalc = kFALSE;
- return fKStar;
- }
- Double_t pinv = TMath::Sqrt(mtrans - ptrans);
-
- Double_t q = (fPart1->Mass()*fPart1->Mass() - fPart2->Mass()*fPart2->Mass())/pinv;
-
- CalculateQInvL();
-
- q = q*q - fQInvL;
- if ( q < 0)
- {
- Info("GetKStar","Sqrt of negative number q = %f",q);
- Error("GetKStar","Particle1:");
- fPart1->Print();
- Error("GetKStar","Particle2:");
- fPart2->Print();
- fKStar = 10e5;
- fKStarNotCalc = kFALSE;
- return fKStar;
- }
-
- q = TMath::Sqrt(q);
- fKStar = q/2.;
- fKStarNotCalc = kFALSE;
- }
- return fKStar;
-}
-/************************************************************************/
-Double_t AliAODPair::GetKStarOut()
-{
- CalculateKStarComp();
- return fKStarOut;
-}
-/************************************************************************/
-Double_t AliAODPair::GetKStarSide()
-{
- CalculateKStarComp();
- return fKStarSide;
-}
-/************************************************************************/
-Double_t AliAODPair::GetKStarLong()
-{
- CalculateKStarComp();
- return fKStarLong;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetQInv()
-{
-//returns Qinv
-//warning for non-id particles you want to use 2*KStar
- if(fQInvNotCalc)
- {
- CalculateQInvL();
- fQInv = TMath::Sqrt(TMath::Abs(fQInvL));
- fQInvNotCalc = kFALSE;
- }
- return fQInv;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetGammaToLCMS()
-{
- //calculates gamma factor of the boost to LCMS
- if(fGammaLCMSNotCalc)
- {
- CalculateSums();
- Double_t beta = fPzSum/fESum;
- fGammaLCMS = 1.0/TMath::Sqrt(1.0 - beta*beta);
- fGammaLCMSNotCalc = kFALSE;
- }
- return fGammaLCMS;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetGammaToTransverse()
-{
- //calculates gamma factor of the boost to LCMS
- Double_t beta = 2.0*GetKt() / GetMt();
- Double_t gamma = 1.0/TMath::Sqrt(1.0 - beta*beta);
-
- return gamma;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetMt()
-{
- //Calculates transverse mass of the pair
- if (fMtNotCalc)
- {
- CalculateSums();
- fMt = TMath::Sqrt(fESum*fESum - fPzSum*fPzSum);
- fMtNotCalc = kFALSE;
- }
- return fMt;
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetAvarageDistance()
-{
-//returns and buffers avarage distance between two tracks calculated
-// out of track points (see AliAODTrackPoints class)
-
- if (fAvarageDistanceNotCalc)
- {
- fAvarageDistance = AvDistance();
- fAvarageDistanceNotCalc = kFALSE;
- }
- return fAvarageDistance;
-}
-/************************************************************************/
-
-Double_t AliAODPair::AvDistance()
-{
- //returns avarage distance between two tracks in range
- //as defined in Track-Points of AliVAODParticle
- //returns negative value if error uccured f.g. tracks do not have track-points
- AliTrackPoints* tpts1 = fPart1->GetTPCTrackPoints();
- if ( tpts1 == 0x0)
- {//it could be simulated pair
-// Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
- return -1.0;
- }
-
- AliTrackPoints* tpts2 = fPart2->GetTPCTrackPoints();
- if ( tpts2 == 0x0)
- {
-// Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
- return -1.0;
- }
-
- return tpts1->AvarageDistance(*tpts2);
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetR()
-{
-//Returns distance between particles vertexes in thir CMS
-
- CalculateDiffs();
-
- Double_t vxDiff = fPart1->Vx() - fPart2->Vx();
- Double_t vyDiff = fPart1->Vy() - fPart2->Vy();
- Double_t vzDiff = fPart1->Vz() - fPart2->Vz();
-
- Double_t r = TMath::Sqrt( vxDiff*vxDiff + vyDiff*vyDiff + vzDiff*vzDiff );
- return r;
-
-}
-/************************************************************************/
-
-Double_t AliAODPair::GetRStar()
-{
-//Returns distance between particles vertexes in thir CMS
-
-
- CalculateSums();
-
- Double_t klen = fPxSum*fPxSum + fPySum*fPySum + fPzSum*fPzSum;
- klen = TMath::Sqrt(klen);
-
- Double_t aBeta = klen/fESum;
- Double_t aGamma = 1.0/TMath::Sqrt(1.0 - aBeta*aBeta);
-
-
- Double_t alpha = -TMath::ATan2(fPySum,fPzSum);
- Double_t beta = TMath::ATan2(fPxSum,TMath::Hypot(fPySum,fPzSum));
-
- Double_t sinalpha = TMath::Sin(alpha);
- Double_t cosalpha = TMath::Cos(alpha);
- Double_t sinbeta = TMath::Sin(beta);
- Double_t cosbeta = TMath::Cos(beta);
-
- Double_t v1xP = fPart1->Vx();
- Double_t v2xP = fPart2->Vx();
- Double_t v1yP = fPart1->Vy()*cosalpha + fPart1->Vz()*sinalpha;
- Double_t v2yP = fPart2->Vy()*cosalpha + fPart2->Vz()*sinalpha;
- Double_t v1zP =-fPart1->Vy()*sinalpha + fPart1->Vz()*cosalpha;
- Double_t v2zP =-fPart2->Vy()*sinalpha + fPart2->Vz()*cosalpha;
-
-
-///////////////////////////////////////////////////
-
-// Double_t p1yP = fPart1->Py()*cosalpha + fPart1->Pz()*sinalpha;
-// Double_t p2yP = fPart2->Py()*cosalpha + fPart2->Pz()*sinalpha;
-//
-// Double_t p1zP =-fPart1->Py()*sinalpha + fPart1->Pz()*cosalpha;
-// Double_t p2zP =-fPart2->Py()*sinalpha + fPart2->Pz()*cosalpha;
-//
-//
-// Double_t p1x = fPart1->Px()*cosbeta - p1zP*sinbeta;
-// Double_t p2x = fPart2->Px()*cosbeta - p2zP*sinbeta;
-// Double_t p1z = fPart1->Px()*sinbeta + p1zP*cosbeta;
-// Double_t p2z = fPart2->Px()*sinbeta + p2zP*cosbeta;
-
-// Info("","%f %f %f",p1yP,p2yP,p1yP+p2yP);
-// Info("","%f %f %f",p1x,p2x,p1x+p2x);
-
-// Info("","%f %f ",p1x+p2x,p1yP+p2yP);
-
-///////////////////////////////////////////////////
-
-
- Double_t v1x = v1xP*cosbeta - v1zP*sinbeta;
- Double_t v2x = v2xP*cosbeta - v2zP*sinbeta;
- Double_t v1y = v1yP;
- Double_t v2y = v2yP;
- Double_t v1z = v1xP*sinbeta + v1zP*cosbeta;
- Double_t v2z = v2xP*sinbeta + v2zP*cosbeta;
-
-
- Double_t v1zB=aGamma*(v1z-aBeta*fPart1->T());
- Double_t v2zB=aGamma*(v2z-aBeta*fPart2->T());
-
-
-
- Double_t dx = v1x - v2x;
- Double_t dy = v1y - v2y;
- Double_t dz = v1zB - v2zB;
-
- Double_t rstar = TMath::Sqrt( dx*dx + dy*dy + dz*dz);
-
- return rstar;
-}
-/************************************************************************/
-
-void AliAODPair::MirrorSecond()
-{
-//makes local copy of the second particle and mirrors their momenta
-//for its deletion is responsible who calls this method
- fPart2 = (AliVAODParticle*)fPart2->Clone();
- fPart2->SetMomentum(-fPart2->Px(),-fPart2->Py(),-fPart2->Pz(),fPart2->E());
- Changed();
-}
-/************************************************************************/
-
-void AliAODPair::DeleteSecond()
-{
-//Deletes second particle
- delete fPart2;
- fPart2 = 0x0;
-}
-
-void AliAODPair::Print()
-{
- if (fPart1) fPart1->Print();
- if (fPart2) fPart2->Print();
-
- Info("Print","GetKStar() %f",GetKStar());
- Info("Print","GetKt() %f",GetKt() );
- Info("Print","QInv %f", GetQInv() );
- Info("Print","GetQOutLCMS() %f",GetQOutLCMS() );
- Info("Print","GetQSideLCMS %f",GetQSideLCMS() );
- Info("Print","GetQLongLCMS() %f", GetQLongLCMS());
- Info("Print","GetDeltaTheta() %f", GetDeltaTheta());
- Info("Print","GetDeltaPhi() %f", GetDeltaPhi());
-
-
-}
+++ /dev/null
-#ifndef AliAODPair_H
-#define AliAODPair_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-//_________________________________________________________________________
-///////////////////////////////////////////////////////////////////////////
-//
-// class AliAODPair
-//
-// class implements pair of particles and taking care of caluclation (almost)
-// all of pair properties (Qinv, InvMass,...)
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
-//
-////////////////////////////////////////////////////////////////////////////
-
-#include <TMath.h>
-#include <TObject.h>
-
-#include "AliVAODParticle.h"
-
-class AliAODPair: public TObject
-{
- public:
- AliAODPair(Bool_t rev = kFALSE); //contructor
- AliAODPair(AliVAODParticle* part1, AliVAODParticle* part2, Bool_t rev = kFALSE); //contructor
- AliAODPair(const AliAODPair& in);
-
- virtual ~AliAODPair(){}
-
- AliAODPair& operator=(const AliAODPair& in);
-
- void SetParticles(AliVAODParticle* p1,AliVAODParticle* p2); //sets particles in the pair
- AliAODPair* GetSwappedPair() {return fSwappedPair;} //returns pair with swapped particles
-
- AliVAODParticle* Particle1() const {return fPart1;} //returns pointer to first particle
- AliVAODParticle* Particle2() const {return fPart2;} //returns pointer to decond particle
-
- virtual void Changed();
- //Center Mass System - Longitudinally Comoving
-
- virtual Double_t GetInvMass(); //returns invariant mass of the pair
- virtual Double_t GetMt();
- virtual Double_t GetQInv(); //returns Q invariant
- virtual Double_t GetQSideLCMS(); //returns Q Side CMS longitudionally co-moving
- virtual Double_t GetQOutLCMS(); //returns Q out CMS longitudionally co-moving
- virtual Double_t GetQLongLCMS(); //returns Q Long CMS longitudionally co-moving
- virtual Double_t GetQtLCMS(); //returns Q transverse CMS longitudionally co-moving
-
- virtual Double_t GetQt(); //returns Q transverse to Kt
-
-
- virtual Double_t GetKt(); //returns K transverse
- virtual Double_t GetKStar();
- virtual Double_t GetKStarOut(); //z.ch.
- virtual Double_t GetKStarSide(); //z.ch.
- virtual Double_t GetKStarLong(); //z.ch.
-
-
- virtual Double_t GetAvarageDistance();//returns avarage distnace between two tracks
-
- virtual Double_t GetDeltaE(); //return difference of Energies
- virtual Double_t GetDeltaP(); //return difference of momenta (scalar difference)
- virtual Double_t GetDeltaPvector(); //return legth of difference vector of momenta
- virtual Double_t GetDeltaPt();
- virtual Double_t GetDeltaPx();
- virtual Double_t GetDeltaPy();
- virtual Double_t GetDeltaPz();
-
- virtual Double_t GetDeltaTheta();
- virtual Double_t GetDeltaPhi();
-
- virtual Double_t GetGammaToLCMS();
- virtual Double_t GetGammaToTransverse();
- virtual Double_t GetPIDProb() const {return fPart1->GetPidProb()*fPart2->GetPidProb();}
-
- virtual Double_t GetRStar() ;
- virtual Double_t GetR() ;//returns distance between particle production points
-
- void MirrorSecond();
- void DeleteSecond();
-
- void Print(const Option_t* option ) const {TObject::Print(option);}
- void Print() ;
-
- protected:
- AliVAODParticle* fPart1; //pointer to first particle
- AliVAODParticle* fPart2; //pointer to second particle
-
- AliAODPair* fSwappedPair; //pointer to swapped pair
-
-/************************************************************/
-/************CMS (LC) Q's *********************************/
-/************************************************************/
- //Center Mass System - Longitudinally Comoving
-
- Double_t fQSideLCMS; //value of Q side CMS longitudially co-moving
- Bool_t fQSideLCMSNotCalc; //flag indicating if fQSideLCMS is already calculated for this pair
-
- Double_t fQOutLCMS; //value of Q out CMS longitudially co-moving
- Bool_t fQOutLCMSNotCalc;//flag indicating if fQOutLCMS is already calculated for this pair
-
- Double_t fQLongLCMS; //value of Q long CMS longitudially co-moving
- Bool_t fQLongLCMSNotCalc;//flag indicating if fQLongLCMS is already calculated for this pair
-
- Double_t fQtLCMS; //value of Qt CMS longitudially co-moving (hypot(qsidelcms,qoutlcms))
- Bool_t fQtLCMSNotCalc;//flag indicating if fQLongLCMS is already calculated for this pair
-
- Double_t fQt; //value of Qt, projection of 3-mom diff to Kt
- Bool_t fQtNotCalc;//flag indicating if fQt is already calculated for this pair
-
-/************************************************************/
-/************************************************************/
- Double_t fQInv; //half of differnece of 4-momenta
- Bool_t fQInvNotCalc;//flag indicating if fQInv is already calculated for this pair
-
- Double_t fInvMass; //invariant mass
- Bool_t fInvMassNotCalc;//flag indicating if fInvMass is already calculated for this pair
-
- Double_t fKt; //K == sum vector of particle's momenta. Kt transverse component
- Bool_t fKtNotCalc;//flag indicating if fKt is already calculated for this pair
-
- Double_t fKStar; // KStar
- Bool_t fKStarNotCalc;// flag indicating if fKStar is calculated
- Double_t fKStarOut; // KStarOut z.ch.
- Double_t fKStarSide;// KStarSide z.ch.
- Double_t fKStarLong;// KStarLong z.ch.
-
- Bool_t fKStarCompNotCalc; // flag indicating if CalcuteKStarComp() is calculated z.ch.
-
- Double_t fPInv; //invariant momentum
-
- Double_t fQSide; //Q Side
- Double_t fOut;//Q Out
- Double_t fQLong;//Q Long
-
- Double_t fMt;//Transverse coordinate of Inv. Mass
- Bool_t fMtNotCalc;//flag indicating if Mt is calculated for current pair
-
- Double_t fInvMassSqr;//squre of invariant mass
- Bool_t fMassSqrNotCalc; //flag indicating if fInvMassSqr for this pair
- void CalculateInvMassSqr();
-
- Double_t fQInvL; //Qinv in longitudional direction
- Bool_t fQInvLNotCalc;//flag indicating if fQInvL is calculated for current pair
- void CalculateQInvL();
-
- Double_t fAvarageDistance;//value of the avarage distance calculated out of track points
- Bool_t fAvarageDistanceNotCalc;//flag indicating if the avarage distance is calculated
-
- Double_t fPxSum;// Sum of Px momenta
- Double_t fPySum;// Sum of Py momenta
- Double_t fPzSum;// Sum of Pz momenta
- Double_t fESum;// Sum of energies
- Bool_t fSumsNotCalc;//flag indicating if fPxSum,fPxSum,fPxSum and fESum is calculated for current pair
- void CalculateSums();
- void CalculateKStarComp();
-
- Double_t fPxDiff;// Difference of Px momenta
- Double_t fPyDiff;// Difference of Px momenta
- Double_t fPzDiff;// Difference of Px momenta
- Double_t fEDiff;// Difference of Px momenta
- Bool_t fDiffsNotCalc;//flag indicating if fPxDiff,fPxDiff,fPxDiff and fEDiff is calculated for current pair
- void CalculateDiffs();
-
- Double_t fGammaLCMS;//gamma of boost in LCMS
- Bool_t fGammaLCMSNotCalc;//flag indicating if fGammaLCMS is calculated for current pair
- /***************************************************/
- Bool_t fChanged;//flag indicating if object has been changed
-
- void CalculateBase();
- Double_t AvDistance();
-
-
- private:
- ClassDef(AliAODPair,1)
-};
-/****************************************************************/
-inline
-void AliAODPair::SetParticles(AliVAODParticle* p1,AliVAODParticle* p2)
-{
- //sets the particle to the pair
-
- fPart1 = p1;
- fPart2 = p2;
- if (fSwappedPair) //if we have Swapped (so we are not)
- fSwappedPair->SetParticles(fPart2,p1); //set particles for him too
- Changed();
- //and do nothing until will be asked for
-}
-/****************************************************************/
-
-inline
-void AliAODPair::Changed()
-{
- // Resel all calculations (flags)
- fChanged = kTRUE;
- fSumsNotCalc = kTRUE;
- fDiffsNotCalc = kTRUE;
- fMassSqrNotCalc = kTRUE;
- fInvMassNotCalc = kTRUE;
- fQInvNotCalc = kTRUE;
- fMtNotCalc = kTRUE;
- fQSideLCMSNotCalc = kTRUE;
- fQOutLCMSNotCalc = kTRUE;
- fQLongLCMSNotCalc = kTRUE;
- fQtLCMSNotCalc = kTRUE;
- fQtNotCalc = kTRUE;
- fKtNotCalc = kTRUE;
- fKStarNotCalc = kTRUE;
- fKStarCompNotCalc = kTRUE;
- fQInvLNotCalc = kTRUE;
- fGammaLCMSNotCalc = kTRUE;
- fAvarageDistanceNotCalc = kTRUE;
-}
-/****************************************************************/
-inline
-void AliAODPair::CalculateInvMassSqr()
- {
- //calculates square of qinv
- if (fMassSqrNotCalc)
- {
- CalculateSums();
-
- Double_t fPart12s= (fPxSum*fPxSum) + (fPySum*fPySum) + (fPzSum*fPzSum);
-
- fInvMassSqr=fESum*fESum-fPart12s;
-
- fMassSqrNotCalc = kFALSE;
- }
- }
-/****************************************************************/
-inline
-void AliAODPair::CalculateQInvL()
- {
- //Calculates square root of Qinv
- if (fQInvLNotCalc)
- {
- CalculateDiffs();
- fQInvL = fEDiff*fEDiff - ( fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff );
- fQInvLNotCalc = kFALSE;
- }
- }
-/****************************************************************/
-inline
-void AliAODPair::CalculateSums()
- {
- //calculates momenta and energy sums
- if(fSumsNotCalc)
- {
- fPxSum = fPart1->Px()+fPart2->Px();
- fPySum = fPart1->Py()+fPart2->Py();
- fPzSum = fPart1->Pz()+fPart2->Pz();
- fESum = fPart1->E() + fPart2->E();
- fSumsNotCalc = kFALSE;
- }
- }
-/****************************************************************/
-inline
-void AliAODPair::CalculateKStarComp()
-{
-
- if (fKStarCompNotCalc)
- {
- CalculateSums();
-
- Double_t ptrans = fPxSum*fPxSum + fPySum*fPySum;
- Double_t mtrans = fESum*fESum - fPzSum*fPzSum;
- Double_t pinv = TMath::Sqrt(mtrans - ptrans);
- ptrans = TMath::Sqrt(ptrans);
- mtrans = TMath::Sqrt(mtrans);
-
- Double_t px1 = fPart1->Px();
- Double_t py1 = fPart1->Py();
- Double_t pz1 = fPart1->Pz();
- Double_t pE1 = fPart1->E();
-
- // boost to LCMS
- Double_t beta = fPzSum / fESum;
- Double_t gamma = fESum / mtrans;
-
- fKStarLong = gamma * (pz1 - beta * pE1);
- double temp = gamma * (pE1 - beta * pz1);
-
- // rotate in transverse plane
- fKStarSide = (-px1*fPySum + py1*fPxSum)/ptrans;
- fKStarOut = ( px1*fPxSum + py1*fPySum)/ptrans;
-
- // go from LCMS to CMS
- gamma = mtrans/pinv;
- beta = ptrans/mtrans;
- fKStarOut = gamma * (fKStarOut - beta * temp);
-
- fKStarCompNotCalc = kFALSE;
- }
-}
-
-/****************************************************************/
-inline
-void AliAODPair::CalculateDiffs()
- {
- //calculates momenta and energy differences
- if(fDiffsNotCalc)
- {
- fPxDiff = fPart1->Px()-fPart2->Px();
- fPyDiff = fPart1->Py()-fPart2->Py();
- fPzDiff = fPart1->Pz()-fPart2->Pz();
- fEDiff = fPart1->E() - fPart2->E();
- fDiffsNotCalc = kFALSE;
- }
- }
-
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaE()
-{
- //returns difference of energies
- return fPart1->E() - fPart2->E();
-}
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaP()
-{
- //returns difference of momenta (scalars)
- return fPart1->P() - fPart2->P();
-}
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaPvector() //return difference of momenta
-{
- //returns legth of the momenta difference vector
- CalculateDiffs();
- return TMath::Sqrt(fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff);
-}
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaPt()
- {
- //returns difference of Pz
- return fPart1->Pt()-fPart2->Pt();
- }
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaPx()
- {
- //returns difference of Pz
- CalculateDiffs();
- return fPxDiff;
- }
-/****************************************************************/
-inline
-Double_t AliAODPair::GetDeltaPy()
- {
- //returns difference of Py
- CalculateDiffs();
- return fPyDiff;
- }
-
-/****************************************************************/
-inline
-Double_t AliAODPair::GetDeltaPz()
- {
- //returns difference of Pz
- CalculateDiffs();
- return fPzDiff;
- }
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaPhi()
- {
- //returns difference of Phi
- Double_t phi1 = fPart1->Phi();
- Double_t phi2 = fPart2->Phi();
- Double_t diff = phi1-phi2;
- if (TMath::Abs(diff) > TMath::Pi())
- {
- if (phi1 > TMath::Pi())
- {
- phi1-=TMath::TwoPi();
- }
- else
- {
- phi2-=TMath::TwoPi();
- }
- diff = phi1-phi2;
- }
- return diff;
- }
-/****************************************************************/
-
-inline
-Double_t AliAODPair::GetDeltaTheta()
- {
- //returns difference of Theta
- return fPart1->Theta()-fPart2->Theta();
- }
-/****************************************************************/
-
-
-#endif
+++ /dev/null
-// Base class AliAODPairBaseCut:
-// This class defines the range of some property - pure virtual
-// Property is coded by AliAODCutTypes type
-// Derived classes:
-// AliAODQInvCut
-// AliAODKtCut
-// AliAODKStarCut
-// AliAODKStarOutCut
-// AliAODKStarSideCut
-// AliAODKStarLongCut
-// AliAODQSideLCMSCut
-// AliAODQOutLCMSCut
-// AliAODQLongLCMSCut
-// AliAODDeltaECut
-// AliAODDeltaPCut
-// AliAODDeltaPvectorCut
-// AliAODDeltaPhiCut
-// AliAODDeltaThetaCut
-// AliAODCluterOverlapCut
-// AliAODAvSeparationCut
-// AliAODSeparationCut
-// AliAODITSSeparationCut
-// AliAODOutSideSameSignCut
-// AliAODOutSideDiffSignCut
-// AliAODLogicalOperPairCut
-// AliAODOrPairCut
-// AliAODAndPairCut
-// Author: Piotr.Skowronski@cern.ch
-#include "AliAODPairBaseCut.h"
-
-#include "AliTrackPoints.h"
-#include "AliClusterMap.h"
-
-
-ClassImp(AliAODPairBaseCut)
-ClassImp(AliAODQInvCut)
-ClassImp(AliAODKtCut)
-ClassImp(AliAODQSideLCMSCut)
-ClassImp(AliAODQOutLCMSCut)
-ClassImp(AliAODQLongLCMSCut)
-ClassImp(AliAODDeltaECut)
-ClassImp(AliAODDeltaPCut)
-ClassImp(AliAODDeltaPvectorCut)
-ClassImp(AliAODDeltaPhiCut)
-ClassImp(AliAODDeltaThetaCut)
-
-/******************************************************************/
-ClassImp(AliAODAvSeparationCut)
-
-Double_t AliAODAvSeparationCut::GetValue(AliAODPair* pair) const
-{
- //chacks if avarage distance of two tracks is in given range
- AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
- if ( tpts1 == 0x0)
- {//it could be simulated pair
-// Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
- return -1.0;
- }
-
- AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
- if ( tpts2 == 0x0)
- {
-// Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
- return -1.0;
- }
-
- return tpts1->AvarageDistance(*tpts2);
-}
-/******************************************************************/
-ClassImp(AliAODSeparationCut)
-
-Double_t AliAODSeparationCut::GetValue(AliAODPair* pair) const
-{
- //chacks if avarage distance of two tracks is in given range
- AliTrackPoints* tpts1 = pair->Particle1()->GetTPCTrackPoints();
- if ( tpts1 == 0x0)
- {//it could be simulated pair
-// Warning("GetValue","Track 1 does not have Track Points. Pair NOT Passed.");
- return -1.0;
- }
-
- AliTrackPoints* tpts2 = pair->Particle2()->GetTPCTrackPoints();
- if ( tpts2 == 0x0)
- {
-// Warning("GetValue","Track 2 does not have Track Points. Pair NOT Passed.");
- return -1.0;
- }
- Float_t x1=0,y1=0,z1=0;
- Float_t x2=0,y2=0,z2=0;
-
- tpts1->PositionAt(fPoint,x1,y1,z1);
- tpts2->PositionAt(fPoint,x2,y2,z2);
- Double_t dx1 = x1 - x2;
- Double_t dy1 = y1 - y2;
- Double_t dz1 = z1 - z2;
- Double_t d = TMath::Sqrt(dx1*dx1 + dy1*dy1 + dz1*dz1);
- return d;
-}
-/******************************************************************/
-
-ClassImp(AliAODITSSeparationCut)
-
-Bool_t AliAODITSSeparationCut::Rejected(AliAODPair* pair) const
-{
- //Checks if two tracks do not cross first pixels too close to each other
- //If two tracks use the same cluster in pixels they are given
- //the same position what skews theta angles (both are the same)
- //These guys create artificial correlation in non-id analyses
- //which is positive for identical polar angles (Qlong=0)
- //and negative for a little bit different theta angle (Qlong=epsilon)
- //Such tracks "attracks" each other.
-
- AliTrackPoints* tpts1 = pair->Particle1()->GetITSTrackPoints();
- if ( tpts1 == 0x0)
- {//it could be simulated pair
- Warning("Pass","Track 1 does not have ITS Track Points. Pair NOT Passed.");
- return kTRUE;//reject
- }
-
- AliTrackPoints* tpts2 = pair->Particle2()->GetITSTrackPoints();
- if ( tpts2 == 0x0)
- {
- Warning("Pass","Track 2 does not have ITS Track Points. Pair NOT Passed.");
- return kTRUE;//reject
- }
- Float_t x1=0.0,y1=0.0,z1=0.0,x2=0.0,y2=0.0,z2=0.0;
- tpts1->PositionAt(fLayer,x1,y1,z1);
- tpts2->PositionAt(fLayer,x2,y2,z2);
-
-// Info("Pass","rphi %f z %f",fMin,fMax);
-// Info("Pass","P1: %f %f %f", x1,y1,z1);
-// Info("Pass","P2: %f %f %f", x2,y2,z2);
-
- Double_t dz = TMath::Abs(z1-z2);
-
- //fMax encodes treshold valaue of distance in Z
- if (dz > fMax) return kFALSE;//pair accepted
-
- Double_t drphi = TMath::Hypot(x1-x2,y1-y2);
-
- //fMin encodes treshold valaue of distance in r-phi
- if (drphi > fMin) return kFALSE;
-
- return kTRUE;//they are too close, rejected
-}
-/******************************************************************/
-
-ClassImp(AliAODCluterOverlapCut)
-
-Double_t AliAODCluterOverlapCut::GetValue(AliAODPair* pair) const
-{
- //Returns Cluter Overlap Factor
- //It ranges between -0.5 (in all padrows both tracks have cluters)
- // and 1 (in all padrows one track has cluter and second has not)
- // When Overlap Factor is 1 this pair of tracks in highly probable to be
- // splitted track: one particle that is recontructed twise
-
- AliClusterMap* cm1 = pair->Particle1()->GetClusterMap();
- if ( cm1 == 0x0)
- {
- Warning("GetValue","Track 1 does not have Cluster Map. Returning -0.5.");
- return -.5;
- }
-
- AliClusterMap* cm2 = pair->Particle2()->GetClusterMap();
- if ( cm2 == 0x0)
- {
- Warning("GetValue","Track 2 does not have Cluster Map. Returning -0.5.");
- return -.5;
- }
- return cm1->GetOverlapFactor(*cm2);
-}
-/******************************************************************/
-ClassImp(AliAODOutSideSameSignCut)
-
-Bool_t AliAODOutSideSameSignCut::Rejected(AliAODPair *p) const
-{
- //returns kTRUE if pair DO NOT meet cut criteria
-
- if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
- {
- return kFALSE;//accpeted
- }
-
- return kTRUE ;//rejected
-}
-/******************************************************************/
-ClassImp(AliAODOutSideDiffSignCut)
-
-Bool_t AliAODOutSideDiffSignCut::Rejected(AliAODPair *p) const
-{
- //returns kTRUE if pair DO NOT meet cut criteria
-
- if ( p->GetQOutLCMS()*p->GetQSideLCMS() > 0 )
- {
- return kTRUE;//rejected
- }
-
- return kFALSE;//accepted
-}
-/******************************************************************/
-ClassImp( AliAODLogicalOperPairCut )
-
-AliAODLogicalOperPairCut::AliAODLogicalOperPairCut():
- AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
- fFirst(new AliAODDummyBasePairCut),
- fSecond(new AliAODDummyBasePairCut)
-{
- //ctor
-}
-/******************************************************************/
-
-AliAODLogicalOperPairCut::AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):
- AliAODPairBaseCut(-10e10,10e10,kHbtPairCutPropNone),
- fFirst((first)?(AliAODPairBaseCut*)first->Clone():0x0),
- fSecond((second)?(AliAODPairBaseCut*)second->Clone():0x0)
-{
- //ctor
- //note that base cuts are copied, not just pointers assigned
- if ( (fFirst && fSecond) == kFALSE)
- {
- Fatal("AliAODLogicalOperPairCut","One of parameters is NULL!");
- }
-}
-/******************************************************************/
-
-AliAODLogicalOperPairCut::~AliAODLogicalOperPairCut()
-{
- //destructor
- delete fFirst;
- delete fSecond;
-}
-/******************************************************************/
-
-Bool_t AliAODLogicalOperPairCut::AliAODDummyBasePairCut::Rejected(AliAODPair* /*pair*/) const
-{
- //checks if particles passes properties defined by this cut
- Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly");
- return kFALSE;//accept
-}
-/******************************************************************/
-
-void AliAODLogicalOperPairCut::Streamer(TBuffer &b)
-{
- // Stream all objects in the array to or from the I/O buffer.
- UInt_t R__s, R__c;
- if (b.IsReading())
- {
- delete fFirst;
- delete fSecond;
- fFirst = 0x0;
- fSecond = 0x0;
-
- b.ReadVersion(&R__s, &R__c);
- TObject::Streamer(b);
- b >> fFirst;
- b >> fSecond;
- b.CheckByteCount(R__s, R__c,AliAODLogicalOperPairCut::IsA());
- }
- else
- {
- R__c = b.WriteVersion(AliAODLogicalOperPairCut::IsA(), kTRUE);
- TObject::Streamer(b);
- b << fFirst;
- b << fSecond;
- b.SetByteCount(R__c, kTRUE);
- }
-}
-
-/******************************************************************/
-ClassImp(AliAODOrPairCut)
-
-Bool_t AliAODOrPairCut::Rejected(AliAODPair * p) const
-{
- //returns true when rejected
- //AND operation is a little bit misleading but is correct
- //User wants to build logical cuts with natural (positive) logic
- //while ALIAN use inernally reverse (returns true when rejected)
- if (fFirst->Rejected(p) && fSecond->Rejected(p) ) return kTRUE;//rejected (both rejected, returned kTRUE)
- return kFALSE;//accepted, at least one accepted (returned kFALSE)
-}
-/******************************************************************/
-
-ClassImp(AliAODAndPairCut)
-
-Bool_t AliAODAndPairCut::Rejected(AliAODPair * p) const
-{
- //returns true when rejected
- //OR operation is a little bit misleading but is correct
- //User wants to build logical cuts with natural (positive) logic
- //while ALIAN use inernally reverse (returns true when rejected)
- if (fFirst->Rejected(p))
- {//first rejected - we reject
- return kTRUE;
- }
- else
- {//first accepted
- if (fSecond->Rejected(p))
- {//second rejected - we reject
- return kTRUE;
- }
- }
-// if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) )
-
- return kFALSE;//accepted (both accepted (returned kFALSE))
-}
-/******************************************************************/
+++ /dev/null
-#ifndef ALIAODPAIRBASECUT_H
-#define ALIAODPAIRBASECUT_H
-// Base class AliAODPairBaseCut:
-// This class defines the range of some property - pure virtual
-// Property is coded by AliAODCutTypes type
-// Derived classes:
-// AliAODQInvCut
-// AliAODKtCut
-// AliAODKStarCut
-// AliAODKStarOutCut
-// AliAODKStarSideCut
-// AliAODKStarLongCut
-// AliAODQSideLCMSCut
-// AliAODQOutLCMSCut
-// AliAODQLongLCMSCut
-// AliAODDeltaECut
-// AliAODDeltaPCut
-// AliAODDeltaPvectorCut
-// AliAODDeltaPhiCut
-// AliAODDeltaThetaCut
-// AliAODCluterOverlapCut
-// AliAODAvSeparationCut
-// AliAODSeparationCut
-// AliAODITSSeparationCut
-// AliAODOutSideSameSignCut
-// AliAODOutSideDiffSignCut
-// AliAODLogicalOperPairCut
-// AliAODOrPairCut
-// AliAODAndPairCut
-
-#include <TObject.h>
-#include "AliAODPair.h"
-
-
-class AliAODPairBaseCut: public TObject
-{
- public:
-
- enum EAODPairCutProperty
- {
- kHbtPairCutPropQInv, //Q invariant
- kHbtPairCutPropKt,
- kHbtPairCutPropKStar,
- kHbtPairCutPropKStarOut,
- kHbtPairCutPropKStarSide,
- kHbtPairCutPropKStarLong,
- kHbtPairCutPropQSideLCMS,
- kHbtPairCutPropQOutLCMS,
- kHbtPairCutPropQLongLCMS,
- kHbtPairCutPropDeltaPhi,
- kHbtPairCutPropDeltaTheta,
- kHbtPairCutPropDeltaE,
- kHbtPairCutPropDeltaP,//scalar difference
- kHbtPairCutPropDeltaPvector,//legth of the momenta difference vector
- kHbtPairCutPropDeltaPt,
- kHbtPairCutPropAvSepar,
- kHbtPairCutPropSepar,
- kHbtPairCutPropClOverlap,
- kHbtPairCutPropPixelSepar,
- kHbtPairCutPropNone
- };
-
- AliAODPairBaseCut(Double_t min = 0.0, Double_t max = 0.0, EAODPairCutProperty prop= kHbtPairCutPropNone):
- fMin(min),fMax(max),fProperty(prop){}
-
- virtual ~AliAODPairBaseCut(){}
-
- virtual Bool_t Rejected(AliAODPair* pair) const;
-
- void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
-
- void SetMinimum(Double_t min){fMin = min;}
- void SetMaximum(Double_t max){fMax = max;}
-
- Double_t GetMinimum() const {return fMin;}
- Double_t GetMaximum() const {return fMax;}
-
- EAODPairCutProperty GetProperty() const {return fProperty;}
-
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const = 0;
-
- Double_t fMin; // Lower boundary of the range
- Double_t fMax; // Upper boundary of the range
-
- EAODPairCutProperty fProperty; // The property itself
-
- ClassDef(AliAODPairBaseCut,1)
-
- };
-/******************************************************************/
-
-inline Bool_t AliAODPairBaseCut::Rejected(AliAODPair* pair) const
-{
- //checks if pair proprty is in range
- //null pointer check is made by AliAODPairCut, so here is unnecesary
-
- Double_t value = GetValue(pair);
- if ( (value > fMin) && (value <fMax ) ) return kFALSE; //accepted
- else return kTRUE; //rejected
-}
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-class AliAODQInvCut: public AliAODPairBaseCut
-{
- public:
- AliAODQInvCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropQInv){}
- virtual ~AliAODQInvCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetQInv();}
-
- ClassDef(AliAODQInvCut,1)
- };
-/******************************************************************/
-
-class AliAODKtCut: public AliAODPairBaseCut {
- public:
- AliAODKtCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKt){}
- virtual ~AliAODKtCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKt();}
-
- ClassDef(AliAODKtCut,1)
- };
-/******************************************************************/
-
-class AliAODKStarCut: public AliAODPairBaseCut
-{
- public:
- AliAODKStarCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKStar){}
- virtual ~AliAODKStarCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKStar();}
-
- ClassDef(AliAODKStarCut,1)
-};
-/******************************************************************/
-
-class AliAODKStarOutCut: public AliAODPairBaseCut
-{
- public:
- AliAODKStarOutCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKStarOut){}
- virtual ~AliAODKStarOutCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKStarOut();}
-
- ClassDef(AliAODKStarOutCut,1)
-};
-/******************************************************************/
-class AliAODKStarSideCut: public AliAODPairBaseCut
-{
- public:
- AliAODKStarSideCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKStarSide){}
- virtual ~AliAODKStarSideCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKStarSide();}
-
- ClassDef(AliAODKStarSideCut,1)
-};
-
-/******************************************************************/
-
-class AliAODKStarLongCut: public AliAODPairBaseCut
-{
- public:
- AliAODKStarLongCut(Double_t min = 0.0, Double_t max = 0.0):AliAODPairBaseCut(min,max,kHbtPairCutPropKStarLong){}
- virtual ~AliAODKStarLongCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const {return pair->GetKStarLong();}
-
- ClassDef(AliAODKStarLongCut,1)
-};
-/******************************************************************/
-
-class AliAODQSideLCMSCut: public AliAODPairBaseCut
-{
- public:
- AliAODQSideLCMSCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropQSideLCMS){}
- virtual ~AliAODQSideLCMSCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return pair->GetQSideLCMS();}
-
- ClassDef(AliAODQSideLCMSCut,1)
-};
-/******************************************************************/
-
-
-class AliAODQOutLCMSCut: public AliAODPairBaseCut
-{
- public:
- AliAODQOutLCMSCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropQOutLCMS){}
- virtual ~AliAODQOutLCMSCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return pair->GetQOutLCMS();}
-
- ClassDef(AliAODQOutLCMSCut,1)
-};
-/******************************************************************/
-
-class AliAODQLongLCMSCut: public AliAODPairBaseCut
-{
- public:
- AliAODQLongLCMSCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropQLongLCMS){}
- virtual ~AliAODQLongLCMSCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return pair->GetQLongLCMS();}
-
- ClassDef(AliAODQLongLCMSCut,1)
-};
-/******************************************************************/
-
-class AliAODDeltaECut: public AliAODPairBaseCut
-{
- public:
- AliAODDeltaECut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaE){}
- virtual ~AliAODDeltaECut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return pair->GetDeltaE();}
-
- ClassDef(AliAODDeltaECut,1)
-};
-/******************************************************************/
-
-class AliAODDeltaPCut: public AliAODPairBaseCut
-{
- public:
- AliAODDeltaPCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaP){}
- virtual ~AliAODDeltaPCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return pair->GetDeltaP();}
-
- ClassDef(AliAODDeltaPCut,1)
-};
-/******************************************************************/
-
-class AliAODDeltaPvectorCut: public AliAODPairBaseCut
-{
- public:
- AliAODDeltaPvectorCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaPvector){}
- virtual ~AliAODDeltaPvectorCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return pair->GetDeltaPvector();}
-
- ClassDef(AliAODDeltaPvectorCut,1)
-};
-/******************************************************************/
-
-class AliAODDeltaPhiCut: public AliAODPairBaseCut
-{
- public:
- AliAODDeltaPhiCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaPhi){}
- virtual ~AliAODDeltaPhiCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return TMath::Abs(pair->GetDeltaPhi());}
-
- ClassDef(AliAODDeltaPhiCut,1)
-};
-/******************************************************************/
-
-class AliAODDeltaThetaCut: public AliAODPairBaseCut
-{
- public:
- AliAODDeltaThetaCut(Double_t min = 0.0, Double_t max = 0.0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropDeltaTheta){}
- virtual ~AliAODDeltaThetaCut(){}
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const
- {return TMath::Abs(pair->GetDeltaTheta());}
-
- ClassDef(AliAODDeltaThetaCut,1)
-};
-/******************************************************************/
-
-class AliAODCluterOverlapCut: public AliAODPairBaseCut
-{
- public:
- AliAODCluterOverlapCut(Double_t min = 0.0, Double_t max = 1e5):
- AliAODPairBaseCut(min,max,kHbtPairCutPropClOverlap){}
- virtual ~AliAODCluterOverlapCut(){}
-
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const;
- ClassDef(AliAODCluterOverlapCut,1)
-};
-/******************************************************************/
-
-class AliAODAvSeparationCut: public AliAODPairBaseCut
-{
- public:
- AliAODAvSeparationCut(Double_t min = 0.0, Double_t max = 1e5):
- AliAODPairBaseCut(min,max,kHbtPairCutPropAvSepar){}
- virtual ~AliAODAvSeparationCut(){}
-
- protected:
- virtual Double_t GetValue(AliAODPair* pair) const;
- ClassDef(AliAODAvSeparationCut,1)
-};
-/******************************************************************/
-
-class AliAODSeparationCut: public AliAODPairBaseCut
-{
- public:
- AliAODSeparationCut(Double_t min = 0.0, Double_t max = 1e5, Int_t point = 0):
- AliAODPairBaseCut(min,max,kHbtPairCutPropSepar),fPoint(point){}
- virtual ~AliAODSeparationCut(){}
-
- protected:
- Int_t fPoint;//index of the point that distance should be measured
- virtual Double_t GetValue(AliAODPair* pair) const;
- ClassDef(AliAODSeparationCut,1)
-};
-/******************************************************************/
-
-class AliAODITSSeparationCut: public AliAODPairBaseCut
-{
-//Anti merging cut for the first layer of pixels
- public:
- AliAODITSSeparationCut(Int_t layer = 0, Double_t deltarphi = 0.01, Double_t deltaz = 0.08):
- AliAODPairBaseCut(deltarphi,deltaz,kHbtPairCutPropPixelSepar),fLayer(layer){}
- virtual ~AliAODITSSeparationCut(){}
- Bool_t Rejected(AliAODPair* pair) const;
- Int_t GetLayer() const {return fLayer;}
- protected:
- Int_t fLayer;//index of the layer that distance should be measured 0: 1st pixels
- virtual Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}//not used
- ClassDef(AliAODITSSeparationCut,1)
-};
-/******************************************************************/
-
-class AliAODOutSideSameSignCut: public AliAODPairBaseCut
-{
- public:
- AliAODOutSideSameSignCut(){}
- virtual ~AliAODOutSideSameSignCut(){}
- virtual Bool_t Rejected(AliAODPair *p) const;
- protected:
- virtual Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}
- ClassDef(AliAODOutSideSameSignCut,1)
-};
-/******************************************************************/
-
-class AliAODOutSideDiffSignCut: public AliAODPairBaseCut
-{
- public:
- AliAODOutSideDiffSignCut(){}
- virtual ~AliAODOutSideDiffSignCut(){}
- virtual Bool_t Rejected(AliAODPair *p) const;
- protected:
- virtual Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}
- ClassDef(AliAODOutSideDiffSignCut,1)
-};
-/******************************************************************/
-
-class AliAODLogicalOperPairCut: public AliAODPairBaseCut
- {
- public:
- AliAODLogicalOperPairCut();
- AliAODLogicalOperPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second);
- virtual ~AliAODLogicalOperPairCut();
- protected:
- Double_t GetValue(AliAODPair * /*pair*/) const {MayNotUse("GetValue");return 0.0;}
-
- AliAODPairBaseCut* fFirst; //second cut
- AliAODPairBaseCut* fSecond; //first cut
- private:
- AliAODLogicalOperPairCut(const AliAODLogicalOperPairCut & src);
- AliAODLogicalOperPairCut & operator=(const AliAODLogicalOperPairCut & src);
- class AliAODDummyBasePairCut: public AliAODPairBaseCut
- {
- Double_t GetValue(AliAODPair* /*pair*/) const {return 0.0;}
- Bool_t Rejected(AliAODPair* /*pair*/) const;
- };
-
- ClassDef(AliAODLogicalOperPairCut,1)
- };
-/******************************************************************/
-
-class AliAODOrPairCut: public AliAODLogicalOperPairCut
-{
- public:
- AliAODOrPairCut(){}
- AliAODOrPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):AliAODLogicalOperPairCut(first,second){}
- virtual ~AliAODOrPairCut(){}
- Bool_t Rejected(AliAODPair *p) const;
- ClassDef(AliAODOrPairCut,1)
-};
-/******************************************************************/
-
-class AliAODAndPairCut: public AliAODLogicalOperPairCut
-{
- public:
- AliAODAndPairCut(){}
- AliAODAndPairCut(AliAODPairBaseCut* first, AliAODPairBaseCut* second):AliAODLogicalOperPairCut(first,second){}
- virtual ~AliAODAndPairCut(){}
- Bool_t Rejected(AliAODPair *p) const;
- ClassDef(AliAODAndPairCut,1)
-};
-
-#endif
+++ /dev/null
-#include "AliAODPairCut.h"
-/* $Id$ */
-
-/////////////////////////////////////////////////////////////////////////
-//
-// Class AliAODPairCut:
-// implements cut on the pair of particles
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
-// Author: Piotr.Skowronski@cern.ch
-//-------------------------------------------------------------------
-
-#include "AliAODPair.h"
-#include "AliAODParticleCut.h"
-//#include "AliTrackPoints.h"
-//#include "AliClusterMap.h"
-
-ClassImp(AliAODPairCut)
-const Int_t AliAODPairCut::fgkMaxCuts = 50;
-/**********************************************************/
-
-AliAODPairCut::AliAODPairCut():
- fFirstPartCut(new AliAODParticleEmptyCut()), //empty cuts
- fSecondPartCut(new AliAODParticleEmptyCut()), //empty cuts
- fCuts(new AliAODPairBaseCut*[fgkMaxCuts]),
- fNCuts(0)
-{
- //constructor
-
- for (Int_t i = 0;i<fNCuts;i++)
- {
- fCuts[i] = 0x0;
- }
-}
-/**********************************************************/
-
-AliAODPairCut::AliAODPairCut(const AliAODPairCut& in):
- TNamed(in),
- fFirstPartCut((AliAODParticleCut*)in.fFirstPartCut->Clone()),
- fSecondPartCut((AliAODParticleCut*)in.fSecondPartCut->Clone()),
- fCuts(new AliAODPairBaseCut*[fgkMaxCuts]),
- fNCuts(in.fNCuts)
-{
- //copy constructor
-
-
- for (Int_t i = 0;i<fNCuts;i++)
- {
- fCuts[i] = (AliAODPairBaseCut*)in.fCuts[i]->Clone();//create new object (clone) and rember pointer to it
- }
-}
-/**********************************************************/
-
-AliAODPairCut& AliAODPairCut::operator=(const AliAODPairCut& in)
-{
- //assignment operator
- fCuts = new AliAODPairBaseCut*[fgkMaxCuts];
- fNCuts = in.fNCuts;
-
- fFirstPartCut = (AliAODParticleCut*)in.fFirstPartCut->Clone();
- fSecondPartCut = (AliAODParticleCut*)in.fSecondPartCut->Clone();
-
- for (Int_t i = 0;i<fNCuts;i++)
- {
- fCuts[i] = (AliAODPairBaseCut*)in.fCuts[i]->Clone();//create new object (clone) and rember pointer to it
- }
- return * this;
-}
-/**********************************************************/
-
-AliAODPairCut::~AliAODPairCut()
-{
- //destructor
- if (fFirstPartCut != fSecondPartCut)
- {
- delete fSecondPartCut;
- }
- delete fFirstPartCut;
- for (Int_t i = 0;i<fNCuts;i++)
- {
- delete fCuts[i];
- }
- delete []fCuts;
-}
-/**********************************************************/
-
-/**********************************************************/
-
-void AliAODPairCut::AddBasePairCut(AliAODPairBaseCut* basecut)
-{
- //adds the base pair cut (cut on one value)
-
- if (!basecut) return;
- if( fNCuts == (fgkMaxCuts-1) )
- {
- Warning("AddBasePairCut","Not enough place for another cut");
- return;
- }
- fCuts[fNCuts++]=basecut;
-}
-/**********************************************************/
-
-Bool_t AliAODPairCut::Rejected(AliAODPair* pair) const
-{
- //methods which checks if given pair meets all criteria of the cut
- //if it meets returns FALSE
- //if NOT returns TRUE
- if(!pair)
- {
- Warning("Pass","No Pasaran! We never accept NULL pointers");
- return kTRUE;
- }
-
- //check particle's cuts
- if( ( fFirstPartCut->Rejected( pair->Particle1()) ) ||
- ( fSecondPartCut->Rejected(pair->Particle2()) ) )
- {
- return kTRUE;
- }
- return PassPairProp(pair);
-}
-/**********************************************************/
-
-Bool_t AliAODPairCut::PassPairProp(AliAODPair* pair) const
-{
- //methods which checks if given pair meets all criteria of the cut
- //if it meets returns FALSE
- //if NOT returns TRUE
- //examine all base pair cuts
- for (Int_t i = 0;i<fNCuts;i++)
- {
- if ( (fCuts[i]->Rejected(pair)) ) return kTRUE; //if one of the cuts reject, then reject
- }
- return kFALSE;
-}
-/**********************************************************/
-
-void AliAODPairCut::Print()
-{
- //Prints the cut
- for (Int_t i = 0;i<fNCuts;i++)
- {
- fCuts[i]->Dump();
- }
-}
-/**********************************************************/
-
-void AliAODPairCut::SetFirstPartCut(AliAODParticleCut* cut)
-{
- // set cut for the first particle
- if(!cut)
- {
- Error("SetFirstPartCut","argument is NULL");
- return;
- }
- delete fFirstPartCut;
- fFirstPartCut = (AliAODParticleCut*)cut->Clone();
-
-}
-/**********************************************************/
-
-void AliAODPairCut::SetSecondPartCut(AliAODParticleCut* cut)
-{
- // set cut for the second particle
- if(!cut)
- {
- Error("SetSecondPartCut","argument is NULL");
- return;
- }
- delete fSecondPartCut;
- fSecondPartCut = (AliAODParticleCut*)cut->Clone();
-}
-/**********************************************************/
-
-void AliAODPairCut::SetPartCut(AliAODParticleCut* cut)
-{
- //sets the the same cut on both particles
- if(!cut)
- {
- Error("SetFirstPartCut","argument is NULL");
- return;
- }
- if (fFirstPartCut == fSecondPartCut) fSecondPartCut = 0x0;
-
- delete fFirstPartCut;
- fFirstPartCut = (AliAODParticleCut*)cut->Clone();
-
- delete fSecondPartCut; //even if null should not be harmful
- fSecondPartCut = fFirstPartCut;
-}
-/**********************************************************/
-
-void AliAODPairCut::SetQInvRange(Double_t min, Double_t max)
-{
- // set range of accepted invariant masses
- AliAODQInvCut* cut= (AliAODQInvCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropQInv);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODQInvCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetQOutLCMSRange(Double_t min, Double_t max)
-{
- // set range of accepted QOut in CMS
- AliAODQOutLCMSCut* cut= (AliAODQOutLCMSCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropQOutLCMS);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODQOutLCMSCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetQSideLCMSRange(Double_t min, Double_t max)
-{
- // set range of accepted QSide in CMS
- AliAODQSideLCMSCut* cut= (AliAODQSideLCMSCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropQSideLCMS);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODQSideLCMSCut(min,max);
-}
-
-/**********************************************************/
-
-void AliAODPairCut::SetQLongLCMSRange(Double_t min, Double_t max)
-{
- // set range of accepted QLong in CMS
- AliAODQLongLCMSCut* cut= (AliAODQLongLCMSCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropQLongLCMS);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODQLongLCMSCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetDeltaERange(Double_t min, Double_t max)
-{
- // set range of accepted DeltaE
- AliAODKtCut* cut= (AliAODKtCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropDeltaE);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODDeltaECut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetDeltaPRange(Double_t min, Double_t max)
-{
- // set range of accepted DeltaP
- AliAODKtCut* cut= (AliAODKtCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropDeltaP);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODDeltaPCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetKtRange(Double_t min, Double_t max)
-{
- // set range of accepted Kt (avarage transverse pair momentum)
- AliAODKtCut* cut= (AliAODKtCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropKt);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODKtCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetKStarRange(Double_t min, Double_t max)
-{
- // set range of accepted KStar (invariant pair momentum difference (fourvector))
- AliAODKStarCut* cut= (AliAODKStarCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropKStar);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODKStarCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetKStarOutRange(Double_t min, Double_t max)
-{
- // set range of accepted KStar (invariant pair momentum difference (fourvector))
- AliAODKStarOutCut* cut= (AliAODKStarOutCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropKStarOut);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODKStarOutCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetKStarSideRange(Double_t min, Double_t max)
-{
- // set range of accepted KStar (invariant pair momentum difference (fourvector))
- AliAODKStarSideCut* cut= (AliAODKStarSideCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropKStarSide);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODKStarSideCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetKStarLongRange(Double_t min, Double_t max)
-{
- // set range of accepted KStar (invariant pair momentum difference (fourvector))
- AliAODKStarLongCut* cut= (AliAODKStarLongCut*)FindCut(AliAODPairBaseCut::kHbtPairCutPropKStarLong);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODKStarLongCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetAvSeparationRange(Double_t min, Double_t max)
-{
- //sets avarage separation cut ->Anti-Merging cut
- AliAODPairBaseCut* cut= FindCut(AliAODPairBaseCut::kHbtPairCutPropAvSepar);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODAvSeparationCut(min,max);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetITSSeparation(Int_t layer, Double_t drphi, Double_t dz)
-{
- //Anti-Merging Cut for first pixel layer
- AliAODITSSeparationCut* cut= dynamic_cast<AliAODITSSeparationCut*>(FindCut(AliAODPairBaseCut::kHbtPairCutPropPixelSepar));
- if(cut)
- {
- if (layer == cut->GetLayer())
- {
- cut->SetRange(drphi,dz);//In this cut fMin is drphi, and fMax dz
- return;
- }
- }
- fCuts[fNCuts++] = new AliAODITSSeparationCut(layer,drphi,dz);
-// Info("SetITSSeparation","Added %d at address %#x",fNCuts-1,fCuts[fNCuts-1]);
-}
-/**********************************************************/
-
-void AliAODPairCut::SetClusterOverlapRange(Double_t min,Double_t max)
-{
- //sets cluster overlap factor cut ->Anti-Splitting cut
- //cluster overlap factor ranges between
- // -0.5 (in all padrows both tracks have cluters)
- // and 1 (in all padrows one track has cluter and second has not)
- // When Overlap Factor is 1 this pair of tracks in highly probable to be
- // splitted track: one particle that is recontructed twise
- // STAR uses range from -0.5 to 0.6
-
- AliAODPairBaseCut* cut= FindCut(AliAODPairBaseCut::kHbtPairCutPropClOverlap);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODCluterOverlapCut(min,max);
-}
-/**********************************************************/
-
-AliAODPairBaseCut* AliAODPairCut::FindCut(AliAODPairBaseCut::EAODPairCutProperty property)
-{
- // Find the cut corresponding to "property"
- for (Int_t i = 0;i<fNCuts;i++)
- {
- if (fCuts[i]->GetProperty() == property)
- return fCuts[i]; //we found the cut we were searching for
- }
-
- return 0x0; //we did not found this cut
-
-}
-/**********************************************************/
-
-void AliAODPairCut::Streamer(TBuffer &b)
-{
- // Stream all objects in the array to or from the I/O buffer.
-
- UInt_t R__s, R__c;
- if (b.IsReading())
- {
- Version_t v = b.ReadVersion(&R__s, &R__c);
- if (v > -1)
- {
- delete fFirstPartCut;
- delete fSecondPartCut;
- fFirstPartCut = 0x0;
- fSecondPartCut = 0x0;
- TObject::Streamer(b);
- b >> fFirstPartCut;
- b >> fSecondPartCut;
- b >> fNCuts;
- for (Int_t i = 0;i<fNCuts;i++)
- {
- b >> fCuts[i];
- }
- }
- b.CheckByteCount(R__s, R__c,AliAODPairCut::IsA());
- }
- else
- {
- R__c = b.WriteVersion(AliAODPairCut::IsA(), kTRUE);
- TObject::Streamer(b);
-
-// printf("Streamer Cut 1 %#x Cut 2 %#x\n",fFirstPartCut,fSecondPartCut);
-// this->Dump();
-// fFirstPartCut->Dump();
-
- b << fFirstPartCut;
- b << fSecondPartCut;
- b << fNCuts;
- for (Int_t i = 0;i<fNCuts;i++)
- {
- b << fCuts[i];
- }
- b.SetByteCount(R__c, kTRUE);
- }
-}
-/******************************************************************/
-
-ClassImp(AliAODPairEmptyCut)
-
-void AliAODPairEmptyCut::Streamer(TBuffer &b)
-{
-//streamer for empty pair cut
- AliAODPairCut::Streamer(b);
-}
-/******************************************************************/
-
+++ /dev/null
-#ifndef ALIAODPAIRCUT_H
-#define ALIAODPAIRCUT_H
-
-/* $Id$ */
-
-//Piotr Skowronski@cern.ch
-//Class implements cut on the pair of particles
-//
-//more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
-
-#include <TNamed.h>
-#include "AliAODPairBaseCut.h"
-
-class AliAODParticleCut;
-class AliAODPairBaseCut;
-
-/******************************************************************/
-
-class AliAODPairCut: public TNamed
-{
- public:
- AliAODPairCut();
- AliAODPairCut(const AliAODPairCut& in);
- AliAODPairCut& operator = (const AliAODPairCut& in);
-
- virtual ~AliAODPairCut();
- virtual Bool_t Rejected(AliAODPair* pair) const;
- virtual Bool_t PassPairProp(AliAODPair* pair) const;
-
- virtual Bool_t IsEmpty() const {return kFALSE;}
- void SetFirstPartCut(AliAODParticleCut* cut); //sets the cut on the first particle
- void SetSecondPartCut(AliAODParticleCut* cut); //sets the cut on the second particle
-
- void SetPartCut(AliAODParticleCut* cut);//sets the the same cut on both particles
-
- virtual void AddBasePairCut(AliAODPairBaseCut* cut);
-
- virtual void Print(const Option_t * opt) const {TNamed::Print(opt);}
- virtual void Print();
-
- void SetDeltaERange(Double_t min, Double_t max);
- void SetDeltaPRange(Double_t min, Double_t max);
-
- void SetQInvRange(Double_t min, Double_t max);
- void SetKtRange(Double_t min, Double_t max);
- void SetKStarRange(Double_t min, Double_t max);
- void SetKStarOutRange(Double_t min, Double_t max);
- void SetKStarSideRange(Double_t min, Double_t max);
- void SetKStarLongRange(Double_t min, Double_t max);
- void SetQOutLCMSRange(Double_t min, Double_t max);
- void SetQSideLCMSRange(Double_t min, Double_t max);
- void SetQLongLCMSRange(Double_t min, Double_t max);
- void SetAvSeparationRange(Double_t min,Double_t max = 10e5);//Anti-Merging Cut
- void SetITSSeparation(Int_t layer, Double_t drphi=0.01,Double_t dz = 0.08);//Anti-Merging Cut for first pixel layer
- void SetClusterOverlapRange(Double_t min,Double_t max);//Anti-Splitting Max range -0.5 1.0
-
- AliAODParticleCut* GetFirstPartCut() const {return fFirstPartCut;}
- AliAODParticleCut* GetSecondPartCut() const {return fSecondPartCut;}
-
- protected:
- AliAODParticleCut* fFirstPartCut;//cut on first particle in pair
- AliAODParticleCut* fSecondPartCut;//cut on second particle in pair
-
- AliAODPairBaseCut** fCuts; //! array of poiters to base cuts
- Int_t fNCuts;//Number of cuts in fCuts array
-
-
- AliAODPairBaseCut* FindCut(AliAODPairBaseCut::EAODPairCutProperty cut);
- private:
- static const Int_t fgkMaxCuts; // Max number of cuts
- ClassDef(AliAODPairCut,2)
-};
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-class AliAODPairEmptyCut: public AliAODPairCut
-{
- //Empty - it passes possitively all particles - it means returns always False
- //Class describing cut on pairs of particles
- public:
- AliAODPairEmptyCut(){};
- AliAODPairEmptyCut(const AliAODPairEmptyCut& in):AliAODPairCut(in){};
- virtual ~AliAODPairEmptyCut(){};
-
- Bool_t Rejected(AliAODPair*) const {return kFALSE;} //accpept everything
- Bool_t IsEmpty() const {return kTRUE;}
-
- ClassDef(AliAODPairEmptyCut,1)
-};
-
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//___________________________________________________________
-/////////////////////////////////////////////////////////////
-//
-// class AliAODParticle
-//
-// Ali HBT Particle: simplified class TParticle
-// Simplified in order to minimize the size of object
-// - we want to keep a lot of such a objects in memory
-// Additionaly adjusted for HBT Analysies purposes
-// + pointer to Track Points
-// + pointer to Cluster Map(s)
-//
-// Piotr.Skowronski@cern.ch
-//
-/////////////////////////////////////////////////////////////
-#include <TParticle.h>
-
-#include "AliAODParticle.h"
-#include "AliClusterMap.h"
-#include "AliLog.h"
-#include "AliTrackPoints.h"
-
-ClassImp(AliAODParticle)
-
-//______________________________________________________________________________
-AliAODParticle::AliAODParticle():
- fPdgIdx(0), fIdxInEvent(0),fNPids(0),fPids(0x0),fPidProb(0x0),
- fCalcMass(0),fPx(0), fPy(0),fPz(0),fE(0), fVx(0), fVy(0),fVz(0),fVt(0),
- fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
-{//empty particle
-}
-//______________________________________________________________________________
-
-AliAODParticle::AliAODParticle(Int_t pdg, Int_t idx,
- Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time):
- fPdgIdx(0), fIdxInEvent(idx),fNPids(0),fPids(0x0),fPidProb(0x0),
- fCalcMass(0),
- fPx(px), fPy(py),fPz(pz),fE(etot),
- fVx(vx), fVy(vy),fVz(vz),fVt(time),
- fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
-{
-//mormal constructor
- SetPdgCode(pdg);
- if (GetPDG()) {
- fCalcMass = GetPDG()->Mass();
- } else {
- Double_t a2 = fE*fE -fPx*fPx -fPy*fPy -fPz*fPz;
- if (a2 >= 0) fCalcMass = TMath::Sqrt(a2);
- else fCalcMass = -TMath::Sqrt(-a2);
- }
-}
-//______________________________________________________________________________
-
-AliAODParticle::AliAODParticle(Int_t pdg, Float_t prob, Int_t idx,
- Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time):
- fPdgIdx(0), fIdxInEvent(idx),fNPids(0),fPids(0x0),fPidProb(0x0),
- fCalcMass(0),
- fPx(px), fPy(py),fPz(pz),fE(etot),
- fVx(vx), fVy(vy),fVz(vz),fVt(time),
- fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
-{
-//mormal constructor
- SetPdgCode(pdg,prob);
- if (GetPDG()) {
- fCalcMass = GetPDG()->Mass();
- } else {
- Double_t a2 = fE*fE -fPx*fPx -fPy*fPy -fPz*fPz;
- if (a2 >= 0) fCalcMass = TMath::Sqrt(a2);
- else fCalcMass = -TMath::Sqrt(-a2);
- }
-}
-//______________________________________________________________________________
-
-AliAODParticle::AliAODParticle(const AliAODParticle& in):
- AliVAODParticle(in),
- fPdgIdx(in.fPdgIdx), fIdxInEvent(in.fIdxInEvent),
- fNPids(in.fNPids),fPids(new Int_t[fNPids]),fPidProb(new Float_t[fNPids]),
- fCalcMass(in.GetCalcMass()),
- fPx(in.Px()),fPy(in.Py()),fPz(in.Pz()),fE(in.E()),
- fVx(in.Vx()),fVy(in.Vy()),fVz(in.Vz()),fVt(in.T()),
- fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
-{
- //Copy constructor
-// Info("AliAODParticle(const AliAODParticle& in)","");
- for(Int_t i = 0; i<fNPids; i++)
- {
- fPids[i] = in.fPids[i];
- fPidProb[i] = in.fPidProb[i];
- }
-
- if (in.fTPCTrackPoints)
- fTPCTrackPoints = (AliTrackPoints*)in.fTPCTrackPoints->Clone();
- if (in.fITSTrackPoints)
- fITSTrackPoints = (AliTrackPoints*)in.fITSTrackPoints->Clone();
- if (in.fClusterMap)
- fClusterMap = (AliClusterMap*)in.fClusterMap->Clone();
-}
-//______________________________________________________________________________
-
-AliAODParticle::AliAODParticle(const AliVAODParticle& in):
- AliVAODParticle(in),
- fPdgIdx(0), fIdxInEvent(in.GetUID()),
- fNPids(0),fPids(0x0),fPidProb(0x0),
- fCalcMass(-1.0),
- fPx(in.Px()),fPy(in.Py()),fPz(in.Pz()),fE(in.E()),
- fVx(in.Vx()),fVy(in.Vy()),fVz(in.Vz()),fVt(in.T()),
- fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
-{
- //Copy constructor
-// Info("AliAODParticle(const AliVAODParticle& in)","");
- for(Int_t i = 0; i<in.GetNumberOfPids(); i++)
- {
- SetPIDprobability(in.GetNthPid(i),in.GetNthPidProb(i));
- }
- SetPdgCode(in.GetPdgCode(),in.GetPidProb());
-
- AliTrackPoints* tpts = in.GetTPCTrackPoints();
- if (tpts) SetTPCTrackPoints((AliTrackPoints*)tpts->Clone());
-
- tpts = in.GetITSTrackPoints();
- if (tpts) SetITSTrackPoints((AliTrackPoints*)tpts->Clone());
-
- AliClusterMap* clmap = in.GetClusterMap();
- if (clmap) SetClusterMap((AliClusterMap*)clmap->Clone());
-}
-//______________________________________________________________________________
-
-AliAODParticle::AliAODParticle(const TParticle &p,Int_t idx):
- fPdgIdx(0), fIdxInEvent(idx),
- fNPids(0),fPids(0x0),fPidProb(0x0),
- fCalcMass(p.GetCalcMass()),
- fPx(p.Px()),fPy(p.Py()),fPz(p.Pz()),fE(p.Energy()),
- fVx(p.Vx()),fVy(p.Vy()),fVz(p.Vz()),fVt(p.T()),
- fTPCTrackPoints(0x0),fITSTrackPoints(0x0),fClusterMap(0x0)
-{
- //all copied in the initialization
- SetPdgCode(p.GetPdgCode());
-}
-//______________________________________________________________________________
-
-AliAODParticle::~AliAODParticle()
-{
-//dtor
- delete [] fPids;
- delete [] fPidProb;
- delete fTPCTrackPoints;
- delete fITSTrackPoints;
- delete fClusterMap;
-}
-//______________________________________________________________________________
-
-void AliAODParticle::Clear(Option_t*)
-{
-//Must be implemented in order to store this object in Clones Array
- delete [] fPids;
- delete [] fPidProb;
- delete fTPCTrackPoints;
- delete fITSTrackPoints;
- delete fClusterMap;
-
- fPids = 0x0;
- fPidProb = 0x0;
- fTPCTrackPoints = 0x0;
- fITSTrackPoints = 0x0;
- fClusterMap = 0x0;
-}
-//______________________________________________________________________________
-
-AliAODParticle& AliAODParticle::operator=(const AliAODParticle& in)
-{
-//assigment operator
-// Info("operator=(const AliAODParticle& in)","AliAODParticle");
- if (&in != this) {
- AliVAODParticle::operator=(in);
- fNPids = in.fNPids;
- delete [] fPids;
- delete [] fPidProb;
- fPids = new Int_t[fNPids];
- fPidProb = new Float_t[fNPids];
- for (Int_t i = 0; i < fNPids;i++)
- {
- fPids[i] = in.fPids[i];
- fPidProb[i] = in.fPidProb[i];
- }
-
- fPdgIdx = in.fPdgIdx;
- fIdxInEvent = in.fIdxInEvent;
- fCalcMass = in.GetCalcMass();
- fPx = in.Px();
- fPy = in.Py();
- fPz = in.Pz();
- fE = in.E();
- fVx = in.Vx();
- fVy = in.Vy();
- fVz = in.Vz();
- fVt = in.T();
-
- delete fTPCTrackPoints;
- fTPCTrackPoints = (in.fTPCTrackPoints)?(AliTrackPoints*)in.fTPCTrackPoints->Clone():0x0;
-
- delete fITSTrackPoints;
- fITSTrackPoints = (in.fITSTrackPoints)?(AliTrackPoints*)in.fITSTrackPoints->Clone():0x0;
-
- delete fClusterMap;
- fClusterMap = (in.fClusterMap)?(AliClusterMap*)in.fClusterMap->Clone():0x0;
- }
- return *this;
-}
-//______________________________________________________________________________
-
-void AliAODParticle::SetPdgCode(Int_t pdg,Float_t prob)
-{
-//Set PDG Code
- SetPIDprobability(pdg,prob);
- fPdgIdx = GetPidSlot(pdg);
-}
-
-//______________________________________________________________________________
-void AliAODParticle::SetPIDprobability(Int_t pdg, Float_t prob)
-{
-//Sets another pdg code and corresponding probabilty
-//Ids are set in decreasing order
-//Check if total probability is not overcoming unity is performed
-//in case, warning is printed
- AliDebug(9,Form("SetPIDprobability","Setting PID %d prob %f",pdg,prob));
-
- Float_t totprob = 0.0;//sums up probabilities
- Int_t idx = GetPidSlot(pdg);
- Int_t i;
-
- if (idx > -1)
- {
- fPidProb[idx] = prob;
- for (i = 0; i < fNPids;i++) totprob+=fPidProb[i];
- if (totprob > (1.0+0.000001))
- {
- Warning("SetPIDprobability","Total probability greater than unity (%f)",totprob);
- }
- AliDebug(9,Form("Current Total probability: %f",totprob));
- return;
- }
-
- Int_t currentpid = GetPdgCode();
- fNPids++;
- Float_t* aPidProbNew = new Float_t[fNPids];
- Int_t* aPidsNew = new Int_t[fNPids];
-
- for (i = 0; i < fNPids-1;i++)//find a slot
- {
- if ( fPidProb[i] > prob)
- {
- AliDebug(9,Form("Copying entry %d",i));
- aPidProbNew[i] = fPidProb[i];
- aPidsNew[i] = fPids[i];
- totprob+=fPidProb[i];
- }
- else break;
- }
-
- AliDebug(9,Form("SetPID","Setting new PID on entry %d",i));
- aPidProbNew[i] = prob;
- aPidsNew[i] = pdg;
- totprob+=prob;
-
-
- for (Int_t j = fNPids-1; j > i ;j--)//copy rest of old arays
- {
- AliDebug(9,Form("SetPID","Copying from old entry %d to new entry %d",j-1,j));
- aPidProbNew[j] = fPidProb[j-1];
- aPidsNew[j] = fPids[j-1];
- totprob+=fPidProb[j-1];
- }
-
- delete [] fPidProb;
- delete [] fPids;
-
- fPidProb = aPidProbNew;
- fPids = aPidsNew;
-
- fPdgIdx = GetPidSlot(currentpid);
- if (fPdgIdx == -1) fPdgIdx = 0;
-
- if (totprob > (1.0+0.000001))//space for numerical error
- {
- Warning("SetId","Total probability is greater than unity (%f)!!!",totprob);
- Print();
- }
-}
-//______________________________________________________________________________
-
-Float_t AliAODParticle::GetPIDprobability(Int_t pdg) const
-{
-//Returns probability that this particle is the type of pdg
- Int_t idx = GetPidSlot(pdg);
- if (idx < 0) return 0.0;//such pid was not specified for this particle
- return fPidProb[idx];
-}
-//______________________________________________________________________________
-
-const Char_t* AliAODParticle::GetName() const
-{
- //returns name of this particle
- static char def[4] = "XXX";
- const TParticlePDG *ap = TDatabasePDG::Instance()->GetParticle(GetPdgCode());
- if (ap) return ap->GetName();
- else return def;
-}
-//______________________________________________________________________________
-
-Int_t AliAODParticle::GetPidSlot(Int_t pdg) const
-{
- //returns position of the given PID in fPids (and fPidProb) array.
- if (fPids == 0x0) return -1;
- for (Int_t i = 0; i< fNPids; i++)
- {
- if (fPids[i] == pdg) return i;
- }
- return -1;
-}
-//______________________________________________________________________________
-
-Int_t AliAODParticle::GetNthPid(Int_t idx) const
-{
- //returns PID sitting on slot idx in fPids
- if ( (idx < 0) || (idx >= fNPids) )
- {
- Error("GetNthPid","Out Of Bounds");
- return 0;
- }
- return fPids[idx];
-}
-//______________________________________________________________________________
-
-Float_t AliAODParticle::GetNthPidProb(Int_t idx) const
-{
- //returns PID sitting on slot idx in fPidProb
- if ( (idx < 0) || (idx >= fNPids) )
- {
- Error("GetNthPid","Out Of Bounds");
- return 0;
- }
- return fPidProb[idx];
-}
-//______________________________________________________________________________
-
-void AliAODParticle::Print(const Option_t * /*opt*/) const
-{
-//prints information about particle
- printf("____________________________________________________\n");
- printf("Idx: %d PID: %d Name: ",fIdxInEvent,GetPdgCode());
- TParticlePDG *pdgp = TDatabasePDG::Instance()->GetParticle(GetPdgCode());
- if (pdgp)
- {
- printf("%s Mass: %f\n",pdgp->GetName(),pdgp->Mass());
- }
- else
- {
- printf("Not known\n");
- }
-
- printf("Px: %+f Py: %+f Pz: %+f E: %+f Calculated Mass: %f\nVx: %+f Vy: %+f Vz: %+f T: %+f\n",
- Px(),Py(),Pz(),E(),GetCalcMass(),Vx(),Vy(),Vz(),T());
-
- for (Int_t i = 0; i < fNPids; i++)
- {
- printf("# %d PID: %d Probability %f name ",i,fPids[i],fPidProb[i]);
- const TParticlePDG *ap = TDatabasePDG::Instance()->GetParticle(fPids[i]);
- if (ap)
- {
- printf("%s Mass %f\n",ap->GetName(),ap->Mass());
- }
- else
- {
- printf("Not known\n");
- }
- }
-
- if (fITSTrackPoints) fITSTrackPoints->Print();
- if (fTPCTrackPoints) fTPCTrackPoints->Print();
-
-}
-
-//______________________________________________________________________________
-
-//void AliAODParticle::Streamer(TBuffer &b)
-//{
-// // Stream all objects in the array to or from the I/O buffer.
-// UInt_t R__s, R__c;
-// Int_t i;
-// if (b.IsReading())
-// {
-// delete [] fPids;
-// delete [] fPidProb;
-//
-// Version_t v = b.ReadVersion(&R__s, &R__c);
-// if (v == 1)
-// {
-// AliAODParticle::Class()->ReadBuffer(b, this);
-// }
-// else
-// {
-// TObject::Streamer(b);
-// b >> fPdgIdx;
-// b >> fIdxInEvent;
-//
-// b >> fNPids;
-// Int_t* fPids = new Int_t[fNPids];
-// Float_t* fPidProb = new Float_t[fNPids];
-// for (i = 0;i<fNPids;i++)
-// {
-// b >> fPids[i];
-// }
-// for (i = 0;i<fNPids;i++)
-// {
-// b >> fPidProb[i];
-// }
-// b >> fCalcMass;
-//
-// b >> fPx;
-// b >> fPy;
-// b >> fPz;
-// b >> fE;
-//
-// b >> fVx;
-// b >> fVy;
-// b >> fVz;
-// b >> fVt;
-// Info("Streamer","Read data");
-// Print();
-// }
-//
-// b.CheckByteCount(R__s, R__c,AliAODParticle::IsA());
-// }
-// else
-// {
-// R__c = b.WriteVersion(AliAODParticle::IsA(), kTRUE);
-// TObject::Streamer(b);
-// Info("Streamer","Read data");
-// Print();
-//
-// b << fPdgIdx;
-// b << fIdxInEvent;
-// b << fNPids;
-// for (i = 0;i<fNPids;i++)
-// {
-// b << fPids[i];
-// }
-// {
-// {
-// for (i = 0;i<fNPids;i++)
-// {
-// b << fPidProb[i];
-// }
-// b << fCalcMass;
-//
-// b << fPx;
-// b << fPy;
-// b << fPz;
-// b << fE;
-//
-// b << fVx;
-// b << fVy;
-// b << fVz;
-// b << fVt;
-//
-// b.SetByteCount(R__c, kTRUE);
-// }
-//}
+++ /dev/null
-#ifndef ALIAODPARTICLE_H
-#define ALIAODPARTICLE_H
-//___________________________________________________________
-/////////////////////////////////////////////////////////////
-//
-// class AliAODParticle
-//
-// Ali HBT Particle: simplified class TParticle
-// Simplified in order to minimize the size of the object
-// - we want to keep a lot of such a objects in memory
-// Additionaly adjusted for HBT Analysies purposes
-// + pointer to Track Points
-// + pointer to Cluster Map(s)
-//
-// Piotr.Skowronski@cern.ch
-//
-/////////////////////////////////////////////////////////////
-
-#include "AliVAODParticle.h"
-#include <TLorentzVector.h>
-#include <TMath.h>
-#include <TDatabasePDG.h>
-
-
-class TParticle;
-class AliTrackPoints;
-class AliClusterMap;
-
-class AliAODParticle: public AliVAODParticle
-{
-public:
- // ****** constructors and destructor
- AliAODParticle();
- AliAODParticle(const AliAODParticle& in);
- AliAODParticle(const AliVAODParticle& in);
-
- AliAODParticle(Int_t pdg, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time);
-
- AliAODParticle(Int_t pdg, Float_t prob, Int_t idx, Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time);
-
- AliAODParticle(const TParticle& p, Int_t idx);
-
- virtual ~AliAODParticle();
-
- AliAODParticle& operator=(const AliAODParticle& in);
-
- void Clear(Option_t* /*option*/ ="");//Must be implemented in order to store this object in Clones Array
-
- void SetPIDprobability(Int_t pdg, Float_t prob = 1.0);
- Float_t GetPIDprobability(Int_t pdg) const;
- Double_t GetProbability(Int_t pdg) const {return GetPIDprobability(pdg);}
-
- Int_t GetMostProbable() const { return (fPids)?fPids[0]:0;}
-
- Int_t GetPdgCode () const { return (fPids)?fPids[fPdgIdx]:0;}
-
- Double_t GetPidProb () const { return (fPidProb)?fPidProb[fPdgIdx]:0;}
-
- Int_t GetUID () const { return fIdxInEvent;}
- Int_t GetNumberOfPids () const { return fNPids;}
- Int_t GetNthPid (Int_t idx) const;
- Float_t GetNthPidProb (Int_t idx) const;
-
- void SetPdgCode(Int_t pdg, Float_t prob = 1.0);
- Double_t GetCalcMass () const { return fCalcMass; }
- Double_t Mass () const { return (GetPDG())?GetPDG()->Mass():-1.;}
-
-
- TParticlePDG* GetPDG () const {return TDatabasePDG::Instance()->GetParticle(GetPdgCode());}
- Double_t Charge () const { return (GetPDG())?GetPDG()->Charge():1.e8;}
-
- Int_t Beauty () { return GetPDG()->Beauty(); }
- Int_t Charm () { return GetPDG()->Charm(); }
- Int_t Strangeness () { return GetPDG()->Strangeness();}
- void ProductionVertex(TLorentzVector &v) const { v.SetXYZT(fVx,fVy,fVz,fVt);}
-
-
- Double_t Vx () const { return fVx;}
- Double_t Vy () const { return fVy;}
- Double_t Vz () const { return fVz;}
- Double_t T () const { return fVt;}
-
- Double_t Px () const { return fPx; } //X coordinate of the momentum
- Double_t Py () const { return fPy; } //Y coordinate of the momentum
- Double_t Pz () const { return fPz; } //Z coordinate of the momentum
- Double_t P () const //momentum
- { return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
-
- void Momentum(TLorentzVector &v) const { v.SetPxPyPzE(fPx,fPy,fPz,fE);}
-
- Double_t Pt () const //transverse momentum
- { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
- Double_t E() const { return fE; }
-
- //Pseudo Rapidity
- Double_t Eta () const { if (P() != fPz) return 0.5*TMath::Log((P()+fPz)/(P()-fPz));
- else return 1.e30;}
-
- //Rapidity
- Double_t Y () const { if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
- else return 1.e30;}
-
- Double_t Phi () const { return TMath::Pi()+TMath::ATan2(-fPy,-fPx); }
-
- Double_t Theta () const { return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P()); }
-
- // setters
-
- void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
- {fPx=px; fPy=py; fPz=pz; fE=e;}
- void SetMomentum(const TLorentzVector& p)
- {SetMomentum(p.Px(),p.Py(),p.Pz(),p.Energy());}
-
- void SetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
- {fVx=vx; fVy=vy; fVz=vz; fVt=t;}
- void SetProductionVertex(const TLorentzVector& v)
- {SetProductionVertex(v.X(),v.Y(),v.Z(),v.T());}
- void SetCalcMass(Double_t mass) {fCalcMass = mass;}
-
- void SetUID(Int_t id){fIdxInEvent = id;}
-
- const Char_t* GetName() const;
- void Print(const Option_t * opt = "") const;
-
- void SetTPCTrackPoints(AliTrackPoints* tpts){fTPCTrackPoints = tpts;}
- AliTrackPoints* GetTPCTrackPoints() const {return fTPCTrackPoints;}
- void SetITSTrackPoints(AliTrackPoints* tpts){fITSTrackPoints = tpts;}
- AliTrackPoints* GetITSTrackPoints() const {return fITSTrackPoints;}
- void SetClusterMap(AliClusterMap* cm){fClusterMap = cm;}
- AliClusterMap* GetClusterMap() const {return fClusterMap;}
-
-
-protected:
- Int_t GetPidSlot(Int_t pdg) const;//returns position of the given PID in fPids (and fPidProb) array.
-
-private:
- Int_t fPdgIdx; // index of PDG code of the particle in fPids
- Int_t fIdxInEvent; // index of a particle: the same particle can appear in the event
- // many times with different pid's. Idx allows to check that they are the same particles
- Int_t fNPids; // number of non-zero proboble Pids
- Int_t *fPids; // [fNPids] Array with PIDs
- Float_t *fPidProb; // [fNPids] PIDs probabilities
- Double_t fCalcMass; // Calculated mass
-
-
- Double_t fPx; // x component of momentum
- Double_t fPy; // y component of momentum
- Double_t fPz; // z component of momentum
- Double_t fE; // Energy
-
- Double_t fVx; // x of production vertex
- Double_t fVy; // y of production vertex
- Double_t fVz; // z of production vertex
- Double_t fVt; // t of production vertex
-
- AliTrackPoints* fTPCTrackPoints; // track positions along trajectory - used by anti-merging cut
- AliTrackPoints* fITSTrackPoints; // track positions along trajectory - used by anti-merging cut
- AliClusterMap* fClusterMap; // bit map of cluters occupation; 1 if has cluter on given layer/padrow/...
-
- ClassDef(AliAODParticle,3) // TParticle vertex particle information
-};
-
-#endif
+++ /dev/null
-#include "AliAODParticleBaseCut.h"
-//__________________________________________________________________________
-////////////////////////////////////////////////////////////////////////////
-// //
-// class AliAODParticleBaseCut //
-// //
-// Set of classes for performing cuts on particle properties of //
-// AliAODParticleBaseCut is a base class for "base //
-// particle cuts". Further, there are implemented classes that performs //
-// cuts on the most common particle properties like pt, pseudo rapidity, //
-// angles, anergy, etc. //
-// //
-// There are also implemeted base cuts that perform logical operations //
-// on results of base particle cuts: AliAODOrCut and AliAODAndCut. //
-// //
-// Each base cut has a property, thet allows to distinguish them. //
-// This functionality is used by the interface methods of Particle Cut //
-// that allows easy update ranges. //
-// //
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html //
-// responsible: Piotr Skowronski@cern.ch //
-// //
-////////////////////////////////////////////////////////////////////////////
-
-
-#include <Riostream.h>
-
-ClassImp(AliAODParticleBaseCut)
- void AliAODParticleBaseCut::Print(const Option_t * /*opt*/) const
-{
- // prints the information anout the base cut to stdout
- cout<<"fMin="<<fMin <<", fMax=" <<fMax<<" ";
- PrintProperty();
-}
-/******************************************************************/
-
-void AliAODParticleBaseCut::PrintProperty(void) const
-{
- //prints the property name
- switch (fProperty)
- {
- case kAODP:
- cout<<"kAODP"; break;
- case kAODPt:
- cout<<"kAODPt"; break;
- case kAODE:
- cout<<"kAODE"; break;
- case kAODRapidity:
- cout<<"kAODRapidity"; break;
- case kAODPseudoRapidity:
- cout<<"kAODPseudoRapidity"; break;
- case kAODPx:
- cout<<"kAODPx"; break;
- case kAODPy:
- cout<<"kAODPy"; break;
- case kAODPz:
- cout<<"kAODPz"; break;
- case kAODPhi:
- cout<<"kAODPhi"; break;
- case kAODTheta:
- cout<<"kAODTheta"; break;
- case kAODVx:
- cout<<"kAODVx"; break;
- case kAODVy:
- cout<<"kAODVy"; break;
- case kAODVz:
- cout<<"kAODVz"; break;
- case kAODPid:
- cout<<"kAODPid"; break;
- case kAODNone:
- cout<<"kAODNone"; break;
- default:
- cout<<"Property Not Found";
- }
- cout<<endl;
-}
-ClassImp( AliAODMomentumCut )
-
-ClassImp( AliAODPtCut )
-ClassImp( AliAODEnergyCut )
-ClassImp( AliAODRapidityCut )
-ClassImp( AliAODPseudoRapidityCut )
-ClassImp( AliAODPxCut )
-ClassImp( AliAODPyCut )
-ClassImp( AliAODPzCut )
-ClassImp( AliAODPhiCut )
-ClassImp( AliAODThetaCut )
-ClassImp( AliAODVxCut )
-ClassImp( AliAODVyCut )
-ClassImp( AliAODVzCut )
-
-ClassImp( AliAODPIDCut )
-
-void AliAODPIDCut::Print(const Option_t * /*opt*/) const
-{
- cout<<"PID "<<fPID<<" ";
- AliAODParticleBaseCut::Print();
-}
-
-ClassImp( AliAODLogicalOperCut )
-
-AliAODLogicalOperCut::AliAODLogicalOperCut():
- AliAODParticleBaseCut(-10e10,10e10,kAODNone),
- fFirst(new AliAODDummyBaseCut),
- fSecond(new AliAODDummyBaseCut)
-{
- //ctor
-}
-/******************************************************************/
-
-AliAODLogicalOperCut::AliAODLogicalOperCut(AliAODParticleBaseCut* first, AliAODParticleBaseCut* second):
- AliAODParticleBaseCut(-10e10,10e10,kAODNone),
- fFirst((first)?(AliAODParticleBaseCut*)first->Clone():0x0),
- fSecond((second)?(AliAODParticleBaseCut*)second->Clone():0x0)
-{
- //ctor
- if ( (fFirst && fSecond) == kFALSE)
- {
- Fatal("AliAODLogicalOperCut","One of parameters is NULL!");
- }
-}
-/******************************************************************/
-
-AliAODLogicalOperCut::~AliAODLogicalOperCut()
-{
- //destructor
- delete fFirst;
- delete fSecond;
-}
-/******************************************************************/
-
-Bool_t AliAODLogicalOperCut::AliAODDummyBaseCut::Rejected(AliVAODParticle* /*part*/) const
-{
- //checks if particles passes properties defined by this cut
- Warning("Pass","You are using dummy base cut! Probobly some logical cut is not set up properly");
- return kFALSE;//accept
-}
-/******************************************************************/
-
-void AliAODLogicalOperCut::Streamer(TBuffer &b)
-{
- // Stream all objects in the array to or from the I/O buffer.
- UInt_t R__s, R__c;
- if (b.IsReading())
- {
- delete fFirst;
- delete fSecond;
- fFirst = 0x0;
- fSecond = 0x0;
-
- b.ReadVersion(&R__s, &R__c);
- TObject::Streamer(b);
- b >> fFirst;
- b >> fSecond;
- b.CheckByteCount(R__s, R__c,AliAODLogicalOperCut::IsA());
- }
- else
- {
- R__c = b.WriteVersion(AliAODLogicalOperCut::IsA(), kTRUE);
- TObject::Streamer(b);
- b << fFirst;
- b << fSecond;
- b.SetByteCount(R__c, kTRUE);
- }
-}
-
-/******************************************************************/
-ClassImp(AliAODOrCut)
-
-Bool_t AliAODOrCut::Rejected(AliVAODParticle * p) const
-{
- //returns true when rejected
- //AND operation is a little bit misleading but is correct
- //User wants to build logical cuts with natural (positive) logic
- //while AODAN use inernally reverse (returns true when rejected)
- if (fFirst->Rejected(p) && fSecond->Rejected(p)) return kTRUE;//rejected (both rejected, returned kTRUE)
- return kFALSE;//accepted, at least one accepted (returned kFALSE)
-}
-/******************************************************************/
-
-ClassImp(AliAODAndCut)
-
-Bool_t AliAODAndCut::Rejected(AliVAODParticle * p) const
-{
- //returns true when rejected
- //OR operation is a little bit misleading but is correct
- //User wants to build logical cuts with natural (positive) logic
- //while AODAN use inernally reverse (returns true when rejected)
- if (fFirst->Rejected(p) || fSecond->Rejected(p)) return kTRUE;//rejected (any of two rejected(returned kTRUE) )
- return kFALSE;//accepted (both accepted (returned kFALSE))
-}
-/******************************************************************/
+++ /dev/null
-#ifndef ALIAODPARTICLEBASECUT_H
-#define ALIAODPARTICLEBASECUT_H
-//__________________________________________________________________________
-////////////////////////////////////////////////////////////////////////////
-// //
-// class AliAODParticleBaseCut //
-// //
-// Set of classes for performing cuts on particle properties of //
-// AliAODParticleBaseCut is a base class for "base //
-// particle cuts". Further, there are implemented classes that performs //
-// cuts on the most common particle properties like pt, pseudo rapidity, //
-// angles, anergy, etc. //
-// //
-// There are also implemeted base cuts that perform logical operations //
-// on results of base particle cuts: AliAODOrCut and AliAODAndCut. //
-// //
-// Each base cut has a property, thet allows to distinguish them. //
-// This functionality is used by the interface methods of Particle Cut //
-// that allows easy update ranges. //
-// //
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html //
-// responsible: Piotr Skowronski@cern.ch //
-// //
-////////////////////////////////////////////////////////////////////////////
-
-
-#include <TObject.h>
-#include "AliVAODParticle.h"
-
-
-class AliAODParticleBaseCut: public TObject
- {
- //This class defines the range of some property - pure virtual
- //Property is coded by AliAODCutTypes type
-
- public:
-
- enum EAODCutProperty
- {
- //codes of particle properties
- kAODP, //Momentum
- kAODPt, //Transverse momentum
- kAODE, //Energy
- kAODRapidity, //
- kAODPseudoRapidity,
- kAODPx, //X coAnddinate of the momentum
- kAODPy, //Y coAnddinate of the momentum
- kAODPz, //Z coAnddinate of the momentum
- kAODPhi,//angle
- kAODTheta,//angle
- kAODVx, // vertex X coAnddinate
- kAODVy, // vertex Y coAnddinate
- kAODVz, // vertex Z coAnddinate
- kAODPid, // vertex Z coAnddinate
- //_____________________________
- kAODNone
- };
-
-
- AliAODParticleBaseCut(Double_t min = 0.0, Double_t max = 0.0,EAODCutProperty prop = kAODNone):
- fProperty(prop),fMin(min),fMax(max){}
-
- virtual ~AliAODParticleBaseCut(){}
-
- virtual Bool_t Rejected(AliVAODParticle *p) const;
-
- void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
-
- void SetMinimum(Double_t min){fMin = min;}
- void SetMaximum(Double_t max){fMax = max;}
-
- Double_t GetMinimum() const {return fMin;}
- Double_t GetMaximum() const {return fMax;}
-
- EAODCutProperty GetProperty() const {return fProperty;}
- virtual void Print(const Option_t * opt = "") const;
-
- protected:
- virtual Double_t GetValue(AliVAODParticle *) const = 0;
-
- EAODCutProperty fProperty; //property that this cut describes
- Double_t fMin;//minimum value
- Double_t fMax;//maximum value
-
- private:
- void PrintProperty(void) const;
- ClassDef(AliAODParticleBaseCut,1)
-
- };
-
-inline Bool_t
-AliAODParticleBaseCut::Rejected(AliVAODParticle *p) const
-{
- //cjecks if particle property fits in range
- if ( (GetValue(p) < fMin) || (GetValue(p) > fMax ) ) return kTRUE; //rejected
- else return kFALSE; //accepted
-}
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-
-class AliAODMomentumCut: public AliAODParticleBaseCut
- {
- public:
- AliAODMomentumCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODP){}
- virtual ~AliAODMomentumCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->P();}
- ClassDef(AliAODMomentumCut,1)
- };
-
-class AliAODPtCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPtCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODPt){}
- virtual ~AliAODPtCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Pt();}
- ClassDef(AliAODPtCut,1)
- };
-
-
-class AliAODEnergyCut: public AliAODParticleBaseCut
- {
- public:
- AliAODEnergyCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODE){}
- virtual ~AliAODEnergyCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const {return p->E();}
- ClassDef(AliAODEnergyCut,1)
- };
-
-class AliAODRapidityCut: public AliAODParticleBaseCut
- {
- public:
- AliAODRapidityCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODRapidity){}
- virtual ~AliAODRapidityCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Y();}
- ClassDef(AliAODRapidityCut,1)
- };
-
-class AliAODPseudoRapidityCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPseudoRapidityCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODPseudoRapidity){}
- virtual ~AliAODPseudoRapidityCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Eta();}
- ClassDef(AliAODPseudoRapidityCut,1)
- };
-
-class AliAODPxCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPxCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODPx){}
- virtual ~AliAODPxCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Px();}
- ClassDef(AliAODPxCut,1)
- };
-
-class AliAODPyCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPyCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODPy){}
- virtual ~AliAODPyCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Py();}
- ClassDef(AliAODPyCut,1)
- };
-
-
-class AliAODPzCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPzCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODPz){}
- virtual ~AliAODPzCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Pz();}
- ClassDef(AliAODPzCut,1)
- };
-
-class AliAODPhiCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPhiCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODPhi){}
- virtual ~AliAODPhiCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Phi();}
- ClassDef(AliAODPhiCut,1)
-
- };
-
-class AliAODThetaCut: public AliAODParticleBaseCut
- {
- public:
- AliAODThetaCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODTheta){}
- virtual ~AliAODThetaCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Theta();}
- ClassDef(AliAODThetaCut,1)
-
- };
-
-class AliAODVxCut: public AliAODParticleBaseCut
- {
- //Cut of the X coAnddinate of the vertex position
- public:
- AliAODVxCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODVx){}
- virtual ~AliAODVxCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Vx();} //retruns value of the vertex
- ClassDef(AliAODVxCut,1)
-
- };
-
-
-class AliAODVyCut: public AliAODParticleBaseCut
- {
- //Cut of the X coAnddinate of the vertex position
- public:
- AliAODVyCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODVy){}
- virtual ~AliAODVyCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Vy();} //retruns value of the vertex
- ClassDef(AliAODVyCut,1)
-
- };
-
-class AliAODVzCut: public AliAODParticleBaseCut
- {
- //Cut of the X coAnddinate of the vertex position
- public:
- AliAODVzCut(Double_t min = 0.0, Double_t max = 0.0):AliAODParticleBaseCut(min,max,kAODVz){}
- virtual ~AliAODVzCut(){}
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->Vz();} //retruns value of the vertex
-
- ClassDef(AliAODVzCut,1)
-
- };
-
-class AliAODPIDCut: public AliAODParticleBaseCut
- {
- public:
- AliAODPIDCut():AliAODParticleBaseCut(0.0,0.0,kAODPid),fPID(0){}
- AliAODPIDCut(Int_t pid, Double_t min = 0.0, Double_t max = 1.0):AliAODParticleBaseCut(min,max,kAODPid),fPID(pid){}
- virtual ~AliAODPIDCut(){}
-
- void SetPID(Int_t pid){fPID = pid;}
- void Print(const Option_t * opt = "") const;
- protected:
- Double_t GetValue(AliVAODParticle * p)const{return p->GetProbability(fPID);}
- Int_t fPID; //pid of particle that the pid is set
- ClassDef(AliAODPIDCut,1)
- };
-//___________________________________________________
-/////////////////////////////////////////////////////
-// //
-// class AliAODLogicalOperCut //
-// //
-// This cut is base class fAnd class that perfAndms //
-// logical operations on cuts //
-// //
-/////////////////////////////////////////////////////
-class AliAODLogicalOperCut: public AliAODParticleBaseCut
- {
- public:
- AliAODLogicalOperCut();
- AliAODLogicalOperCut(AliAODParticleBaseCut* first, AliAODParticleBaseCut* second);
- virtual ~AliAODLogicalOperCut();
- protected:
- Double_t GetValue(AliVAODParticle * /*part*/) const {MayNotUse("GetValue");return 0.0;}
-
- AliAODParticleBaseCut* fFirst; //second cut
- AliAODParticleBaseCut* fSecond; //first cut
- private:
- AliAODLogicalOperCut(const AliAODLogicalOperCut & src);
- AliAODLogicalOperCut & operator=(const AliAODLogicalOperCut & src);
- class AliAODDummyBaseCut: public AliAODParticleBaseCut
- {
- Double_t GetValue(AliVAODParticle * /*part*/) const {return 0.0;}
- Bool_t Rejected(AliVAODParticle* /*part*/) const;
- };
-
- ClassDef(AliAODLogicalOperCut,1)
- };
-
-class AliAODOrCut: public AliAODLogicalOperCut
-{
- public:
- AliAODOrCut(){}
- AliAODOrCut(AliAODParticleBaseCut* first, AliAODParticleBaseCut* second):AliAODLogicalOperCut(first,second){}
- virtual ~AliAODOrCut(){}
- Bool_t Rejected(AliVAODParticle *p) const;
- ClassDef(AliAODOrCut,1)
-};
-
-class AliAODAndCut: public AliAODLogicalOperCut
-{
- public:
- AliAODAndCut(){}
- AliAODAndCut(AliAODParticleBaseCut* first, AliAODParticleBaseCut* second):AliAODLogicalOperCut(first,second){}
- virtual ~AliAODAndCut(){}
- Bool_t Rejected(AliVAODParticle *p) const;
- ClassDef(AliAODAndCut,1)
-};
-
-#endif
+++ /dev/null
-#include "AliAODParticleCut.h"
-//__________________________________________________________________________
-////////////////////////////////////////////////////////////////////////////
-// //
-// class AliAODParticleCut //
-// //
-// Classes for single particle cuts. //
-// User should use mainly AliAODParticleCut interface methods, //
-// eventually EmptyCut which passes all particles. //
-// //
-// There is all interface for setting cuts on all particle properties //
-// The main method is Rejected - which returns //
-// True to reject particle //
-// False in case it meets all the criteria of the given cut //
-// //
-// This class has the list of base particle cuts that perform check on //
-// single property. Particle is rejected if any of cuts rejects it. //
-// There are implemented logical base cuts that perform logical //
-// operations on results of two other base cuts. Using them user can //
-// create a tree structure of a base cuts that performs sophisticated //
-// cut. //
-// //
-// User can also implement a base cut that performs complicated //
-// calculations, if it is only more convenient and/or efficint. //
-// //
-// User should delete created cuts himself //
-// because when setting a cut, other objects (functions,analyses, //
-// readers, other cuts) make their own copy of a cut. //
-// //
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html //
-// responsible: Piotr Skowronski@cern.ch //
-// //
-////////////////////////////////////////////////////////////////////////////
-
-#include <Riostream.h>
-
-
-ClassImp(AliAODParticleCut)
-const Int_t AliAODParticleCut::fgkMaxCuts = 50;
-/******************************************************************/
-
-AliAODParticleCut::AliAODParticleCut():
- fCuts(new AliAODParticleBaseCut* [fgkMaxCuts]),//last property in the property enum => defines number of properties
- fNCuts(0),
- fPID(0)
-{
- //default ctor
-}
-/******************************************************************/
-
-AliAODParticleCut::AliAODParticleCut(const AliAODParticleCut& in):
- TObject(in),
- fCuts(new AliAODParticleBaseCut* [fgkMaxCuts]),//last property in the property
- //property enum => defines number of properties
- fNCuts(in.fNCuts),
- fPID(in.fPID)
-{
- //cpy ctor
- for (Int_t i = 0;i<fNCuts;i++)
- {
- fCuts[i] = (AliAODParticleBaseCut*)in.fCuts[i]->Clone();//create new object (clone) and rember pointer to it
- }
-}
-/******************************************************************/
-AliAODParticleCut& AliAODParticleCut::operator=(const AliAODParticleCut& in)
-{
- //assigment operator
- Info("operator=","operator=operator=operator=operator=\noperator=operator=operator=operator=");
- for (Int_t i = 0;i<fNCuts;i++)
- {
- delete fCuts[i];
- }
-
- fNCuts = in.fNCuts;
- fPID = in.fPID;
- for (Int_t i = 0;i<fNCuts;i++)
- {
- fCuts[i] = (AliAODParticleBaseCut*)in.fCuts[i]->Clone();//create new object (clone) and rember pointer to it
- }
- return *this;
-}
-
-/******************************************************************/
-AliAODParticleCut::~AliAODParticleCut()
-{
- //dtor
- for (Int_t i = 0;i<fNCuts;i++)
- {
- delete fCuts[i];
- }
- delete []fCuts;
-}
-/******************************************************************/
-
-Bool_t AliAODParticleCut::Rejected(AliVAODParticle* p) const
-{
-//method checks all the cuts that are set (in the list)
-//If any of the baseCuts rejects particle False(rejection) is returned
-
- if(!p)
- {
- Warning("Rejected()","No Pasaran! We never accept NULL pointers");
- return kTRUE;
- }
- if( (p->GetPdgCode() != fPID) && ( fPID != 0)) return kTRUE;
-
- for (Int_t i = 0;i<fNCuts;i++)
- {
- if ( (fCuts[i]->Rejected(p)) )
- {
-// fCuts[i]->Print();
- return kTRUE; //if one of the cuts rejects, then reject
- }
- }
- return kFALSE;
-}
-/******************************************************************/
-
-void AliAODParticleCut::AddBasePartCut(AliAODParticleBaseCut* basecut)
-{
- //adds the base pair cut (cut on one value)
-
- if (!basecut) return;
- if( fNCuts == (fgkMaxCuts-1) )
- {
- Warning("AddBasePartCut","Not enough place for another cut");
- return;
- }
- fCuts[fNCuts++]=basecut;
-
-}
-
-/******************************************************************/
-AliAODParticleBaseCut* AliAODParticleCut::FindCut(AliAODParticleBaseCut::EAODCutProperty property)
-{
- //returns pointer to the cut checking the given property
- for (Int_t i = 0;i<fNCuts;i++)
- {
- if (fCuts[i]->GetProperty() == property)
- return fCuts[i]; //we found the cut we were searching for
- }
-
- return 0x0; //we did not found this cut
-
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetMomentumRange(Double_t min, Double_t max)
-{
- //Sets momentum range
- AliAODMomentumCut* cut= (AliAODMomentumCut*)FindCut(AliAODParticleBaseCut::kAODP);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODMomentumCut(min,max);
-}
-/******************************************************************/
-
-
-void AliAODParticleCut::SetPtRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODPtCut* cut= (AliAODPtCut*)FindCut(AliAODParticleBaseCut::kAODPt);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODPtCut(min,max);
-
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetEnergyRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODEnergyCut* cut= (AliAODEnergyCut*)FindCut(AliAODParticleBaseCut::kAODE);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODEnergyCut(min,max);
-
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetRapidityRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODRapidity);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODRapidityCut(min,max);
-
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetPseudoRapidityRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPseudoRapidity);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODPseudoRapidityCut(min,max);
-
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetPxRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPx);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODPxCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetPyRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPy);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODPyCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetPzRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPz);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODPzCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetPhiRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODPhi);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODPhiCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetThetaRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODTheta);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODThetaCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetVxRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODVx);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODVxCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetVyRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODVy);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODVyCut(min,max);
-}
-/******************************************************************/
-
-void AliAODParticleCut::SetVzRange(Double_t min, Double_t max)
-{
- //name self descriptive
- AliAODParticleBaseCut* cut = FindCut(AliAODParticleBaseCut::kAODVz);
- if(cut) cut->SetRange(min,max);
- else fCuts[fNCuts++] = new AliAODVzCut(min,max);
-}
-
-/******************************************************************/
-void AliAODParticleCut::Streamer(TBuffer &b)
-{
- // Stream all objects in the array to or from the I/O buffer.
-
- UInt_t R__s, R__c;
- if (b.IsReading())
- {
- Int_t i;
- for (i = 0;i<fNCuts;i++) delete fCuts[i];
- b.ReadVersion(&R__s, &R__c);
- TObject::Streamer(b);
- b >> fPID;
- b >> fNCuts;
- for (i = 0;i<fNCuts;i++)
- {
- b >> fCuts[i];
- }
- b.CheckByteCount(R__s, R__c,AliAODParticleCut::IsA());
- }
- else
- {
- R__c = b.WriteVersion(AliAODParticleCut::IsA(), kTRUE);
- TObject::Streamer(b);
- b << fPID;
- b << fNCuts;
- for (Int_t i = 0;i<fNCuts;i++)
- {
- b << fCuts[i];
- }
- b.SetByteCount(R__c, kTRUE);
- }
-}
-/******************************************************************/
-
-void AliAODParticleCut::Print(const Option_t * /*opt*/) const
-{
- //prints all information about the cut to stdout
- cout<<"Printing AliAODParticleCut, this = "<<this<<endl;
- cout<<"fPID "<<fPID<<endl;
- cout<<"fNCuts "<<fNCuts <<endl;
- for (Int_t i = 0;i<fNCuts;i++)
- {
- cout<<" fCuts["<<i<<"] "<<fCuts[i]<<endl<<" ";
- fCuts[i]->Print();
- }
-}
-
-/******************************************************************/
-/******************************************************************/
-ClassImp(AliAODParticleEmptyCut)
-
-void AliAODParticleEmptyCut::Streamer(TBuffer &b)
- {
- //stramer
- AliAODParticleCut::Streamer(b);
- }
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
+++ /dev/null
-#ifndef ALIAODPARTICLECUT_H
-#define ALIAODPARTICLECUT_H
-//__________________________________________________________________________
-////////////////////////////////////////////////////////////////////////////
-// //
-// class AliAODParticleCut //
-// //
-// Classes for single particle cuts. //
-// User should use mainly AliAODParticleCut interface methods, //
-// eventually EmptyCut which passes all particles. //
-// //
-// There is all interface for setting cuts on all particle properties //
-// The main method is Rejected - which returns //
-// True to reject particle //
-// False in case it meets all the criteria of the given cut //
-// //
-// This class has the list of base particle cuts that perform check on //
-// single property. Particle is rejected if any of cuts rejects it. //
-// There are implemented logical base cuts that perform logical //
-// operations on results of two other base cuts. Using them user can //
-// create a tree structure of a base cuts that performs sophisticated //
-// cut. //
-// //
-// User can also implement a base cut that performs complicated //
-// calculations, if it is only more convenient and/or efficint. //
-// //
-// User should delete created cuts himself //
-// because when setting a cut, other objects (functions,analyses, //
-// readers, other cuts) make their own copy of a cut. //
-// //
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html //
-// responsible: Piotr Skowronski@cern.ch //
-// //
-////////////////////////////////////////////////////////////////////////////
-
-#include <TObject.h>
-#include "AliVAODParticle.h"
-#include "AliAODParticleBaseCut.h"
-
-
-class AliAODParticleEmptyCut;
-class AliAODParticleCut;
-class AliAODParticleBaseCut;
-
-
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-class AliAODParticleCut: public TObject
-{
-//Class describing cut on particle
- public:
-
- AliAODParticleCut();
- AliAODParticleCut(const AliAODParticleCut& in);
- virtual ~AliAODParticleCut();
- AliAODParticleCut& operator = (const AliAODParticleCut& in);
-
- virtual Bool_t Rejected(AliVAODParticle* p) const;
- Bool_t IsEmpty() const {return kFALSE;}
-
- void AddBasePartCut(AliAODParticleBaseCut* basecut);
-
- Int_t GetPID() const { return fPID;}
- void SetPID(Int_t pid){fPID=pid;}
- void SetMomentumRange(Double_t min, Double_t max);
- void SetPRange(Double_t min, Double_t max){SetMomentumRange(min,max);}
- void SetPtRange(Double_t min, Double_t max);
- void SetEnergyRange(Double_t min, Double_t max);
- void SetRapidityRange(Double_t min, Double_t max);
- void SetYRange(Double_t min, Double_t max){SetRapidityRange(min,max);}
- void SetPseudoRapidityRange(Double_t min, Double_t max);
- void SetPxRange(Double_t min, Double_t max);
- void SetPyRange(Double_t min, Double_t max);
- void SetPzRange(Double_t min, Double_t max);
- void SetPhiRange(Double_t min, Double_t max);
- void SetThetaRange(Double_t min, Double_t max);
- void SetVxRange(Double_t min, Double_t max);
- void SetVyRange(Double_t min, Double_t max);
- void SetVzRange(Double_t min, Double_t max);
-
- void Print(const Option_t * opt = "") const;
- protected:
-
- AliAODParticleBaseCut* FindCut(AliAODParticleBaseCut::EAODCutProperty property);
-
- AliAODParticleBaseCut ** fCuts;//! Array with cuts
- Int_t fNCuts; //number of base cuts stored in fCuts
-
- Int_t fPID; //particle PID - if=0 (rootino) all pids are accepted
-
- private:
- static const Int_t fgkMaxCuts; //Size of the fCuts array
-
- ClassDef(AliAODParticleCut,1)
-};
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-class AliAODParticleEmptyCut: public AliAODParticleCut
-{
-//Empty - it passes possitively all particles - it means returns always False
-//Class describing cut on particles
- public:
- AliAODParticleEmptyCut(){};
- virtual ~AliAODParticleEmptyCut(){};
-
- Bool_t Rejected(AliVAODParticle*) const {return kFALSE;} //accept everything
- Bool_t IsEmpty() const {return kTRUE;}
-
- ClassDef(AliAODParticleEmptyCut,1)
-
-};
-
-/******************************************************************/
-/******************************************************************/
-/******************************************************************/
-
-
-#endif
+++ /dev/null
-#include "AliAODRun.h"
-//____________________
-///////////////////////////////////////////////////////
-// //
-// AliAODRun //
-// //
-// Class storing and managing events //
-// //
-// Piotr.Skowronski@cern.ch //
-// http://aliweb.cern.ch/people/skowron/analyzer //
-// //
-///////////////////////////////////////////////////////
-
-#include <TObjArray.h>
-
-ClassImp(AliAODRun)
-/**************************************************************************/
-
-AliAODRun::AliAODRun():
- fEvents(new TObjArray())
-{
- //contructor
- if(!fEvents) Fatal("AliAODRun::AliAODRun","Can not allocate memory");
- fEvents->SetOwner(); //array is an owner: when is deleted or cleared it deletes objects that it contains
-}
-/**************************************************************************/
-
-AliAODRun::~AliAODRun()
-{
- //destructor
- delete fEvents;//delete array with events
-}
-/**************************************************************************/
-
-void AliAODRun::Reset()
- {
- fEvents->Clear();//clear an array with events.
- //All events are deleted because array is an owner (set in constructor)
- }
-/**************************************************************************/
-
-void AliAODRun::AddParticle(Int_t event, AliVAODParticle* part)
-{
- //Adds particle to event
- //if there is no event of this number, crate it and add to the collection
- if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliAOD, event);
-
- GetEvent(event)->AddParticle(part);
-}
-/**************************************************************************/
-
-void AliAODRun::AddParticle(Int_t event, TParticle* part, Int_t idx)
-{
- //if there is no event of this number, crate it and add to the collection
- if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliAOD, event);
- GetEvent(event)->AddParticle(part,idx);
-}
-/**************************************************************************/
-
-void AliAODRun::AddParticle(Int_t event, Int_t pdg, Int_t idx,
- Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time)
-{
- //if there is no event of this number, crate it and add to the collection
- if(!GetEvent(event)) fEvents->AddAtAndExpand(new AliAOD, event);
- GetEvent(event)->AddParticle(pdg,idx,px,py,pz,etot,vx,vy,vz,time);
-}
-/**************************************************************************/
-
-void AliAODRun::SetEvent(Int_t number, AliAOD* event)
-{
- //adds an event to the run
- if (event == 0x0)
- {
- delete fEvents->RemoveAt(number);
- return;
- }
- AliAOD* ev = GetEvent(number);
- if (ev == event) return;
-
- delete fEvents->RemoveAt(number);
- fEvents->AddAtAndExpand(event, number);
-
-}
-/**************************************************************************/
-
+++ /dev/null
-#ifndef ALIAODRUN_H
-#define ALIAODRUN_H
-//____________________
-///////////////////////////////////////////////////////
-// //
-// AliAODRun //
-// //
-// Class storing and managing set events //
-// designed for fast acces //
-// //
-// Piotr.Skowronski@cern.ch //
-// http://aliweb.cern.ch/people/skowron/analyzer //
-// //
-///////////////////////////////////////////////////////
-
-
-#include "AliAOD.h"
-#include <TObjArray.h>
-
-class AliVAODParticle;
-class TParticle;
-
-class AliAODRun: public TObject
- {
- public:
- AliAODRun();
- virtual ~AliAODRun();
-
- void AddParticle(Int_t event, AliVAODParticle* part); //inerface to AliAOD::AddParticle(AliVAODParticle*)
- void AddParticle(Int_t event, TParticle* part, Int_t idx);//inerface to AliAOD::AddParticle(TParticle*)
-
- //inerface to AliAOD::AddParticle(Int_t.Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Double_t,Double_t)
- void AddParticle(Int_t event, Int_t pdg, Int_t idx,
- Double_t px, Double_t py, Double_t pz, Double_t etot,
- Double_t vx, Double_t vy, Double_t vz, Double_t time);
-
- void SetEvent(Int_t number, AliAOD* event);
- AliVAODParticle* GetParticle(Int_t event, Int_t n); //returns nth particle from event
- AliAOD* GetEvent(Int_t event) const; //returns AliAOD number "event"
-
- Int_t GetNumberOfEvents() const; //returns number of events
- Int_t GetNumberOfParticlesInEvent(Int_t event) const; //returns number of particles in event number "event"
- void Reset();//clears all events in the array (deletes)
- protected:
- TObjArray* fEvents;//!Array containig AliAODs
- private:
-
- AliAODRun(const AliAODRun&); // Not implemented
- AliAODRun& operator=(const AliAODRun&); // Not implemented
-
- ClassDef(AliAODRun,1)
- };
-
-
-/**************************************************************************/
-
-inline
-AliAOD* AliAODRun::GetEvent(Int_t event) const
-{
-//returns pointer to AliAOD number "event"
- //check if array is enough big - protect from error massage from array "Out Of Bounds"
- if (event>=fEvents->GetSize()) return 0x0;//WARNING, that line relies
- //on index of first object in TObjArray is 0
- //== LowerBound = 0
- return (AliAOD*)fEvents->At(event);
-}
-/**************************************************************************/
-inline
-AliVAODParticle* AliAODRun::GetParticle(Int_t event, Int_t n)
-{
- //returns nth particle from event number event
- AliAOD* e = GetEvent(event);
- return (e)?e->GetParticle(n):0x0;
-}
-
-/**************************************************************************/
-
-inline
-Int_t AliAODRun::GetNumberOfEvents() const
- {
-//returns number of events in collection
-
- return fEvents->GetEntriesFast(); //there may be empty slots but we do not care
- //Analysis checks it if return is not NULL
- }
-/**************************************************************************/
-
-inline
-Int_t AliAODRun::GetNumberOfParticlesInEvent(Int_t event) const
-{
-//returns number of Particles in event
- AliAOD* e = GetEvent(event);
- return (e)?e->GetNumberOfParticles():0x0;
-}
-
-#endif
+++ /dev/null
-#include "AliAnalysis.h"
-//________________________________
-///////////////////////////////////////////////////////////
-//
-// class AliAnalysis
-//
-// Base class for analysis.
-// Each inheriting calss must define 3 methods:
-// - Init() : that is called before event processing
-// - ProcessEvent(AliESD*,AliStack*)
-// -
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////
-
-#include "AliEventCut.h"
-#include "AliAODPairCut.h"
-
-ClassImp(AliAnalysis)
-
-AliAnalysis::AliAnalysis():
- fEventCut(0x0),
- fCutOnSim(kTRUE),
- fCutOnRec(kTRUE),
- fPairCut(new AliAODPairEmptyCut()),//empty cut - accepts all particles
- fkPass(&AliAnalysis::PassPartAndTrack), //by default perform cut on both track and particle pair
- fkPass1(&AliAnalysis::PassPartAndTrack1), //used onluy by ProcessTracksAndParticles
- fkPass2(&AliAnalysis::PassPartAndTrack2),
- fkPassPairProp(&AliAnalysis::PassPairPropPartAndTrack)
-{
- //ctor
-}
-/*********************************************************/
-
-AliAnalysis::AliAnalysis(const char* name,const char* title):
- TTask(name,title),
- fEventCut(0x0),
- fCutOnSim(kTRUE),
- fCutOnRec(kTRUE),
- fPairCut(new AliAODPairEmptyCut()),//empty cut - accepts all particles
- fkPass(&AliAnalysis::PassPartAndTrack), //by default perform cut on both track and particle pair
- fkPass1(&AliAnalysis::PassPartAndTrack1), //used onluy by ProcessTracksAndParticles
- fkPass2(&AliAnalysis::PassPartAndTrack2),
- fkPassPairProp(&AliAnalysis::PassPairPropPartAndTrack)
-{
- //ctor
-}
-/*********************************************************/
-AliAnalysis::AliAnalysis(const AliAnalysis& ana):
- TTask(ana),
- fEventCut(ana.fEventCut),
- fCutOnSim(ana.fCutOnSim),
- fCutOnRec(ana.fCutOnRec),
- fPairCut(ana.fPairCut),
- fkPass(ana.fkPass),
- fkPass1(ana.fkPass1),
- fkPass2(ana.fkPass2),
- fkPassPairProp(ana.fkPassPairProp)
-{
- //ctor
-}
-/*********************************************************/
-
-AliAnalysis::~AliAnalysis()
-{
- //dtor
- delete fEventCut;
-}
-/*********************************************************/
-
-void AliAnalysis::SetEventCut(AliEventCut* evcut)
-{
-//Sets event - makes a private copy
- delete fEventCut;
- if (evcut) fEventCut = (AliEventCut*)evcut->Clone();
- else fEventCut = 0x0;
-}
-/*********************************************************/
-
-Bool_t AliAnalysis::Rejected(AliAOD* recevent, AliAOD* simevent)
-{
- //checks the event cut
- if (fEventCut == 0x0) return kFALSE;
-
- if (fCutOnRec)
- if (fEventCut->Rejected(recevent)) return kTRUE;
-
- if (fCutOnSim)
- if (fEventCut->Rejected(simevent)) return kTRUE;
-
- return kFALSE;
-}
-/*************************************************************************************/
-
-void AliAnalysis::SetPairCut(AliAODPairCut* cut)
-{
-//Sets new Pair Cut. Old one is deleted
-//Note that it is created new object instead of simple pointer set
-//I do not want to have pointer
-//to object created somewhere else
-//because in that case I could not believe that
-//it would always exist (sb could delete it)
-//so we have always own copy
-
- if(!cut)
- {
- Error("AliHBTFunction::SetPairCut","argument is NULL");
- return;
- }
- delete fPairCut;
- fPairCut = (AliAODPairCut*)cut->Clone();
-
-}
-/******************************************************************/
-
-void AliAnalysis::SetCutsOnSim()
-{
- // -- aplies only to Process("TracksAndParticles")
- // (ProcessTracksAndParticles and ProcessTracksAndParticlesNonIdentAnal)
- // Only particles properties are checkes against cuts
-
- fCutOnRec = kFALSE;
- fCutOnSim = kTRUE;
-
- fkPass = &AliAnalysis::PassPart;
- fkPass1 = &AliAnalysis::PassPart1;
- fkPass2 = &AliAnalysis::PassPart2;
- fkPassPairProp = &AliAnalysis::PassPairPropPart;
-
-}
-/*************************************************************************************/
-
-void AliAnalysis::SetCutsOnRec()
-{
- // -- aplies only to Process("TracksAndParticles")
- // (ProcessTracksAndParticles and ProcessTracksAndParticlesNonIdentAnal)
- // Only tracks properties are checkes against cuts
-
- fCutOnRec = kTRUE;
- fCutOnSim = kFALSE;
-
- fkPass = &AliAnalysis::PassTrack;
- fkPass1 = &AliAnalysis::PassTrack1;
- fkPass2 = &AliAnalysis::PassTrack2;
- fkPassPairProp = &AliAnalysis::PassPairPropTrack;
-
-}
-/*************************************************************************************/
-
-void AliAnalysis::SetCutsOnRecAndSim()
-{
- // -- aplies only to Process("TracksAndParticles")
- // (ProcessTracksAndParticles and ProcessTracksAndParticlesNonIdentAnal)
- // Both, tracks and particles, properties are checked against cuts
-
- fCutOnRec = kTRUE;
- fCutOnSim = kTRUE;
-
- fkPass = &AliAnalysis::PassPartAndTrack;
- fkPass1 = &AliAnalysis::PassPartAndTrack1;
- fkPass2 = &AliAnalysis::PassPartAndTrack2;
- fkPassPairProp = &AliAnalysis::PassPairPropPartAndTrack;
-}
+++ /dev/null
-#ifndef ALIANALYSIS_H
-#define ALIANALYSIS_H
-//________________________________
-///////////////////////////////////////////////////////////
-//
-// class AliAnalysis
-//
-// Base class for analysis
-//
-//
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////
-
-#include <TTask.h>
-#include <AliAODParticleCut.h>
-#include <AliAODPairCut.h>
-
-class AliAOD;
-class AliStack;
-class AliEventCut;
-class AliVAODParticle;
-class AliAODPair;
-
-class AliAnalysis: public TTask
-{
- public:
- AliAnalysis();
- AliAnalysis(const char* name,const char* title);
- virtual ~AliAnalysis();
-
- virtual Int_t Init() = 0;
- virtual Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim = 0x0) = 0;
- virtual Int_t Finish() = 0;
-
- void SetCutsOnRec();
- void SetCutsOnSim();
- void SetCutsOnRecAndSim();
-
- void SetEventCut(AliEventCut* evcut);
- void SetPairCut(AliAODPairCut* cut);
-
- protected:
- Bool_t Rejected(AliAOD* recevent, AliAOD* simevent);
- AliEventCut* fEventCut;//event cut
-
- Bool_t fCutOnSim;//flag indicating that event cut is performed on simulated particles
- Bool_t fCutOnRec;//flag indicating that event cut is performed on reconstructed tracks
-
- AliAODPairCut* fPairCut;// Pair cut applied for all mixed particles
-
- /**********************************************/
- /* C U T S */
- /**********************************************/
-
- Bool_t (AliAnalysis::*fkPass)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
- Bool_t (AliAnalysis::*fkPass1)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on first particle
- Bool_t (AliAnalysis::*fkPass2)(AliVAODParticle* partpair, AliVAODParticle* trackpair) const;//Pointer to function that performes cut on second particle
- Bool_t (AliAnalysis::*fkPassPairProp)(AliAODPair* partpair, AliAODPair* trackpair) const;//Pointer to function that performes pair cut
-
- Bool_t PassPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->Rejected((AliAODPair*)partpair))?kTRUE:fPairCut->Rejected((AliAODPair*)trackpair);}
- Bool_t PassPartAndTrack1(AliVAODParticle* part, AliVAODParticle* track) const;
- Bool_t PassPartAndTrack2(AliVAODParticle* part, AliVAODParticle* track) const;
- Bool_t PassPairPropPartAndTrack (AliAODPair* partpair, AliAODPair* trackpair) const {return (fPairCut->PassPairProp((AliAODPair*)partpair))?kTRUE:fPairCut->PassPairProp((AliAODPair*)trackpair);}
-
- Bool_t PassPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->Rejected((AliAODPair*)partpair);}
- Bool_t PassPart1(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetFirstPartCut()->Rejected(part);}
- Bool_t PassPart2(AliVAODParticle* part, AliVAODParticle* /*track*/) const {return fPairCut->GetSecondPartCut()->Rejected(part);}
- Bool_t PassPairPropPart (AliAODPair* partpair, AliAODPair* /*trackpair*/) const {return fPairCut->PassPairProp((AliAODPair*)partpair);}
-
- Bool_t PassTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->Rejected((AliAODPair*)trackpair);}
- Bool_t PassTrack1(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetFirstPartCut()->Rejected(track);}
- Bool_t PassTrack2(AliVAODParticle* /*part*/, AliVAODParticle* track) const {return fPairCut->GetSecondPartCut()->Rejected(track);}
- Bool_t PassPairPropTrack (AliAODPair* /*partpair*/, AliAODPair* trackpair) const {return fPairCut->PassPairProp((AliAODPair*)trackpair);}
-
- AliAnalysis(const AliAnalysis&);
-
- private:
- AliAnalysis& operator=(const AliAnalysis&); // Not implemented
-
- ClassDef(AliAnalysis,1)
-};
-
-
-inline Bool_t AliAnalysis::PassPartAndTrack1(AliVAODParticle* part,AliVAODParticle* track) const
-{
-//Checks first particle from both, particle and track pairs
- AliAODParticleCut* pc = fPairCut->GetFirstPartCut();
- return (pc->Rejected(part))?kTRUE:pc->Rejected(track);
-}
-/*************************************************************************************/
-
-inline Bool_t AliAnalysis::PassPartAndTrack2(AliVAODParticle* part,AliVAODParticle* track) const
-{
-//Checks second particle from both, particle and track pairs
- AliAODParticleCut* pc = fPairCut->GetSecondPartCut();
- return (pc->Rejected(part))?kTRUE:pc->Rejected(track);
-}
-/*************************************************************************************/
-
-#endif
+++ /dev/null
-/**************************************************************************
- * Author: Panos Christakoglou. *
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-----------------------------------------------------------------
-// AliAnalysisEventCuts class
-// This is the class to deal with the event and track level cuts
-// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
-//-----------------------------------------------------------------
-
-
-
-//ROOT
-#include <TPaveText.h>
-#include <TText.h>
-#include <TLine.h>
-#include <TCanvas.h>
-
-#include "AliLog.h"
-#include "AliESD.h"
-
-#include "AliAnalysisEventCuts.h"
-
-ClassImp(AliAnalysisEventCuts)
-
-//----------------------------------------//
- AliAnalysisEventCuts::AliAnalysisEventCuts() :
- TObject(),
- fVerboseOff(0), fVxMin(0), fVxMax(0),
- fVyMin(0), fVyMax(0),
- fVzMin(0), fVzMax(0),
- fMultMin(0), fMultMax(0),
- fVzFlagType(""),
- fMult(0), fVx(0), fVy(0), fVz(0),
- fVzFlag(0), fTotalEvents(0),
- fAcceptedEvents(0), fFlagMult(0),
- fFlagVx(0), fFlagVy(0), fFlagVz(0),
- fFlagVzType(0) {
- //Default constructor which calls the Reset method.
- Reset();
- }
-
-//----------------------------------------//
-AliAnalysisEventCuts::~AliAnalysisEventCuts()
-{
- //Defaut destructor.
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::Reset()
-{
- fVerboseOff = kFALSE;
-
- //Sets dummy values to every private member.
- fVxMin = -1000.0;
- fVxMax = 1000.0;
- fVyMin = -1000.0;
- fVyMax = 1000.0;
- fVzMin = -1000.0;
- fVzMax = 1000.0;
- fMultMin = 0;
- fMultMax = 100000;
- fVzFlagType = "default";
-
- fMult = 0;
- fVx = 0;
- fVy = 0;
- fVz = 0;
- fVzFlag = 0;
- fTotalEvents = 0;
- fAcceptedEvents = 0;
-
- fFlagMult = 0;
- fFlagVx = 0;
- fFlagVy = 0;
- fFlagVz = 0;
- fFlagVzType = 0;
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::SetPrimaryVertexXRange(Float_t r1, Float_t r2)
-{
- //Sets the primary vertex x range.
- fVxMin = r1;
- fVxMax = r2;
- fFlagVx = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::SetPrimaryVertexYRange(Float_t r1, Float_t r2)
-{
- //Sets the primary vertex y range.
- fVyMin = r1;
- fVyMax = r2;
- fFlagVy = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::SetPrimaryVertexZRange(Float_t r1, Float_t r2)
-{
- //Sets the primary vertex z range.
- fVzMin = r1;
- fVzMax = r2;
- fFlagVz = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::SetMultiplicityRange(Int_t n1, Int_t n2)
-{
- //Sets the multiplicity range.
- fMultMin = n1;
- fMultMax = n2;
- fFlagMult = 1;
-}
-
-
-//----------------------------------------//
-Bool_t AliAnalysisEventCuts::IsAccepted(AliESD *esd)
-{
- //Returns true if the events is accepted otherwise false.
- fTotalEvents++;
- if((esd->GetNumberOfTracks() < fMultMin) || (esd->GetNumberOfTracks() > fMultMax)) {
- fMult++;
- if(!fVerboseOff)
- AliInfo(Form("Event rejected due to multiplicity cut"));
- return kFALSE;
- }
- const AliESDVertex *esdvertex = esd->GetVertex();
- TString vertexname = esdvertex->GetName();
- if((esdvertex->GetXv() < fVxMin) || (esdvertex->GetXv() > fVxMax)) {
- fVx++;
- if(!fVerboseOff)
- AliInfo(Form("Event rejected due to Vx cut"));
- return kFALSE;
- }
- if((esdvertex->GetYv() < fVyMin) || (esdvertex->GetYv() > fVyMax)) {
- fVy++;
- if(!fVerboseOff)
- AliInfo(Form("Event rejected due to Vy cut"));
- return kFALSE;
- }
- if((esdvertex->GetZv() < fVzMin) || (esdvertex->GetZv() > fVzMax)) {
- fVz++;
- if(!fVerboseOff)
- AliInfo(Form("Event rejected due to Vz cut"));
- return kFALSE;
- }
- if((fFlagVzType == 1)&&(vertexname == "default")) {
- fVzFlag++;
- if(!fVerboseOff)
- AliInfo(Form("Event rejected due to Vz flag cut"));
- return kFALSE;
- }
- fAcceptedEvents++;
-
- return kTRUE;
-}
-
-
-//----------------------------------------//
-TPaveText *AliAnalysisEventCuts::GetEventCuts()
-{
- //Shows a TPaveText with all the event cut stats.
- TCanvas *ccuts = new TCanvas("ccuts","Event cuts",10,10,400,400);
- ccuts->SetFillColor(10);
- ccuts->SetHighLightColor(10);
-
- TPaveText *pave = new TPaveText(0.01,0.01,0.98,0.98);
- pave->SetFillColor(5);
- Char_t cutName[256];
-
- TLine *l1 = pave->AddLine(0,0.78,1,0.78);
- l1->SetLineWidth(2);
- TLine *l2 = pave->AddLine(0,0.58,1,0.58);
- l2->SetLineWidth(2);
- TLine *l3 = pave->AddLine(0,0.38,1,0.38);
- l3->SetLineWidth(2);
- TLine *l4 = pave->AddLine(0,0.18,1,0.18);
- l4->SetLineWidth(2);
-
- sprintf(cutName,"Total number of events: %d",fTotalEvents);
- TText *t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Total number of accepted events: %d",fAcceptedEvents);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Multiplicity range: [%d,%d]",fMultMin,fMultMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Events rejected: %d",fMult);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Vx range: [%f,%f]",fVxMin,fVxMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Events rejected: %d",fVx);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Vy range: [%f,%f]",fVyMin,fVyMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Events rejected: %d",fVy);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Vz range: [%f,%f]",fVzMin,fVzMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Events rejected: %d",fVz);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(4);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- return pave;
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::GetEventStats()
-{
- //Returns the total event stats.
- //fTotalEvents is the total number of events.
- //fAcceptedEvents is the total number of accepted events.
- AliInfo(Form("Total number of events: %d",fTotalEvents));
- AliInfo(Form("Total number of accepted events: %d",fAcceptedEvents));
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::GetMultStats()
-{
- //Gets the multiplicity statistics.
- //Prints the percentage of events rejected due to this cut.
- AliInfo(Form("Multiplicity range: [%d,%d]",fMultMin,fMultMax));
- AliInfo(Form("Events rejected: %d",fMult));
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::GetVxStats()
-{
- //Gets the Vx statistics.
- //Prints the percentage of events rejected due to this cut.
- AliInfo(Form("Vx range: [%f,%f]",fVxMin,fVxMax));
- AliInfo(Form("Events rejected: %d",fVx));
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::GetVyStats()
-{
- //Gets the Vy statistics.
- //Prints the percentage of events rejected due to this cut.
- AliInfo(Form("Vy range: [%f,%f]",fVyMin,fVyMax));
- AliInfo(Form("Events rejected: %d",fVy));
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::GetVzStats()
-{
- //Gets the Vz statistics.
- //Prints the percentage of events rejected due to this cut.
- AliInfo(Form("Vz range: [%f,%f]",fVzMin,fVzMax));
- AliInfo(Form("Events rejected: %d",fVz));
- AliInfo(Form("Events rejected (Vz flag): %d",fVzFlag));
-}
-
-//----------------------------------------//
-void AliAnalysisEventCuts::PrintEventCuts()
-{
- //Prints the event stats.
- //GetEventCuts()->Draw();
-
- AliInfo(Form("**************EVENT CUTS**************"));
- GetEventStats();
- if(fFlagMult) GetMultStats();
- if(fFlagVx) GetVxStats();
- if(fFlagVy) GetVyStats();
- if((fFlagVz)||(fFlagVzType)) GetVzStats();
- AliInfo(Form("**************************************"));
-}
-
-
-
+++ /dev/null
-#ifndef ALIANALYSISEVENTCUTS_H
-#define ALIANALYSISEVENTCUTS_H
-/* See cxx source for full Copyright notice */
-
-
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// Class AliAnalysisEventCuts
-// This is the class for the cuts in event & track level
-//
-// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
-//-------------------------------------------------------------------------
-
-#include <TObject.h>
-
-class TPaveText;
-class AliESD;
-
-class AliAnalysisEventCuts : public TObject
-{
- public:
- AliAnalysisEventCuts();
-
- ~AliAnalysisEventCuts();
-
- void Reset();
-
- void SetPrimaryVertexXRange(Float_t r1, Float_t r2);
- void SetPrimaryVertexYRange(Float_t r1, Float_t r2);
- void SetPrimaryVertexZRange(Float_t r1, Float_t r2);
- void SetPrimaryVertexZFlag() {fVzFlagType = "reconstructed";fFlagVzType = 1;};
- void SetMultiplicityRange(Int_t n1, Int_t n2);
- void SetVerboseOff() {fVerboseOff = kTRUE;};
-
- Bool_t IsAccepted(AliESD *esd);
-
- TPaveText *GetEventCuts();
- void PrintEventCuts();
- void GetEventStats();
- void GetMultStats();
- void GetVxStats();
- void GetVyStats();
- void GetVzStats();
-
- private:
- Bool_t fVerboseOff; //cancel the output
-
- Float_t fVxMin, fVxMax; //Definition of the range of the Vx
- Float_t fVyMin, fVyMax; //Definition of the range of the Vy
- Float_t fVzMin, fVzMax; //Definition of the range of the Vz
- Int_t fMultMin, fMultMax; //Definition of the range of the multiplicity
- TString fVzFlagType; //Flag for the primary vertex(good: "reconstructed" -- fake: "default")
-
- Int_t fMult; //Number of events rejected due to multiplicity cut
- Int_t fVx; //Number of events rejected due to Vx cut
- Int_t fVy; //Number of events rejected due to Vy cut
- Int_t fVz; //Number of events rejected due to Vz cut
- Int_t fVzFlag; //Number of events rejected due to Vz flag cut
- Int_t fTotalEvents; //Total number of events
- Int_t fAcceptedEvents; //Total number of events accepted
-
- Int_t fFlagMult; //Flag that shows if the multiplicity cut was imposed
- Int_t fFlagVx; //Flag that shows if the Vx cut was imposed
- Int_t fFlagVy; //Flag that shows if the Vy cut was imposed
- Int_t fFlagVz; //Flag that shows if the Vz cut was imposed
- Int_t fFlagVzType; //Flag that shows if the Vz flag cut was imposed
-
- ClassDef(AliAnalysisEventCuts, 2)
-} ;
-
-#endif
+++ /dev/null
-/**************************************************************************
- * Author: Panos Christakoglou. *
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//-----------------------------------------------------------------
-// AliAnalysisTrackCuts class
-// This is the class to deal with the event and track level cuts
-// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
-//-----------------------------------------------------------------
-
-
-
-//ROOT
-#include <TPaveText.h>
-#include <TText.h>
-#include <TLine.h>
-#include <TCanvas.h>
-#include <TObjArray.h>
-#include <Riostream.h>
-
-#include "AliLog.h"
-
-#include "AliESDtrack.h"
-#include "AliESD.h"
-
-#include "AliAnalysisTrackCuts.h"
-
-ClassImp(AliAnalysisTrackCuts)
-
-//----------------------------------------//
- AliAnalysisTrackCuts::AliAnalysisTrackCuts() :
- TObject(),
- fPMin(0), fPMax(0), fPtMin(0), fPtMax(0),
- fPxMin(0), fPxMax(0), fPyMin(0), fPyMax(0),
- fPzMin(0), fPzMax(0), fEtaMin(0), fEtaMax(0),
- fRapMin(0), fRapMax(0), fBrMin(0), fBrMax(0),
- fBzMin(0), fBzMax(0),
- fP(0), fPt(0), fPx(0), fPy(0), fPz(0),
- fEta(0), fRap(0),
- fbr(0), fbz(0),
- fTotalTracks(0), fAcceptedTracks(0),
- fFlagP(0), fFlagPt(0), fFlagPx(0), fFlagPy(0), fFlagPz(0),
- fFlagEta(0), fFlagRap(0), fFlagbr(0), fFlagbz(0),
- fAcceptedParticleList(0) {
- //Default constructor.
- //Calls the Reset method.
- Reset();
-}
-
-//----------------------------------------//
-AliAnalysisTrackCuts::~AliAnalysisTrackCuts()
-{
- //Destructor.
- delete fAcceptedParticleList;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::Reset()
-{
- //Assigns dummy values to every private member.
- fPxMin = -1000.0;
- fPxMax = 1000.0;
- fPyMin = -1000.0;
- fPyMax = 1000.0;
- fPzMin = -1000.0;
- fPzMax = 1000.0;
- fPtMin = 0.0;
- fPtMax = 1000.0;
- fPMin = 0.0;
- fPMax = 1000.0;
- fBrMin = 0.0;
- fBrMax = 1000.0;
- fBzMin = 0.0;
- fBzMax = 1000.0;
- fEtaMin = -100.0;
- fEtaMax = 100.0;
- fRapMin = -100.0;
- fRapMax = 100.0;
-
- fP = 0;
- fPt = 0;
- fPx = 0;
- fPy = 0;
- fPz = 0;
- fbr = 0;
- fbz = 0;
- fEta = 0;
- fRap = 0;
- fTotalTracks = 0;
- fAcceptedTracks = 0;
-
- fFlagP = 0;
- fFlagPt = 0;
- fFlagPx = 0;
- fFlagPy = 0;
- fFlagPz = 0;
- fFlagEta = 0;
- fFlagRap = 0;
- fFlagbr = 0;
- fFlagbz = 0;
-
- fAcceptedParticleList = new TObjArray();
-}
-
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetPxRange(Float_t r1, Float_t r2)
-{
- //Sets the range for the momentum x component.
- fPxMin = r1;
- fPxMax = r2;
- fFlagPx = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetPyRange(Float_t r1, Float_t r2)
-{
- //Sets the range for the momentum y component.
- fPyMin = r1;
- fPyMax = r2;
- fFlagPy = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetPzRange(Float_t r1, Float_t r2)
-{
- //Sets the range for the momentum z component.
- fPzMin = r1;
- fPzMax = r2;
- fFlagPy = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetPRange(Float_t r1, Float_t r2)
-{
- //Sets the range for the momentum.
- fPMin = r1;
- fPMax = r2;
- fFlagPz = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetPtRange(Float_t r1, Float_t r2)
-{
- //Sets the range for the teransverse momentum.
- fPtMin = r1;
- fPtMax = r2;
- fFlagPt = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetBrRange(Float_t r1, Float_t r2)
-{
- //Sets the range of the closest approach of the track
- //to the primary vertex in the r-phi plane.
- fBrMin = r1;
- fBrMax = r2;
- fFlagbr = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetBzRange(Float_t r1, Float_t r2)
-{
- //Sets the range of the closest approach of the track
- //to the primary vertex in the beam axis.
- fBzMin = r1;
- fBzMax = r2;
- fFlagbz = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetEtaRange(Float_t r1, Float_t r2)
-{
- //Sets the range of the pseudo-rapidity.
- fEtaMin = r1;
- fEtaMax = r2;
- fFlagEta = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::SetRapRange(Float_t r1, Float_t r2)
-{
- //Sets the range of the rapidity.
- fRapMin = r1;
- fRapMax = r2;
- fFlagRap = 1;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetTrackStats()
-{
- //Gets the statistics.
- //fTotalTracks is the total number of tracks.
- //fAcceptedTracks is the number of accepted tracks after the cuts.
- AliInfo(Form("Total number of tracks: %d",fTotalTracks));
- AliInfo(Form("Total number of accepted tracks: %d",fAcceptedTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetPStats()
-{
- //Gets the momentum statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("P range: [%f,%f]",fPMin,fPMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fP/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetPtStats()
-{
- //Gets the transverse momentum statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("Pt range: [%f,%f]",fPtMin,fPtMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fPt/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetPxStats()
-{
- //Gets the x momentum statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("Px range: [%f,%f]",fPxMin,fPxMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fPx/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetPyStats()
-{
- //Gets the y momentum statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("Py range: [%f,%f]",fPyMin,fPyMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fPy/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetPzStats()
-{
- //Gets the z momentum statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("Pz range: [%f,%f]",fPzMin,fPzMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fPz/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetEtaStats()
-{
- //Gets the pseudo-rapidity statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("eta range: [%f,%f]",fEtaMin,fEtaMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fEta/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetRapStats()
-{
- //Gets the rapidity statistics.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("y range: [%f,%f]",fRapMin,fRapMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fRap/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetBrStats()
-{
- //Gets the statistics fro the closest distance of
- //the track to the primary vertex in the r-phi plane.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("br range: [%f,%f]",fBrMin,fBrMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fbr/fTotalTracks));
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::GetBzStats()
-{
- //Gets the statistics fro the closest distance of
- //the track to the primary vertex in the beam axis.
- //Prints the percentage of tracks rejected due to this cut.
- AliInfo(Form("bz range: [%f,%f]",fBzMin,fBzMax));
- if(fTotalTracks != 0)
- AliInfo(Form("Tracks rejected: %f",100.0*fbz/fTotalTracks));
-}
-
-
-//----------------------------------------//
-Bool_t AliAnalysisTrackCuts::IsAccepted(AliESD *esd ,AliESDtrack *esdtrack)
-{
- //Returns true if the tracks is accepted otherwise false.
- fTotalTracks++;
-
- //momentum related calculations
- Double_t p[3];
- esdtrack->GetPxPyPz(p);
- Float_t momentum = TMath::Sqrt(pow(p[0],2) + pow(p[1],2) + pow(p[2],2));
- Float_t pt = TMath::Sqrt(pow(p[0],2) + pow(p[1],2));
- Float_t energy = TMath::Sqrt(pow(esdtrack->GetMass(),2) + pow(momentum,2));
-
- //y-eta related calculations
- Float_t eta = -100.;
- Float_t y = -100.;
- if((momentum != TMath::Abs(p[2]))&&(momentum != 0))
- eta = 0.5*TMath::Log((momentum + p[2])/(momentum - p[2]));
- if((energy != TMath::Abs(p[2]))&&(momentum != 0))
- y = 0.5*TMath::Log((energy + p[2])/(energy - p[2]));
-
- //impact parameter related calculations
- Double_t trackPosition[3];
- esdtrack->GetXYZ(trackPosition);
- const AliESDVertex * vertexIn = esd->GetVertex();
- Double_t vertexPosition[3];
- vertexIn->GetXYZ(vertexPosition);
- for (Int_t ii=0; ii<3; ii++) trackPosition[ii] -= vertexPosition[ii];
-
- Float_t br = Float_t(TMath::Sqrt(pow(trackPosition[0],2) + pow(trackPosition[1],2)));
- Float_t bz = Float_t(TMath::Abs(trackPosition[2]));
-
- if((momentum < fPMin) || (momentum > fPMax)) {
- fP++;
- return kFALSE;
- }
- if((pt < fPtMin) || (pt > fPtMax)) {
- fPt++;
- return kFALSE;
- }
- if((p[0] < fPxMin) || (p[0] > fPxMax)) {
- fPx++;
- return kFALSE;
- }
- if((p[1] < fPyMin) || (p[1] > fPyMax)) {
- fPy++;
- return kFALSE;
- }
- if((p[2] < fPzMin) || (p[2] > fPzMax)) {
- fPz++;
- return kFALSE;
- }
- if((br < fBrMin) || (br > fBrMax)) {
- fbr++;
- return kFALSE;
- }
- if((bz < fBzMin) || (bz > fBzMax)) {
- fbz++;
- return kFALSE;
- }
- if((eta < fEtaMin) || (eta > fEtaMax)) {
- fEta++;
- return kFALSE;
- }
- if((y < fRapMin) || (y > fRapMax)) {
- fRap++;
- return kFALSE;
- }
-
- fAcceptedTracks++;
-
- return kTRUE;
-}
-
-
-//----------------------------------------//
-TObjArray *AliAnalysisTrackCuts::GetAcceptedParticles(AliESD *esd)
-{
- // Returns a list of all tracks that pass the cuts
- fAcceptedParticleList->Clear();
- for (Int_t iTrack = 0; iTrack < esd->GetNumberOfTracks(); iTrack++) {
- AliESDtrack* track = esd->GetTrack(iTrack);
-
- if(IsAccepted(esd,track)) fAcceptedParticleList->Add(track);
- }
-
- return fAcceptedParticleList;
-}
-
-//----------------------------------------//
-TPaveText *AliAnalysisTrackCuts::GetTrackCuts()
-{
- //Shows a TPaveText with all the track cuts stats.
- TCanvas *ccuts2 = new TCanvas("ccuts2","Track cuts",410,10,400,400);
- ccuts2->SetFillColor(10);
- ccuts2->SetHighLightColor(10);
-
- TPaveText *pave = new TPaveText(0.01,0.01,0.98,0.98);
- pave->SetFillColor(3);
- Char_t cutName[256];
-
- TLine *l1 = pave->AddLine(0,0.89,1,0.89);
- l1->SetLineWidth(2);
- TLine *l2 = pave->AddLine(0,0.79,1,0.79);
- l2->SetLineWidth(2);
- TLine *l3 = pave->AddLine(0,0.69,1,0.69);
- l3->SetLineWidth(2);
- TLine *l4 = pave->AddLine(0,0.59,1,0.59);
- l4->SetLineWidth(2);
- TLine *l5 = pave->AddLine(0,0.49,1,0.49);
- l5->SetLineWidth(2);
- TLine *l6 = pave->AddLine(0,0.39,1,0.39);
- l6->SetLineWidth(2);
- TLine *l7 = pave->AddLine(0,0.29,1,0.29);
- l7->SetLineWidth(2);
- TLine *l8 = pave->AddLine(0,0.19,1,0.19);
- l8->SetLineWidth(2);
- TLine *l9 = pave->AddLine(0,0.09,1,0.09);
- l9->SetLineWidth(2);
-
- sprintf(cutName,"Total number of tracks: %d",fTotalTracks);
- TText *t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Total number of accepted tracks: %d",fAcceptedTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"P range: [%f,%f]",fPMin,fPMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fP/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Pt range: [%f,%f]",fPtMin,fPtMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fPt/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Px range: [%f,%f]",fPxMin,fPxMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fPx/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Py range: [%f,%f]",fPyMin,fPyMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fPy/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"Pz range: [%f,%f]",fPzMin,fPzMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fPz/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"br range: [%f,%f]",fBrMin,fBrMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fbr/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"bz range: [%f,%f]",fBzMin,fBzMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fbz/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"eta range: [%f,%f]",fEtaMin,fEtaMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fEta/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- sprintf(cutName,"y range: [%f,%f]",fRapMin,fRapMax);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
- sprintf(cutName,"Tracks rejected: %f",100.0*fRap/fTotalTracks);
- t1 = pave->AddText(cutName);
- t1->SetTextColor(1);
- t1->SetTextSize(0.04);
- t1->SetTextAlign(11);
-
- return pave;
-}
-
-//----------------------------------------//
-void AliAnalysisTrackCuts::PrintTrackCuts()
-{
- //Prints the track cut stats.
- //GetTrackCuts()->Draw();
-
- AliInfo(Form("**************TRACK CUTS**************"));
- GetTrackStats();
- if(fFlagP)
- GetPStats();
- if(fFlagPt)
- GetPtStats();
- if(fFlagPx)
- GetPxStats();
- if(fFlagPy)
- GetPyStats();
- if(fFlagPz)
- GetPzStats();
- if(fFlagEta)
- GetEtaStats();
- if(fFlagRap)
- GetRapStats();
- if(fFlagbr)
- GetBrStats();
- if(fFlagbz)
- GetBzStats();
- AliInfo(Form("**************************************"));
-}
+++ /dev/null
-#ifndef ALIANALYSISTRACKCUTS_H
-#define ALIANALYSISTRACKCUTS_H
-/* See cxx source for full Copyright notice */
-
-
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// Class AliAnalysisTrackCuts
-// This is the class for the cuts in event & track level
-//
-// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
-//-------------------------------------------------------------------------
-
-#include <TObject.h>
-
-class AliESD;
-class AliESDtrack;
-
-class TPaveText;
-class TObjArray;
-
-class AliAnalysisTrackCuts : public TObject
-{
- public:
- AliAnalysisTrackCuts();
-
- ~AliAnalysisTrackCuts();
-
- void Reset();
-
- void SetPRange(Float_t r1, Float_t r2);
- void SetPtRange(Float_t r1, Float_t r2);
- void SetPxRange(Float_t r1, Float_t r2);
- void SetPyRange(Float_t r1, Float_t r2);
- void SetPzRange(Float_t r1, Float_t r2);
- void SetBrRange(Float_t r1, Float_t r2);
- void SetBzRange(Float_t r1, Float_t r2);
- void SetEtaRange(Float_t r1, Float_t r2);
- void SetRapRange(Float_t r1, Float_t r2);
-
- Bool_t IsAccepted(AliESD *esd,AliESDtrack *esdtrack);
- TObjArray *GetAcceptedParticles(AliESD *esd);
-
- TPaveText *GetTrackCuts();
- void PrintTrackCuts();
- void GetTrackStats();
- void GetPStats();
- void GetPxStats();
- void GetPyStats();
- void GetPzStats();
- void GetPtStats();
- void GetEtaStats();
- void GetRapStats();
- void GetBrStats();
- void GetBzStats();
-
- private:
- Float_t fPMin, fPMax; //Definition of the range of the P
- Float_t fPtMin, fPtMax; //Definition of the range of the Pt
- Float_t fPxMin, fPxMax; //Definition of the range of the Px
- Float_t fPyMin, fPyMax; //Definition of the range of the Py
- Float_t fPzMin, fPzMax; //Definition of the range of the Pz
- Float_t fEtaMin, fEtaMax; //Definition of the range of the eta
- Float_t fRapMin, fRapMax; //Definition of the range of the y
- Float_t fBrMin, fBrMax; //Definition of the range of the br
- Float_t fBzMin, fBzMax; //Definition of the range of the bz
-
- Int_t fP; //Number of events rejected due to P cut
- Int_t fPt; //Number of events rejected due to Pt cut
- Int_t fPx; //Number of events rejected due to Px cut
- Int_t fPy; //Number of events rejected due to Py cut
- Int_t fPz; //Number of events rejected due to Pz cut
- Int_t fEta; //Number of events rejected due to eta cut
- Int_t fRap; //Number of events rejected due to y cut
- Int_t fbr; //Number of events rejected due to br cut
- Int_t fbz; //Number of events rejected due to bz cut
- Int_t fTotalTracks; //Total number of tracks
- Int_t fAcceptedTracks; //Total number of accepted tracks
-
- Int_t fFlagP; //Flag that shows if the P cut was imposed
- Int_t fFlagPt; //Flag that shows if the Pt cut was imposed
- Int_t fFlagPx; //Flag that shows if the Px cut was imposed
- Int_t fFlagPy; //Flag that shows if the Py cut was imposed
- Int_t fFlagPz; //Flag that shows if the Pz cut was imposed
- Int_t fFlagEta; //Flag that shows if the eta cut was imposed
- Int_t fFlagRap; //Flag that shows if the y cut was imposed
- Int_t fFlagbr; //Flag that shows if the br cut was imposed
- Int_t fFlagbz; //Flag that shows if the bz cut was imposed
-
- TObjArray *fAcceptedParticleList; //List of accepted particles after quality cuts
-
- AliAnalysisTrackCuts(const AliAnalysisTrackCuts&); // Not implemented
- AliAnalysisTrackCuts& operator=(const AliAnalysisTrackCuts&); // Not implemented
-
- ClassDef(AliAnalysisTrackCuts, 2)
-} ;
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////
-//
-// class AliClusterMap
-// class that describes cluster occupation at TPC
-// Each padraw has a corresponding bit in fPadRawMap
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////////////////////
-
-#include <TString.h>
-
-#include "AliClusterMap.h"
-#include "AliESDtrack.h"
-#include "AliLog.h"
-#include "AliTPCtrack.h"
-
-const Int_t AliClusterMap::fgkNPadRows = 159;
-
-ClassImp(AliClusterMap)
-
-AliClusterMap::AliClusterMap():
- fPadRawMap(fgkNPadRows)
-{
-//ctor
-
-}
-/***********************************************************************/
-AliClusterMap::AliClusterMap(AliESDtrack* track):
- fPadRawMap( (track)?track->GetTPCClusterMap():fgkNPadRows )
-{
- //ctor
-
- StdoutToAliDebug(3,Print());
-
-}
-/***********************************************************************/
-
-AliClusterMap::AliClusterMap(AliTPCtrack* track):
- fPadRawMap(fgkNPadRows)
-{
- //ctor
-
- AliDebug(10,"#####################################################################");
- if (track == 0x0)
- {
- Error("AliClusterMap","Pointer to TPC track is NULL");
- return;
- }
- Int_t prevrow = -1;
- Int_t i = 0;
- for ( ; i < track->GetNumberOfClusters(); i++)
- {
- Int_t idx = track->GetClusterIndex(i);
- Int_t sect = (idx&0xff000000)>>24;
- Int_t row = (idx&0x00ff0000)>>16;
- if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors
- AliDebug(9,Form("Cl.idx is %d, sect %d, row %d",idx,sect,row));
-
- fPadRawMap.SetBitNumber(row,kTRUE);
-
- //Fill the gap between previous row and this row with 0 bits
- if (prevrow < 0)
- {
- prevrow = row;//if previous bit was not assigned yet == this is the first one
- }
- else
- { //we don't know the order (inner to outer or reverse)
- //just to be save in case it is going to change
- Int_t n = 0, m = 0;
- if (prevrow < row)
- {
- n = prevrow;
- m = row;
- }
- else
- {
- n = row;
- m = prevrow;
- }
- for (Int_t j = n+1; j < m; j++)
- {
- fPadRawMap.SetBitNumber(j,kFALSE);
- }
- prevrow = row;
- }
- }
-
- StdoutToAliDebug(3,Print());
-
-}
-/***********************************************************************/
-
-void AliClusterMap::Print() const
-{
-//Prints the bit map
- TString msg;
- for ( Int_t i = 0; i < fgkNPadRows; i++)
- {
- if ( fPadRawMap.TestBitNumber(i) )
- {
- msg+="1";
- }
- else
- {
- msg+="0";
- }
- }
- Info("AliClusterMap","BitMap is\n %s",msg.Data());
-
-}
-
-/***********************************************************************/
-
-Float_t AliClusterMap::GetOverlapFactor(const AliClusterMap& clmap) const
-{
- //Returns quality factor FQ = Sum(An)/Sum(clusters)
- // | -1; if both tracks have a cluster on padrow n
- //An = < 0; if neither track has a cluster on padrow n
- // | 1; if only one trackhas a cluster on padrow n
- // Returned value ranges between
- // -0.5 (low probability that these tracks are a split track)
- // and
- // 1.0 (high probability that these tracks are a split track)
-
- Int_t nh = 0;
- Int_t an = 0;
- for ( Int_t i = 0; i < fgkNPadRows; i++)
- {
- Bool_t x = HasClAtPadRow(i);
- Bool_t y = clmap.HasClAtPadRow(i);
-
- if (x && y)//both have clasters
- {
- an--;
- nh+=2;
- }
- else
- {
-
- if (x || y)//only one have cluters
- {
- an++;
- nh++;
- }
- }
- }
-
-
- Float_t retval = 0.0;
- if (nh > 0) retval = ((Float_t)an)/((Float_t)nh);
- else Warning("GetOverlapFactor","Number of counted cluters is 0.");
-
- return retval;
-}
+++ /dev/null
-#ifndef ALICLUSTERMAP_H
-#define ALICLUSTERMAP_H
-
-///////////////////////////////////////////////////////////////////////////
-//
-// class AliClusterMap
-// class that describes cluster occupation at TPC
-// Each padraw has a corresponding bit in fPadRawMap
-// more info: http://aliweb.cern.ch/people/skowron/analyzer/index.html
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////////////////////
-
-
-#include <TObject.h>
-#include <TBits.h>
-
-class AliTPCtrack;
-class AliESDtrack;
-class TBits;
-
-class AliClusterMap: public TObject
-{
- public:
- AliClusterMap();
- AliClusterMap(AliTPCtrack* track);
- AliClusterMap(AliESDtrack* track);
- virtual ~AliClusterMap(){}
- Float_t GetOverlapFactor(const AliClusterMap& clmap) const;
- Bool_t HasClAtPadRow(Int_t i) const { return fPadRawMap.TestBitNumber(i);}
- void Print(const Option_t * opt) const {TObject::Print(opt);}
- void Print() const;
- protected:
- private:
- TBits fPadRawMap;//bit vector of length 150 correspondind to total number of padraws in TPC
- static const Int_t fgkNPadRows; // Number of pad rows
- ClassDef(AliClusterMap,1)
-};
-
-#endif
+++ /dev/null
-#include "AliEventBaseCut.h"
-//________________________________
-///////////////////////////////////////////////////////////
-//
-// class AliEventBaseCut
-//
-//
-//
-//
-///////////////////////////////////////////////////////////
-
-#include <AliAOD.h>
-ClassImp(AliEventBaseCut)
-
-AliEventBaseCut::AliEventBaseCut():
- fMin(0.0),
- fMax(0.0),
- fProperty(kNone)
-{
-//ctor
-}
-/**********************************************************/
-
-AliEventBaseCut::AliEventBaseCut(Double_t min, Double_t max, EEventCutProperty prop):
- fMin(min),
- fMax(max),
- fProperty(prop)
-{
- //ctor
-}
-/**********************************************************/
-
-Bool_t AliEventBaseCut::Rejected(AliAOD* aod) const
-{
-//Checks if value is in the range,
-// returns true if it is in the range, false otherwise
- Double_t v = GetValue(aod);
-// Info("Rejected","Value %f Min %f Max %f",v,fMin,fMax);
- if ( ( v < fMin) || ( v > fMax) ) return kTRUE;
- return kFALSE;
-}
-/**********************************************************/
-/**********************************************************/
-/**********************************************************/
-ClassImp(AliPrimVertexXCut)
-
-Double_t AliPrimVertexXCut::GetValue(AliAOD* aod) const
-{
- //returns x coordinate of the primary vertex
- Double_t x = 0, y = 0, z = 0;
- if (aod) aod->GetPrimaryVertex(x,y,z);
- return x;
-}
-/**********************************************************/
-/**********************************************************/
-/**********************************************************/
-ClassImp(AliPrimVertexYCut)
-
-Double_t AliPrimVertexYCut::GetValue(AliAOD* aod) const
-{
- //returns x coordinate of the primary vertex
- Double_t x = 0, y = 0, z = 0;
- if (aod) aod->GetPrimaryVertex(x,y,z);
- return y;
-}
-/**********************************************************/
-/**********************************************************/
-/**********************************************************/
-ClassImp(AliPrimVertexZCut)
-
-Double_t AliPrimVertexZCut::GetValue(AliAOD* aod) const
-{
- //returns x coordinate of the primary vertex
- Double_t x = 0, y = 0, z = 0;
- if (aod) aod->GetPrimaryVertex(x,y,z);
- return z;
-}
-
-/**********************************************************/
-/**********************************************************/
-/**********************************************************/
-
-ClassImp(AliNChargedCut)
-
-Double_t AliNChargedCut::GetValue(AliAOD* aod) const
-{
- //returns number of charged particles
- if (aod)
- {
- return aod->GetNumberOfCharged(fEtaMin,fEtaMax);
- }
- Error("GetValue","Pointer to AOD is NULL");
- return 0.0;
-}
+++ /dev/null
-#ifndef ALIEVENTBASECUT_H
-#define ALIEVENTBASECUT_H
-//________________________________
-///////////////////////////////////////////////////////////
-//
-// class AliEventBaseCut
-//
-// Base class for cauts that checks only one event property
-//
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////
-
-#include "TObject.h"
-
-class AliAOD;
-
-class AliEventBaseCut: public TObject
-{
- public:
- enum EEventCutProperty {
- kPrimVertexXCut,kPrimVertexYCut,kPrimVertexZCut,
- kNChargedCut,kNone
- };
-
- AliEventBaseCut();
- AliEventBaseCut(Double_t min,Double_t max, EEventCutProperty prop = kNone);
- virtual ~AliEventBaseCut(){}
- virtual Bool_t Rejected(AliAOD* aod) const;//returns kTRUE if rejected
- virtual void SetRange(Double_t min, Double_t max){fMin = min; fMax = max;}
-
- virtual EEventCutProperty GetProperty()const{return fProperty;}
-
- protected:
- virtual Double_t GetValue(AliAOD* aod) const = 0;
-
- Double_t fMin;//Minimum value
- Double_t fMax;//Maximum value
- EEventCutProperty fProperty;//Defines the type of the cut - used by the setters cut
-
- private:
- ClassDef(AliEventBaseCut,1)
-};
-
-/************************************************************/
-
-class AliPrimVertexXCut: public AliEventBaseCut
-{
- public:
- AliPrimVertexXCut():AliEventBaseCut(0,0,kPrimVertexXCut){}
- AliPrimVertexXCut(Double_t min,Double_t max):AliEventBaseCut(min,max,kPrimVertexXCut){}
- virtual ~AliPrimVertexXCut(){}
- protected:
- Double_t GetValue(AliAOD* aod) const;
-
- private:
- ClassDef(AliPrimVertexXCut,1)
-};
-/************************************************************/
-
-class AliPrimVertexYCut: public AliEventBaseCut
-{
- public:
- AliPrimVertexYCut():AliEventBaseCut(0,0,kPrimVertexYCut){}
- AliPrimVertexYCut(Double_t min,Double_t max):AliEventBaseCut(min,max,kPrimVertexYCut){}
- virtual ~AliPrimVertexYCut(){}
-
- protected:
- Double_t GetValue(AliAOD* aod) const;
-
- private:
- ClassDef(AliPrimVertexYCut,1)
-};
-/************************************************************/
-
-class AliPrimVertexZCut: public AliEventBaseCut
-{
- public:
- AliPrimVertexZCut():AliEventBaseCut(0,0,kPrimVertexZCut){}
- AliPrimVertexZCut(Double_t min,Double_t max):AliEventBaseCut(min,max,kPrimVertexZCut){}
- virtual ~AliPrimVertexZCut(){}
- protected:
- Double_t GetValue(AliAOD* aod) const;
-
- private:
- ClassDef(AliPrimVertexZCut,1)
-};
-
-
-/************************************************************/
-
-class AliNChargedCut: public AliEventBaseCut
-{
- public:
- AliNChargedCut():AliEventBaseCut(0,0,kNChargedCut),fEtaMin(-10.0),fEtaMax(10.0){}
- AliNChargedCut(Int_t min, Int_t max, Double_t etamin = -10.0, Double_t etamax = 10.0):
- AliEventBaseCut(min,max,kNChargedCut),fEtaMin(etamin),fEtaMax(etamax){}
- virtual ~AliNChargedCut(){}
-
- void SetEtaRange(Double_t min,Double_t max){fEtaMin = min;fEtaMax = max;}
- protected:
- Double_t GetValue(AliAOD* aod) const;
- Double_t fEtaMin;//Defines max of eta range where mult is caclulated
- Double_t fEtaMax;//Defines min of eta range where mult is caclulated
-
- private:
- ClassDef(AliNChargedCut,1)
-};
-
-
-#endif
+++ /dev/null
-#include "AliEventBuffer.h"
-
-ClassImp(AliEventBuffer)
-
-//______________________________________________________
-////////////////////////////////////////////////////////
-//
-// class AliEventBuffer
-//
-// FIFO type event buffer
-//
-// Piotr.Skowronski@cern.ch
-//
-////////////////////////////////////////////////////////
-
-AliEventBuffer::AliEventBuffer():
- fSize(-1),fEvents(),fIter(&fEvents)
-{
- //ctor
-}
-/***********************************************************/
-
-AliEventBuffer::AliEventBuffer(Int_t size):
- fSize(size),fEvents(),fIter(&fEvents)
-{
- //ctor
-}
-/***********************************************************/
-
-AliEventBuffer::~AliEventBuffer()
-{
- //dtor -- TList::IsOwner(1) does not work - Valgrind says that there is mem leak
- //take care owerseves
- if (fEvents.IsOwner())
- {
- AliAOD* e=0x0;
- while (( e=RemoveLast() )) delete e;
- }
-}
-/***********************************************************/
-
-void AliEventBuffer::Reset()
-{
- //Resets the queue
- if (fEvents.IsOwner())
- {
- AliAOD* e=0x0;
- while (( e=RemoveLast() )) delete e;
- }
- else
- {
- fEvents.RemoveAll();
- }
-}
-/***********************************************************/
-
-AliAOD* AliEventBuffer::Push(AliAOD* event)
-{
- //adds a new event, and returns old of do not fit in size
- if (fSize == 0) return event;
-
- AliAOD* ret = 0x0;
-
- if (fSize == fEvents.GetSize())
- ret = dynamic_cast<AliAOD*>(fEvents.Remove(fEvents.Last()));
- if (event) fEvents.AddFirst(event);
- return ret;
-}
-
+++ /dev/null
-#ifndef AliEventBuffer_H
-#define AliEventBuffer_H
-//______________________________________________________
-////////////////////////////////////////////////////////
-//
-// class AliEventBuffer
-//
-// FIFO type event buffer
-//
-// Piotr.Skowronski@cern.ch
-//
-////////////////////////////////////////////////////////
-
-#include <TObject.h>
-#include <TList.h>
-#include "AliAOD.h"
-
-class AliEventBuffer: public TObject
-{
- public:
- AliEventBuffer();
- AliEventBuffer(Int_t size);
- virtual ~AliEventBuffer();
-
- AliAOD* Push(AliAOD* event);//adds a new event, and returns old of do not fit in size
- AliAOD* RemoveLast(){return dynamic_cast<AliAOD*>(fEvents.Remove(fEvents.Last()));}
- void ResetIter(){fIter.Reset();}
- AliAOD* Next(){return dynamic_cast<AliAOD*>( fIter.Next() );}
- void SetSize(Int_t size){fSize = size;}
- Int_t GetSize() const {return fSize;}
- void SetOwner(Bool_t flag) {fEvents.SetOwner(flag);}
- void Reset();
- protected:
- private:
- Int_t fSize;//size of buffer; if -1 infinite size
- TList fEvents;//list with arrays
- TIter fIter;//iterator
- ClassDef(AliEventBuffer,1)
-};
-
-
-#endif
+++ /dev/null
-#include "AliEventCut.h"
-
-///////////////////////////////////////////////////////////
-//
-// class AliEventCut
-//
-// Event cut. It has list of base event cuts.
-// Each of base event cut checks only one property.
-// Logical base cuts also exists that point to other base cuts.
-// Using them one can build complicated cut with binary tree structure
-// Author: Piotr.Skowronski@cern.ch
-///////////////////////////////////////////////////////////
-
-#include "AliEventBaseCut.h"
-
-ClassImp(AliEventCut)
-
-AliEventCut::AliEventCut():
- fBaseCuts(10)
-{
-//costructor
-
-}
-/*********************************************************/
-AliEventCut::AliEventCut(const AliEventCut& in):
- TObject(in),
- fBaseCuts(in.fBaseCuts)
-{
- //cpy ctor
- fBaseCuts.SetOwner(kTRUE);
-}
-/*********************************************************/
-
-AliEventCut::~AliEventCut()
-{
-//costructor
-}
-
-/*********************************************************/
-
-Bool_t AliEventCut::Rejected(AliAOD* aod) const
-{
- //returns kTRUE if rejected
- if (aod == 0x0)
- {
- Error("Pass","Pointer to AOD is NULL. Not passed the cut");
- return kFALSE;
- }
-
- TIter iter(&fBaseCuts);
- AliEventBaseCut* becut;
- while (( becut = (AliEventBaseCut*)iter() ))
- {
- if (becut->Rejected(aod)) return kTRUE;
- }
- return kFALSE;
-}
-/*********************************************************/
-void AliEventCut::AddBasePartCut(AliEventBaseCut* ebcut)
-{
-//Adds a base cut
- if (ebcut == 0x0)
- {
- Error("AddBasePartCut","Pointer to base cut is NULL");
- return;
- }
-
- if (ebcut->GetProperty() != AliEventBaseCut::kNone)
- {
- if (FindCut(ebcut->GetProperty()))
- {
- Warning("AddBasePartCut","Cut with this property is already in the list of base cuts");
- }
- }
-
- fBaseCuts.Add(ebcut->Clone());
-
-}
-/*********************************************************/
-
-AliEventBaseCut* AliEventCut::FindCut(AliEventBaseCut::EEventCutProperty prop)
-{
-//Finds and returns pointer to the cut with given property
- Int_t n = fBaseCuts.GetEntries();
- for (Int_t i = 0; i<n; i++)
- {
- AliEventBaseCut* bcut = (AliEventBaseCut*)fBaseCuts.At(i);
- if (bcut->GetProperty() == prop)
- return bcut; //we found the cut we were searching for
- }
-
- return 0x0; //we did not found this cut
-
-}
-/*********************************************************/
-
-void AliEventCut::SetNChargedRange(Int_t min,Int_t max,Double_t etamin,Double_t etamax)
-{
- //Sets renge of number of charged particles
- AliNChargedCut* cut = dynamic_cast<AliNChargedCut*>(FindCut(AliEventBaseCut::kNChargedCut));
- if(cut)
- {
- cut->SetRange(min,max);
- cut->SetEtaRange(etamin,etamax);
- }
- else fBaseCuts.Add(new AliNChargedCut(min,max,etamin,etamax));
-}
-/*********************************************************/
-
-void AliEventCut::SetVertexXRange(Double_t min, Double_t max)
-{
- //Sets range of z coordinate of a primary vertex
- AliEventBaseCut* cut = FindCut(AliEventBaseCut::kPrimVertexXCut);
- if (cut) cut->SetRange(min,max);
- else fBaseCuts.Add(new AliPrimVertexXCut(min,max));
-}
-/*********************************************************/
-
-void AliEventCut::SetVertexYRange(Double_t min, Double_t max)
-{
- //Sets range of z coordinate of a primary vertex
- AliEventBaseCut* cut = FindCut(AliEventBaseCut::kPrimVertexYCut);
- if (cut) cut->SetRange(min,max);
- else fBaseCuts.Add(new AliPrimVertexYCut(min,max));
-}
-/*********************************************************/
-
-void AliEventCut::SetVertexZRange(Double_t min, Double_t max)
-{
- //Sets range of z coordinate of a primary vertex
- AliEventBaseCut* cut = FindCut(AliEventBaseCut::kPrimVertexZCut);
- if (cut) cut->SetRange(min,max);
- else fBaseCuts.Add(new AliPrimVertexZCut(min,max));
-}
-/*********************************************************/
-/*********************************************************/
-/*********************************************************/
-
-ClassImp(AliEventEmptyCut)
+++ /dev/null
-#ifndef ALIEVENTCUT_H
-#define ALIEVENTCUT_H
-
-///////////////////////////////////////////////////////////
-//
-// class AliEventCut
-//
-// Event cut. It has list of base event cuts.
-// Each of base event cut checks only one property.
-// Logical base cuts also exists that point to other base cuts.
-// Using them one can build complicated cut with binary tree structure
-// Author: Piotr.Skowronski@cern.ch
-///////////////////////////////////////////////////////////
-
-#include <TObject.h>
-#include <TObjArray.h>
-#include "AliEventBaseCut.h"
-
-class AliAOD;
-
-class AliEventCut: public TObject
-{
- public:
- AliEventCut();
- AliEventCut(const AliEventCut& in);
- virtual ~AliEventCut();
-
- virtual Bool_t Rejected(AliAOD* aod) const;//returns kTRUE if rejected
- void AddBasePartCut(AliEventBaseCut* ebcut);
-
- void SetNChargedRange(Int_t min,Int_t max, Double_t etamin = -10.0,Double_t etamax = 10.0);
- void SetVertexXRange(Double_t min, Double_t max);
- void SetVertexYRange(Double_t min, Double_t max);
- void SetVertexZRange(Double_t min, Double_t max);
-
- protected:
- AliEventBaseCut* FindCut(AliEventBaseCut::EEventCutProperty prop);
-
- TObjArray fBaseCuts; // Array of cuts
- private:
- ClassDef(AliEventCut,1)
-};
-
-class AliEventEmptyCut: public TObject
-{
- public:
- AliEventEmptyCut(){}
- virtual ~AliEventEmptyCut(){}
-
- Bool_t Rejected(AliAOD* /*aod*/) const {return kFALSE;}//always accept
-
- protected:
- private:
- ClassDef(AliEventEmptyCut,1)
-};
-
-#endif
+++ /dev/null
-#include "AliFlowAnalysis.h"
-
-//*********************************************************
-// class AliFlowAnalysis
-// Flow Analysis
-// S.Radomski@gsi.de
-// Piotr.Skowronski@cern.ch
-//*********************************************************
-
-#include <AliAOD.h>
-#include <AliVAODParticle.h>
-#include <AliAODParticleCut.h>
-
-#include <AliESDtrack.h>
-#include <AliESD.h>
-
-ClassImp(AliFlowAnalysis)
-
-AliFlowAnalysis::AliFlowAnalysis():
- fPartCut(0x0)
-{
- //ctor
-}
-/*********************************************************/
-
-AliFlowAnalysis::~AliFlowAnalysis()
-{
- //dtor
- delete fPartCut;
-}
-/*********************************************************/
-
-Int_t AliFlowAnalysis::Init()
-{
- //Initilizes anaysis
- Info("Init","");
- return 0;
-}
-/*********************************************************/
-
-Int_t AliFlowAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
-{
- // Process AOD events containing the reconstructed and simulated information
- Info("ProcessEvent","Sim AOD address %#x",aodsim);
- Double_t psi = 0, v2 = 0;
- if (aodrec)
- {
- GetFlow(aodrec,v2,psi);
- Info("ProcessEvent","Reconstructed Event: Event plane is %f, V2 is %f",psi,v2);
- }
-
- if (aodsim)
- {
- GetFlow(aodsim,v2,psi);
- Info("ProcessEvent","Simulated Event: Event plane is %f, V2 is %f",psi,v2);
- }
-
- return 0;
-
-}
-/*********************************************************/
-
-Int_t AliFlowAnalysis::Finish()
-{
- //Finish analysis and writes results
- Info("Init","Finish");
- return 0;
-}
-/*********************************************************/
-
-Double_t AliFlowAnalysis::GetEventPlane(AliAOD* aod)
-{
- //returns event plane in degrees
- if (aod == 0x0)
- {
- Error("AliFlowAnalysis::GetFlow","Pointer to AOD is NULL");
- return -1.0;
- }
-
- Double_t psi;
- Int_t mult = aod->GetNumberOfParticles();
-
- Double_t ssin = 0, scos = 0;
-
- for (Int_t i=0; i<mult; i++)
- {
- AliVAODParticle* aodtrack = aod->GetParticle(i);
- if (aodtrack == 0x0)
- {
- Error("AliFlowAnalysis::GetEventPlane","Can not get track %d", i);
- continue;
- }
-
- if (fPartCut)
- if (fPartCut->Rejected(aodtrack))
- continue;
-
- Double_t phi = TMath::Pi()+TMath::ATan2(-aodtrack->Py(),-aodtrack->Px());
-
- ssin += TMath::Sin( 2.0 * phi );
- scos += TMath::Cos( 2.0 * phi );
- }
-
- psi = atan2 (ssin, scos) / 2.0;
- psi = psi * 180. / TMath::Pi();
-
- return psi;
-
-}
-/*********************************************************/
-
-void AliFlowAnalysis::GetFlow(AliAOD* aod,Double_t& v2,Double_t& psi)
-{
-//returns flow parameters: v2 and event plane
- if (aod == 0x0)
- {
- Error("AliFlowAnalysis::GetFlow","Pointer to AOD is NULL");
- return;
- }
-
- psi = GetEventPlane(aod);
- Int_t mult = aod->GetNumberOfParticles();
-
- Double_t ssin = 0, scos = 0;
-
- for (Int_t i=0; i<mult; i++)
- {
- AliVAODParticle* aodtrack = aod->GetParticle(i);
- if (aodtrack == 0x0)
- {
- Error("AliFlowAnalysis::GetEventPlane","Can not get track %d", i);
- continue;
- }
- if (fPartCut)
- if (fPartCut->Rejected(aodtrack))
- continue;
-
- Double_t phi = TMath::Pi()+TMath::ATan2(-aodtrack->Py(),-aodtrack->Px());
- ssin += TMath::Sin( 2.0 * (phi - psi));
- scos += TMath::Cos( 2.0 * (phi - psi));
- }
-
- v2 = TMath::Hypot(ssin,scos);
-}
-
-
-/*********************************************************/
-
-Double_t AliFlowAnalysis::GetEventPlane(AliESD* esd)
-{
- //returns event plane
- if (esd == 0x0)
- {
- ::Error("AliFlowAnalysis::GetFlow","Pointer to ESD is NULL");
- return -1.0;
- }
-
- Double_t psi;
- Int_t mult = esd->GetNumberOfTracks();
-
- Double_t ssin = 0, scos = 0;
-
- for (Int_t i=0; i<mult; i++)
- {
- AliESDtrack* esdtrack = esd->GetTrack(i);
- if (esdtrack == 0x0)
- {
- ::Error("AliFlowAnalysis::GetEventPlane","Can not get track %d", i);
- continue;
- }
-
- Double_t mom[3];//momentum
- esdtrack->GetPxPyPz(mom);
- Double_t phi = TMath::Pi()+TMath::ATan2(-mom[1],-mom[0]);
-
- ssin += TMath::Sin( 2.0 * phi );
- scos += TMath::Cos( 2.0 * phi );
- }
-
- psi = atan2 (ssin, scos) / 2.0;
- psi = psi * 180. / TMath::Pi();
-
- return psi;
-
-}
-/*********************************************************/
-
-void AliFlowAnalysis::GetFlow(AliESD* esd,Double_t& v2,Double_t& psi)
-{
-//returns flow parameters: v2 and event plane
- if (esd == 0x0)
- {
- ::Error("AliFlowAnalysis::GetFlow","Pointer to ESD is NULL");
- return;
- }
-
- psi = GetEventPlane(esd);
- Int_t mult = esd->GetNumberOfTracks();
-
- Double_t ssin = 0, scos = 0;
-
- for (Int_t i=0; i<mult; i++)
- {
- AliESDtrack* esdtrack = esd->GetTrack(i);
- if (esdtrack == 0x0)
- {
- ::Error("AliFlowAnalysis::GetEventPlane","Can not get track %d", i);
- continue;
- }
-
- Double_t mom[3];//momentum
- esdtrack->GetPxPyPz(mom);
- Double_t phi = TMath::Pi()+TMath::ATan2(-mom[1],-mom[0]);
-
- ssin += TMath::Sin( 2.0 * (phi - psi));
- scos += TMath::Cos( 2.0 * (phi - psi));
- }
-
- v2 = TMath::Hypot(ssin,scos);
-}
-/*********************************************************/
+++ /dev/null
-#ifndef ALIFLOWANALYSIS_H
-#define ALIFLOWANALYSIS_H
-
-//*********************************************************
-// class AliFlowAnalysis
-// Flow Analysis
-// S.Radomski@gsi.de
-// Piotr.Skowronski@cern.ch
-//*********************************************************
-
-#include "AliAnalysis.h"
-
-class AliESD;
-class AliAOD;
-class AliStack;
-class AliAODParticleCut;
-
-class AliFlowAnalysis: public AliAnalysis
-{
- public:
- AliFlowAnalysis();
- virtual ~AliFlowAnalysis();
-
- Int_t Init();
- Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim = 0x0);
- Int_t Finish();
-
- void SetParticleCut(AliAODParticleCut* pcut){fPartCut = pcut;}
- static Double_t GetEventPlane(AliESD* esd);
- static void GetFlow(AliESD* esd,Double_t& v2,Double_t& psi);
-
- Double_t GetEventPlane(AliAOD* aod);
- void GetFlow(AliAOD* aod,Double_t& v2,Double_t& psi);
- protected:
-
- private:
- AliAODParticleCut* fPartCut;//Particle Cut
-
- AliFlowAnalysis(const AliFlowAnalysis&); // Not implemented
- AliFlowAnalysis& operator=(const AliFlowAnalysis&); // Not implemented
-
- ClassDef(AliFlowAnalysis,1)
-};
-
-#endif
+++ /dev/null
-#include "AliMuonAnalysis.h"
-//________________________________
-///////////////////////////////////////////////////////////
-//
-// class AliMuonAnalysis
-//
-// MUON Analysis
-//
-//
-//
-// finck@subatech.in2p3.fr
-//
-///////////////////////////////////////////////////////////
-/*********************************************************/
-
-#include <TString.h>
-#include <TParticle.h>
-
-#include <AliStack.h>
-#include <AliAOD.h>
-#include <AliAODParticle.h>
-#include <AliAODParticleCut.h>
-
-#include <AliESDtrack.h>
-#include <AliESD.h>
-
-#include "TFile.h"
-#include "TH1.h"
-#include "TH2.h"
-
-ClassImp(AliMuonAnalysis)
-
-AliMuonAnalysis::AliMuonAnalysis():
- fHistoFile(0x0),
- fHPtMuon(0x0),
- fHPtMuonPlus(0x0),
- fHPtMuonMinus(0x0),
- fHPMuon(0x0),
- fHInvMassAll(0x0),
- fHRapMuon(0x0),
- fHRapResonance(0x0),
- fHPtResonance(0x0),
- fHInvMassAllvsPt(0x0),
- fPartCut(0x0)
-{
- //ctor
-}
-
-/*********************************************************/
-AliMuonAnalysis::~AliMuonAnalysis()
-{
- //dtor
- delete fPartCut;
- delete fHistoFile;
- delete fHPtMuon;
- delete fHPtMuonPlus;
- delete fHPtMuonMinus;
- delete fHPMuon;
- delete fHInvMassAll;
- delete fHRapMuon;
- delete fHRapResonance;
- delete fHPtResonance;
- delete fHInvMassAllvsPt;
-}
-/*********************************************************/
-
-Int_t AliMuonAnalysis::Init()
-{
- //Initilizes analysis
- Info("Init","Histo initialized for MUON Analysis");
-
- fHistoFile = new TFile("MUONmassPlot.root", "RECREATE");
- fHPtMuon = new TH1F("hPtMuon", "Muon Pt (GeV/c)", 100, 0., 20.);
- fHPMuon = new TH1F("hPMuon", "Muon P (GeV/c)", 100, 0., 200.);
- fHPtMuonPlus = new TH1F("hPtMuonPlus", "Muon+ Pt (GeV/c)", 100, 0., 20.);
- fHPtMuonMinus = new TH1F("hPtMuonMinus", "Muon- Pt (GeV/c)", 100, 0., 20.);
- fHInvMassAll = new TH1F("hInvMassAll", "Mu+Mu- invariant mass (GeV/c2)", 480, 0., 12.);
- fHRapMuon = new TH1F("hRapMuon"," Muon Rapidity",50,-4.5,-2);
- fHRapResonance = new TH1F("hRapResonance"," Resonance Rapidity",50,-4.5,-2);
- fHPtResonance = new TH1F("hPtResonance", "Resonance Pt (GeV/c)", 100, 0., 20.);
- fHInvMassAllvsPt = new TH2F("hInvMassAll_vs_Pt","hInvMassAll_vs_Pt",480,0.,12.,80,0.,20.);
-
- return 0;
-}
-/*********************************************************/
-
-Int_t AliMuonAnalysis::ProcessEvent(AliAOD* aodrec, AliAOD* aodsim)
-{
- //
- // process the event
- //
- if (aodrec) {
- GetInvMass(aodrec);
- // Info("ProcessEvent","Inv Mass Rec");
- }
-
- if (aodsim) {
- // Info("ProcessEvent","aodsim not implemented");
- }
-
- return 0;
-
-}
-
-/*********************************************************/
-
-Int_t AliMuonAnalysis::Finish()
-{
- //Finish analysis and writes results
- Info("Finish","Histo writing for MUON Analysis");
-
- fHistoFile->Write();
- fHistoFile->Close();
-
- return 0;
-}
-/*********************************************************/
-
-void AliMuonAnalysis::GetInvMass(AliAOD* aod)
-{
- // get the invariant mass distribution
- // from the oad events
-
- TLorentzVector lorV1, lorV2, lorVtot;
- Float_t massMin = 9.17;
- Float_t massMax = 9.77;
- Int_t charge1, charge2;
-
-//returns flow parameters: v2 and event plane
- if (aod == 0x0) {
- Error("AliMuonAnalysis::GetInvMass","Pointer to AOD is NULL");
- return;
- }
-
- Int_t nPart = aod->GetNumberOfParticles();
-
- for (Int_t iPart1 = 0; iPart1 < nPart; iPart1++) {
- AliAODParticle* aodPart1 = (AliAODParticle*)aod->GetParticle(iPart1);
-
- if (aodPart1 == 0x0) {
- Error("AliMuonAnalysis::GetInvMass","Cannot get particle %d", iPart1);
- continue;
- }
-
- lorV1.SetPxPyPzE(aodPart1->Px(),
- aodPart1->Py(),
- aodPart1->Pz(),
- aodPart1->E());
-
- fHPtMuon->Fill(lorV1.Pt());
- fHPMuon->Fill(lorV1.P());
-
- charge1 = TMath::Sign(1,aodPart1->GetPdgCode());
-
- if (charge1 > 0) {
- fHPtMuonPlus->Fill(lorV1.Pt());
- } else {
- fHPtMuonMinus->Fill(lorV1.Pt());
- }
- fHRapMuon->Fill(lorV1.Rapidity());
- for (Int_t iPart2 = iPart1 + 1; iPart2 < nPart; iPart2++) {
-
- AliAODParticle* aodPart2 = (AliAODParticle*)aod->GetParticle(iPart2);
-
- lorV2.SetPxPyPzE(aodPart2->Px(),
- aodPart2->Py(),
- aodPart2->Pz(),
- aodPart2->E());
-
- charge2 = TMath::Sign(1,aodPart2->GetPdgCode());
-
- if ((charge1 * charge2) == -1) {
-
- lorVtot = lorV1;
- lorVtot += lorV2;
- Float_t invMass = lorVtot.M();
-
- fHInvMassAll->Fill(invMass);
- fHInvMassAllvsPt->Fill(invMass,lorVtot.Pt());
-
- if (invMass > massMin && invMass < massMax) {
- fHRapResonance->Fill(lorVtot.Rapidity());
- fHPtResonance->Fill(lorVtot.Pt());
- }
- }
-
- }
- }
-}
+++ /dev/null
-#ifndef ALIMUONANALYSIS_H
-#define ALIMUONANALYSIS_H
-//________________________________
-///////////////////////////////////////////////////////////
-//
-// class AliMuonAnalysis
-//
-// Flow Analysis
-//
-//
-// S.Radomski@gsi.de
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////
-
-#include "AliAnalysis.h"
-
-class AliESD;
-class AliAOD;
-class AliStack;
-class AliAODParticleCut;
-class TFile;
-class TH1F;
-class TH2F;
-
-class AliMuonAnalysis: public AliAnalysis
-{
- public:
- AliMuonAnalysis();
- virtual ~AliMuonAnalysis();
-
- Int_t Init();
- Int_t ProcessEvent(AliAOD* aodrec, AliAOD* aodsim);
- Int_t Finish();
-
- void SetParticleCut(AliAODParticleCut* pcut){fPartCut = pcut;}
-
- void GetInvMass(AliAOD* aod);
-
- protected:
-
- private:
-
- TFile *fHistoFile; // histogramm file pointer
- TH1F *fHPtMuon; // Muon Pt distribution
- TH1F *fHPtMuonPlus; // Muon Plus Pt distribution
- TH1F *fHPtMuonMinus; // Muon Minus Pt distribution
- TH1F *fHPMuon; // Muon momentum distribution
- TH1F *fHInvMassAll; // Invariant mass distribution
- TH1F *fHRapMuon; // Muon rapidity distribution
- TH1F *fHRapResonance; // Muon rapidity distribution around resonance
- TH1F *fHPtResonance; // Muon Pt distribution around resonance
- TH2F *fHInvMassAllvsPt; // Invariant mass vs Pt distribution
-
- AliAODParticleCut* fPartCut;//Particle Cut
-
- AliMuonAnalysis(const AliMuonAnalysis&); // Not implemented
- AliMuonAnalysis& operator=(const AliMuonAnalysis&); // Not implemented
-
- ClassDef(AliMuonAnalysis,1)
-};
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//_________________________________________________________________________
-///////////////////////////////////////////////////////////////////////////
-//
-// class AliReader
-//
-// Reader Base class
-// Reads particles and tracks and
-// puts them to the AliAOD objects and eventually, if needed, buffers AliAODs in AliAODRun(s)
-//
-// User loops over events calling method Next. In case of success this method returns 0.
-// In case of error or if there is no more events to read, non-0 value is returned
-//
-// Reading can be rewound to the beginning using method Rewind.
-//
-// Tracks are read to the fEventRec (contains reconstructed tracks)
-// and fEventSim (corresponding MC simulated data) data members,
-// that are of the type AliAOD.
-//
-// If a given reader has ability of reading both, reconstructed and simulated data,
-// these are structured in AODs so a "n'th" simulated particle
-// (the one stored in the fEventSim at slot n)
-// corresponds to the n'th reconstructed track (the one stored in the fEventRec at slot n).
-//
-// The same reconstructed track can be present more than ones in the AOD,
-// but with a different PID. In this case
-// pointer to the corresponding MC simulated particles is also present more than ones.
-// This situation happens if you want to read all particles
-// with PID probability of being , e.g., pion higher than 60%
-// and being kaon higher than 40%. Than, if a given track has probability Ppid(pi)=52% and Ppid(K)=48%
-// than it is read twise.
-//
-// Provides functionality for both buffering and non-buffering reading
-// This can be switched on/off via method SetEventBuffering(bool)
-// The main method that inheriting classes need to implement is ReadNext()
-// that read next event in queue.
-//
-// The others are:
-// Bool_t ReadsRec() const; specifies if reader is able to read simulated particles
-// Bool_t ReadsSim() const; specifies if reader is able to read reconstructed tracks
-// void Rewind(); rewind reading to the beginning
-//
-// This class provides full functionality for reading from many sources
-// User can provide TObjArray of TObjStrings (SetDirs method or via parameter
-// in the constructor) which desribes paths of directories to search data in.
-// If none specified current directory is searched.
-//
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////////////////////
-
-#include <TClass.h>
-#include <TGliteXmlEventlist.h>
-#include <TH1.h>
-#include <TObjArray.h>
-#include <TObjString.h>
-#include <TRandom.h>
-#include <TString.h>
-
-#include "AliAOD.h"
-#include "AliAODParticleCut.h"
-#include "AliAODRun.h"
-#include "AliLog.h"
-#include "AliReader.h"
-
-ClassImp(AliReader)
-//pure virtual
-
-/*************************************************************************************/
-
-AliReader::AliReader():
- fEventList(0x0),
- fCuts(new TObjArray()),
- fDirs(0x0),
- fCurrentEvent(0),
- fCurrentDir(0),
- fNEventsRead(0),
- fEventRec(0x0),
- fEventSim(0x0),
- fRunSim(0x0),
- fRunRec(0x0),
- fIsRead(kFALSE),
- fBufferEvents(kFALSE),
- fBlend(kFALSE),
- fFirst(0),
- fLast(0),
- fTrackCounter(0x0)
-{
-//constructor
-}
-/*************************************************************************************/
-
-AliReader::AliReader(TObjArray* dirs):
- fEventList(0x0),
- fCuts(new TObjArray()),
- fDirs(dirs),
- fCurrentEvent(0),
- fCurrentDir(0),
- fNEventsRead(0),
- fEventRec(0x0),
- fEventSim(0x0),
- fRunSim(0x0),
- fRunRec(0x0),
- fIsRead(kFALSE),
- fBufferEvents(kFALSE),
- fBlend(kFALSE),
- fFirst(0),
- fLast(0),
- fTrackCounter(0x0)
-{
-//ctor with array of directories to read as parameter
-}
-/*************************************************************************************/
-AliReader::AliReader(const AliReader& in):
- TNamed(in),
- fEventList((in.fEventList)?(TGliteXmlEventlist*)in.fEventList->Clone():0x0),
- fCuts((in.fCuts)?(TObjArray*)in.fCuts->Clone():0x0),
- fDirs((in.fDirs)?(TObjArray*)in.fDirs->Clone():0x0),
- fCurrentEvent(0),
- fCurrentDir(0),
- fNEventsRead(0),
- fEventRec(0x0),
- fEventSim(0x0),
- fRunSim(0x0),
- fRunRec(0x0),
- fIsRead(kFALSE),
- fBufferEvents(in.fBufferEvents),
- fBlend(in.fBlend),
- fFirst(in.fFirst),
- fLast(in.fLast),
- fTrackCounter(0x0)
-{
- //cpy constructor
-}
-
-AliReader::~AliReader()
-{
-//destructor
- if(fCuts)
- {
- fCuts->SetOwner();
- delete fCuts;
- }
- delete fEventSim;
- delete fEventRec;
- delete fTrackCounter;
- delete fEventList;
-}
-/*************************************************************************************/
-
-AliReader& AliReader::operator=(const AliReader& in)
-{
- //Assigment operator
- if (this == &in) return *this;
- TNamed::operator=( (const TNamed&)in );
-
- fCuts = (in.fCuts)?(TObjArray*)in.fCuts->Clone():0x0;
- fDirs = (in.fDirs)?(TObjArray*)in.fDirs->Clone():0x0;
- fCurrentEvent = 0;
- fCurrentDir = 0;
- fNEventsRead = 0;
- fEventRec = 0x0;
- fEventSim = 0x0;
- fRunSim = 0x0;
- fRunRec = 0x0;
- fIsRead = kFALSE;
- fBufferEvents = in.fBufferEvents;
- fBlend = in.fBlend;
- fFirst = in.fFirst;
- fLast = in.fLast;
- fTrackCounter = 0x0;
- return *this;
-}
-/*************************************************************************************/
-
-Int_t AliReader::Next()
-{
-//moves to next event
-
- //if asked to read up to event nb. fLast, and it is overcome, report no more events
- if ((fNEventsRead >= fLast) && (fLast > 0) ) return kTRUE;
-
- if (fTrackCounter == 0x0)//create Track Counter
- {
- fTrackCounter = new TH1I("trackcounter","Track Counter",20000,0,20000);
- fTrackCounter->SetDirectory(0x0);
- }
-
- do //if asked to read from event fFirst, rewind to it
- {
- if ( ReadNext() == kTRUE) //if no more evets, return it
- return kTRUE;
- }while (fNEventsRead < fFirst);
-
- //here we have event
-
- if (fBlend) Blend();//Mix particles order
-
- if (fBufferEvents)//store events if buffering is on
- {
- if ( ReadsRec() && fEventRec)
- fRunRec->SetEvent(fNEventsRead-1-fFirst,fEventRec);
- if ( ReadsSim() && fEventSim)
- fRunSim->SetEvent(fNEventsRead-1-fFirst,fEventSim);
- }
- return kFALSE;
-}
-/*************************************************************************************/
-
-void AliReader::AddParticleCut(AliAODParticleCut* cut)
-{
- //sets the new cut. MAKES A COPY OF THE CUT !!!!
-
- if (!cut) //if cut is NULL return with error
- {
- Error("AddParticleType","NULL pointers are not accepted any more.\nIf You want to accept all particles of this type, set an empty cut ");
- return;
- }
- AliAODParticleCut *c = (AliAODParticleCut*)cut->Clone();
- fCuts->Add(c);
-}
-/********************************************************************/
-
-AliAOD* AliReader::GetEventSim(Int_t n)
- {
- //returns Nth event with simulated particles
- if (ReadsSim() == kFALSE)
- {
- Error("GetParticleEvent","This reader is not able to provide simulated particles.");
- return 0;
- }
-
- if (!fIsRead)
- {
- if (ReadsSim() && (fRunSim == 0x0)) fRunSim = new AliAODRun();
- if (ReadsRec() && (fRunRec == 0x0)) fRunRec = new AliAODRun();
-
- if (Read(fRunSim,fRunRec))
- {
- Error("GetParticleEvent","Error in reading");
- return 0x0;
- }
- else fIsRead = kTRUE;
- }
- return fRunSim->GetEvent(n);
- }
-/********************************************************************/
-
-AliAOD* AliReader::GetEventRec(Int_t n)
- {
- //returns Nth event with reconstructed tracks
- if (ReadsRec() == kFALSE)
- {
- Error("GetTrackEvent","This reader is not able to provide recosntructed tracks.");
- return 0;
- }
- if (!fIsRead)
- {
- if (ReadsSim() && (fRunSim == 0x0)) fRunSim = new AliAODRun();
- if (ReadsRec() && (fRunRec == 0x0)) fRunRec = new AliAODRun();
-
- if(Read(fRunSim,fRunRec))
- {
- Error("GetTrackEvent","Error in reading");
- return 0x0;
- }
- else fIsRead = kTRUE;
- }
- return fRunRec->GetEvent(n);
- }
-/********************************************************************/
-
-Int_t AliReader::GetNumberOfSimEvents()
- {
- //returns number of events of particles
- if (ReadsSim() == kFALSE)
- {
- Error("GetNumberOfPartEvents","This reader is not able to provide simulated particles.");
- return 0;
- }
-
- if (!fIsRead)
- {
- if (ReadsSim() && (fRunSim == 0x0)) fRunSim = new AliAODRun();
- if (ReadsRec() && (fRunRec == 0x0)) fRunRec = new AliAODRun();
-
- if (Read(fRunSim,fRunRec))
- {
- Error("GetNumberOfPartEvents","Error in reading");
- return 0;
- }
- else fIsRead = kTRUE;
- }
- return fRunSim->GetNumberOfEvents();
- }
-/********************************************************************/
-
-Int_t AliReader::GetNumberOfRecEvents()
- {
- //returns number of events of tracks
- if (ReadsRec() == kFALSE)
- {
- Error("GetNumberOfTrackEvents","This reader is not able to provide recosntructed tracks.");
- return 0;
- }
- if (!fIsRead)
- {
- if (ReadsSim() && (fRunSim == 0x0)) fRunSim = new AliAODRun();
- if (ReadsRec() && (fRunRec == 0x0)) fRunRec = new AliAODRun();
-
- if(Read(fRunSim,fRunRec))
- {
- Error("GetNumberOfTrackEvents","Error in reading");
- return 0;
- }
- else fIsRead = kTRUE;
- }
- return fRunRec->GetNumberOfEvents();
- }
-/********************************************************************/
-
-Int_t AliReader::Read(AliAODRun* particles, AliAODRun *tracks)
-{
- //reads data and puts put to the particles and tracks objects
- //reurns 0 if everything is OK
- //
- Info("Read","");
-
- if ( ReadsSim() && (particles == 0x0) ) //check if an object is instatiated
- {
- Error("Read"," particles object must be instatiated before passing it to the reader");
- return 1;
- }
- if ( ReadsRec() && (tracks == 0x0) ) //check if an object is instatiated
- {
- Error("Read"," tracks object must be instatiated before passing it to the reader");
- return 1;
- }
-
- if (ReadsSim()) particles->Reset();//clear runs == delete all old events
- if (ReadsRec()) tracks->Reset();
-
- Rewind();
-
- Int_t i = 0;
- while(Next() == kFALSE)
- {
- if (ReadsRec()) tracks->SetEvent(i,fEventRec);
- if (ReadsSim()) particles->SetEvent(i,fEventSim);
- i++;
- }
- return 0;
-}
-/*************************************************************************************/
-
-Bool_t AliReader::Rejected(AliVAODParticle* p)
-{
- //Method examines whether particle meets all cut and particle type criteria
-
- if(p==0x0)//of corse we not pass NULL pointers
- {
- Warning("Rejected()","No Pasaran! We never accept NULL pointers");
- return kTRUE;
- }
- //if no particle is specified, we pass all particles
- //excluding NULL pointers, of course
- if ( fCuts->GetEntriesFast() == 0 ) return kFALSE; //if no cut specified accept all particles
- for(Int_t i=0; i<fCuts->GetEntriesFast(); i++)
- {
- AliAODParticleCut &cut = *((AliAODParticleCut*)fCuts->At(i));
- if(!cut.Rejected(p)) return kFALSE; //accepted
- }
-
- return kTRUE;//not accepted
-}
-/*************************************************************************************/
-
-Bool_t AliReader::Rejected(Int_t pid)
-{
-//this method checks if any of existing cuts accepts this pid particles
-//or any cuts accepts all particles
-
- if(pid == 0)
- return kTRUE;
-
- if ( fCuts->GetEntriesFast() == 0 ) return kFALSE; //if no cut specified accept all particles
-
- for(Int_t i=0; i<fCuts->GetEntriesFast(); i++)
- {
- AliAODParticleCut &cut = *((AliAODParticleCut*)fCuts->At(i));
- //if some of cuts accepts all particles or some accepts particles of this type, accept
- if ( (cut.GetPID() == 0) || (cut.GetPID() == pid) ) return kFALSE;
- }
- return kTRUE;
-}
-/*************************************************************************************/
-
-TString AliReader::GetDirName(Int_t entry)
-{
-//returns directory name of next one to read
- TString retval;//return value
- if (fDirs == 0x0)
- {
- if (entry == 0)
- {
- retval = ".";
- return retval;
- }
- else
- {
- return retval;
- }
- }
-
-
- if ( (entry >= fDirs->GetEntries()) || (entry < 0))//if out of bounds return empty string
- { //note that entry==0 is accepted even if array is empty (size=0)
- if ( (fDirs->GetEntries() == 0) && (entry == 0) )
- {
- retval = ".";
- return retval;
- }
- AliDebug(1,Form("Index %d out of bounds",entry));
-
- return retval;
- }
-
-
- TClass *objclass = fDirs->At(entry)->IsA();
- TClass *stringclass = TObjString::Class();
-
- TObjString *dir = (TObjString*)objclass->DynamicCast(stringclass,fDirs->At(entry));
-
- if(dir == 0x0)
- {
- Error("GetDirName","Object in TObjArray is not a TObjString or its descendant");
- return retval;
- }
- AliDebug(1,Form("Returned ok %s",dir->String().Data()));
- retval = dir->String();
- return retval;
-}
-/*************************************************************************************/
-
-void AliReader::Blend()
-{
- //randomly change positions of the particles after reading
- //is used to check if some distributions (of many particle properties)
- //depend on the order of particles
- //(tracking gives particles Pt sorted)
- Int_t npart = 0;
-
- if (fEventSim )
- {
- npart = fEventSim->GetNumberOfParticles();
- }
- else
- if (fEventRec )
- {
- npart = fEventRec->GetNumberOfParticles();
- }
- else
- {
- return;
- }
- for (Int_t i = 2; i < npart; i++)
- {
- Int_t with = gRandom->Integer(i);
-// Info("Blend","%d %d",i, with);
- if (fEventSim) fEventSim->SwapParticles(i,with);
- if (fEventRec) fEventRec->SwapParticles(i,with);
- }
-}
-/*************************************************************************************/
-
-void AliReader::WriteTrackCounter() const
-{
- //writes the counter histogram
-
- if (fTrackCounter) fTrackCounter->Write(0,TObject::kOverwrite);
- else
- {
- Warning("WriteTrackCounter","Counter is NULL");
- }
-}
+++ /dev/null
-#ifndef ALIREADER_H
-#define ALIREADER_H
-//_________________________________________________________________________
-///////////////////////////////////////////////////////////////////////////
-//
-// class AliReader
-//
-// Reader Base class
-// Reads particles and tracks and
-// puts them to the AliAOD objects and eventually, if needed, buffers AliAODs in AliAODRun(s)
-//
-// User loops over events calling method Next. In case of success this method returns 0.
-// In case of error or if there is no more events to read, non-0 value is returned
-//
-// Reading can be rewound to the beginning using method Rewind.
-//
-// Tracks are read to the fEventRec (contains reconstructed tracks)
-// and fEventSim (corresponding MC simulated data) data members,
-// that are of the type AliAOD.
-//
-// If a given reader has ability of reading both, reconstructed and simulated data,
-// these are structured in AODs so a "n'th" simulated particle
-// (the one stored in the fEventSim at slot n)
-// corresponds to the n'th reconstructed track (the one stored in the fEventRec at slot n).
-//
-// The same reconstructed track can be present more than ones in the AOD,
-// but with a different PID. In this case
-// pointer to the corresponding MC simulated particles is also present more than ones.
-// This situation happens if you want to read all particles
-// with PID probability of being , e.g., pion higher than 60%
-// and being kaon higher than 40%. Than, if a given track has probability Ppid(pi)=52% and Ppid(K)=48%
-// than it is read twise.
-//
-// Provides functionality for both buffering and non-buffering reading
-// This can be switched on/off via method SetEventBuffering(bool)
-// The main method that inheriting classes need to implement is ReadNext()
-// that read next event in queue.
-//
-// The others are:
-// Bool_t ReadsSim() const; specifies if reader is able to read simulated particles
-// Bool_t ReadsRec() const; specifies if reader is able to read reconstructed tracks
-// void Rewind(); rewind reading to the beginning
-//
-// This class provides full functionality for reading from many sources
-// User can provide TObjArray of TObjStrings (SetDirs method or via parameter
-// in the constructor) which desribes paths of directories to search data in.
-// If none specified current directory is searched.
-//
-// Piotr.Skowronski@cern.ch
-//
-///////////////////////////////////////////////////////////////////////////
-
-#include <TNamed.h>
-#include <TObjArray.h>
-
-class TGliteXmlEventlist;
-
-class AliAODRun;
-class AliAOD;
-class AliAODParticleCut;
-class AliVAODParticle;
-class TString;
-class TH1I;
-
-class AliReader: public TNamed
-{
- public:
- AliReader();
- AliReader(TObjArray*);
- AliReader(const AliReader& in);
- virtual ~AliReader();
-
- AliReader& operator=(const AliReader& in);
-
- virtual Int_t Next();
- virtual void Rewind() = 0; //
-
- virtual Bool_t ReadsSim() const = 0; //specifies if reader is able to read simulated particles
- virtual Bool_t ReadsRec() const = 0;//specifies if reader is able to read reconstructed tracks
-
- void AddParticleCut(AliAODParticleCut* cut);//adds a particle cut to the list of cuts
-
- virtual AliAOD* GetEventRec() const {return fEventRec;}//returns current event with reconstructed tracks
- virtual AliAOD* GetEventSim() const {return fEventSim;}//returns current event with simulated particles
-
- virtual AliAOD* GetEventRec(Int_t n);//returns event number n
- virtual AliAOD* GetEventSim(Int_t n);
-
- virtual Int_t Read(const char * name) {return TObject::Read(name);}
- virtual Int_t Read(AliAODRun* particles, AliAODRun *tracks);//Reads all available evenets and stores them in 'particles' and 'tracks'
-
- virtual Int_t GetNumberOfRecEvents();//Returns number of available events -> usually conncected with reading all events
- //may be time consuming
- virtual Int_t GetNumberOfSimEvents();//
-
- void SetEventList(TGliteXmlEventlist* evl){fEventList = evl;}
-
- void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names
- void SetEventBuffering(Bool_t flag){fBufferEvents = flag;}//switches on/off buffering - read data are kept in local buffer
- void SetBlend(Bool_t flag = kTRUE){fBlend=flag;} //set blending - randomizing particle order
- virtual Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;}
- void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;}
- virtual TH1I* GetTrackCounter() const {return fTrackCounter;}
- virtual void WriteTrackCounter() const;//Writes the track counting histigram
-
- protected:
-
- TGliteXmlEventlist* fEventList;//Event list delivered by GLite/AliEn
-
- TObjArray* fCuts;//array with particle cuts
- TObjArray* fDirs;//arry with directories to read data from
-
- Int_t fCurrentEvent;//! number of current event in current directory
- Int_t fCurrentDir;//! number of current directory
-
- Int_t fNEventsRead;//!total
-
- AliAOD* fEventRec; //! tracks read from current event
- AliAOD* fEventSim; //! particles read from current event
-
- AliAODRun* fRunSim; //!simulated particles
- AliAODRun* fRunRec; //!reconstructed tracks
-
- Bool_t fIsRead;//!flag indicating if the data are already read
- Bool_t fBufferEvents;//flag indicating if the data should be bufferred
-
- Bool_t fBlend;// flag indicating if randomly change positions of the particles after reading
-
- Int_t fFirst;//first event to return (all before are skipped)
- Int_t fLast;//the last one
-
- TH1I* fTrackCounter; //histogram with number of tracks read
-
- virtual Int_t ReadNext() = 0; //this methods reads next event and put result in fTracksEvent and/or fParticlesEvent
- Bool_t Rejected(AliVAODParticle* p);//Checks if a given particle agains cuts
- Bool_t Rejected(Int_t pid);//Checks if a given pid passes cuts
- void Blend();//Mixes current events in a symmetric way so after mixing thy are consistent
-
- TString GetDirName(Int_t entry);
-
- private:
-
- ClassDef(AliReader,1)//
-};
-
-#endif
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//______________________________________________________________________________
-////////////////////////////////////////////////////////////////////////////////
-// //
-// class AliReaderAOD //
-// //
-// Reader and Writer for AOD format. //
-// AODs are stored in a tree named by the variable fgkTreeName. //
-// There is stored 1 or 2 branches. Each of them stores AOD objects //
-// First branch is named by the variable fgkReconstructedDataBranchName //
-// ("reconstructed.") and keeps reconstructed data. //
-// Second branch is called by the variable fgkSimulatedDataBranchName //
-// ("simulated.") and stores Monte carlo truth. If both branches are present //
-// AODs are parallel, i.e. nth particle in one branch corresponds to the nth //
-// particle in the other one. //
-// //
-// Since we accept different formats of particles that are stored in AODs //
-// reader must take care of that fact: clean buffer if the next file contains //
-// different particle type. //
-// //
-// Piotr.Skowronski@cern.ch //
-// //
-////////////////////////////////////////////////////////////////////////////////
-
-
-#include <TError.h>
-#include <TFile.h>
-#include <TTree.h>
-#include <TH1.h>
-
-#include "AliAOD.h"
-#include "AliLog.h"
-#include "AliReaderAOD.h"
-
-const TString AliReaderAOD::fgkTreeName("TAOD");
-const TString AliReaderAOD::fgkReconstructedDataBranchName("reconstructed.");
-const TString AliReaderAOD::fgkSimulatedDataBranchName("simulated.");
-
-ClassImp(AliReaderAOD)
-
-AliReaderAOD::AliReaderAOD(const Char_t* aodfilename):
- fFileName(aodfilename),
- fReadSim(kFALSE),
- fReadRec(kTRUE),
- fTree(0x0),
- fFile(0x0),
- fSimBuffer(0x0),
- fRecBuffer(0x0)
-{
- //ctor
-}
-/********************************************************************/
-
-AliReaderAOD::~AliReaderAOD()
-{
-//dtor
- if (fEventSim == fSimBuffer )
- {
- fEventSim = 0x0;
- fEventRec = 0x0;
- }
- delete fSimBuffer;
- delete fRecBuffer;
-
- delete fTree;
- delete fFile;
-}
-/********************************************************************/
-
-void AliReaderAOD::Rewind()
-{
-//Rewinds reading
- delete fTree;
- fTree = 0x0;
- delete fFile;
- fFile = 0x0;
- fCurrentDir = 0;
- fNEventsRead= 0;
-}
-/********************************************************************/
-Int_t AliReaderAOD::ReadNext()
-{
-//Reads next event
-
- Info("ReadNext","Entered");
- do //do{}while; is OK even if 0 dirs specified. In that case we try to read from "./"
- {
- if (fFile == 0x0)
- {
- Int_t openfailed = OpenFile(fCurrentDir);//rl is opened here
- if (openfailed)
- {
- //Error("ReadNext","Error Occured while opening directory number %d",fCurrentDir);
- fCurrentDir++;
- continue;
- }
- fCurrentEvent = 0;
- }
- //Tree must exist because OpenFile would reuturn error in the other case
- if ( fCurrentEvent >= fTree->GetEntries() )
- {
- delete fTree;
- fTree = 0x0;
- delete fFile;
- fFile = 0x0;
-
- delete fSimBuffer;
- delete fRecBuffer;
-
- fSimBuffer = 0x0;
- fRecBuffer = 0x0;
- fCurrentDir++;
- continue;
- }
-
- Info("ReadNext","Getting event %d",fCurrentEvent);
- fTree->GetEvent(fCurrentEvent);
- Info("ReadNext","Getting event %d Done",fCurrentEvent);
-
- Int_t retval = 0;
- if (fReadRec && fReadSim)
- {
- retval = ReadRecAndSim();
- }
- else
- {
- if (fReadRec) retval = ReadRec();
- if (fReadSim) retval = ReadSim();
- }
-
- fCurrentEvent++;
- if (retval != 0)
- {
- //something wrong has happend during reading this event, take next
- continue;
- }
-
- fNEventsRead++;
- return retval;//success -> read one event
-
- }while(fCurrentDir < GetNumberOfDirs());//end of loop over directories specified in fDirs Obj Array
-
- return 1; //no more directories to read
-
-
-}
-/********************************************************************/
-
-Int_t AliReaderAOD::ReadRecAndSim()
-{
-//Reads raconstructed and simulated data
-
- Info("ReadRecAndSim","Found %d reconstructed tracks and %d simulated particles",
- fRecBuffer->GetNumberOfParticles(),fSimBuffer->GetNumberOfParticles());
-
- if (fCuts->GetEntriesFast() == 0x0)
- {//if there is no cuts we return pointer to the buffer
- if (fEventRec != fRecBuffer)
- {
- delete fEventRec;
- delete fEventSim;
- }
- fEventRec = fRecBuffer;//fEventRec is the pointer that the user gets when he asks about an event
- fEventSim = fSimBuffer;
- }
- else
- {//if there are cuts specified
- if ( (fEventRec == 0x0) || (fEventRec == fRecBuffer) )
- {//we need to create a new event, if it is not existing or it is the same as branch buffer
- fEventRec = new AliAOD();
- fEventSim = new AliAOD();
-
- fEventRec->SetParticleClass( fRecBuffer->GetParticleClass() );
- fEventSim->SetParticleClass( fSimBuffer->GetParticleClass() );
- }
- else
- {//or simply reset it in case it already exists
- fEventRec->Reset();
- fEventSim->Reset();
- }
-
- Int_t npart = fRecBuffer->GetNumberOfParticles();
-
- if (npart != fSimBuffer->GetNumberOfParticles())
- {
- Error("ReadRecAndSim","There is different number of simulated and reconstructed particles!",
- fSimBuffer->GetNumberOfParticles(),npart);
- return 1;
- }
- for (Int_t i = 0; i < npart; i++)
- {
- AliVAODParticle* prec = fRecBuffer->GetParticle(i);
- AliVAODParticle* psim = fSimBuffer->GetParticle(i);
-
- if (prec == 0x0)
- {
- Error("ReadRecAndSim","Reconstructed Particle is NULL !!!");
- continue;
- }
- if (psim == 0x0)
- {
- Error("ReadRecAndSim","Simulated Particle is NULL !!!");
- continue;
- }
-
- if (Rejected(prec)) continue;//we make cuts only on reconstructed data
-
- fEventRec->AddParticle(prec);
- fEventSim->AddParticle( fSimBuffer->GetParticle(i));
- }
- }
-
- Info("ReadRecAndSim","Read %d reconstructed tracks and %d simulated particles",
- fEventRec->GetNumberOfParticles(),fEventSim->GetNumberOfParticles());
-
- fTrackCounter->Fill(fEventRec->GetNumberOfParticles());
-
- return 0;
-}
-/********************************************************************/
-
-Int_t AliReaderAOD::ReadRec()
-{
-//Reads reconstructed data only
-
- Info("ReadRec","Found %d reconstructed tracks",fRecBuffer->GetNumberOfParticles());
-
- if (fCuts->GetEntriesFast() == 0x0)
- {//if there is no cuts we return pointer to the buffer
- if (fEventRec != fRecBuffer)
- {
- delete fEventRec;
- }
- fEventRec = fRecBuffer;//fEventRec is the pointer that the user gets when he asks about an event
- }
- else
- {//if there are cuts specified
- if ( (fEventRec == 0x0) || (fEventRec == fRecBuffer) )
- {//we need to create a new event, if it is not existing or it is the same as branch buffer
- fEventRec = new AliAOD();
-
- fEventRec->SetParticleClass( fRecBuffer->GetParticleClass() );
- }
- else
- {//or simply reset it in case it already exists
- fEventRec->Reset();
- }
-
- Int_t npart = fRecBuffer->GetNumberOfParticles();
- for (Int_t i = 0; i < npart; i++)
- {
- AliVAODParticle* prec = fRecBuffer->GetParticle(i);
- if (Rejected(prec)) continue;//we make cuts only on simulated data
-
- fEventRec->AddParticle(prec);
- }
- }
-
- Info("ReadRec","Read %d reconstructed tracks",fEventRec->GetNumberOfParticles());
- fTrackCounter->Fill(fEventRec->GetNumberOfParticles());
-
- return 0;
-}
-/********************************************************************/
-
-Int_t AliReaderAOD::ReadSim()
-{
-//Reads simulated data only
-
- Info("ReadSim","Found %d simulated particles",fSimBuffer->GetNumberOfParticles());
-
- if (fCuts->GetEntriesFast() == 0x0)
- {//if there is no cuts we return pointer to the buffer
- if (fEventSim != fSimBuffer)
- {
- delete fEventSim;
- }
- fEventSim = fSimBuffer;
- }
- else
- {//if there are cuts specified
- if ( (fEventSim == 0x0) || (fEventSim == fSimBuffer) )
- {//we need to create a new event, if it is not existing or it is the same as branch buffer
- fEventSim = new AliAOD();
-
- fEventSim->SetParticleClass( fSimBuffer->GetParticleClass() );
- }
- else
- {//or simply reset it in case it already exists
- fEventSim->Reset();
- }
-
- Int_t npart = fSimBuffer->GetNumberOfParticles();
- for (Int_t i = 0; i < npart; i++)
- {
- AliVAODParticle* prec = fSimBuffer->GetParticle(i);
- if (Rejected(prec)) continue;//we make cuts only on simulated data
- fEventSim->AddParticle(prec);
- }
- }
-
- Info("ReadSim","Read %d simulated particles",fEventSim->GetNumberOfParticles());
- fTrackCounter->Fill(fEventSim->GetNumberOfParticles());
-
-
- return 0;
-}
-/********************************************************************/
-
-Int_t AliReaderAOD::OpenFile(Int_t n)
-{
-//opens fFile with tree
-
-// Info("ReadNext","Opening File %d",n);
- const TString dirname = GetDirName(n);
- if (dirname == "")
- {
- AliDebug(3,"Got empty string as a directory name.");
- return 1;
- }
-
- TString filename = dirname +"/"+ fFileName;
- fFile = TFile::Open(filename.Data());
- if ( fFile == 0x0)
- {
- Error("OpenFile","Can't open fFile %s",filename.Data());
- return 2;
- }
- if (!fFile->IsOpen())
- {
- Error("OpenFile","Can't open fFile %s",filename.Data());
- delete fFile;
- fFile = 0x0;
- return 3;
- }
-
- Info("ReadNext","File %s Is Opened, Getting the TREE",filename.Data());
-
- fTree = dynamic_cast<TTree*>(fFile->Get(fgkTreeName));
- if (fTree == 0x0)
- {
- AliDebug(3,Form("Can not find TTree object named %s",fgkTreeName.Data()));
- delete fFile;
- fFile = 0x0;
- return 4;
- }
-
-// Info("ReadNext","Got TREE, Setting branch addresses");
-
- if (fReadRec)
- {
- TBranch* branch = fTree->GetBranch(fgkReconstructedDataBranchName);
- if (branch == 0x0)
- {
- Error("OpenFile","Can not find branch %s in file %s",
- fgkReconstructedDataBranchName.Data(),filename.Data());
-
- delete fTree;
- fTree = 0x0;
- delete fFile;
- fFile = 0x0;
- return 5;
- }
- fTree->SetBranchAddress(fgkReconstructedDataBranchName,&fRecBuffer);
- }
-
-
- if (fReadSim)
- {
- TBranch* branch = fTree->GetBranch(fgkSimulatedDataBranchName);
- if (branch == 0x0)
- {
- Error("OpenFile","Can not find branch %s in file %s",
- fgkSimulatedDataBranchName.Data(),filename.Data());
-
- delete fTree;
- fTree = 0x0;
- delete fFile;
- fFile = 0x0;
- return 6;
- }
- fTree->SetBranchAddress(fgkSimulatedDataBranchName,&fSimBuffer);
- }
-// Info("ReadNext","Got TREE, Addresses are set.");
-// Info("ReadNext","Quitting the method.");
-
- return 0;
-
-}
-/********************************************************************/
-
-Int_t AliReaderAOD::WriteAOD(AliReader* reader, const char* outfilename, const char* pclassname, Bool_t /*multcheck*/)
-{
-//reads tracks from runs and writes them to file
- ::Info("AliReaderAOD::Write","________________________________________________________");
- ::Info("AliReaderAOD::Write","________________________________________________________");
- ::Info("AliReaderAOD::Write","________________________________________________________");
-
- if (reader == 0x0)
- {
- ::Error("AliReaderAOD::Write","Input Reader is NULL");
- return -1;
- }
- TFile *outfile = TFile::Open(outfilename,"recreate");
- if (outfile == 0x0)
- {
- ::Error("AliReaderAOD::Write","Can not open output file %s",outfilename);
- return -1;
- }
-
- TTree *tree = new TTree(fgkTreeName,"Tree with tracks");
-
- TBranch *recbranch = 0x0, *simbranch = 0x0;
-
- AliAOD* eventrec = new AliAOD();//must be created before Branch is called. Otherwise clones array is not splitted
- AliAOD* eventsim = new AliAOD();//AOD together with fParticles clones array knowing exact type of particles
-
- eventrec->SetParticleClassName(pclassname);
- eventsim->SetParticleClassName(pclassname);
-
- AliAOD* recbuffer = eventrec;
- AliAOD* simbuffer = eventsim;
-
- if (reader->ReadsRec()) recbranch = tree->Branch(fgkReconstructedDataBranchName,"AliAOD",&recbuffer,32000,99);
- if (reader->ReadsSim()) simbranch = tree->Branch(fgkSimulatedDataBranchName,"AliAOD",&simbuffer,32000,99);
-
- reader->Rewind();
- while (reader->Next() == kFALSE)
- {
-
- if (reader->ReadsRec())
- {//here we can get AOD that has different particle type
- AliAOD* event = reader->GetEventRec();
- if ( eventrec->GetParticleClass() != event->GetParticleClass() )
- {//if class type is not what what we whant we copy particles
- eventrec->CopyData(event);
- recbuffer = eventrec;
- }
- else
- {//else just pointer to event from input reader is passed
- recbuffer = event;
- }
- }
-
- if (reader->ReadsSim())
- {
- AliAOD* event = reader->GetEventSim();
- if ( eventsim->GetParticleClass() != event->GetParticleClass() )
- {//if class type is not what what we whant we copy particles
- eventsim->CopyData(event);
- simbuffer = eventrec;
- }
- else
- {//else just pointer to event from input reader is passed
- simbuffer = event;
- }
- }
- tree->Fill();
- }
-
- ::Info("AliReaderAOD::Write","Written %d events",tree->GetEntries());
- outfile->cd();
- tree->Write();
-
- delete eventsim;
- delete eventrec;
-
- delete tree;
- delete outfile;
- return 0;
-}
-
+++ /dev/null
-/**************************************************************************
- * 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. *
- **************************************************************************/
-
-/* $Id$ */
-
-//____________________________________________________________________
-//////////////////////////////////////////////////////////////////////
-// //
-// class AliReaderESD //
-// //
-// reader for ALICE Event Summary Data (ESD). //
-// //
-// Piotr.Skowronski@cern.ch //
-// //
-//////////////////////////////////////////////////////////////////////
-
-#include <TFile.h>
-#include <TGliteXmlEventlist.h>
-#include <TH1.h>
-#include <TPDGCode.h>
-#include <TParticle.h>
-#include <TString.h>
-
-#include "AliAOD.h"
-#include "AliAODParticle.h"
-#include "AliClusterMap.h"
-#include "AliESD.h"
-#include "AliESDtrack.h"
-#include "AliLog.h"
-#include "AliReaderESD.h"
-#include "AliRunLoader.h"
-#include "AliStack.h"
-
-ClassImp(AliReaderESD)
-
-AliReaderESD::AliReaderESD(const Char_t* esdfilename, const Char_t* galfilename):
- fESDFileName(esdfilename),
- fGAlFileName(galfilename),
- fFile(0x0),
- fRunLoader(0x0),
- fKeyIterator(0x0),
- fReadSim(kFALSE),
- fCheckParticlePID(kFALSE),
- fReadMostProbableOnly(kFALSE),
- fNTrackPoints(0),
- fdR(0.0),
- fClusterMap(kFALSE),
- fITSTrackPoints(kFALSE),
- fITSTrackPointsType(AliTrackPoints::kITS),
- fMustTPC(kFALSE),
- fReadCentralBarrel(kTRUE),
- fReadMuon(kFALSE),
- fReadPHOS(kFALSE),
- fNTPCClustMin(0),
- fNTPCClustMax(1500),
- fTPCChi2PerClustMin(0.0),
- fTPCChi2PerClustMax(10e5),
- fChi2Min(0.0),
- fChi2Max(10e5),
- fC00Min(0.0),
- fC00Max(10e5),
- fC11Min(0.0),
- fC11Max(10e5),
- fC22Min(0.0),
- fC22Max(10e5),
- fC33Min(0.0),
- fC33Max(10e5),
- fC44Min(0.0),
- fC44Max(10e5),
- fTPCC00Min(0.0),
- fTPCC00Max(10e5),
- fTPCC11Min(0.0),
- fTPCC11Max(10e5),
- fTPCC22Min(0.0),
- fTPCC22Max(10e5),
- fTPCC33Min(0.0),
- fTPCC33Max(10e5),
- fTPCC44Min(0.0),
- fTPCC44Max(10e5)
-
-{
- //cosntructor
- if ( ((Int_t)kNSpecies) != ((Int_t)AliPID::kSPECIES))
- Fatal("AliReaderESD","ESD defintions probobly changed. Ask Youra.");
-}
-/********************************************************************/
-
-AliReaderESD::AliReaderESD(TObjArray* dirs,const Char_t* esdfilename, const Char_t* galfilename):
- AliReader(dirs),
- fESDFileName(esdfilename),
- fGAlFileName(galfilename),
- fFile(0x0),
- fRunLoader(0x0),
- fKeyIterator(0x0),
- fReadSim(kFALSE),
- fCheckParticlePID(kFALSE),
- fReadMostProbableOnly(kFALSE),
- fNTrackPoints(0),
- fdR(0.0),
- fClusterMap(kFALSE),
- fITSTrackPoints(kFALSE),
- fITSTrackPointsType(AliTrackPoints::kITS),
- fMustTPC(kFALSE),
- fReadCentralBarrel(kTRUE),
- fReadMuon(kFALSE),
- fReadPHOS(kFALSE),
- fNTPCClustMin(0),
- fNTPCClustMax(150),
- fTPCChi2PerClustMin(0.0),
- fTPCChi2PerClustMax(10e5),
- fChi2Min(0.0),
- fChi2Max(10e5),
- fC00Min(0.0),
- fC00Max(10e5),
- fC11Min(0.0),
- fC11Max(10e5),
- fC22Min(0.0),
- fC22Max(10e5),
- fC33Min(0.0),
- fC33Max(10e5),
- fC44Min(0.0),
- fC44Max(10e5),
- fTPCC00Min(0.0),
- fTPCC00Max(10e5),
- fTPCC11Min(0.0),
- fTPCC11Max(10e5),
- fTPCC22Min(0.0),
- fTPCC22Max(10e5),
- fTPCC33Min(0.0),
- fTPCC33Max(10e5),
- fTPCC44Min(0.0),
- fTPCC44Max(10e5)
-{
- //cosntructor
- if ( ((Int_t)kNSpecies) != ((Int_t)AliPID::kSPECIES))
- Fatal("AliReaderESD","ESD defintions probobly changed. Ask Youra.");
-}
-/********************************************************************/
-
-AliReaderESD::~AliReaderESD()
-{
- //desctructor
- delete fRunLoader;
- delete fKeyIterator;
- delete fFile;
-}
-
-/**********************************************************/
-Int_t AliReaderESD::ReadNext()
-{
-//reads next event from fFile
- //fRunLoader is for reading Kine
-
- AliDebug(1,"Entered");
-
- if (fEventSim == 0x0) fEventSim = new AliAOD();
- if (fEventRec == 0x0) fEventRec = new AliAOD();
-
- fEventSim->Reset();
- fEventRec->Reset();
-
- do //do{}while; is OK even if 0 dirs specified. In that case we try to read from "./"
- {
- if (fFile == 0x0)
- {
- fFile = OpenFile(fCurrentDir);//rl is opened here
- if (fFile == 0x0)
- {
- Error("ReadNext","Cannot get fFile for dir no. %d",fCurrentDir);
- fCurrentDir++;
- continue;
- }
- fCurrentEvent = 0;
- }
- TString esdname = "ESD";
- esdname+=fCurrentEvent;
- AliESD* esd = dynamic_cast<AliESD*>(fFile->Get(esdname));
- if (esd == 0x0)
- {
- AliDebug(3,Form("Can not find AliESD object named %s",esdname.Data()));
- fCurrentDir++;
- delete fFile;//we have to assume there is no more ESD objects in the fFile
- fFile = 0x0;
- delete fRunLoader;
- fRunLoader = 0x0;
- continue;
- }
- ReadESD(esd);
-
- fCurrentEvent++;
- fNEventsRead++;
- delete esd;
- return 0;//success -> read one event
- }while(fCurrentDir < GetNumberOfDirs());//end of loop over directories specified in fDirs Obj Array
-
- return 1; //no more directories to read
-}
-
-/**********************************************************/
-Int_t AliReaderESD::ReadESD(AliESD* esd)
-{
-//Reads esd data
- if (esd == 0x0)
- {
- Error("ReadESD","ESD is NULL");
- return 1;
- }
-
- // seperate each method
- if (fReadCentralBarrel) ReadESDCentral(esd);
-
- if (fReadMuon) ReadESDMuon(esd);
-
- if (fReadPHOS) ReadESDPHOS(esd);
-
- return 1;
-}
-
-/**********************************************************/
-Int_t AliReaderESD::ReadESDCentral(AliESD* esd)
-{
- //****** Tentative particle type "concentrations"
- static const Double_t kConcentr[5]={0.05, 0., 0.85, 0.10, 0.05};
-
- Double_t pidtable[kNSpecies];//array used for reading pid probabilities from ESD track
- Double_t w[kNSpecies];
- Double_t mom[3];//momentum
- Double_t pos[3];//position
- Double_t vertexpos[3];//vertex position
- //Reads one ESD
-
- TDatabasePDG* pdgdb = TDatabasePDG::Instance();
- if (pdgdb == 0x0)
- {
- Error("ReadESD","Can not get PDG Database Instance.");
- return 1;
- }
-
- Float_t mf = esd->GetMagneticField()/10.; //AliESD::GetMagnField returns mf in kG
-
- if ( (mf == 0.0) && ((fNTrackPoints > 0) || fITSTrackPoints) )
- {
- Error("ReadESD","Magnetic Field is 0 and Track Points Demended. Skipping to next event.");
-
- }
-
- if (fITSTrackPoints)
- {
- Info("ReadESD","Magnetic Field is %f",mf);
- //AliKalmanTrack::SetMagneticField(mf);
- }
-
- AliStack* stack = 0x0;
- if (fReadSim && fRunLoader)
- {
- fRunLoader->GetEvent(fCurrentEvent);
- stack = fRunLoader->Stack();
- }
-
- const AliESDVertex* vertex = esd->GetVertex();
- if (vertex == 0x0)
- {
- Info("ReadESD","ESD returned NULL pointer to vertex - assuming (0.0,0.0,0.0)");
- vertexpos[0] = 0.0;
- vertexpos[1] = 0.0;
- vertexpos[2] = 0.0;
- }
- else
- {
- vertex->GetXYZ(vertexpos);
- }
-
- AliDebug(1,Form("Primary Vertex is (%f,%f,%f)",vertexpos[0],vertexpos[1],vertexpos[2]));
-
- Info("ReadESD","Reading Event %d",fCurrentEvent);
-
- Int_t ntr = esd->GetNumberOfTracks();
- Info("ReadESD","Found %d tracks.",ntr);
- for (Int_t i = 0;i<ntr; i++)
- {
- AliESDtrack *esdtrack = esd->GetTrack(i);
- if (esdtrack == 0x0)
- {
- Error("Next","Can not get track %d", i);
- continue;
- }
-
- //if (esdtrack->HasVertexParameters() == kFALSE)
- if ((esdtrack->GetStatus() & AliESDtrack::kITSrefit) == kFALSE)
- {
- AliDebug(3,Form("Particle skipped: Data at vertex not available."));
- continue;
- }
-
- if (fMustTPC)
- {
- if ((esdtrack->GetStatus() & AliESDtrack::kTPCin) == kFALSE)
- {
- AliDebug(3,"Particle skipped: Was not reconstructed in TPC.");
- continue;
- }
- }
-
- if ((esdtrack->GetStatus() & AliESDtrack::kESDpid) == kFALSE)
- {
- AliDebug(3,"Particle skipped: PID BIT is not set.");
- continue;
- }
-
-
- Double_t alpha,extx;
- Double_t extp[5];
- esdtrack->GetConstrainedExternalParameters(alpha,extx,extp);
- if (extp[4] == 0.0)
- {
- AliDebug(3,"Track has 0 contrianed curvature -> Probobly parameters never updated. Skipping.");
- continue;
- }
- esdtrack->GetESDpid(pidtable);
- esdtrack->GetConstrainedPxPyPz(mom);
- esdtrack->GetConstrainedXYZ(pos);
- pos[0] -= vertexpos[0];//we are interested only in relative position to Primary vertex at this point
- pos[1] -= vertexpos[1];
- pos[2] -= vertexpos[2];
-
- Int_t charge = (extp[4] > 0)?1:-1;//if curvature=charg/Pt is positive charge is positive
-
- //Particle from kinematics
- AliAODParticle* particle = 0;
- Bool_t keeppart = kFALSE;
- if ( fReadSim && stack )
- {
- if (esdtrack->GetLabel() < 0) continue;//this is fake - we are not able to match any track
- TParticle *p = stack->Particle(esdtrack->GetLabel());
- if (p==0x0)
- {
- Error("ReadNext","Can not find track with such label.");
- continue;
- }
-
- if (fCheckParticlePID)
- {
- if(Rejected(p->GetPdgCode()))
- {
- AliDebug(6,Form("Simulated Particle PID (%d) did not pass the cut.",p->GetPdgCode()));
- continue; //check if we are intersted with particles of this type
- }
- }
-// if(p->GetPdgCode()<0) charge = -1;
- particle = new AliAODParticle(*p,i);
-
- }
-
- if(CheckTrack(esdtrack)) continue;
-
- //Here we apply Bayes' formula
- Double_t rc=0.;
- for (Int_t s=0; s<AliPID::kSPECIES; s++) rc+=kConcentr[s]*pidtable[s];
- if (rc==0.0)
- {
- AliDebug(3,"Particle rejected since total bayessian PID probab. is zero.");
- continue;
- }
-
- for (Int_t s=0; s<AliPID::kSPECIES; s++) w[s]=kConcentr[s]*pidtable[s]/rc;
-
- if (AliDebugLevel() > 4)
- {
- Info("ReadNext","###########################################################################");
- Info("ReadNext","Momentum: %f %f %f",mom[0],mom[1],mom[2]);
- Info("ReadNext","Position: %f %f %f",pos[0],pos[1],pos[2]);
- TString msg("Pid list got from track:");
- for (Int_t s = 0;s<kNSpecies;s++)
- {
- msg+="\n ";
- msg+=s;
- msg+="(";
- msg+=charge*GetSpeciesPdgCode((ESpecies)s);
- msg+="): ";
- msg+=w[s];
- msg+=" (";
- msg+=pidtable[s];
- msg+=")";
- }
- Info("ReadNext","%s",msg.Data());
- }//if (AliDebugLevel()>4)
-
- AliTrackPoints* tpts = 0x0;
- if (fNTrackPoints > 0)
- {
- tpts = new AliTrackPoints(fNTrackPoints,esdtrack,mf*10.0,fdR);
-// tpts->Move(-vertexpos[0],-vertexpos[1],-vertexpos[2]);
- }
-
- AliTrackPoints* itstpts = 0x0;
- if (fITSTrackPoints)
- {
- itstpts = new AliTrackPoints(fITSTrackPointsType,esdtrack,mf*10.0);
-// itstpts->Move(-vertexpos[0],-vertexpos[1],-vertexpos[2]);
- }
-
- AliClusterMap* cmap = 0x0;
- if ( fClusterMap )
- {
- cmap = new AliClusterMap(esdtrack);
- }
-
- //If this flag fReadMostProbableOnly is false the
- //loop over species (see "LOOPPIDS") is over all possible PIDs
- //in other case the most probablle PID is searched
- //and the loop is limited to that PID only
-
- Int_t firstspecie = 0;
- Int_t lastspecie = kNSpecies;
-
- if (fReadMostProbableOnly)
- {
- //find the most probable PID
- Int_t spec = 0;
- Float_t maxprob = w[0];
- for (Int_t s=1; s<AliPID::kSPECIES; s++)
- {
- if (w[s]>maxprob)
- {
- maxprob = w[s];
- spec = s;
- }
- }
- firstspecie = spec;
- lastspecie = spec + 1;
- }
-
- for (Int_t s = firstspecie; s<lastspecie; s++)//LOOPPIDS
- {
- Int_t pdgcode = charge*GetSpeciesPdgCode((ESpecies)s);
- Float_t pp = w[s];
- if (pp == 0.0)
- {
- AliDebug(6,Form("Probability of being PID %d is zero. Continuing.",pdgcode));
- continue;
- }
-
- if(Rejected(pdgcode))
- {
- AliDebug(6,Form("PID (%d) did not pass the cut.",pdgcode));
- continue; //check if we are intersted with particles of this type
- }
-
- Double_t mass = pdgdb->GetParticle(pdgcode)->Mass();
- Double_t tEtot = TMath::Sqrt( mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2] + mass*mass);//total energy of the track
-
- AliAODParticle* track = new AliAODParticle(pdgcode, w[s],i,
- mom[0], mom[1], mom[2], tEtot,
- pos[0], pos[1], pos[2], 0.);
- //copy probabilitis of other species (if not zero)
- for (Int_t k = 0; k<kNSpecies; k++)
- {
- if (k == s) continue;
- if (w[k] == 0.0) continue;
- track->SetPIDprobability(charge*GetSpeciesPdgCode( (ESpecies)k ),w[k]);
- }
-
- if(Rejected(track))//check if meets all criteria of any of our cuts
- //if it does not delete it and take next good track
- {
- AliDebug(5,"Track did not pass the cut");
- delete track;
- continue;
- }
-
- //Single Particle cuts on cluster map and track points rather do not have sense
- if (tpts)
- {
- track->SetTPCTrackPoints(tpts);
- }
-
- if (itstpts)
- {
- track->SetITSTrackPoints(itstpts);
- }
-
- if (cmap)
- {
- track->SetClusterMap(cmap);
- }
-
- fEventRec->AddParticle(track);
- if (particle) fEventSim->AddParticle(particle);
- keeppart = kTRUE;
-
- if (AliDebugLevel() > 4 )
- {
- Info("ReadNext","\n\nAdding Particle with incarnation %d",pdgcode);
- track->Print();
- if (particle) particle->Print();
- Info("ReadNext","\n----------------------------------------------\n");
- }
- }//for (Int_t s = 0; s<kNSpecies; s++)
-
- if (keeppart == kFALSE)
- {
- delete particle;//particle was not stored in event
- delete tpts;
- delete itstpts;
- delete cmap;
- }
- else
- {
- if ( fReadSim && stack )
- {
- if (particle->P() < 0.00001)
- {
- Info("ReadNext","###################################");
- Info("ReadNext","###################################");
- Info("ReadNext","Track Label %d",esdtrack->GetLabel());
- TParticle *p = stack->Particle(esdtrack->GetLabel());
- Info("ReadNext","");
- p->Print();
- Info("ReadNext","");
- particle->Print();
- }
- }
- }
-
- }//for (Int_t i = 0;i<ntr; i++) -- loop over tracks
-
- Info("ReadNext","Read %d tracks and %d particles from event %d (event %d in dir %d).",
- fEventRec->GetNumberOfParticles(), fEventSim->GetNumberOfParticles(),
- fNEventsRead,fCurrentEvent,fCurrentDir);
- fTrackCounter->Fill(fEventRec->GetNumberOfParticles());
-
- /******************************************************/
- /****** Setting glevet properties *************/
- /******************************************************/
-
- if (fEventRec->GetNumberOfParticles() > 0)
- {
- fEventRec->SetPrimaryVertex(vertexpos[0],vertexpos[1],vertexpos[2]);
- }
- return 0;
-}
-
-/**********************************************************/
-Int_t AliReaderESD::ReadESDMuon(AliESD* esd)
-{
- // Reads the muon tracks from the ESD
- Double_t vertexpos[3];//vertex position, assuming no secondary decay
-
- const AliESDVertex* vertex = esd->GetVertex();
-
- if (vertex == 0x0) {
- Info("ReadESD","ESD returned NULL pointer to vertex - assuming (0.0,0.0,0.0)");
- vertexpos[0] = 0.0;
- vertexpos[1] = 0.0;
- vertexpos[2] = 0.0;
- } else {
- vertex->GetXYZ(vertexpos);
- }
-
- Int_t nTracks = (Int_t)esd->GetNumberOfMuonTracks() ;
-
- AliDebug(1,Form("Reading Event %d \nFound %d tracks.",fCurrentEvent,nTracks));
-
- // settings
- Float_t chi2Cut = 100.;
- Float_t ptCutMin = 1.;
- Float_t ptCutMax = 10000.;
- Float_t muonMass = 0.105658389;
- Int_t pdgcode = -13;
- Double_t thetaX, thetaY, pYZ;
- Double_t pxRec1, pyRec1, pzRec1, e1;
- Int_t charge;
-
- Int_t ntrackhits;
- Double_t fitfmin;
-
- TLorentzVector fV1;
- fEventRec->Reset();
- for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
-
- AliESDMuonTrack* muonTrack = esd->GetMuonTrack(iTrack);
-
- thetaX = muonTrack->GetThetaX();
- thetaY = muonTrack->GetThetaY();
-
- pYZ = 1./TMath::Abs(muonTrack->GetInverseBendingMomentum());
- pzRec1 = - pYZ / TMath::Sqrt(1.0 + TMath::Tan(thetaY)*TMath::Tan(thetaX));
- pxRec1 = pzRec1 * TMath::Tan(thetaX);
- pyRec1 = pzRec1 * TMath::Tan(thetaY);
- charge = Int_t(TMath::Sign(1.,muonTrack->GetInverseBendingMomentum()));