]>
Commit | Line | Data |
---|---|---|
ec3cd833 | 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 | ||
18 | #include "AliAnalysisTaskEmcalBadCells.h" | |
19 | ||
20 | ClassImp(AliAnalysisTaskEmcalBadCells) | |
21 | ||
22 | //________________________________________________________________________ | |
23 | AliAnalysisTaskEmcalBadCells::AliAnalysisTaskEmcalBadCells() : | |
9239b066 | 24 | AliAnalysisTaskEmcal("AliAnalysisTaskEmcalBadCells"), |
ec3cd833 | 25 | fh2AmplitudeCellNumber(0x0) |
ec3cd833 | 26 | { |
27 | // Default constructor. | |
28 | ||
29 | ||
30 | SetMakeGeneralHistograms(kTRUE); | |
31 | } | |
32 | ||
33 | //________________________________________________________________________ | |
34 | AliAnalysisTaskEmcalBadCells::AliAnalysisTaskEmcalBadCells(const char *name, Bool_t histo) : | |
9239b066 | 35 | AliAnalysisTaskEmcal(name, histo), |
ec3cd833 | 36 | fh2AmplitudeCellNumber(0x0) |
37 | { | |
38 | // Standard constructor. | |
39 | ||
40 | SetMakeGeneralHistograms(histo); | |
41 | } | |
42 | ||
43 | //________________________________________________________________________ | |
44 | AliAnalysisTaskEmcalBadCells::~AliAnalysisTaskEmcalBadCells() | |
45 | { | |
46 | // Destructor. | |
47 | } | |
48 | ||
49 | //________________________________________________________________________ | |
50 | void AliAnalysisTaskEmcalBadCells::UserCreateOutputObjects() | |
51 | { | |
52 | // Create user output. | |
53 | ||
9239b066 | 54 | AliAnalysisTaskEmcal::UserCreateOutputObjects(); |
ec3cd833 | 55 | |
56 | fh2AmplitudeCellNumber = new TH2F("fh2AmplitudeCellNumber","fh2AmplitudeCellNumber",11520,0,11520,100,0,10); | |
57 | fOutput->Add(fh2AmplitudeCellNumber); | |
58 | ||
59 | PostData(1, fOutput); // Post data for ALL output slots > 0 here. | |
60 | } | |
61 | ||
62 | //________________________________________________________________________ | |
63 | Bool_t AliAnalysisTaskEmcalBadCells::FillHistograms() | |
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 = 1e6; | |
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 | //________________________________________________________________________ | |
103 | Bool_t AliAnalysisTaskEmcalBadCells::Run() | |
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 | //________________________________________________________________________ | |
111 | void AliAnalysisTaskEmcalBadCells::Terminate(Option_t *) | |
112 | { | |
113 | // Called once at the end of the analysis. | |
114 | } |