]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliForwardCreateResponseMatrices.h
The code and scripts to do multiplicity distributions with FMD+SPD from C.Nygaard
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliForwardCreateResponseMatrices.h
1 #ifndef ALIFORWARDCREATERESPONSEMATRICES_H
2 #define ALIFORWARDCREATERESPONSEMATRICES_H
3  
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6   
7 #include "AliAnalysisTaskSE.h"
8 #include "AliBasedNdetaTask.h"
9 #include <TList.h>
10 #include <iostream>
11
12 class TH2D;
13
14 /**
15  * Task to do the multiplicity distibution
16  * 
17  */
18 class AliForwardCreateResponseMatrices : public AliBasedNdetaTask
19 {
20 public:
21   /** 
22    * 
23    * Default Constructor 
24    * 
25    */
26   AliForwardCreateResponseMatrices();
27   /**
28    *  Constructor
29    *
30    */
31   AliForwardCreateResponseMatrices(const char* name);
32   /**
33    * Copy Constructor
34    *
35    */
36   AliForwardCreateResponseMatrices(const AliForwardCreateResponseMatrices& o) : AliBasedNdetaTask(o), fTrigger(),fBins(), fOutput() { }
37   /**
38    * Assignment operator
39    *
40    */
41   AliForwardCreateResponseMatrices& operator=(const AliForwardCreateResponseMatrices&){return *this;}
42   /** 
43    * 
44    * Destructor
45    * 
46    */
47   virtual ~AliForwardCreateResponseMatrices(){}
48   /**
49    *  Embedded Class begins here
50    */
51   struct Bin : public TNamed
52   {
53     /**
54      * Default Constructor
55      */
56     Bin();
57     /**
58      * Constructor
59      */
60     Bin(Double_t etaLow, Double_t etaHigh);
61     /**
62      * Copy Constructor
63      */ 
64     Bin(const Bin&);
65     /**
66      * Assignment Operator
67      */
68     Bin&operator=(const Bin&){return*this;}
69     /**
70      * Destructor
71      */
72     ~Bin(){}
73     /**
74      * Define outputs of a single eta bin
75      */
76     virtual void DefineOutputs(TList* cont,  Int_t max);
77     /**
78      * Process a single eta bin
79      */    
80     virtual void Process(TH1D* dndetaForward, TH1D* dndetaCentral, TH1D* normForward,   TH1D* normCentral, TH1D* dndetaMC, Double_t VtxZ, Bool_t selectedTrigger,  Bool_t isMCNSDm, Bool_t isESDNSD, AliAODEvent* aodevent);
81     Double_t fEtaLow;                  // low eta limit 
82     Double_t fEtaHigh;                 // high eta limit 
83     TH1D*    fHist;                    // multiplicity histogram 
84     TH1D*    fHistMC;                  // multiplicity histogram MC truth primaries
85     TH2D*    fAcceptance;              // histogram showing the 'holes' in acceptance. BinContent of 1 shows a hole, and BinContent of 10 shows data coverage
86     TH2D*    fVtxZvsNdataBins;         // VtxZ vs. number of data acceptance bins (normalised to the eta range) 
87     TH2D*    fResponseMatrix;          //Response matrix (MC truth vs. analysed multiplicity)
88     TH2D*    fResponseMatrixPlus05;    //Response matrix with analysed multiplicity scaled up by 5%
89     TH2D*    fResponseMatrixPlus075;   //Response matrix  with analysed multiplicity scaled up by 7.5%
90     TH2D*    fResponseMatrixPlus10;    //Response matrix with analysed multiplicity scaled up by 10%
91     TH2D*    fResponseMatrixMinus05;   //Response matrix with analysed multiplicity scaled down by 5%
92     TH2D*    fResponseMatrixMinus075;  //Response matrix with analysed multiplicity scaled down by 7.55%
93     TH2D*    fResponseMatrixMinus10;   //Response matrix with analysed multiplicity scaled down by 10%
94     TH2D*    fResponseMatrixMinusSys;  //Response matrix with analysed multiplicity scaled up by event mult uncertainty
95     TH2D*    fResponseMatrixPlusSys;   //Response matrix with analysed multiplicity scaled down by event mult uncertainty
96     TH1D*    fESDNSD;                  //number of events found as NSD by the analysis vs. multiplicity
97     TH1D*    fMCNSD;                   //number of events found as NSD by the MC truth vs. multiplicity
98     TH1D*    fMCESDNSD;                //number of events found as NSD by both analysis and MC truth vs. multiplicity
99     TH1D*    fTriggerBias;             // histogram for trigger vertex bias correction
100    ClassDef(Bin,1); // Manager of data 
101   };
102   /**
103    * Create Output Objects
104    */
105   virtual void UserCreateOutputObjects();
106   /**
107    * User Exec
108    */
109   void UserExec(Option_t *option);
110   /**
111    * Terminate
112    */
113   void Terminate(Option_t *option);
114   /** 
115    * implementation of pure virtual function, always returning 0
116    */
117   virtual TH2D* GetHistogram(const AliAODEvent* aod, Bool_t mc);
118   /** 
119    * Get single event forward and central @f$d^2N/d\eta d\phi@f$
120    * histograms
121    * 
122    */  
123   virtual void GetHistograms(const AliAODEvent* aod, TH2D& forward, TH2D& central); 
124   /** 
125    * Add another eta bin to the task
126    */
127   void AddBin(Double_t etaLow, Double_t etaHigh){fBins.Add(new Bin(etaLow, etaHigh)); }
128  protected:
129   TH1I* fTrigger;  //Trigger histogram
130   TList  fBins;    // List of eta bins
131   TList*  fOutput; // Output list
132   ClassDef(AliForwardCreateResponseMatrices, 1); 
133 };
134
135 #endif
136 // Local Variables:
137 //   mode: C++
138 // End: