-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice *
- **************************************************************************/
-
-/* $Id$ */
-
-//-------------------------------------------------------------------------
-// Class AliRsnEvent
-// Simple collection of reconstructed tracks, selected from an ESD event
-//
-// author: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
-//-------------------------------------------------------------------------
+//
+// *** Class AliRsnEvent ***
+//
+// A container for a collection of AliRsnDaughter objects from an event.
+// Contains also the primary vertex, useful for some cuts.
+// In order to retrieve easily the tracks which have been identified
+// as a specific type and charge, there is an array of indexes which
+// allows to avoid to loop on all tracks and have only the neede ones.
+//
+// authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
+// M. Vala (email: martin.vala@cern.ch)
+//
#ifndef ALIRSNEVENT_H
#define ALIRSNEVENT_H
-class TTree;
-class TParticle;
-class TRefArray;
-class TClonesArray;
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliRsnDaughter.h"
-class AliESDtrack;
-class AliAODTrack;
-class AliRsnDaughter;
-
-#include "AliRsnPID.h"
+class AliVEvent;
+class AliMCEvent;
+class AliRsnCutPID;
class AliRsnEvent : public TObject
{
-public:
+ public:
- enum ESource {
- kUnknown = 0,
- kESD,
- kAOD,
- kMC
- };
-
- AliRsnEvent();
+ AliRsnEvent(AliVEvent *ref = 0, AliMCEvent *refMC = 0);
AliRsnEvent(const AliRsnEvent& copy);
- AliRsnEvent& operator=(const AliRsnEvent& copy);
+ AliRsnEvent& operator= (const AliRsnEvent& copy);
virtual ~AliRsnEvent();
- // Array management
- void Init();
- AliRsnDaughter* AddTrack(AliRsnDaughter track);
- void Clear(Option_t *option = "");
- void Print(Option_t *option = "") const;
- TClonesArray* GetAllTracks() {return fTracks;}
- TRefArray* GetTracks(Char_t sign, AliRsnPID::EType type);
- TRefArray* GetCharged(Char_t sign) {if (sign=='+') return fPos; else if (sign=='-') return fNeg; else return 0x0;}
- void FillPIDArrays();
-
- // Primary vertex
- Double_t GetPrimaryVertexX() const {return fPVx;}
- Double_t GetPrimaryVertexY() const {return fPVy;}
- Double_t GetPrimaryVertexZ() const {return fPVz;}
- void GetPrimaryVertex(Double_t &x, Double_t &y, Double_t &z) const {x=fPVx;y=fPVy;z=fPVz;}
- void GetPrimaryVertex(Double_t* &v) {GetPrimaryVertex(v[0], v[1], v[2]);}
- void SetPrimaryVertexX(Double_t value) {fPVx = value;}
- void SetPrimaryVertexY(Double_t value) {fPVy = value;}
- void SetPrimaryVertexZ(Double_t value) {fPVz = value;}
- void SetPrimaryVertex(Double_t x, Double_t y, Double_t z) {fPVx=x;fPVy=y;fPVz=z;}
- void SetPrimaryVertex(Double_t* &v) {SetPrimaryVertex(v[0], v[1], v[2]);}
-
- // Multiplicity
- Int_t GetMultiplicity() const;
- Int_t GetNPos() const;
- Int_t GetNNeg() const;
+ void SetRef(AliVEvent * const event, AliMCEvent * const mc = 0) {fRef = event; fRefMC = mc;}
+ AliVEvent* GetRef() const {return fRef;}
+ AliMCEvent* GetRefMC() const {return fRefMC;}
+ AliESDEvent* GetRefESD() const {return dynamic_cast<AliESDEvent*>(fRef);}
+ AliAODEvent* GetRefAOD() const {return dynamic_cast<AliAODEvent*>(fRef);}
+ Bool_t IsESD() const {return (GetRefESD() != 0x0);}
+ Bool_t IsAOD() const {return (GetRefAOD() != 0x0);}
- // Source type
- void SetSource(ESource source) {fSource = source;}
- ESource GetSource() {return fSource;}
+ Double_t GetVz();
+ Int_t GetMultiplicity();
-private:
-
- ESource fSource; // type of source event
+ Bool_t SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
+ AliRsnDaughter GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
+
+ Int_t SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
+ Int_t GetLeadingParticleID() {return fLeading;}
+ void SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
+ Double_t GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
+ Bool_t GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
- Double_t fPVx; // position of
- Double_t fPVy; // primary
- Double_t fPVz; // vertex
+ private:
- TClonesArray *fTracks; // collection of particles
- TRefArray *fPos; // ref array to all positive particles
- TRefArray *fNeg; // ref array to all negative particles
- TRefArray *fPosID[AliRsnPID::kSpecies + 1]; // ref array to pos particles of each PID
- TRefArray *fNegID[AliRsnPID::kSpecies + 1]; // ref array to pos particles of each PID
+ AliVEvent *fRef; // pointer to input event
+ AliMCEvent *fRefMC; // pointer to reference MC event (if any)
+ Int_t fLeading; // index of leading track
- ClassDef(AliRsnEvent,1);
+ ClassDef(AliRsnEvent, 3);
};
#endif