]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnMiniOutput.h
Implemented rotated background (experimental)
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnMiniOutput.h
1 #ifndef ALIRSNMINIOUTPUT_H
2 #define ALIRSNMINIOUTPUT_H
3
4 //
5 // Mini-Output
6 // All the definitions needed for building a RSN histogram
7 // including:
8 // -- properties of resonance (mass, PDG code if needed)
9 // -- properties of daughters (assigned mass, charges)
10 // -- definition of output histogram
11 // 
12
13 #include "AliRsnDaughter.h"
14 #include "AliRsnMiniParticle.h"
15
16 class THnSparse;
17 class TList;
18 class TH1;
19
20 class TList;
21 class TClonesArray;
22 class AliRsnMiniAxis;
23 class AliRsnMiniPair;
24 class AliRsnMiniEvent;
25
26 typedef AliRsnDaughter::ESpecies RSNPID;
27
28 class AliRsnMiniOutput : public TNamed {
29 public:
30
31    enum EOutputType {
32       kHistogram,
33       kHistogramSparse,
34       kTypes
35    };
36    
37    enum EComputation {
38       kEventOnly,
39       kTrackPair,
40       kTrackPairMix,
41       kTrackPairRotated1,
42       kTrackPairRotated2,
43       kTruePair,
44       kMother,
45       kComputations
46    };
47    
48    AliRsnMiniOutput();
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 &copy);
52    AliRsnMiniOutput& operator=(const AliRsnMiniOutput &copy);
53    
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                                         
61    EOutputType     GetOutputType()      const {return fOutputType;}
62    EComputation    GetComputation()     const {return fComputation;}
63    Int_t           GetCutID(Int_t i)    const {if (i <= 0) return fCutID [0]; else return fCutID [1];}
64    RSNPID          GetDaughter(Int_t i) const {if (i <= 0) return fDaughter[0]; else return fDaughter[1];}
65    Double_t        GetMass(Int_t i)     const {return AliRsnDaughter::SpeciesMass(GetDaughter(i));}
66    Int_t           GetPDG(Int_t i)      const {return AliRsnDaughter::SpeciesPDG(GetDaughter(i));}
67    Int_t           GetCharge(Int_t i)   const {if (i <= 0) return fCharge[0]; else return fCharge[1];}
68    Int_t           GetMotherPDG()       const {return fMotherPDG;}
69    Double_t        GetMotherMass()      const {return fMotherMass;}
70                    
71    void            SetOutputType(EOutputType type)    {fOutputType = type;}
72    void            SetComputation(EComputation src)   {fComputation = src;}
73    void            SetCutID(Int_t i, Int_t   value)   {if (i <= 0) fCutID [0] = value; else fCutID [1] = value;}
74    void            SetDaughter(Int_t i, RSNPID value) {if (i <= 0) fDaughter[0] = value; else fDaughter[1] = value;}
75    void            SetCharge(Int_t i, Char_t  value)  {if (i <= 0) fCharge[0] = value; else fCharge[1] = value;}
76    void            SetMotherPDG(Int_t pdg)            {fMotherPDG = pdg;}
77    void            SetMotherMass(Double_t mass)       {fMotherMass = mass;}
78    void            SetPairCuts(AliRsnCutSet *set)     {fPairCuts = set;}
79                    
80    void            AddAxis(Int_t id, Int_t nbins, Double_t min, Double_t max);
81    void            AddAxis(Int_t id, Double_t min, Double_t max, Double_t step);
82    void            AddAxis(Int_t id, Int_t nbins, Double_t *values);
83    AliRsnMiniAxis* GetAxis(Int_t i)  {if (i >= 0 && i < fAxes.GetEntries()) return (AliRsnMiniAxis*)fAxes[i]; return 0x0;}
84    Double_t*       GetAllComputed()  {return fComputed.GetArray();}
85    
86    AliRsnMiniPair& Pair() {return fPair;}
87    Bool_t          Init(const char *prefix, TList *list);
88    Bool_t          Fill(AliRsnMiniParticle *p1, AliRsnMiniParticle *p2, AliRsnMiniEvent *event, TClonesArray *valueList);
89    Bool_t          Fill(const AliRsnMiniPair *pair, AliRsnMiniEvent *event, TClonesArray *valueList);
90    Bool_t          Fill(AliRsnMiniEvent *event, TClonesArray *valueList);
91                   
92 private:
93
94    void   CreateHistogram(const char *name);
95    void   CreateHistogramSparse(const char *name);
96    Bool_t ComputeValues(AliRsnMiniEvent *event, TClonesArray *valueList);
97    Bool_t FillHistogram();
98
99    EOutputType      fOutputType;       //  type of output
100    EComputation     fComputation;      //  type of computation
101    Int_t            fCutID[2];         //  ID of cut set used to select tracks
102    RSNPID           fDaughter[2];      //  species of daughters
103    Char_t           fCharge[2];        //  required track charge
104    Int_t            fMotherPDG;        //  PDG code of resonance
105    Double_t         fMotherMass;       //  nominal resonance mass
106    AliRsnCutSet    *fPairCuts;         //  cuts on the pair
107                            
108    Int_t            fOutputID;         //  index of output object in container list
109    TClonesArray     fAxes;             //  definitions for the axes of each value
110    TArrayD          fComputed;         //! temporary container for all computed values
111    AliRsnMiniPair   fPair;             //! minipair for computations
112    TList           *fList;             //! pointer to the TList containing the output
113    
114    ClassDef(AliRsnMiniOutput,1)  // AliRsnMiniOutput class
115 };
116
117 #endif