1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 // --- ROOT system ---
20 #include <TClonesArray.h>
25 #include <Riostream.h>
26 // --- Standard library ---
28 // --- AliRoot header files ---
29 #include "AliESDCaloCluster.h"
30 #include "AliESDEvent.h"
31 #include "AliQAChecker.h"
33 #include "AliHMPIDDigit.h"
34 #include "AliHMPIDHit.h"
35 #include "AliHMPIDCluster.h"
36 #include "AliHMPIDQADataMakerRec.h"
37 #include "AliHMPIDParam.h"
38 #include "AliHMPIDRawStream.h"
40 ClassImp(AliHMPIDQADataMakerRec)
42 //____________________________________________________________________________
43 AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec() :
44 AliQADataMakerRec(AliQA::GetDetName(AliQA::kHMPID), "HMPID Quality Assurance Data Maker")
49 //____________________________________________________________________________
50 AliHMPIDQADataMakerRec::AliHMPIDQADataMakerRec(const AliHMPIDQADataMakerRec& qadm) :
54 SetName((const char*)qadm.GetName()) ;
55 SetTitle((const char*)qadm.GetTitle());
58 //__________________________________________________________________
59 AliHMPIDQADataMakerRec& AliHMPIDQADataMakerRec::operator = (const AliHMPIDQADataMakerRec& qadm )
62 this->~AliHMPIDQADataMakerRec();
63 new(this) AliHMPIDQADataMakerRec(qadm);
67 //____________________________________________________________________________
69 void AliHMPIDQADataMakerRec::InitRecPoints()
71 // create cluster histograms in RecPoint subdir
73 TH1F *hCluEvt=new TH1F("CluPerEvt","Cluster multiplicity" ,100,0,100);
74 TH1F *hCluChi2 =new TH1F("CluChi2" ,"Chi2 " ,1000,0,100);
75 TH1F *hCluFlg =new TH1F("CluFlg" ,"Cluster flag" ,14,-1.5,12.5); hCluFlg->SetFillColor(5);
76 TH1F *hCluSize =new TH1F("CluSize" ,"Cluster size ",100,0,100);
77 TH1F *hCluQ =new TH1F("CluQ" ,"Cluster charge (ADC)",1000,0,5000);
79 Add2RecPointsList(hCluEvt , 0);
80 Add2RecPointsList(hCluChi2, 1);
81 Add2RecPointsList(hCluFlg , 2);
82 Add2RecPointsList(hCluSize, 3);
83 Add2RecPointsList(hCluQ , 4);
85 //____________________________________________________________________________
87 void AliHMPIDQADataMakerRec::InitRaws()
90 // Booking QA histo for Raw data
92 const Int_t nerr = (Int_t)AliHMPIDRawStream::kSumErr+1;
93 TH1F *hqPad[14], *hSumErr[14];
95 for(Int_t iddl =0; iddl<AliHMPIDRawStream::kNDDL; iddl++) {
96 hqPad[iddl] = new TH1F(Form("hqPadDDL%i",iddl), Form("Pad Q Entries at DDL %i",iddl), 500,0,5000);
97 Add2RawsList(hqPad[iddl],iddl);
98 hSumErr[iddl] = new TH1F(Form("SumErrDDL%i",iddl), Form("Error summary for ddl %i",iddl), 2*nerr,0,2*nerr);
99 hSumErr[iddl]->SetYTitle("%");
101 for(Int_t ilabel=0; ilabel< nerr; ilabel++) {
102 hSumErr[iddl]->GetXaxis()->CenterLabels(kTRUE);
103 //hSumErr[iddl]->GetXaxis()->SetBinLabel((2*ilabel+1),Form("%i %s",ilabel+1,hnames[ilabel]));
104 hSumErr[iddl]->GetXaxis()->SetBinLabel((2*ilabel+1),Form("%i %s",ilabel+1,AliHMPIDRawStream::GetErrName(ilabel)));
107 Add2RawsList(hSumErr[iddl],iddl+14);
109 TH1F *hNevRaws = new TH1F("NevRaws","Events per DDL",15,0,15);
110 Add2RawsList(hNevRaws,28);
112 //____________________________________________________________________________
113 void AliHMPIDQADataMakerRec::InitESDs()
116 //Booking ESDs histograms
117 TH2F* hCkovP = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]" , 150, 0, 7 ,100, 0, 1) ;
118 TH2F* hSigP = new TH2F("SigP" ,"#sigma_{#theta_c} [mrad];[GeV]", 150, 0, 7 ,100, 0, 1) ;
119 TH2F* hMipXY = new TH2F("MipXY" ,"mip position" , 260, 0,130 ,252, 0,126) ;
120 TH2F* hDifXY = new TH2F("DifXY" ,"diff" , 200, -10, 10 ,200,-10,10) ;
122 hPid[0] = new TH1F("PidE" ,"electron response" , 101, -0.005,1.005) ;
123 hPid[1] = new TH1F("PidMu","#mu response" , 101, -0.005,1.005) ;
124 hPid[2] = new TH1F("PidPi","#pi response" , 101, -0.005,1.005) ;
125 hPid[3] = new TH1F("PidK" ,"K response" , 101, -0.005,1.005) ;
126 hPid[4] = new TH1F("PidP" ,"p response" ,101, -0.005,1.005) ;
128 Add2ESDsList(hCkovP,0);
129 Add2ESDsList(hSigP ,1);
130 Add2ESDsList(hMipXY,2);
131 Add2ESDsList(hDifXY,3);
132 for(Int_t i=0; i< 5; i++) Add2ESDsList(hPid[i],i+4);
134 //____________________________________________________________________________
135 void AliHMPIDQADataMakerRec::MakeRaws(AliRawReader *rawReader)
138 // Filling Raws QA histos
140 AliHMPIDRawStream stream(rawReader);
144 UInt_t ddl=stream.GetDDLNumber(); //returns 0,1,2 ... 13
146 for(Int_t iPad=0;iPad<stream.GetNPads();iPad++) {
147 GetRawsData(ddl)->Fill(stream.GetChargeArray()[iPad]);}
149 GetRawsData(28)->Fill(ddl);
151 for(Int_t iErr =1; iErr<(Int_t)AliHMPIDRawStream::kSumErr; iErr++){
153 Int_t NumOfErr = stream.GetErrors(ddl,iErr);
155 GetRawsData(ddl+14)->Fill(iErr,NumOfErr);
160 //___________________________________________________________________________
161 void AliHMPIDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
164 //filling QA histos for clusters
166 TClonesArray *clusters = new TClonesArray("AliHMPIDCluster");
167 for(int i=AliHMPIDParam::kMinCh;i<=AliHMPIDParam::kMaxCh;i++){
168 TBranch *branch = clustersTree->GetBranch(Form("HMPID%d",i));
169 branch->SetAddress(&clusters);
172 GetRecPointsData(0)->Fill(i,clusters->GetEntries());
173 TIter next(clusters);
174 AliHMPIDCluster *clu;
175 while ( (clu = dynamic_cast<AliHMPIDCluster *>(next())) ) {
176 GetRecPointsData(1)->Fill(clu->Chi2());
177 GetRecPointsData(2)->Fill(clu->Status());
178 GetRecPointsData(3)->Fill(clu->Size());
179 GetRecPointsData(4)->Fill(clu->Q());
187 //____________________________________________________________________________
188 void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
191 //fills QA histos for ESD
193 for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
194 AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
195 GetESDsData(0)->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal());
196 GetESDsData(1)->Fill( pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
197 Float_t xm,ym; Int_t q,np;
198 pTrk->GetHMPIDmip(xm,ym,q,np); //mip info
199 GetESDsData(2)->Fill(xm,ym);
200 Float_t xRad,yRad,th,ph;
201 pTrk->GetHMPIDtrk(xRad,yRad,th,ph); //track info at the middle of the radiator
202 Float_t xPc = xRad+9.25*TMath::Tan(th)*TMath::Cos(ph); // temporar: linear extrapol (B=0!)
203 Float_t yPc = yRad+9.25*TMath::Tan(th)*TMath::Sin(ph); // temporar: "
204 GetESDsData(3)->Fill(xm-xPc,ym-yPc); //track info
205 Double_t pid[5] ; pTrk->GetHMPIDpid(pid) ;
206 for(Int_t i = 0 ; i < 5 ; i++) GetESDsData(4+i)->Fill(pid[i]) ;
209 //____________________________________________________________________________
210 void AliHMPIDQADataMakerRec::StartOfDetectorCycle()
212 //Detector specific actions at start of cycle
216 void AliHMPIDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray *)
218 //Detector specific actions at end of cycle
219 // do the QA checking
220 //AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj);
221 //if(task==AliQA::kRAWS){
223 // for(Int_t iddl=0; iddl<14; iddl++)
225 // if(GetRawsData(28)->GetBinContent(iddl)!=0) GetRawsData(iddl+14)->Scale(100./GetRawsData(28)->GetBinContent(iddl));