1 #ifndef ALIRSNMINIOUTPUT_H
2 #define ALIRSNMINIOUTPUT_H
6 // All the definitions needed for building a RSN histogram
8 // -- properties of resonance (mass, PDG code if needed)
9 // -- properties of daughters (assigned mass, charges)
10 // -- definition of output histogram
13 #include "AliRsnDaughter.h"
14 #include "AliRsnMiniParticle.h"
24 class AliRsnMiniEvent;
26 typedef AliRsnDaughter::ESpecies RSNPID;
28 class AliRsnMiniOutput : public TNamed {
49 AliRsnMiniOutput(const char *name, EOutputType type, EComputation src = kTrackPair);
50 AliRsnMiniOutput(const char *name, const char *outType, const char *compType);
51 AliRsnMiniOutput(const AliRsnMiniOutput ©);
52 AliRsnMiniOutput &operator=(const AliRsnMiniOutput ©);
54 Bool_t IsEventOnly() const {return (fComputation == kEventOnly);}
55 Bool_t IsTrackPair() const {return (fComputation == kTrackPair);}
56 Bool_t IsTrackPairMix() const {return (fComputation == kTrackPairMix);}
57 Bool_t IsTruePair() const {return (fComputation == kTruePair);}
58 Bool_t IsMother() const {return (fComputation == kMother);}
59 Bool_t IsDefined() const {return (IsEventOnly() || IsTrackPair() || IsTrackPairMix() || IsTruePair() || IsMother());}
60 Bool_t IsLikeSign() const {return (fCharge[0] == fCharge[1]);}
61 Bool_t IsSameCut() const {return (fCutID[0] == fCutID[1]);}
62 Bool_t IsSameDaughter() const {return (fDaughter[0] == fDaughter[1]);}
63 //Bool_t IsSymmetric() const {return (IsLikeSign() && IsSameCut());}
64 Bool_t IsSymmetric() const {return (IsLikeSign() && IsSameDaughter());}
66 EOutputType GetOutputType() const {return fOutputType;}
67 EComputation GetComputation() const {return fComputation;}
68 Int_t GetCutID(Int_t i) const {if (i <= 0) return fCutID [0]; else return fCutID [1];}
69 RSNPID GetDaughter(Int_t i) const {if (i <= 0) return fDaughter[0]; else return fDaughter[1];}
70 Double_t GetMass(Int_t i) const {return AliRsnDaughter::SpeciesMass(GetDaughter(i));}
71 Int_t GetPDG(Int_t i) const {return AliRsnDaughter::SpeciesPDG(GetDaughter(i));}
72 Int_t GetCharge(Int_t i) const {if (i <= 0) return fCharge[0]; else return fCharge[1];}
73 Int_t GetMotherPDG() const {return fMotherPDG;}
74 Double_t GetMotherMass() const {return fMotherMass;}
76 void SetOutputType(EOutputType type) {fOutputType = type;}
77 void SetComputation(EComputation src) {fComputation = src;}
78 void SetCutID(Int_t i, Int_t value) {if (i <= 0) fCutID [0] = value; else fCutID [1] = value;}
79 void SetDaughter(Int_t i, RSNPID value) {if (i <= 0) fDaughter[0] = value; else fDaughter[1] = value;}
80 void SetCharge(Int_t i, Char_t value) {if (i <= 0) fCharge[0] = value; else fCharge[1] = value;}
81 void SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;}
82 void SetMotherMass(Double_t mass) {fMotherMass = mass;}
83 void SetPairCuts(AliRsnCutSet *set) {fPairCuts = set;}
85 void AddAxis(Int_t id, Int_t nbins, Double_t min, Double_t max);
86 void AddAxis(Int_t id, Double_t min, Double_t max, Double_t step);
87 void AddAxis(Int_t id, Int_t nbins, Double_t *values);
88 AliRsnMiniAxis *GetAxis(Int_t i) {if (i >= 0 && i < fAxes.GetEntries()) return (AliRsnMiniAxis *)fAxes[i]; return 0x0;}
89 Double_t *GetAllComputed() {return fComputed.GetArray();}
91 AliRsnMiniPair &Pair() {return fPair;}
92 Bool_t Init(const char *prefix, TList *list);
93 Bool_t FillMother(const AliRsnMiniPair *pair, AliRsnMiniEvent *event, TClonesArray *valueList);
94 Bool_t FillEvent(AliRsnMiniEvent *event, TClonesArray *valueList);
95 Int_t FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2, TClonesArray *valueList, Bool_t refFirst = kTRUE);
99 void CreateHistogram(const char *name);
100 void CreateHistogramSparse(const char *name);
101 void ComputeValues(AliRsnMiniEvent *event, TClonesArray *valueList);
102 void FillHistogram();
104 EOutputType fOutputType; // type of output
105 EComputation fComputation; // type of computation
106 Int_t fCutID[2]; // ID of cut set used to select tracks
107 RSNPID fDaughter[2]; // species of daughters
108 Char_t fCharge[2]; // required track charge
109 Int_t fMotherPDG; // PDG code of resonance
110 Double_t fMotherMass; // nominal resonance mass
111 AliRsnCutSet *fPairCuts; // cuts on the pair
113 Int_t fOutputID; // index of output object in container list
114 TClonesArray fAxes; // definitions for the axes of each value
115 TArrayD fComputed; //! temporary container for all computed values
116 AliRsnMiniPair fPair; //! minipair for computations
117 TList *fList; //! pointer to the TList containing the output
118 TArrayI fSel1; //! list of selected particles for definition 1
119 TArrayI fSel2; //! list of selected particles for definition 2
121 ClassDef(AliRsnMiniOutput,1) // AliRsnMiniOutput class