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 "AliRsnEvent.h"
14 #include "AliRsnDaughter.h"
15 #include "AliRsnMiniParticle.h"
25 class AliRsnMiniEvent;
27 typedef AliRsnDaughter::ESpecies RSNPID;
29 class AliRsnMiniOutput : public TNamed {
50 AliRsnMiniOutput(const char *name, EOutputType type, EComputation src = kTrackPair);
51 AliRsnMiniOutput(const char *name, const char *outType, const char *compType);
52 AliRsnMiniOutput(const AliRsnMiniOutput ©);
53 AliRsnMiniOutput &operator=(const AliRsnMiniOutput ©);
55 Bool_t IsEventOnly() const {return (fComputation == kEventOnly);}
56 Bool_t IsTrackPair() const {return (fComputation == kTrackPair);}
57 Bool_t IsTrackPairMix() const {return (fComputation == kTrackPairMix);}
58 Bool_t IsTruePair() const {return (fComputation == kTruePair);}
59 Bool_t IsMother() const {return (fComputation == kMother);}
60 Bool_t IsDefined() const {return (IsEventOnly() || IsTrackPair() || IsTrackPairMix() || IsTruePair() || IsMother());}
61 Bool_t IsLikeSign() const {return (fCharge[0] == fCharge[1]);}
62 Bool_t IsSameCut() const {return (fCutID[0] == fCutID[1]);}
63 Bool_t IsSameDaughter() const {return (fDaughter[0] == fDaughter[1]);}
64 //Bool_t IsSymmetric() const {return (IsLikeSign() && IsSameCut());}
65 Bool_t IsSymmetric() const {return (IsLikeSign() && IsSameDaughter());}
67 EOutputType GetOutputType() const {return fOutputType;}
68 EComputation GetComputation() const {return fComputation;}
69 Int_t GetCutID(Int_t i) const {if (i <= 0) return fCutID [0]; else return fCutID [1];}
70 RSNPID GetDaughter(Int_t i) const {if (i <= 0) return fDaughter[0]; else return fDaughter[1];}
71 Double_t GetMass(Int_t i) const {return AliRsnDaughter::SpeciesMass(GetDaughter(i));}
72 Int_t GetPDG(Int_t i) const {return AliRsnDaughter::SpeciesPDG(GetDaughter(i));}
73 Int_t GetCharge(Int_t i) const {if (i <= 0) return fCharge[0]; else return fCharge[1];}
74 Int_t GetMotherPDG() const {return fMotherPDG;}
75 Double_t GetMotherMass() const {return fMotherMass;}
76 Bool_t GetFillHistogramOnlyInRange() { return fCheckHistRange; }
77 Short_t GetMaxNSisters() {return fMaxNSisters;}
79 void SetOutputType(EOutputType type) {fOutputType = type;}
80 void SetComputation(EComputation src) {fComputation = src;}
81 void SetCutID(Int_t i, Int_t value) {if (i <= 0) fCutID [0] = value; else fCutID [1] = value;}
82 void SetDaughter(Int_t i, RSNPID value) {if (i <= 0) fDaughter[0] = value; else fDaughter[1] = value;}
83 void SetCharge(Int_t i, Char_t value) {if (i <= 0) fCharge[0] = value; else fCharge[1] = value;}
84 void SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;}
85 void SetMotherMass(Double_t mass) {fMotherMass = mass;}
86 void SetPairCuts(AliRsnCutSet *set) {fPairCuts = set;}
87 void SetFillHistogramOnlyInRange(Bool_t fillInRangeOnly) { fCheckHistRange = fillInRangeOnly; }
88 void SetMaxNSisters(Short_t n) {fMaxNSisters = n;}
89 void SetCheckMomentumConservation(Bool_t checkP) {fCheckP = checkP;}
91 void AddAxis(Int_t id, Int_t nbins, Double_t min, Double_t max);
92 void AddAxis(Int_t id, Double_t min, Double_t max, Double_t step);
93 void AddAxis(Int_t id, Int_t nbins, Double_t *values);
94 AliRsnMiniAxis *GetAxis(Int_t i) {if (i >= 0 && i < fAxes.GetEntries()) return (AliRsnMiniAxis *)fAxes[i]; return 0x0;}
95 Double_t *GetAllComputed() {return fComputed.GetArray();}
97 AliRsnMiniPair &Pair() {return fPair;}
98 Bool_t Init(const char *prefix, TList *list);
99 Bool_t FillMother(const AliRsnMiniPair *pair, AliRsnMiniEvent *event, TClonesArray *valueList);
100 Bool_t FillEvent(AliRsnMiniEvent *event, TClonesArray *valueList);
101 Int_t FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2, TClonesArray *valueList, Bool_t refFirst = kTRUE);
105 void CreateHistogram(const char *name);
106 void CreateHistogramSparse(const char *name);
107 void ComputeValues(AliRsnMiniEvent *event, TClonesArray *valueList);
108 void FillHistogram();
110 EOutputType fOutputType; // type of output
111 EComputation fComputation; // type of computation
112 Int_t fCutID[2]; // ID of cut set used to select tracks
113 RSNPID fDaughter[2]; // species of daughters
114 Char_t fCharge[2]; // required track charge
115 Int_t fMotherPDG; // PDG code of resonance
116 Double_t fMotherMass; // nominal resonance mass
117 AliRsnCutSet *fPairCuts; // cuts on the pair
119 Int_t fOutputID; // index of output object in container list
120 TClonesArray fAxes; // definitions for the axes of each value
121 TArrayD fComputed; //! temporary container for all computed values
122 AliRsnMiniPair fPair; //! minipair for computations
123 TList *fList; //! pointer to the TList containing the output
124 TArrayI fSel1; //! list of selected particles for definition 1
125 TArrayI fSel2; //! list of selected particles for definition 2
126 Short_t fMaxNSisters; // maximum number of allowed mother's daughter
127 Bool_t fCheckP; // flag to set in order to check the momentum conservation for daughters
128 Bool_t fCheckHistRange; // check if values is in histogram range
130 ClassDef(AliRsnMiniOutput, 3) // AliRsnMiniOutput class