]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnEvent.h
Coverity fixes
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnEvent.h
CommitLineData
0dffcc8a 1#ifndef ALIRSNEVENT_H
2#define ALIRSNEVENT_H
3
7356f978 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7////////////////////////////////////////////////////////////////////////////////
8//
9// Interface to full event.
10//
11////////////////////////////////////////////////////////////////////////////////
12
5f1c287d 13#include "AliVEvent.h"
a378358c 14#include "AliMCEvent.h"
2dab9030 15#include "AliESDEvent.h"
16#include "AliAODEvent.h"
d7712d44 17#include "AliVVertex.h"
e2bafbbc 18#include "AliRsnDaughter.h"
78b94cbd 19
2dab9030 20class AliRsnCutPID;
a378358c 21class AliESDtrackCuts;
7c2974c8 22
2a1c7696 23class AliRsnEvent : public TObject {
24public:
25
26 AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0);
27 AliRsnEvent(const AliRsnEvent& copy);
28 AliRsnEvent& operator= (const AliRsnEvent& copy);
29 virtual ~AliRsnEvent();
30
31 // basic setters/getters
5f1c287d 32 void SetRef(AliVEvent *ref) {fRef = ref;}
2a1c7696 33 void SetRefMC(AliVEvent *refmc) {fRefMC = refmc;}
34 void SetLeadingIndex(Int_t i) {fLeading = i;}
35 void SetLocalID(Int_t i) {fLocalID = i;}
36 AliVEvent* GetRef() {return fRef;}
37 AliVEvent* GetRefMC() {return fRefMC;}
38 Int_t GetLeadingIndex() const {return fLeading;}
39 Int_t GetLeadingParticleID() const {return fLeading;}
40 Int_t GetLocalID() const {return fLocalID;}
41
42 // getters which convert into allowed input types
7356f978 43 AliESDEvent* GetRefESD() {if (classMatchRef (AliESDEvent::Class())) return static_cast<AliESDEvent*>(fRef) ; return 0x0;}
44 AliAODEvent* GetRefAOD() {if (classMatchRef (AliAODEvent::Class())) return static_cast<AliAODEvent*>(fRef) ; return 0x0;}
45 AliMCEvent* GetRefMCESD() {if (classMatchRefMC(AliMCEvent ::Class())) return static_cast<AliMCEvent *>(fRefMC); return 0x0;}
46 AliAODEvent* GetRefMCAOD() {if (classMatchRefMC(AliAODEvent::Class())) return static_cast<AliAODEvent*>(fRefMC); return 0x0;}
2a1c7696 47 Bool_t IsESD() {return (GetRefESD() != 0x0);}
48 Bool_t IsAOD() {return (GetRefAOD() != 0x0);}
49
50 // advanced getters
d7712d44 51 Double_t GetVz() {if (fRef) return fRef->GetPrimaryVertex()->GetZ(); return 1E+10;}
52 Int_t GetMultiplicityFromTracks() {if (fRef) return fRef->GetNumberOfTracks(); return -1;}
53 Int_t GetMultiplicityFromMC() {if (fRefMC) return fRefMC->GetNumberOfTracks(); return -1;}
54 Int_t GetMultiplicityFromESDCuts();
3fe8af3d 55 Float_t GetMultiplicityFromSPD();
2a1c7696 56
57 // setters for a daughter
7356f978 58 Bool_t SetDaughterAbs(AliRsnDaughter &daughter, Int_t absoluteIndex);
2a1c7696 59 Bool_t SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
60 Bool_t SetDaughterMC(AliRsnDaughter &daughter, Int_t index);
7356f978 61 AliRsnDaughter GetDaughterAbs(Int_t absoluteIndex);
2a1c7696 62 AliRsnDaughter GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
63 AliRsnDaughter GetDaughterMC(Int_t i);
64 Int_t GetAbsoluteSum();
65 Bool_t ConvertAbsoluteIndex(Int_t index, Int_t &realIndex, AliRsnDaughter::ERefType &type);
7356f978 66 Int_t ConvertRealIndex(Int_t index, AliRsnDaughter::ERefType type);
2a1c7696 67
68 // leading particle stuff
69 void SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
70 Int_t SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
71 Double_t GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
d7712d44 72 Bool_t GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
eaa44581 73
2a1c7696 74private:
75
7356f978 76 Bool_t classMatchRef (TClass *ref) {if (fRef ) return (fRef ->InheritsFrom(ref)); return kFALSE;}
77 Bool_t classMatchRefMC(TClass *ref) {if (fRefMC) return (fRefMC->InheritsFrom(ref)); return kFALSE;}
125c0528 78
2a1c7696 79 Bool_t SetDaughterESDtrack(AliRsnDaughter &target, Int_t index);
80 Bool_t SetDaughterAODtrack(AliRsnDaughter &target, Int_t index);
81 Bool_t SetDaughterESDv0(AliRsnDaughter &target, Int_t index);
82 Bool_t SetDaughterAODv0(AliRsnDaughter &target, Int_t index);
83 Bool_t SetDaughterESDcascade(AliRsnDaughter &target, Int_t index);
84 Bool_t SetDaughterAODcascade(AliRsnDaughter &target, Int_t index);
85 Bool_t SetMCInfoESD(AliRsnDaughter &target);
86 Bool_t SetMCInfoAOD(AliRsnDaughter &target);
87
7356f978 88 AliVEvent *fRef; // pointer to input event
89 AliVEvent *fRefMC; // pointer to reference MC event (if any)
90 Int_t fLeading; // index of leading track
91 Int_t fLocalID; // identification number used locally
2a1c7696 92
2a1c7696 93 ClassDef(AliRsnEvent, 4);
0dffcc8a 94};
95
96#endif