]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/AliJetModelBaseTask.h
From Salvatore
[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 TH1I;
8 class AliEMCALGeometry;
9 class AliVCluster;
10 class AliPicoTrack;
11 class AliVCaloCells;
12 class AliAODMCParticle;
13 class AliNamedArrayI;
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",250,f->GetXmin(),f->GetXmax()); 
34                                                                  fPtSpectrum->Add(f); }
35
36   void                   SetMC(Bool_t a)                       { fIsMC         = a   ; }
37
38   void                   SetCopyArray(Bool_t copy)             { fCopyArray    = copy; }
39   void                   SetTracksName(const char *n)          { fTracksName   = n;    }
40   void                   SetClusName(const char *n)            { fCaloName     = n;    }
41   void                   SetCellsName(const char *n)           { fCellsName    = n;    }
42   void                   SetMCParticlesName(const char *n)     { fMCParticlesName = n; }
43   void                   SetSuffix(const char *s)              { fSuffix       = s;    }
44
45   void                   SetGeometryName(const char *n)        { fGeomName     = n;    }
46   void                   SetMarkMC(Int_t m)                    { fMarkMC       = m;    }
47   virtual void           SetNClusters(Int_t n)                 { fNClusters    = n;    }
48   virtual void           SetNCells(Int_t n)                    { fNCells       = n;    }
49   virtual void           SetNTracks(Int_t n)                   { fNTracks      = n;    }
50
51
52  protected:
53   Int_t                  SetNumberOfOutCells(Int_t n);                                          // set the number of cells
54   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
55   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
56   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
57   AliVCluster           *AddCluster(Double_t e, Int_t absId, Int_t label=0);                   // add a cluster with given energy and position
58   AliVCluster           *AddCluster(AliVCluster *oc);                                          // add a cluster (copy)
59   AliPicoTrack          *AddTrack(Double_t pt = -1, Double_t eta = -999, Double_t phi = -1, Byte_t type=0, 
60                                   Double_t etaemc=0, Double_t phiemc=0, Bool_t ise=kFALSE, 
61                                   Int_t label=0, Short_t charge=1); // add a track; if values are -1 generate random parameters
62   AliAODMCParticle      *AddMCParticle(AliAODMCParticle *part, Int_t origIndex);                // add a MC particle
63   void                   CopyCells();
64   void                   CopyClusters();
65   void                   CopyTracks();
66   void                   CopyMCParticles();
67   void                   GetRandomCell(Double_t &eta, Double_t &phi, Int_t &absId);             // generate a random cell in the calorimeter
68   Double_t               GetRandomEta(Bool_t emcal=kFALSE);                                     // generate a random eta value in the given range
69   Double_t               GetRandomPhi(Bool_t emcal=kFALSE);                                     // generate a random phi value in the given range
70   Double_t               GetRandomPt();                                                         // generate a random pt value in the given range
71   virtual Bool_t         ExecOnce();                                                            // intialize task
72   virtual void           Run();                                                                 // do jet model action
73
74   TString                fGeomName;               // EMCal geometry name
75   TString                fTracksName;             // name of track collection
76   TString                fOutTracksName;          // name of output track collection
77   TString                fCaloName;               // name of calo cluster collection
78   TString                fOutCaloName;            // name of output cluster collection
79   TString                fCellsName;              // name of calo cells collection
80   TString                fOutCellsName;           // name of output cells collection
81   TString                fMCParticlesName;        // name of MC particle collection
82   TString                fOutMCParticlesName;     // name of output MC particle collection
83   Bool_t                 fIsMC;                   // whether the current event is MC or not
84   TString                fSuffix;                 // suffix to add in the name of new collections
85   Float_t                fEtaMin;                 // eta minimum value
86   Float_t                fEtaMax;                 // eta maximum value
87   Float_t                fPhiMin;                 // phi minimum value
88   Float_t                fPhiMax;                 // phi maximum value
89   Float_t                fPtMin;                  // pt minimum value
90   Float_t                fPtMax;                  // pt maximum value
91   Bool_t                 fCopyArray;              // whether or not the array will be copied to a new one before modelling
92   Int_t                  fNClusters;              // how many clusters are being processed
93   Int_t                  fNCells;                 // how many cells are being processed
94   Int_t                  fNTracks;                // how many tracks are being processed
95   Int_t                  fMarkMC;                 // which MC label is to be used (default=100)
96   TH1                   *fPtSpectrum;             // pt spectrum parametrization to extract random pt values
97   Bool_t                 fQAhistos;               // draw QA histograms
98   Bool_t                 fIsInit;                 //!=true if initialized
99   AliEMCALGeometry      *fGeom;                   //!pointer to EMCal geometry
100   Double_t               fVertex[3];              //!event vertex
101   TClonesArray          *fClusters;               //!cluster collection
102   TClonesArray          *fOutClusters;            //!output cluster collection
103   TClonesArray          *fTracks;                 //!track collection
104   TClonesArray          *fOutTracks;              //!output track collection
105   AliVCaloCells         *fCaloCells;              //!cells collection
106   AliVCaloCells         *fOutCaloCells;           //!output cells collection
107   Int_t                  fAddedCells;             //!number of added cells
108   TClonesArray          *fMCParticles;            //!MC particles collection
109   AliNamedArrayI        *fMCParticlesMap;         //!MC particles mapping
110   TClonesArray          *fOutMCParticles;         //!output MC particles collection
111   AliNamedArrayI        *fOutMCParticlesMap;      //!MC particles mapping
112   Int_t                  fMCLabelShift;           //!MC label shift
113   Bool_t                 fEsdMode;                //!ESD/AOD mode
114   TList                 *fOutput;                 //!output list for QA histograms
115
116  private:
117   AliJetModelBaseTask(const AliJetModelBaseTask&);            // not implemented
118   AliJetModelBaseTask &operator=(const AliJetModelBaseTask&); // not implemented
119
120   ClassDef(AliJetModelBaseTask, 8) // Jet modelling task
121 };
122 #endif