]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HMPID/AliHMPIDQADataMakerRec.cxx
Coverity defects (16716,16712) fixed
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDQADataMakerRec.cxx
CommitLineData
04236e67 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
17/* $Id$ */
18
04236e67 19// --- ROOT system ---
20#include <TClonesArray.h>
21#include <TFile.h>
c9d2a880 22#include <TLine.h>
04236e67 23#include <TH1F.h>
24#include <TH2F.h>
aa21372e 25#include <TProfile.h>
a2741b47 26#include <TProfile2D.h>
04236e67 27#include <Riostream.h>
28// --- Standard library ---
29
30// --- AliRoot header files ---
31#include "AliESDCaloCluster.h"
32#include "AliESDEvent.h"
cc1abc7f 33#include "AliQAChecker.h"
04236e67 34#include "AliLog.h"
35#include "AliHMPIDDigit.h"
36#include "AliHMPIDHit.h"
44ed7a66 37#include "AliHMPIDDigit.h"
04236e67 38#include "AliHMPIDCluster.h"
39#include "AliHMPIDQADataMakerRec.h"
7656d8ac 40#include "AliHMPIDQAChecker.h"
cc1abc7f 41#include "AliHMPIDParam.h"
42#include "AliHMPIDRawStream.h"
43#include "AliLog.h"
b38ac33a 44
606697a8 45//.
b38ac33a 46// HMPID AliHMPIDQADataMakerRec base class
47// for QA of reconstruction
48// here also errors are calculated
49//.
50
04236e67 51ClassImp(AliHMPIDQADataMakerRec)
52
ec575c20 53//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
04236e67 54 AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec() :
8d9917bf 55 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kHMPID), "HMPID Quality Assurance Data Maker"),fEvtRaw(0), fLineDdlDatSizeLow(0x0), fLineDdlDatSizeUp(0x0), fLineDdlPadOCcLow(0x0), fLineDdlPadOCcUp(0x0), fChannel(0)
04236e67 56{
57 // ctor
8d9917bf 58 for(Int_t i=0; i<6; i++) fModline[i]=0x0;
04236e67 59}
60
ec575c20 61//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
04236e67 62AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec(const AliHMPIDQADataMakerRec& qadm) :
8d9917bf 63 AliQADataMakerRec(),fEvtRaw(qadm.fEvtRaw), fLineDdlDatSizeLow(qadm.fLineDdlDatSizeLow), fLineDdlDatSizeUp(qadm.fLineDdlDatSizeUp), fLineDdlPadOCcLow(qadm.fLineDdlPadOCcLow), fLineDdlPadOCcUp(qadm.fLineDdlPadOCcUp), fChannel(qadm.fChannel)
04236e67 64{
65 //copy ctor
8d9917bf 66 for(Int_t i=0; i<6; i++) fModline[i]=qadm.fModline[i];
04236e67 67 SetName((const char*)qadm.GetName()) ;
68 SetTitle((const char*)qadm.GetTitle());
69}
70
ec575c20 71//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
04236e67 72AliHMPIDQADataMakerRec& AliHMPIDQADataMakerRec::operator = (const AliHMPIDQADataMakerRec& qadm )
73{
74 // Equal operator.
75 this->~AliHMPIDQADataMakerRec();
76 new(this) AliHMPIDQADataMakerRec(qadm);
77 return *this;
78}
79
44ed7a66 80//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
81void AliHMPIDQADataMakerRec::InitDigits()
82{
83 // create Digits histograms in Digits subdir
84 const Bool_t expert = kTRUE ;
85 const Bool_t image = kTRUE ;
86
db72ff3b 87 TH1F *hDigChEvt = new TH1F("hDigChEvt","Chamber occupancy per event;Occupancy [%];Counts",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
44ed7a66 88 TH1F *hDigPcEvt = new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
89 TH2F *hDigMap[7];
90 TH1F *hDigQ[42];
91 for(Int_t iCh =0; iCh < 7; iCh++){
92 hDigMap[iCh] = new TH2F(Form("MapCh%i",iCh),Form("Digit Map in Chamber %i",iCh),159,0,159,143,0,143);
93 for(Int_t iPc =0; iPc < 6; iPc++ ){
db72ff3b 94 hDigQ[iCh*6+iPc] = new TH1F(Form("QCh%iPc%i ",iCh,iPc),Form("Charge of digits (ADC) in Chamber %i and PC %i;Charge [ADC counts];Counts",iCh,iPc),4100,0,4100);
44ed7a66 95 }
96 }
97
98 Add2DigitsList(hDigChEvt,0, !expert, image);
99 Add2DigitsList(hDigPcEvt,1,expert, !image);
100 for(Int_t iMap=0; iMap < 7; iMap++) Add2DigitsList(hDigMap[iMap],2+iMap,expert, !image);
101 for(Int_t iH =0; iH < 42 ; iH++) Add2DigitsList(hDigQ[iH] ,9+iH,expert,!image);
102}
103
ec575c20 104//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
04236e67 105void AliHMPIDQADataMakerRec::InitRecPoints()
106{
107 // create cluster histograms in RecPoint subdir
7d297381 108 const Bool_t expert = kTRUE ;
109 const Bool_t image = kTRUE ;
41391bd4 110
db72ff3b 111 TProfile *hCluMult = new TProfile("CluMult" ,"Cluster multiplicity per chamber;Chamber Id;# of clusters" , 16, -1 , 7 , 0, 500);
7d297381 112 Add2RecPointsList(hCluMult , 0,expert, !image);
aa21372e 113
db72ff3b 114 TH2F *hCluFlg = new TH2F("CluFlg" ,"Cluster flag;??;??" , 56 ,-1.5, 12.5, 70, -0.5, 6.5);
7d297381 115 Add2RecPointsList(hCluFlg , 1,expert, !image);
aa21372e 116
117 TH1F *hCluSizeMip[7], *hCluSizePho[7];
118
119 TH1F *hCluQSect[42], *hCluQSectZoom[42];
120
7656d8ac 121 for(Int_t iCh =0; iCh <7; iCh++){
db72ff3b 122 hCluSizeMip[iCh] = new TH1F(Form("CluSizeMipCh%i",iCh),Form("Cluster size MIP (cluster Q > 100 ADC) in Chamber %i;Size [MIP];Counts",iCh), 50 , 0 , 50 );
7d297381 123 Add2RecPointsList(hCluSizeMip[iCh], iCh+2,expert,!image);
aa21372e 124
db72ff3b 125 hCluSizePho[iCh] = new TH1F(Form("CluSizePho%i",iCh ),Form("Cluster size Phots(cluster Q < 100 ADC) in Chamber %i;Size [MIP];Counts",iCh), 50 , 0 , 50 );
7d297381 126 Add2RecPointsList(hCluSizePho[iCh], iCh+7+2,expert,!image);
127
aa21372e 128 for(Int_t iSect =0; iSect < 6; iSect++){
db72ff3b 129 hCluQSectZoom[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%iZoom",iCh,iSect) ,Form("Zoom on Cluster charge (ADC) in Chamber %i and sector %i;Charge [ADC counts];Counts",iCh,iSect),100,0,100);
7d297381 130 Add2RecPointsList(hCluQSectZoom[iCh*6+iSect],2+14+iCh*6+iSect,expert,!image);
131
db72ff3b 132 hCluQSect[iCh*6+iSect] = new TH1F(Form("QClusCh%iSect%i",iCh,iSect) ,Form("Cluster charge (ADC) in Chamber %i and sector %i;Charge [ADC counts];Counts",iCh,iSect),250,0,5000);
7d297381 133 Add2RecPointsList(hCluQSect[iCh*6+iSect],2+14+42+iCh*6+iSect, !expert, image);
aa21372e 134 }
135 }
cc1abc7f 136}
ec575c20 137//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cc1abc7f 138void AliHMPIDQADataMakerRec::InitRaws()
139{
140//
141// Booking QA histo for Raw data
142//
64f2781e 143// All histograms implemented in InitRaws are used in AMORE. Any change here should be propagated to the amoreHMP-QA as well!!! (clm)
144//
145
7d297381 146 const Bool_t expert = kTRUE ;
147 const Bool_t saveCorr = kTRUE ;
148 const Bool_t image = kTRUE ;
149
b38ac33a 150 const Int_t kNerr = (Int_t)AliHMPIDRawStream::kSumErr+1;
aa21372e 151 TH1F *hSumErr[14];
152 TH2F *hDilo[14];
64f2781e 153 TH2I *hPadMap[42]; //AMORE monitoring
154 TH1I *hPadQ[42]; //AMORE monitoring
8d9917bf 155
156 fLineDdlDatSizeLow = new TLine(0.5,932,14.5,932); fLineDdlDatSizeLow->SetLineColor(kGreen); fLineDdlDatSizeLow->SetLineWidth(2);
157 fLineDdlDatSizeUp = new TLine(0.5,1500,14.5,1500); fLineDdlDatSizeUp->SetLineColor(kGreen); fLineDdlDatSizeUp->SetLineWidth(2);
a39cc5ff 158
8d9917bf 159 fLineDdlPadOCcLow = new TLine(0.5,0.086,14.5,0.086); fLineDdlPadOCcLow->SetLineColor(kGreen); fLineDdlPadOCcLow->SetLineWidth(2);
160 fLineDdlPadOCcUp = new TLine(0.5,0.86,14.5,0.86); fLineDdlPadOCcUp->SetLineColor(kGreen); fLineDdlPadOCcUp->SetLineWidth(2);
161
162 for(Int_t modcnt=0; modcnt < 6; modcnt++){ fModline[modcnt] = new TLine(0,(1+modcnt)*144,160,(1+modcnt)*144); }
163
3c8e86a0 164 for(Int_t iddl =0; iddl<AliHMPIDRawStream::kNDDL; iddl++) {
3c8e86a0 165
db72ff3b 166 hSumErr[iddl] = new TH1F(Form("hSumErrDDL%i",iddl), Form("Error summary for DDL %i;??;??",iddl), 2*kNerr,0,2*kNerr);
b38ac33a 167 for(Int_t ilabel=0; ilabel< kNerr; ilabel++) {
3c8e86a0 168 hSumErr[iddl]->GetXaxis()->CenterLabels(kTRUE);
3c8e86a0 169 hSumErr[iddl]->GetXaxis()->SetBinLabel((2*ilabel+1),Form("%i %s",ilabel+1,AliHMPIDRawStream::GetErrName(ilabel)));
7d297381 170 }
171
a39cc5ff 172 Add2RawsList(hSumErr[iddl],iddl,expert,!image, !saveCorr);
aa21372e 173
ab534702 174 hDilo[iddl] = new TH2F(Form("hDiloDDL%i",iddl),Form("Dilogic response at DDL %i;Row # ;Dilogic #",iddl),24,1,25,10,1,11);
7d297381 175 Add2RawsList(hDilo[iddl],14+iddl,expert,!image, !saveCorr);
64f2781e 176 }//DDL loop
7d297381 177 for(Int_t iCh = AliHMPIDParam::kMinCh; iCh <=AliHMPIDParam::kMaxCh ;iCh++) {
178 for(Int_t iPc = AliHMPIDParam::kMinPc; iPc <= AliHMPIDParam::kMaxPc ;iPc++) {
64f2781e 179 hPadMap[iPc+6*iCh] = new TH2I(Form("hPadMap_Ch_%i_Pc%i",iCh,iPc),Form("Pad Map of Ch: %i Pc: %i;Pad X;Pad Y;",iCh,iPc),80,0,80,48,0,48);
a39cc5ff 180 Add2RawsList(hPadMap[iPc+6*iCh],28+iPc+6*iCh,expert,!image, !saveCorr);
64f2781e 181 hPadQ[iPc+6*iCh] = new TH1I(Form("hPadQ_Ch_%i_Pc%i",iCh,iPc),Form("Pad Charge of Ch: %i Pc: %i;Pad Q;Entries;",iCh,iPc),4100,0,4100);
7d297381 182 Add2RawsList(hPadQ[iPc+6*iCh],70+iPc+6*iCh,expert,!image, !saveCorr);
64f2781e 183 }//PC loop
184 }//Ch loop
185
7d297381 186 TH2I *hGeneralErrorSummary = new TH2I("GeneralErrorSummary"," DDL index vs Error type plot", 2*kNerr, 0, 2*kNerr, 2*AliHMPIDRawStream::kNDDL,0,2*AliHMPIDRawStream::kNDDL);
187 for(Int_t igenlabel =0 ; igenlabel< kNerr; igenlabel++) hGeneralErrorSummary->GetXaxis()->SetBinLabel((2*igenlabel+1),Form("%i %s",igenlabel+1,AliHMPIDRawStream::GetErrName(igenlabel)));
c9d2a880 188 Add2RawsList(hGeneralErrorSummary,14+14+42+42, expert, !image, !saveCorr);
a39cc5ff 189
c9d2a880 190 //___ for DQM shifter and eLogBook ___ start
191 //___ Double booking of histograms since TProfile cannot be display in summary image
192 //___ hence TProfile plots will not be shown in QA and LogBook!
a39cc5ff 193
c9d2a880 194 TH1F* hHmpDdlDataSize = new TH1F("hHmpDdlDataSize","HMP Data Size per DDL;;Data Size (Bytes)",14,0.5,14.5);
195 hHmpDdlDataSize->Sumw2();
196 hHmpDdlDataSize->SetOption("P");
197 hHmpDdlDataSize->SetMinimum(0);
198 for(Int_t iddl=0;iddl<14;iddl++) hHmpDdlDataSize->GetXaxis()->SetBinLabel(iddl+1,Form("DDL_%d",1535+iddl+1));
199 hHmpDdlDataSize->SetStats(0);hHmpDdlDataSize->SetMinimum(0);hHmpDdlDataSize->SetMarkerStyle(20);
8d9917bf 200 hHmpDdlDataSize->GetListOfFunctions()->Add(fLineDdlDatSizeLow);
201 hHmpDdlDataSize->GetListOfFunctions()->Add(fLineDdlDatSizeUp);
c9d2a880 202 Add2RawsList(hHmpDdlDataSize,14+14+42+42+1,!expert,image,saveCorr); //shifter, image
203
204 TH1F *fHmpPadOcc = new TH1F("fHmpPadOcc","HMP Average pad occupancy per DDL;;Pad occupancy (%)",14,0.5,14.5);
205 fHmpPadOcc->Sumw2();fHmpPadOcc->SetMinimum(0);
206 fHmpPadOcc->SetMinimum(0);
207 for(Int_t iddl=0;iddl<14;iddl++) fHmpPadOcc->GetXaxis()->SetBinLabel(iddl+1,Form("DDL_%d",1535+iddl+1));
208 fHmpPadOcc->SetStats(0);fHmpPadOcc->SetMinimum(0);fHmpPadOcc->SetMarkerStyle(20);
8d9917bf 209 fHmpPadOcc->GetListOfFunctions()->Add(fLineDdlPadOCcLow);
210 fHmpPadOcc->GetListOfFunctions()->Add(fLineDdlPadOCcUp);
c9d2a880 211 Add2RawsList(fHmpPadOcc,14+14+42+42+2,!expert,image,!saveCorr); //shifter, image
212
a2741b47 213 TH2F* fHmpBigMap = new TH2F("hHmpBigMap","HMP Sum Q Maps Ch: 0-6;Ch 0-6: pad X;Ch0, Ch1, Ch2, Ch3, Ch4, Ch5, Ch6 pad Y ;Sum Q / Nevt",160,0,160,1008,0,1008);
c9d2a880 214 fHmpBigMap->SetStats(0); fHmpBigMap->SetOption("COLZ");
8d9917bf 215 for(Int_t modcnt=0; modcnt < 6; modcnt++) fHmpBigMap->GetListOfFunctions()->Add(fModline[modcnt]);
c9d2a880 216 Add2RawsList(fHmpBigMap,14+14+42+42+3,!expert,image,!saveCorr); //shifter, image
217
218 TH2F *fHmpHvSectorQ = new TH2F("fHmpHvSectorQ","HMP HV Sector vs Q; Q (ADC);HV Sector (Ch0-Sc0,Ch0-Sc1,...);Entries*Q/Nevt",410,1,4101,42,0,42);
219 fHmpHvSectorQ->SetStats(0); fHmpHvSectorQ->SetOption("colz");
220 Add2RawsList(fHmpHvSectorQ,14+14+42+42+4,!expert,image,!saveCorr); //shifter, image
a39cc5ff 221
a2741b47 222 // TProfiles
223 TProfile* hHmpDdlDataSizePrf = new TProfile("hHmpDdlDataSizePrf","HMP Data Size per DDL;;Data Size (Bytes)",14,0.5,14.5);
224 hHmpDdlDataSizePrf->Sumw2();
225 hHmpDdlDataSizePrf->SetOption("P");
226 hHmpDdlDataSizePrf->SetMinimum(0);
227 for(Int_t iddl=0;iddl<14;iddl++) hHmpDdlDataSizePrf->GetXaxis()->SetBinLabel(iddl+1,Form("DDL_%d",1535+iddl+1));
228 hHmpDdlDataSizePrf->SetStats(0);hHmpDdlDataSizePrf->SetMinimum(0);hHmpDdlDataSizePrf->SetMarkerStyle(20);
229 Add2RawsList(hHmpDdlDataSizePrf,14+14+42+42+5,expert,!image,saveCorr); //expert, no image
230
231 TProfile *fHmpPadOccPrf = new TProfile("fHmpPadOccPrf","HMP Average pad occupancy per DDL;;Pad occupancy (%)",14,0.5,14.5);
232 fHmpPadOccPrf->Sumw2();fHmpPadOccPrf->SetMinimum(0);
233 fHmpPadOccPrf->SetMinimum(0);
234 for(Int_t iddl=0;iddl<14;iddl++) fHmpPadOccPrf->GetXaxis()->SetBinLabel(iddl+1,Form("DDL_%d",1535+iddl+1));
235 fHmpPadOccPrf->SetStats(0);fHmpPadOccPrf->SetMinimum(0);fHmpPadOccPrf->SetMarkerStyle(20);
236 Add2RawsList(fHmpPadOccPrf,14+14+42+42+6,expert,!image,saveCorr); //expert, no image
237
238
c9d2a880 239 //___ for DQM shifter and eLogBook ___ stop
04236e67 240}
ec575c20 241//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
04236e67 242void AliHMPIDQADataMakerRec::InitESDs()
243{
cc1abc7f 244 //
245 //Booking ESDs histograms
7d297381 246 const Bool_t expert = kTRUE ;
247 const Bool_t image = kTRUE ;
248
249 TH2F* hCkovP = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]" , 150, 0, 7 ,100, 0, 1) ;
250 TH2F* hSigP = new TH2F("SigP" ,"#sigma_{#theta_c} [mrad];[GeV]", 150, 0, 7 ,100, 0, 1) ;
251 TH2F* hDifXY = new TH2F("DifXY" ,"diff" , 200, -10, 10 ,200,-10,10) ;
252 TH2F* hMvsP = new TH2F("MvsP","Reconstructed Mass vs P",60,0,6,1000,0,1) ;
253 TH1F* hPid[5];
254 hPid[0] = new TH1F("PidE" ,"electron response" , 101, -0.005,1.005) ;
255 hPid[1] = new TH1F("PidMu","#mu response" , 101, -0.005,1.005) ;
256 hPid[2] = new TH1F("PidPi","#pi response" , 101, -0.005,1.005) ;
257 hPid[3] = new TH1F("PidK" ,"K response" , 101, -0.005,1.005) ;
258 hPid[4] = new TH1F("PidP" ,"p response" , 101, -0.005,1.005) ;
259
260 Add2ESDsList(hCkovP,0, !expert, image);
261 Add2ESDsList(hSigP ,1, expert, !image);
262 Add2ESDsList(hDifXY,2, !expert, image);
263 Add2ESDsList(hMvsP,3, expert, !image);
264 for(Int_t i=0; i< 5; i++) Add2ESDsList(hPid[i],i+4, expert, !image);
04236e67 265}
ec575c20 266//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cc1abc7f 267void AliHMPIDQADataMakerRec::MakeRaws(AliRawReader *rawReader)
04236e67 268{
cc1abc7f 269//
270// Filling Raws QA histos
271//
a39cc5ff 272 rawReader->Reset() ;
d9719df1 273 Int_t hmpDaqId = AliDAQ::DetectorID("HMPID"); // shoudl be number 6
274 const UInt_t *detPattern = rawReader->GetDetectorPattern();
275 UInt_t isHmpInRawData = ( ((1 << hmpDaqId) & detPattern[0]) >> hmpDaqId); // check the 6th bit if HMP is there or not
276 if (! isHmpInRawData ) return; // if HMP is not in the event then skip it
c9d2a880 277
a39cc5ff 278 AliHMPIDRawStream stream(rawReader);
a39cc5ff 279 Int_t ddlOcc[14]={0};
c9d2a880 280 Int_t isHMPin=0;
281 UInt_t word; Int_t Nddl, r, d, a;
282 Int_t numPadsInDdl;
283
cc1abc7f 284 while(stream.Next())
285 {
c9d2a880 286 UInt_t ddl=stream.GetDDLNumber(); //returns 0,1,2 ... 13
64f2781e 287 if(ddl > 13) continue;
c9d2a880 288
a2741b47 289 // GetRawsData(14+14+42+42+1)->Fill(ddl+1,stream.GetDdlDataSize());
290 GetRawsData(14+14+42+42+5)->Fill(ddl+1,stream.GetDdlDataSize());
c9d2a880 291 if(stream.GetDdlDataSize() > 0)
292 {
293 isHMPin++;
294 //___ fill error histo
295 for(Int_t iErr =1; iErr<(Int_t)AliHMPIDRawStream::kSumErr; iErr++){
296 Int_t numOfErr = stream.GetErrors(ddl,iErr);
297 GetRawsData(ddl)->Fill(iErr,numOfErr);
298 ((TH2I*)GetRawsData(14+14+42+42))->Fill(iErr,ddl,iErr); //
299 }
300
301 numPadsInDdl= stream.GetNPads();
302 ddlOcc[ddl] = numPadsInDdl;
a2741b47 303 GetRawsData(14+14+42+42+6)->Fill(ddl+1,numPadsInDdl/11520.0*100.0);
304
c9d2a880 305 //___ loop on pads from raw data from a ddl
306 for(Int_t iPad=0;iPad<numPadsInDdl;iPad++) {
307 AliHMPIDDigit dig(stream.GetPadArray()[iPad],stream.GetChargeArray()[iPad]);dig.Raw(word,Nddl,r,d,a);
308 //for DQM shifter
309 ((TH2F*)GetRawsData(14+14+42+42+3))->Fill(dig.PadChX(), dig.Ch()*144+dig.PadChY(),dig.Q());
a2741b47 310 ((TH2F*)GetRawsData(14+14+42+42+4))->Fill(dig.Q(),(ddl/2*6)+dig.PadChY()/24,dig.Q());
311
c9d2a880 312 GetRawsData(ddl+14)->Fill(r,d);
313 GetRawsData(28+stream.Pc(Nddl,r,d,a)+6*AliHMPIDParam::DDL2C(ddl))->Fill(stream.PadPcX(Nddl,r,d,a),stream.PadPcY(Nddl,r,d,a));
314 GetRawsData(70+stream.Pc(Nddl,r,d,a)+6*AliHMPIDParam::DDL2C(ddl))->Fill(stream.GetChargeArray()[iPad]);
a2741b47 315 // GetRawsData(14+14+42+42+6)->Fill(ddl+1,1);
c9d2a880 316 }//pad loop
317 }
318 }//next
319
320
321 if(isHMPin > 0) fEvtRaw++;
a39cc5ff 322
323
c9d2a880 324}//MakeRaws
44ed7a66 325//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6252ceeb 326void AliHMPIDQADataMakerRec::MakeDigits()
44ed7a66 327{
328 //
329 //filling QA histos for Digits
330 //
eca4fa66 331
6252ceeb 332 Int_t i = fChannel ;
333 GetDigitsData(0)->Fill(i,fDigitsArray->GetEntriesFast()/(48.*80.*6.));
334 TIter next(fDigitsArray);
335 AliHMPIDDigit * digit;
336 while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
337 GetDigitsData(1)->Fill(10.*i+digit->Pc(),1./(48.*80.));
338 GetDigitsData(2+i)->Fill(digit->PadChX(),digit->PadChY());
339 GetDigitsData(9+i*6+digit->Pc())->Fill(digit->Q());
340 }
341}
44ed7a66 342
44ed7a66 343//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
d9719df1 344void AliHMPIDQADataMakerRec::MakeDigits(TTree * digTree)
44ed7a66 345{
346 //
347 //Opening the Digit Tree
348 //
eca4fa66 349
6252ceeb 350 if(fDigitsArray)
351 fDigitsArray->Clear() ;
352 else
353 fDigitsArray=new TClonesArray("AliHMPIDDigit");
44ed7a66 354
355 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
6252ceeb 356 fChannel = iCh ;
357 fDigitsArray->Clear() ;
d9719df1 358 TBranch *branch = digTree->GetBranch(Form("HMPID%d",iCh));
359 branch->SetAddress(&fDigitsArray);
360 branch->GetEntry(0);
6252ceeb 361 MakeDigits();
44ed7a66 362 }
44ed7a66 363}
364
ec575c20 365//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cc1abc7f 366void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
367{
368 //
369 //filling QA histos for clusters
370 //
7656d8ac 371 AliHMPIDParam *pPar =AliHMPIDParam::Instance();
6252ceeb 372
373 if (fRecPointsArray)
374 fRecPointsArray->Clear() ;
375 else
376 fRecPointsArray = new TClonesArray("AliHMPIDCluster");
c2df1ef0 377
aa21372e 378 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
379 TBranch *branch = clustersTree->GetBranch(Form("HMPID%d",iCh));
6252ceeb 380 branch->SetAddress(&fRecPointsArray);
04236e67 381 branch->GetEntry(0);
6252ceeb 382 GetRecPointsData(0)->Fill(iCh,fRecPointsArray->GetEntries());
383 TIter next(fRecPointsArray);
04236e67 384 AliHMPIDCluster *clu;
cc1abc7f 385 while ( (clu = dynamic_cast<AliHMPIDCluster *>(next())) ) {
aa21372e 386 GetRecPointsData(1)->Fill(clu->Status(),iCh);
387 Int_t sect = pPar->InHVSector(clu->Y());
388 if(clu->Q()>100) GetRecPointsData(2+iCh)->Fill(clu->Size());
389 else {
390 GetRecPointsData(2+7+iCh)->Fill(clu->Size());
6252ceeb 391 GetRecPointsData(2+14+iCh*6+sect)->Fill(clu->Q());
aa21372e 392 }
393 GetRecPointsData(2+14+42+iCh*6+sect)->Fill(clu->Q());
04236e67 394 }
395 }
04236e67 396}
ec575c20 397//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
04236e67 398void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
399{
cc1abc7f 400 //
04236e67 401 //fills QA histos for ESD
cc1abc7f 402 //
6252ceeb 403
04236e67 404 for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
405 AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
cc1abc7f 406 GetESDsData(0)->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal());
407 GetESDsData(1)->Fill( pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
04236e67 408 Float_t xm,ym; Int_t q,np;
409 pTrk->GetHMPIDmip(xm,ym,q,np); //mip info
04236e67 410 Float_t xRad,yRad,th,ph;
411 pTrk->GetHMPIDtrk(xRad,yRad,th,ph); //track info at the middle of the radiator
412 Float_t xPc = xRad+9.25*TMath::Tan(th)*TMath::Cos(ph); // temporar: linear extrapol (B=0!)
413 Float_t yPc = yRad+9.25*TMath::Tan(th)*TMath::Sin(ph); // temporar: "
7656d8ac 414 GetESDsData(2)->Fill(xm-xPc,ym-yPc); //track info
415 if(pTrk->GetHMPIDsignal()>0) {
416 Double_t a = 1.292*1.292*TMath::Cos(pTrk->GetHMPIDsignal())*TMath::Cos(pTrk->GetHMPIDsignal())-1.;
417 if(a > 0) {
418 Double_t mass = pTrk->P()*TMath::Sqrt(1.292*1.292*TMath::Cos(pTrk->GetHMPIDsignal())*TMath::Cos(pTrk->GetHMPIDsignal())-1.);
419 GetESDsData(3)->Fill( pTrk->GetP(),mass);
420 }
421 }
422 Double_t pid[5] ; pTrk->GetHMPIDpid(pid) ;
cc1abc7f 423 for(Int_t i = 0 ; i < 5 ; i++) GetESDsData(4+i)->Fill(pid[i]) ;
424 }
425}
ec575c20 426//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cc1abc7f 427void AliHMPIDQADataMakerRec::StartOfDetectorCycle()
428{
429 //Detector specific actions at start of cycle
430
431}
ec575c20 432//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cc1abc7f 433
4e25ac79 434void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray **histos)
cc1abc7f 435{
436 //Detector specific actions at end of cycle
437 // do the QA checking
4e25ac79 438 if(task==AliQAv1::kRAWS) {
57acd2d2 439 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
6252ceeb 440 if (! IsValidEventSpecie(specie, histos) )
eca4fa66 441 continue ;
57acd2d2 442 for(Int_t iddl=0;iddl<14;iddl++) {
443 TH1F *h = (TH1F*)histos[specie]->At(14+iddl); //ddl histos scaled by the number of events
a2741b47 444 if(fEvtRaw>0) h->Scale(1.0/(Float_t)fEvtRaw);
c9d2a880 445 }//ddl loop
a2741b47 446
c9d2a880 447 TH2F *h2 = (TH2F*)histos[specie]->At(14+14+42+42+3);
8d9917bf 448 if(fEvtRaw>0) h2->Scale(1.0/(Float_t)fEvtRaw);
c9d2a880 449
450 TH2F *h3 = (TH2F*)histos[specie]->At(14+14+42+42+4);
a2741b47 451 if(fEvtRaw>0) h3->Scale(1.0/(Float_t)fEvtRaw);
c9d2a880 452
a2741b47 453
a2741b47 454 Double_t binval=0,binerr=0;
455
c9d2a880 456 TH1F *h4 = (TH1F*)histos[specie]->At(14+14+42+42+1);
a2741b47 457 TProfile *h4prf = (TProfile*)histos[specie]->At(14+14+42+42+5);
458 for(Int_t iddl=1;iddl<=14;iddl++)
459 {
460 binval=h4prf->GetBinContent(iddl); binerr=h4prf->GetBinError(iddl);
461 h4->SetBinContent(iddl,binval); h4->SetBinError(iddl,binerr);
462 }
463 //if(fEvtRaw>0) h4->Scale(1./(Float_t)fEvtRaw);
8d9917bf 464
c9d2a880 465 TH1F *h5 = (TH1F*)histos[specie]->At(14+14+42+42+2);
a2741b47 466 TProfile *h5prf = (TProfile*)histos[specie]->At(14+14+42+42+6);
467 for(Int_t iddl=1;iddl<=14;iddl++)
468 {
469 binval=h5prf->GetBinContent(iddl); binerr=h5prf->GetBinError(iddl);
470 h5->SetBinContent(iddl,binval); h5->SetBinError(iddl,binerr);
471 }
472
473 //if(fEvtRaw>0) h5->Scale(1./(Float_t)fEvtRaw/11520.0*100.0);
a2741b47 474
c9d2a880 475 }//specie loop
476 }//RAWS
477
478 AliQAChecker::Instance()->Run(AliQAv1::kHMPID, task, histos);
479
480
481}
482//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++