#pragma link C++ class AliFlowAnalysis+;
#pragma link C++ class AliEventCut+;
+#pragma link C++ class AliEmptyEventCut+;
+#pragma link C++ class AliBaseEventCut+;
+
+#pragma link C++ class AliPrimVertexXCut+;
+#pragma link C++ class AliPrimVertexYCut+;
+#pragma link C++ class AliPrimVertexZCut+;
+#pragma link C++ class AliNChargedCut+;
#pragma link C++ class AliAODParticleCut-;
#pragma link C++ class AliAODEmptyParticleCut-;
#include <TParticle.h>
#include "AliAOD.h"
-
#include "AliAODParticle.h"
+#include "AliTrackPoints.h"
ClassImp(AliAOD)
+AliAOD::AliAOD():
+ fParticles(10),
+ fIsRandomized(kFALSE),
+ fPrimaryVertexX(0.0),
+ fPrimaryVertexY(0.0),
+ fPrimaryVertexZ(0.0)
+{
+ //ctor
+ SetOwner(kTRUE);
+}
+
/**************************************************************************/
void AliAOD::AddParticle(TParticle* part, Int_t idx)
}
// fRandomized = 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;
+ Int_t npart = fParticles.GetEntries();
+ for (Int_t i = 0; i < npart; i++)
+ {
+ AliVAODParticle* p = (AliVAODParticle*)fParticles.At(i);
+ Double_t eta = p->Eta();
+ if ( (eta < etamin) || (eta > etamax) ) continue;
+ if (p->Charge() != 0.0) n++;
+ }
+ return 0;
+}
+/**************************************************************************/
+
+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 = fParticles.GetEntries();
+ for (Int_t i = 0; i < npart; i++)
+ {
+ AliVAODParticle* p = (AliVAODParticle*)fParticles.At(i);
+ AliTrackPoints* tp = p->GetTPCTrackPoints();
+ if (tp) tp->Move(x,y,z);
+ tp = p->GetITSTrackPoints();
+ if (tp) tp->Move(x,y,z);
+ }
+}
class AliAOD: public TObject {
public:
- AliAOD(){SetOwner(kTRUE);}
+ AliAOD();
virtual ~AliAOD() { Reset(); }
virtual void SetOwner(Bool_t owner){fParticles.SetOwner(owner);}
virtual TObjArray* GetParticles() {return &fParticles;};
virtual Int_t GetNumberOfParticles() const {return fParticles.GetEntriesFast();}
- virtual AliVAODParticle* GetParticle(Int_t index) const {return (AliVAODParticle*) fParticles[index];}
+ virtual AliVAODParticle* GetParticle(Int_t index) const {return (AliVAODParticle*) fParticles[index];}
virtual void AddParticle(AliVAODParticle* particle) {fParticles.Add(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,
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
private:
TObjArray 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
+
+
ClassDef(AliAOD,1) // base class for AOD containers
};
AliAODParticleCut* pc = fPairCut->GetFirstPartCut();
return (pc->Pass(part))?kTRUE:pc->Pass(track);
}
-/*************************************************************************************/
+/*************************************************************************************/
+
inline Bool_t AliAnalysis::PassPartAndTrack2(AliVAODParticle* part,AliVAODParticle* track) const
{
//Checks second particle from both, particle and track pairs
//
///////////////////////////////////////////////////////////
-#include <AliESDtrack.h>
-#include <AliESD.h>
+#include <AliAOD.h>
ClassImp(AliBaseEventCut)
AliBaseEventCut::AliBaseEventCut():
fMin(0.0),
- fMax(0.0),
+ fMax(0.0)
{
-
+//ctor
}
/**********************************************************/
-Bool_t AliBaseEventCut::Pass(AliESD* esd) const
+AliBaseEventCut::AliBaseEventCut(Double_t min, Double_t max):
+ fMin(min),
+ fMax(max)
{
- if ( (GetValue() < fMin) || (GetValue() > fMax) ) return kTRUE;
+ //ctor
+}
+/**********************************************************/
+
+Bool_t AliBaseEventCut::Pass(AliAOD* aod) const
+{
+ if ( (GetValue(aod) < fMin) || (GetValue(aod) > 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;
+}
class AliAOD;
+enum AliEventCutProperty
+ {
+ kPrimVertexXCut,
+ kPrimVertexYCut,
+ kPrimVertexZCut,
+ kNChargedCut
+ };
+
class AliBaseEventCut: public TObject
{
public:
AliBaseEventCut();
+ AliBaseEventCut(Double_t min,Double_t max);
virtual ~AliBaseEventCut(){}
virtual Bool_t Pass(AliAOD* aod) const;//returns kTRUE if rejected
ClassDef(AliBaseEventCut,1)
};
+/************************************************************/
+
+class AliPrimVertexXCut: public AliBaseEventCut
+{
+ public:
+ AliPrimVertexXCut(){}
+ AliPrimVertexXCut(Double_t min,Double_t max):AliBaseEventCut(min,max){}
+ virtual ~AliPrimVertexXCut(){}
+ protected:
+ Double_t GetValue(AliAOD* aod) const;
+
+ private:
+ ClassDef(AliPrimVertexXCut,1)
+};
+/************************************************************/
+
+class AliPrimVertexYCut: public AliBaseEventCut
+{
+ public:
+ AliPrimVertexYCut(){}
+ AliPrimVertexYCut(Double_t min,Double_t max):AliBaseEventCut(min,max){}
+ virtual ~AliPrimVertexYCut(){}
+
+ protected:
+ Double_t GetValue(AliAOD* aod) const;
+
+ private:
+ ClassDef(AliPrimVertexYCut,1)
+};
+/************************************************************/
+
+class AliPrimVertexZCut: public AliBaseEventCut
+{
+ public:
+ AliPrimVertexZCut(){}
+ AliPrimVertexZCut(Double_t min,Double_t max):AliBaseEventCut(min,max){}
+ virtual ~AliPrimVertexZCut(){}
+ protected:
+ Double_t GetValue(AliAOD* aod) const;
+
+ private:
+ ClassDef(AliPrimVertexZCut,1)
+};
+
+
+/************************************************************/
+
+class AliNChargedCut: public AliBaseEventCut
+{
+ public:
+ AliNChargedCut(){}
+ AliNChargedCut(Double_t min, Double_t max, Double_t etamin = -10.0, Double_t etamax = 10.0):
+ AliBaseEventCut(min,max),fEtaMin(etamin),fEtaMax(etamax){}
+ virtual ~AliNChargedCut(){}
+ 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
#include "AliBaseEventCut.h"
+ClassImp(AliEventCut)
+
+
AliEventCut::AliEventCut():
- fBaseCuts(0x0)
+ fBaseCuts(10)
{
//costructor
}
/*********************************************************/
+AliEventCut::AliEventCut(const AliEventCut& in):
+ TObject(in),
+ fBaseCuts(in.fBaseCuts)
+{
+ //cpy ctor
+ fBaseCuts.SetOwner(kTRUE);
+}
+/*********************************************************/
AliEventCut::~AliEventCut()
{
//costructor
- delete fBaseCuts;
}
/*********************************************************/
return kFALSE;
}
- TIter iter(fBaseCuts);
+ TIter iter(&fBaseCuts);
AliBaseEventCut* becut;
while (( becut = (AliBaseEventCut*)iter() ))
{
}
return kFALSE;
}
+
+/*********************************************************/
+/*********************************************************/
+/*********************************************************/
+
+ClassImp(AliEmptyEventCut)
//________________________________
///////////////////////////////////////////////////////////
//
-// class AliRunAnalysis
-//
-//
+// 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
//
///////////////////////////////////////////////////////////
-#include "TObject.h"
+#include <TObject.h>
+#include <TObjArray.h>
+#include "AliBaseEventCut.h"
class AliAOD;
-class TObjArray;
class AliEventCut: public TObject
{
public:
AliEventCut();
+ AliEventCut(const AliEventCut& in);
virtual ~AliEventCut();
virtual Bool_t Pass(AliAOD* aod) const;//returns kTRUE if rejected
+ void AddBasePartCut(AliBaseEventCut* ebcut){fBaseCuts.Add(ebcut);}
protected:
- TObjArray* fBaseCuts;
+ TObjArray fBaseCuts;
private:
ClassDef(AliEventCut,1)
};
+class AliEmptyEventCut: public TObject
+{
+ public:
+ AliEmptyEventCut(){}
+ virtual ~AliEmptyEventCut(){}
+
+ Bool_t Pass(AliAOD* aod) const {return kFALSE;}//always accept
+
+ protected:
+ private:
+ ClassDef(AliEmptyEventCut,1)
+};
+
#endif
if (fNTrackPoints > 0)
{
tpts = new AliTrackPoints(fNTrackPoints,esdtrack,mf,fdR);
- tpts->Move(-vertexpos[0],-vertexpos[1],-vertexpos[2]);
+// tpts->Move(-vertexpos[0],-vertexpos[1],-vertexpos[2]);
}
AliTrackPoints* itstpts = 0x0;
if (fITSTrackPoints)
{
itstpts = new AliTrackPoints(AliTrackPoints::kITS,esdtrack);
- itstpts->Move(-vertexpos[0],-vertexpos[1],-vertexpos[2]);
+// itstpts->Move(-vertexpos[0],-vertexpos[1],-vertexpos[2]);
}
AliClusterMap* cmap = 0x0;
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;
}
//Reads Kinematics Tree
Info("Read","");
- if (fEventSim == 0x0) fEventSim = new AliAOD();
+ if (fEventSim == 0x0)
+ {
+ fEventSim = new AliAOD();
+ }
fEventSim->Reset();
do //do{}while; is OK even if 0 dirs specified. In that case we try to read from "./"
AliVAODParticle.cxx AliAODParticle.cxx \
AliAODPair.cxx AliAODPairCut.cxx \
AliAODParticleCut.cxx AliAODRun.cxx \
- AliRunAnalysis.cxx AliAnalysis.cxx AliEventCut.cxx \
+ AliRunAnalysis.cxx AliAnalysis.cxx \
+ AliEventCut.cxx AliBaseEventCut.cxx \
AliReader.cxx AliReaderESD.cxx AliReaderKineTree.cxx\
AliTrackPoints.cxx AliClusterMap.cxx \
AliD0toKpi.cxx AliD0toKpiAnalysis.cxx AliFlowAnalysis.cxx \