]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALQADataMakerRec.cxx
tuning of histo ranges
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALQADataMakerRec.cxx
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 /*
16 Based on the QA code for PHOS written by Yves Schutz July 2007
17
18 Authors:  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"
34 #include "AliESDCaloCells.h"
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"
43
44 ClassImp(AliEMCALQADataMakerRec)
45            
46 //____________________________________________________________________________ 
47   AliEMCALQADataMakerRec::AliEMCALQADataMakerRec() : 
48   AliQADataMakerRec(AliQA::GetDetName(AliQA::kEMCAL), "EMCAL Quality Assurance Data Maker")
49 {
50   // ctor
51 }
52
53 //____________________________________________________________________________ 
54 AliEMCALQADataMakerRec::AliEMCALQADataMakerRec(const AliEMCALQADataMakerRec& qadm) :
55   AliQADataMakerRec()
56 {
57   //copy ctor 
58   SetName((const char*)qadm.GetName()) ; 
59   SetTitle((const char*)qadm.GetTitle()); 
60 }
61
62 //__________________________________________________________________
63 AliEMCALQADataMakerRec& AliEMCALQADataMakerRec::operator = (const AliEMCALQADataMakerRec& qadm )
64 {
65   // Equal operator.
66   this->~AliEMCALQADataMakerRec();
67   new(this) AliEMCALQADataMakerRec(qadm);
68   return *this;
69 }
70  
71 //____________________________________________________________________________ 
72 void AliEMCALQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
73 {
74   //Detector specific actions at end of cycle
75   // do the QA checking
76   AliQAChecker::Instance()->Run(AliQA::kEMCAL, task, list) ;  
77 }
78
79 //____________________________________________________________________________ 
80 void AliEMCALQADataMakerRec::InitESDs()
81 {
82   //Create histograms to controll ESD
83   TH1F * h1 = new TH1F("hESDCaloClusterE",  "ESDs CaloCluster energy in EMCAL",    200, 0., 20.) ; 
84   h1->Sumw2() ;
85   Add2ESDsList(h1, kESDCaloClusE)  ;                                                     
86
87   TH1I * h2 = new TH1I("hESDCaloClusterM", "ESDs CaloCluster multiplicity in EMCAL", 100, 0,  100) ; 
88   h2->Sumw2() ;
89   Add2ESDsList(h2, kESDCaloClusM)  ;
90
91   TH1F * h3 = new TH1F("hESDCaloCellA",  "ESDs CaloCell amplitude in EMCAL",    500, 0., 250.) ; 
92   h3->Sumw2() ;
93   Add2ESDsList(h3, kESDCaloCellA)  ;  
94  
95   TH1I * h4 = new TH1I("hESDCaloCellM", "ESDs CaloCell multiplicity in EMCAL", 200, 0,  1000) ; 
96   h4->Sumw2() ;
97   Add2ESDsList(h4, kESDCaloCellM) ;
98         
99 }
100
101 //____________________________________________________________________________ 
102 void AliEMCALQADataMakerRec::InitRecPoints()
103 {
104   // create Reconstructed Points histograms in RecPoints subdir
105   TH1F* h0 = new TH1F("hEMCALRpE","EMCAL RecPoint energies",200, 0.,20.); //GeV
106   h0->Sumw2();
107   Add2RecPointsList(h0,kRecPE);
108
109   TH1I* h1 = new TH1I("hEMCALRpM","EMCAL RecPoint multiplicities",100,0,100);
110   h1->Sumw2();
111   Add2RecPointsList(h1,kRecPM);
112
113   TH1I* h2 = new TH1I("hEMCALRpDigM","EMCAL RecPoint Digit Multiplicities",20,0,20);
114   h2->Sumw2();
115   Add2RecPointsList(h2,kRecPDigM);
116
117 }
118
119 //____________________________________________________________________________ 
120 void AliEMCALQADataMakerRec::InitRaws()
121 {
122   // create Raws histograms in Raws subdir
123   //these need more thought
124   /*
125   TH1I * h0 = new TH1I("hLowEmcalSupermodules",    "Low Gain digits in EMCAL supermodules",       12, 0, 12) ;
126   h0->Sumw2() ;
127   Add2RawsList(h0, kNsmodLG) ;
128   TH1I * h1 = new TH1I("hHighEmcalSupermodules",   "High Gain Digits in EMCAL supermodules",       12, 0, 12) ;
129   h1->Sumw2() ;
130   Add2RawsList(h1, kNsmodHG) ;
131
132   TH1F * h2 = new TH1F("hLowEmcalRawtime", "Low Gain Time of raw digits in EMCAL", 500, -50., 200.) ;
133   h2->Sumw2() ;
134   Add2RawsList(h2, kLGtime) ;
135   TH1F * h3 = new TH1F("hHighEmcalRawtime", "High Gain Time of raw digits in EMCAL", 500, -50., 200.) ;
136   h3->Sumw2() ;
137   Add2RawsList(h3, kHGtime) ;
138
139   TH1F * h4 = new TH1F("hLowEmcalRawEnergy", "Low Gain Energy of raw digits in EMCAL", 500, 0., 1000.) ;
140   h4->Sumw2() ;
141   Add2RawsList(h4, kSpecLG) ;
142   TH1F * h5 = new TH1F("hHighEmcalRawEnergy", "High Gain Energy of raw digits in EMCAL",500,0., 1000.) ;
143   h5->Sumw2() ;
144   Add2RawsList(h5, kSpecHG) ;
145
146   TH1I * h6 = new TH1I("hLowNtot", "Low Gain Total Number of raw digits in EMCAL", 500, 0, 10000) ;
147   h6->Sumw2() ;
148   Add2RawsList(h6, kNtotLG) ;
149   TH1I * h7 = new TH1I("hHighNtot", "High Gain Total Number of raw digits in EMCAL",500,0, 10000) ;
150   h7->Sumw2() ;
151   Add2RawsList(h7, kNtotHG) ;
152
153   TH1F * h8 = new TH1F("hLowEtot", "Low Gain Total Energy of raw digits in EMCAL", 500, 0., 5000.) ;
154   h8->Sumw2() ;
155   Add2RawsList(h8, kEtotLG) ;
156   TH1F * h9 = new TH1F("hHighEtot", "High Gain Total Energy of raw digits in EMCAL",500,0., 100000.) ;
157   h9->Sumw2() ;
158   Add2RawsList(h9, kEtotHG) ;
159   */
160   
161 }
162
163 //____________________________________________________________________________
164 void AliEMCALQADataMakerRec::MakeESDs(AliESDEvent * esd)
165 {
166   // make QA data from ESDs
167
168   Int_t nTot = 0 ; 
169   for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
170     AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
171     if( clu->IsEMCAL() ) {
172       GetESDsData(kESDCaloClusE)->Fill(clu->E()) ;
173       nTot++ ;
174     } 
175   }
176   GetESDsData(kESDCaloClusM)->Fill(nTot) ;
177
178   //fill calo cells
179   AliESDCaloCells* cells = esd->GetEMCALCells();
180   GetESDsData(kESDCaloCellM)->Fill(cells->GetNumberOfCells()) ;
181
182   for ( Int_t index = 0; index < cells->GetNumberOfCells() ; index++ ) {
183     GetESDsData(kESDCaloCellA)->Fill(cells->GetAmplitude(index)) ;
184   }
185
186 }
187
188 //____________________________________________________________________________
189 void AliEMCALQADataMakerRec::MakeRaws(AliRawReader* /* rawReader */)
190 {
191   //Fill prepared histograms with Raw digit properties
192
193   //Raw histogram filling not yet implemented
194   //
195   //Need to figure out how to get the info we want without having to
196   //actually run Raw2Digits twice.
197   //I suspect what we actually want is a raw digits method, not a true
198   //emcal raw data method, but this doesn't seem to be allowed in
199   //AliQADataMakerRec.h
200
201 }
202
203 //____________________________________________________________________________
204 void AliEMCALQADataMakerRec::MakeRecPoints(TTree * clustersTree)
205 {
206   // makes data from RecPoints
207   TBranch *emcbranch = clustersTree->GetBranch("EMCALECARP");
208   if (!emcbranch) { 
209     AliError("can't get the branch with the EMCAL clusters !");
210     return;
211   }
212   TObjArray * emcrecpoints = new TObjArray(100) ;
213   emcbranch->SetAddress(&emcrecpoints);
214   emcbranch->GetEntry(0);
215   
216   GetRecPointsData(kRecPM)->Fill(emcrecpoints->GetEntriesFast()) ; 
217   TIter next(emcrecpoints) ; 
218   AliEMCALRecPoint * rp ; 
219   while ( (rp = dynamic_cast<AliEMCALRecPoint *>(next())) ) {
220     GetRecPointsData(kRecPE)->Fill( rp->GetEnergy()) ;
221     GetRecPointsData(kRecPDigM)->Fill(rp->GetMultiplicity());
222   }
223   emcrecpoints->Delete();
224   delete emcrecpoints;
225   
226 }
227
228 //____________________________________________________________________________ 
229 void AliEMCALQADataMakerRec::StartOfDetectorCycle()
230 {
231   //Detector specific actions at start of cycle
232   
233 }