]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALQADataMakerRec.cxx
Make and print an image of QA user flagged histograms (Yves)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALQADataMakerRec.cxx
CommitLineData
94594e5d 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15/*
16Based on the QA code for PHOS written by Yves Schutz July 2007
17
18Authors: J.Klay (Cal Poly) May 2008
19 S. Salur LBL April 2008
20
21*/
22
23// --- ROOT system ---
24#include <TClonesArray.h>
25#include <TFile.h>
26#include <TH1F.h>
27#include <TH1I.h>
28#include <TH2F.h>
29
30// --- Standard library ---
31
32// --- AliRoot header files ---
33#include "AliESDCaloCluster.h"
601c73e3 34#include "AliESDCaloCells.h"
94594e5d 35#include "AliESDEvent.h"
36#include "AliLog.h"
37#include "AliEMCALQADataMakerRec.h"
38#include "AliQAChecker.h"
39#include "AliEMCALRecPoint.h"
40#include "AliEMCALRawUtils.h"
41#include "AliEMCALReconstructor.h"
42#include "AliEMCALRecParam.h"
78328afd 43#include "AliRawReader.h"
94594e5d 44
45ClassImp(AliEMCALQADataMakerRec)
46
47//____________________________________________________________________________
48 AliEMCALQADataMakerRec::AliEMCALQADataMakerRec() :
4e25ac79 49 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kEMCAL), "EMCAL Quality Assurance Data Maker")
94594e5d 50{
51 // ctor
52}
53
54//____________________________________________________________________________
55AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) :
56 AliQADataMakerRec()
57{
58 //copy ctor
59 SetName((const char*)qadm.GetName()) ;
60 SetTitle((const char*)qadm.GetTitle());
61}
62
63//__________________________________________________________________
64AliEMCALQADataMakerRec& AliEMCALQADataMakerRec::operator = (const AliEMCALQADataMakerRec& qadm )
65{
66 // Equal operator.
67 this->~AliEMCALQADataMakerRec();
68 new(this) AliEMCALQADataMakerRec(qadm);
69 return *this;
70}
71
72//____________________________________________________________________________
4e25ac79 73void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
94594e5d 74{
75 //Detector specific actions at end of cycle
76 // do the QA checking
4e25ac79 77 AliQAChecker::Instance()->Run(AliQAv1::kEMCAL, task, list) ;
94594e5d 78}
79
80//____________________________________________________________________________
81void AliEMCALQADataMakerRec::InitESDs()
82{
83 //Create histograms to controll ESD
7d297381 84 const Bool_t expert = kTRUE ;
85 const Bool_t image = kTRUE ;
86
601c73e3 87 TH1F * h1 = new TH1F("hESDCaloClusterE", "ESDs CaloCluster energy in EMCAL", 200, 0., 20.) ;
94594e5d 88 h1->Sumw2() ;
7d297381 89 Add2ESDsList(h1, kESDCaloClusE, !expert, image) ;
601c73e3 90
91 TH1I * h2 = new TH1I("hESDCaloClusterM", "ESDs CaloCluster multiplicity in EMCAL", 100, 0, 100) ;
94594e5d 92 h2->Sumw2() ;
7d297381 93 Add2ESDsList(h2, kESDCaloClusM, !expert, image) ;
601c73e3 94
95 TH1F * h3 = new TH1F("hESDCaloCellA", "ESDs CaloCell amplitude in EMCAL", 500, 0., 250.) ;
94594e5d 96 h3->Sumw2() ;
7d297381 97 Add2ESDsList(h3, kESDCaloCellA, !expert, image) ;
94594e5d 98
601c73e3 99 TH1I * h4 = new TH1I("hESDCaloCellM", "ESDs CaloCell multiplicity in EMCAL", 200, 0, 1000) ;
94594e5d 100 h4->Sumw2() ;
7d297381 101 Add2ESDsList(h4, kESDCaloCellM, !expert, image) ;
94594e5d 102
103}
104
105//____________________________________________________________________________
106void AliEMCALQADataMakerRec::InitRecPoints()
107{
108 // create Reconstructed Points histograms in RecPoints subdir
7d297381 109 const Bool_t expert = kTRUE ;
110 const Bool_t image = kTRUE ;
111
601c73e3 112 TH1F* h0 = new TH1F("hEMCALRpE","EMCAL RecPoint energies",200, 0.,20.); //GeV
113 h0->Sumw2();
7d297381 114 Add2RecPointsList(h0,kRecPE, !expert, image);
94594e5d 115
601c73e3 116 TH1I* h1 = new TH1I("hEMCALRpM","EMCAL RecPoint multiplicities",100,0,100);
117 h1->Sumw2();
7d297381 118 Add2RecPointsList(h1,kRecPM, !expert, image);
94594e5d 119
601c73e3 120 TH1I* h2 = new TH1I("hEMCALRpDigM","EMCAL RecPoint Digit Multiplicities",20,0,20);
121 h2->Sumw2();
7d297381 122 Add2RecPointsList(h2,kRecPDigM, !expert, image);
94594e5d 123
124}
125
126//____________________________________________________________________________
127void AliEMCALQADataMakerRec::InitRaws()
128{
129 // create Raws histograms in Raws subdir
601c73e3 130 //these need more thought
131 /*
7d297381 132 const Bool_t expert = kTRUE ;
133 const Bool_t saveCorr = kTRUE ;
134 const Bool_t image = kTRUE ;
135
601c73e3 136 TH1I * h0 = new TH1I("hLowEmcalSupermodules", "Low Gain digits in EMCAL supermodules", 12, 0, 12) ;
137 h0->Sumw2() ;
7d297381 138 Add2RawsList(h0, kNsmodLG, !expert, image, !saveCorr) ;
601c73e3 139 TH1I * h1 = new TH1I("hHighEmcalSupermodules", "High Gain Digits in EMCAL supermodules", 12, 0, 12) ;
140 h1->Sumw2() ;
7d297381 141 Add2RawsList(h1, kNsmodHG, !expert, image, !saveCorr) ;
94594e5d 142
601c73e3 143 TH1F * h2 = new TH1F("hLowEmcalRawtime", "Low Gain Time of raw digits in EMCAL", 500, -50., 200.) ;
144 h2->Sumw2() ;
7d297381 145 Add2RawsList(h2, kLGtime, !expert, image, !saveCorr) ;
601c73e3 146 TH1F * h3 = new TH1F("hHighEmcalRawtime", "High Gain Time of raw digits in EMCAL", 500, -50., 200.) ;
147 h3->Sumw2() ;
7d297381 148 Add2RawsList(h3, kHGtime, !expert, image, !saveCorr) ;
94594e5d 149
601c73e3 150 TH1F * h4 = new TH1F("hLowEmcalRawEnergy", "Low Gain Energy of raw digits in EMCAL", 500, 0., 1000.) ;
151 h4->Sumw2() ;
7d297381 152 Add2RawsList(h4, kSpecLG, !expert, image, !saveCorr) ;
601c73e3 153 TH1F * h5 = new TH1F("hHighEmcalRawEnergy", "High Gain Energy of raw digits in EMCAL",500,0., 1000.) ;
154 h5->Sumw2() ;
7d297381 155 Add2RawsList(h5, kSpecHG, !expert, image, !saveCorr) ;
601c73e3 156
157 TH1I * h6 = new TH1I("hLowNtot", "Low Gain Total Number of raw digits in EMCAL", 500, 0, 10000) ;
158 h6->Sumw2() ;
7d297381 159 Add2RawsList(h6, kNtotLG, !expert, image, !saveCorr) ;
601c73e3 160 TH1I * h7 = new TH1I("hHighNtot", "High Gain Total Number of raw digits in EMCAL",500,0, 10000) ;
161 h7->Sumw2() ;
7d297381 162 Add2RawsList(h7, kNtotHG, !expert, image, !saveCorr) ;
601c73e3 163
164 TH1F * h8 = new TH1F("hLowEtot", "Low Gain Total Energy of raw digits in EMCAL", 500, 0., 5000.) ;
165 h8->Sumw2() ;
7d297381 166 Add2RawsList(h8, kEtotLG, !expert, image, !saveCorr) ;
601c73e3 167 TH1F * h9 = new TH1F("hHighEtot", "High Gain Total Energy of raw digits in EMCAL",500,0., 100000.) ;
168 h9->Sumw2() ;
7d297381 169 Add2RawsList(h9, kEtotHG, !expert, image, !saveCorr) ;
601c73e3 170 */
94594e5d 171
172}
173
174//____________________________________________________________________________
175void AliEMCALQADataMakerRec::MakeESDs(AliESDEvent * esd)
176{
177 // make QA data from ESDs
178
179 Int_t nTot = 0 ;
94594e5d 180 for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
181 AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
182 if( clu->IsEMCAL() ) {
601c73e3 183 GetESDsData(kESDCaloClusE)->Fill(clu->E()) ;
94594e5d 184 nTot++ ;
185 }
186 }
601c73e3 187 GetESDsData(kESDCaloClusM)->Fill(nTot) ;
188
189 //fill calo cells
190 AliESDCaloCells* cells = esd->GetEMCALCells();
191 GetESDsData(kESDCaloCellM)->Fill(cells->GetNumberOfCells()) ;
192
193 for ( Int_t index = 0; index < cells->GetNumberOfCells() ; index++ ) {
194 GetESDsData(kESDCaloCellA)->Fill(cells->GetAmplitude(index)) ;
195 }
196
94594e5d 197}
198
199//____________________________________________________________________________
78328afd 200void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* rawReader)
94594e5d 201{
202 //Fill prepared histograms with Raw digit properties
203
204 //Raw histogram filling not yet implemented
601c73e3 205 //
206 //Need to figure out how to get the info we want without having to
207 //actually run Raw2Digits twice.
208 //I suspect what we actually want is a raw digits method, not a true
209 //emcal raw data method, but this doesn't seem to be allowed in
210 //AliQADataMakerRec.h
94594e5d 211
78328afd 212 rawReader->Reset() ;
94594e5d 213}
214
215//____________________________________________________________________________
216void AliEMCALQADataMakerRec::MakeRecPoints(TTree * clustersTree)
217{
218 // makes data from RecPoints
219 TBranch *emcbranch = clustersTree->GetBranch("EMCALECARP");
220 if (!emcbranch) {
221 AliError("can't get the branch with the EMCAL clusters !");
222 return;
223 }
224 TObjArray * emcrecpoints = new TObjArray(100) ;
225 emcbranch->SetAddress(&emcrecpoints);
226 emcbranch->GetEntry(0);
227
601c73e3 228 GetRecPointsData(kRecPM)->Fill(emcrecpoints->GetEntriesFast()) ;
94594e5d 229 TIter next(emcrecpoints) ;
230 AliEMCALRecPoint * rp ;
94594e5d 231 while ( (rp = dynamic_cast<AliEMCALRecPoint *>(next())) ) {
601c73e3 232 GetRecPointsData(kRecPE)->Fill( rp->GetEnergy()) ;
233 GetRecPointsData(kRecPDigM)->Fill(rp->GetMultiplicity());
94594e5d 234 }
94594e5d 235 emcrecpoints->Delete();
236 delete emcrecpoints;
237
238}
239
240//____________________________________________________________________________
241void AliEMCALQADataMakerRec::StartOfDetectorCycle()
242{
243 //Detector specific actions at start of cycle
244
245}