]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/AliJetModelBaseTask.h
Merge branch 'TPCdev' of https://git.cern.ch/reps/AliRoot into TPCdev
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliJetModelBaseTask.h
1 #ifndef ALIJETMODELBASETASK_H
2 #define ALIJETMODELBASETASK_H
3
4 // $Id$
5
6 class TClonesArray;
7 class AliEMCALGeometry;
8 class AliVCluster;
9 class AliPicoTrack;
10 class AliVCaloCells;
11 class AliAODMCParticle;
12 class AliNamedArrayI;
13 class TF2;
14
15 #include <TH1F.h>
16 #include <TF1.h>
17
18 #include "AliAnalysisTaskSE.h"
19
20 class AliJetModelBaseTask : public AliAnalysisTaskSE {
21  public:
22   AliJetModelBaseTask();
23   AliJetModelBaseTask(const char *name, Bool_t drawqa=kFALSE); 
24   virtual ~AliJetModelBaseTask();
25
26   void                   UserExec(Option_t* /*option*/);
27   void                   UserCreateOutputObjects();
28
29   void                   SetEtaRange(Float_t min, Float_t max) { fEtaMin       = min;  fEtaMax = max; }
30   void                   SetPhiRange(Float_t min, Float_t max) { fPhiMin       = min;  fPhiMax = max; }
31   void                   SetPtRange(Float_t min, Float_t max)  { fPtMin        = min;  fPtMax  = max; }
32   void                   SetPtSpectrum(TH1 *f)                 { fPtSpectrum   = f;    }
33   void                   SetPtSpectrum(TF1 *f)                 { fPtSpectrum   = new TH1F("ptSpectrum","ptSpectrum",1000,f->GetXmin(),f->GetXmax()); 
34                                                                  fPtSpectrum->Add(f); }
35   void                   SetPtPhiEvPlDistribution(TF2 *f)      { fPtPhiEvPlDistribution   = f;    }
36   void                   SetDensitySpectrum(TH1 *f)            { fDensitySpectrum = f;    }
37   void                   SetDensitySpectrum(TF1 *f)            { fDensitySpectrum = new TH1F("densitypectrum","densitypectrum",1000,f->GetXmin(),f->GetXmax()); 
38                                                                  fDensitySpectrum->Add(f); }
39
40   void                   SetMC(Bool_t a)                       { fIsMC         = a   ; }
41
42   void                   SetCopyArray(Bool_t copy)             { fCopyArray    = copy; }
43   void                   SetTracksName(const char *n)          { fTracksName   = n;    }
44   void                   SetClusName(const char *n)            { fCaloName     = n;    }
45   void                   SetCellsName(const char *n)           { fCellsName    = n;    }
46   void                   SetMCParticlesName(const char *n)     { fMCParticlesName = n; }
47   void                   SetSuffix(const char *s)              { fSuffix       = s;    }
48
49   void                   SetGeometryName(const char *n)        { fGeomName     = n;    }
50   void                   SetMarkMC(Int_t m)                    { fMarkMC       = m;    }
51   virtual void           SetNClusters(Int_t n)                 { fNClusters    = n;    }
52   virtual void           SetNCells(Int_t n)                    { fNCells       = n;    }
53   virtual void           SetNTracks(Int_t n)                   { fNTracks      = n;    }
54
55
56  protected:
57   Int_t                  SetNumberOfOutCells(Int_t n);                                          // set the number of cells
58   Int_t                  AddCell(Double_t e = -1, Double_t eta = -999, Double_t phi = -1);      // add a cell; if values are -1 generate random parameters
59   Int_t                  AddCell(Double_t e, Int_t absId, Double_t time = 0, Int_t label=0);   // add a cell with given energy, position and times
60   AliVCluster           *AddCluster(Double_t e = -1, Double_t eta = -999, Double_t phi = -1, Int_t label=0); // add a cluster; if values are -1 generate random parameters
61   AliVCluster           *AddCluster(Double_t e, Int_t absId, Int_t label=0);                   // add a cluster with given energy and position
62   AliVCluster           *AddCluster(AliVCluster *oc);                                          // add a cluster (copy)
63   AliPicoTrack          *AddTrack(Double_t pt = -1, Double_t eta = -999, Double_t phi = -1, Byte_t type=0, 
64                                   Double_t etaemc=0, Double_t phiemc=0, Double_t ptemc=0, Bool_t ise=kFALSE, 
65                                   Int_t label=0, Short_t charge=1, Double_t mass = 0); // add a track; if values are -1 generate random parameters
66   AliAODMCParticle      *AddMCParticle(AliAODMCParticle *part, Int_t origIndex);                // add a MC particle
67   void                   CopyCells();
68   void                   CopyClusters();
69   void                   CopyTracks();
70   void                   CopyMCParticles();
71   void                   GetRandomCell(Double_t &eta, Double_t &phi, Int_t &absId);             // generate a random cell in the calorimeter
72   Double_t               GetRandomEta(Bool_t emcal=kFALSE);                                     // generate a random eta value in the given range
73   Double_t               GetRandomPhi(Bool_t emcal=kFALSE);                                     // generate a random phi value in the given range
74   Double_t               GetRandomPt();                                                         // generate a random pt value in the given range
75   void                   GetRandomParticle(Double_t &pt, Double_t &eta, Double_t &phi, Bool_t emcal=kFALSE);  // generate a particle with random eta,phi,pt values
76   virtual Bool_t         ExecOnce();                                                            // intialize task
77   virtual void           Run();                                                                 // do jet model action
78
79   TString                fGeomName;               // EMCal geometry name
80   TString                fTracksName;             // name of track collection
81   TString                fOutTracksName;          // name of output track collection
82   TString                fCaloName;               // name of calo cluster collection
83   TString                fOutCaloName;            // name of output cluster collection
84   TString                fCellsName;              // name of calo cells collection
85   TString                fOutCellsName;           // name of output cells collection
86   TString                fMCParticlesName;        // name of MC particle collection
87   TString                fOutMCParticlesName;     // name of output MC particle collection
88   Bool_t                 fIsMC;                   // whether the current event is MC or not
89   TString                fSuffix;                 // suffix to add in the name of new collections
90   Float_t                fEtaMin;                 // eta minimum value
91   Float_t                fEtaMax;                 // eta maximum value
92   Float_t                fPhiMin;                 // phi minimum value
93   Float_t                fPhiMax;                 // phi maximum value
94   Float_t                fPtMin;                  // pt minimum value
95   Float_t                fPtMax;                  // pt maximum value
96   Bool_t                 fCopyArray;              // whether or not the array will be copied to a new one before modelling
97   Int_t                  fNClusters;              // how many clusters are being processed
98   Int_t                  fNCells;                 // how many cells are being processed
99   Int_t                  fNTracks;                // how many tracks are being processed
100   Int_t                  fMarkMC;                 // which MC label is to be used (default=100)
101   TH1                   *fPtSpectrum;             // pt spectrum to extract random pt values
102   TF2                   *fPtPhiEvPlDistribution;  // pt vs. (phi-psi) distribution to extract random pt/phi values
103   TH1                   *fDensitySpectrum;        // particle density spectrum to extract random density values
104   Bool_t                 fQAhistos;               // draw QA histograms
105   Double_t               fPsi;                    //!simmetry plane for the elliptic flow
106   Bool_t                 fIsInit;                 //!=true if initialized
107   AliEMCALGeometry      *fGeom;                   //!pointer to EMCal geometry
108   Double_t               fVertex[3];              //!event vertex
109   TClonesArray          *fClusters;               //!cluster collection
110   TClonesArray          *fOutClusters;            //!output cluster collection
111   TClonesArray          *fTracks;                 //!track collection
112   TClonesArray          *fOutTracks;              //!output track collection
113   AliVCaloCells         *fCaloCells;              //!cells collection
114   AliVCaloCells         *fOutCaloCells;           //!output cells collection
115   Int_t                  fAddedCells;             //!number of added cells
116   TClonesArray          *fMCParticles;            //!MC particles collection
117   AliNamedArrayI        *fMCParticlesMap;         //!MC particles mapping
118   TClonesArray          *fOutMCParticles;         //!output MC particles collection
119   AliNamedArrayI        *fOutMCParticlesMap;      //!MC particles mapping
120   Int_t                  fMCLabelShift;           //!MC label shift
121   Bool_t                 fEsdMode;                //!ESD/AOD mode
122   TList                 *fOutput;                 //!output list for QA histograms
123
124  private:
125   AliJetModelBaseTask(const AliJetModelBaseTask&);            // not implemented
126   AliJetModelBaseTask &operator=(const AliJetModelBaseTask&); // not implemented
127
128   ClassDef(AliJetModelBaseTask, 10) // Jet modelling task
129 };
130 #endif