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