AliPhysics  5b5fbb3 (5b5fbb3)
AliAnalysisTaskEmcalBadCells.cxx
Go to the documentation of this file.
1 //
2 // Bad cells analysis task.
3 //
4 // Author: M. Verweij
5 
6 #include <TClonesArray.h>
7 #include <TH1F.h>
8 #include <TH2F.h>
9 #include <TList.h>
10 #include <TLorentzVector.h>
11 
12 #include "AliVCluster.h"
13 #include "AliVTrack.h"
14 #include "AliLog.h"
15 #include "AliEMCALGeometry.h"
16 #include "AliVCaloCells.h"
17 
19 
21 
22 //________________________________________________________________________
25  fh2AmplitudeCellNumber(0x0)
26 {
27  // Default constructor.
28 
29 
30  SetMakeGeneralHistograms(kTRUE);
31 }
32 
33 //________________________________________________________________________
35  AliAnalysisTaskEmcal(name, histo),
36  fh2AmplitudeCellNumber(0x0)
37 {
38  // Standard constructor.
39 
41 }
42 
43 //________________________________________________________________________
45 {
46  // Destructor.
47 }
48 
49 //________________________________________________________________________
51 {
52  // Create user output.
53 
55 
56  fh2AmplitudeCellNumber = new TH2F("fh2AmplitudeCellNumber","fh2AmplitudeCellNumber",11520,0,11520,100,0,10);
58 
59  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
60 }
61 
62 //________________________________________________________________________
64 {
65  // Fill histograms.
66 
67  if(!fGeom)
68  fGeom = AliEMCALGeometry::GetInstance();
69 
70  Short_t absId = -1;
71  Int_t nCells = 0;
72 
73  Int_t absIdMin = 1000000;
74  Int_t absIdMax = -1;
75 
76  if (fCaloCells) {
77  if(fCaloCells->IsEMCAL()){
78  for (Int_t icell = 0; icell < fCaloCells->GetNumberOfCells(); icell++) {
79 
80  nCells++;
81 
82  Double_t amp =0., time = 0., efrac = 0;
83  Int_t mclabel = -1;
84 
85  fCaloCells->GetCell(icell, absId, amp, time,mclabel,efrac);
86  if(absId<absIdMin) absIdMin=absId;
87  if(absId>absIdMax) absIdMax=absId;
88 
89  fh2AmplitudeCellNumber->Fill(absId,amp);
90 
91  }
92  // AliInfo(Form("%s: absId min: %d max: %d nCells: %d",GetName(),absIdMin,absIdMax,nCells));
93  }
94 
95  }
96 
97 
98 
99  return kTRUE;
100 }
101 
102 //________________________________________________________________________
104 {
105  // Run analysis code here, if needed. It will be executed before FillHistograms().
106 
107  return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
108 }
109 
110 //________________________________________________________________________
112 {
113  // Called once at the end of the analysis.
114 }
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
double Double_t
Definition: External.C:58
Definition: External.C:236
Base task in the EMCAL framework.
int Int_t
Definition: External.C:63
AliEMCALGeometry * fGeom
!emcal geometry
short Short_t
Definition: External.C:23
AliVCaloCells * fCaloCells
!cells
AliEmcalList * fOutput
!output list
void SetMakeGeneralHistograms(Bool_t g)
const char Option_t
Definition: External.C:48
void UserCreateOutputObjects()
Main initialization function on the worker.
bool Bool_t
Definition: External.C:53
Bool_t FillHistograms()
Function filling histograms.