]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnEvent.h
few modifications on package, waiting for AOD compliance corrections
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnEvent.h
CommitLineData
0dffcc8a 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * See cxx source for full Copyright notice *
4 **************************************************************************/
5
d51554df 6/* $Id$ */
7
06351446 8//
9// *** Class AliRsnEvent ***
10//
11// A container for a collection of AliRsnDaughter objects from an event.
12// Contains also the primary vertex, useful for some cuts.
13// In order to retrieve easily the tracks which have been identified
14// as a specific type and charge, there is an array of indexes which
15// allows to avoid to loop on all tracks and have only the neede ones.
16//
17// authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
18// M. Vala (email: martin.vala@cern.ch)
19//
0dffcc8a 20
21#ifndef ALIRSNEVENT_H
22#define ALIRSNEVENT_H
23
06351446 24#include <TNamed.h>
25#include <TArrayI.h>
26#include <TClonesArray.h>
e2bafbbc 27
7c2974c8 28#include "AliRsnPID.h"
06351446 29#include "AliRsnPIDIndex.h"
e2bafbbc 30#include "AliRsnDaughter.h"
78b94cbd 31#include "AliRsnCutSet.h"
32
33class TH1D;
7c2974c8 34
06351446 35class AliRsnEvent : public TNamed
0dffcc8a 36{
06351446 37 public:
38
7c2974c8 39 AliRsnEvent();
aec0ec32 40 AliRsnEvent(const AliRsnEvent& copy);
06351446 41 AliRsnEvent& operator= (const AliRsnEvent& copy);
7c2974c8 42 virtual ~AliRsnEvent();
43
44 // Array management
45 void Init();
aec0ec32 46 void Clear(Option_t *option = "");
47 AliRsnDaughter* AddTrack(AliRsnDaughter track);
48 AliRsnDaughter* GetTrack(Int_t index);
06351446 49 TClonesArray* GetTracks() {return fTracks;}
aec0ec32 50 TArrayI* GetCharged(Char_t sign);
51 TArrayI* GetTracksArray(AliRsnDaughter::EPIDMethod method, Char_t sign, AliRsnPID::EType type);
e0baff8c 52 void FillPIDArrays(Int_t arraySizeDefault = 1000);
e2bafbbc 53 void SortTracks() {fTracks->Sort();}
aec0ec32 54 void Print(Option_t *option = "") const;
e0baff8c 55 void MakeComputations();
15d5fd02 56 void CorrectTracks();
0dffcc8a 57
7c2974c8 58 // Primary vertex
59 Double_t GetPrimaryVertexX() const {return fPVx;}
06351446 60 Double_t GetPrimaryVertexY() const {return fPVy;}
61 Double_t GetPrimaryVertexZ() const {return fPVz;}
15d5fd02 62 Double_t GetPrimaryVertexXMC() const {return fPVxMC;}
63 Double_t GetPrimaryVertexYMC() const {return fPVyMC;}
64 Double_t GetPrimaryVertexZMC() const {return fPVzMC;}
aec0ec32 65 void GetPrimaryVertex(Double_t &x, Double_t &y, Double_t &z) const {x=fPVx;y=fPVy;z=fPVz;}
e0baff8c 66 Double_t GetVz() const {return GetPrimaryVertexZ();}
aec0ec32 67 void SetPrimaryVertexX(Double_t value) {fPVx = value;}
68 void SetPrimaryVertexY(Double_t value) {fPVy = value;}
69 void SetPrimaryVertexZ(Double_t value) {fPVz = value;}
15d5fd02 70 void SetPrimaryVertexXMC(Double_t value) {fPVxMC = value;}
71 void SetPrimaryVertexYMC(Double_t value) {fPVyMC = value;}
72 void SetPrimaryVertexZMC(Double_t value) {fPVzMC = value;}
aec0ec32 73 void SetPrimaryVertex(Double_t x, Double_t y, Double_t z) {fPVx=x;fPVy=y;fPVz=z;}
15d5fd02 74 void SetPrimaryVertexMC(Double_t x, Double_t y, Double_t z) {fPVxMC=x;fPVyMC=y;fPVzMC=z;}
7c2974c8 75
76 // Multiplicity
e343e521 77 void SetTrueMultiplicity(Int_t value) {fTrueMult = value;}
78 Int_t GetTrueMultiplicity() {return fTrueMult;}
e0baff8c 79 Int_t GetMultiplicity() const {return fMult;}
aec0ec32 80 Int_t GetNCharged(Char_t sign);
15d5fd02 81
e0baff8c 82 // Mean phi
83 Double_t GetPhiMean() const {return fPhiMean;}
15d5fd02 84
78b94cbd 85 // functions for event selection and computation (require on-fly setting of sel parameters)
86 void SetSelectionPIDType(AliRsnPID::EType type) {fSelPIDType = type;}
87 void SetSelectionCharge(Char_t charge) {fSelCharge = charge;}
88 void SetSelectionPIDMethod(AliRsnDaughter::EPIDMethod method) {fSelPIDMethod = method;}
89 void SetSelectionTrackCuts(AliRsnCutSet *cuts) {fSelCuts = cuts;}
90 void SetSelection(AliRsnPID::EType pid, Char_t charge, AliRsnDaughter::EPIDMethod meth, AliRsnCutSet *cuts = 0x0);
15d5fd02 91
92 Bool_t CutPass(AliRsnDaughter *d)
78b94cbd 93 {if (!fSelCuts) return kTRUE; else return fSelCuts->IsSelected(AliRsnCut::kParticle, d);}
15d5fd02 94
78b94cbd 95 AliRsnDaughter* GetLeadingParticle(Double_t ptMin = 0.0);
96 Double_t GetAverageMomentum(Int_t &count);
97 Bool_t GetAngleDistrWRLeading(Double_t &angleMean, Double_t &angleRMS, Double_t ptMin = 0.0);
06351446 98
99 private:
100
aec0ec32 101 Int_t ChargeIndex(Char_t sign) const;
102 Int_t Fill(TObjArray *array);
06351446 103
104 Double_t fPVx; // position of
105 Double_t fPVy; // primary
106 Double_t fPVz; // vertex
e0baff8c 107 Double_t fPhiMean; // mean "phi" coord of all tracks
108 Int_t fMult; // track multiplicity
15d5fd02 109 Double_t fPVxMC; // position of
110 Double_t fPVyMC; // primary
111 Double_t fPVzMC; // vertex in MC
06351446 112
113 TClonesArray *fTracks; // collection of particles
e343e521 114 Int_t fTrueMult; // true multiplicity taken from source event
06351446 115
116 AliRsnPIDIndex *fNoPID; // array index only for charged tracks
117 AliRsnPIDIndex *fPerfectPID; // array index for perfect PID
118 AliRsnPIDIndex *fRealisticPID; // array index for realistic PID (largest prob)
15d5fd02 119
78b94cbd 120 AliRsnPID::EType fSelPIDType; //! (for selection/cut functions) particle type
121 Char_t fSelCharge; //! (for selection/cut functions) particle charge ('0' = both)
122 AliRsnDaughter::EPIDMethod fSelPIDMethod; //! (for selection/cut functions) PID method used
123 AliRsnCutSet *fSelCuts; //! (for selection/cut functions) track cuts used
06351446 124
15d5fd02 125 ClassDef(AliRsnEvent, 3);
0dffcc8a 126};
127
128#endif