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 **************************************************************************/
20 // Produces the data needed to calculate the quality assurance.
21 // All data must be mergeable objects.
25 // --- ROOT system ---
26 #include <TClonesArray.h>
31 #include <TDirectory.h>
32 #include <Riostream.h>
33 // --- Standard library ---
35 // --- AliRoot header files ---
36 #include "AliESDCaloCluster.h"
37 #include "AliESDEvent.h"
39 #include "AliHMPIDDigit.h"
40 #include "AliHMPIDHit.h"
41 #include "AliHMPIDCluster.h"
42 #include "AliHMPIDQualAssDataMaker.h"
44 ClassImp(AliHMPIDQualAssDataMaker)
46 //____________________________________________________________________________
47 AliHMPIDQualAssDataMaker::AliHMPIDQualAssDataMaker() :
48 AliQualAssDataMaker(AliQualAss::GetDetName(AliQualAss::kHMPID), "HMPID Quality Assurance Data Maker"),
66 for(Int_t i=0; i<7; i++) fhHitMap[i]=0x0;
67 for(Int_t j=0; j<5; j++) fhPid[j]=0x0;
68 fDetectorDir = fOutput->GetDirectory(GetName()) ;
70 fDetectorDir = fOutput->mkdir(GetName()) ;
73 //____________________________________________________________________________
74 AliHMPIDQualAssDataMaker::AliHMPIDQualAssDataMaker(const AliHMPIDQualAssDataMaker& qadm) :
75 AliQualAssDataMaker(),
76 fhHitQdc(qadm.fhHitQdc),
77 fhSDigits(qadm.fhSDigits),
78 fhDigPcEvt(qadm.fhDigPcEvt),
79 fhDigChEvt(qadm.fhDigChEvt),
81 fhCluEvt(qadm.fhCluEvt),
82 fhCluChi2(qadm.fhCluChi2),
84 fhCluFlg(qadm.fhCluFlg),
85 fhCluSize(qadm.fhCluSize),
86 fhMipCluSize(qadm.fhMipCluSize),
87 fhCkovP(qadm.fhCkovP),
89 fhMipXY(qadm.fhMipXY),
93 for(Int_t i=0; i<7; i++) fhHitMap[i]=qadm.fhHitMap[i];
94 for(Int_t j=0; j<5; j++) fhPid[j]=qadm.fhPid[j];
96 SetName((const char*)qadm.GetName()) ;
97 SetTitle((const char*)qadm.GetTitle());
100 //__________________________________________________________________
101 AliHMPIDQualAssDataMaker& AliHMPIDQualAssDataMaker::operator = (const AliHMPIDQualAssDataMaker& qadm )
104 this->~AliHMPIDQualAssDataMaker();
105 new(this) AliHMPIDQualAssDataMaker(qadm);
109 //____________________________________________________________________________
110 void AliHMPIDQualAssDataMaker::InitHits()
112 // create Hits histograms in Hits subdir
113 fhHitQdc=new TH1F("HitQdc","HMPID Hit Qdc all chamber;QDC",500,0,4000);
114 for(Int_t iCh=0;iCh<7;iCh++) fhHitMap[iCh]=new TH2F(Form("HMPID HitMap%i",iCh),Form("Ch%i;x_{Hit};y_{Hit}",iCh),162,-1,161,146,-1,145);
117 //____________________________________________________________________________
118 void AliHMPIDQualAssDataMaker::InitDigits()
120 // create Digits histograms in Digits subdir
121 fhDigPcEvt=new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
122 fhDigChEvt=new TH1F("hDigChEvt","Chamber occupancy",32,-1,7);
123 fhDigQ =new TH1F("Q "," digit charge ",3000,0,3000);
126 //____________________________________________________________________________
127 void AliHMPIDQualAssDataMaker::InitSDigits()
129 // create SDigits histograms in SDigits subdir
130 fhSDigits = new TH1F("hHmpidSDigits", "SDigits Q distribution in HMPID", 500, 0., 5000.) ;
133 //____________________________________________________________________________
135 void AliHMPIDQualAssDataMaker::InitRecPoints()
137 // create cluster histograms in RecPoint subdir
138 fhCluEvt=new TH1F("CluPerEvt","# clusters per chamber",16,-1,7);
139 fhCluChi2 =new TH1F("CluChi2" ,"Chi2 " ,1000,0,100);
140 fhCluQ =new TH1F("CluQ" ,"Cluster charge" ,3000,0,3000);
141 fhCluFlg =new TH1F("CluFlg" ,"Cluster flag" ,14,-1.5,12.5);
142 fhCluSize =new TH1F("CluSize" ,"Raw cluster size ",100,0,100);
143 fhMipCluSize =new TH1F("MipCluSize" ,"Mip cluster size ",100,0,100);
145 //____________________________________________________________________________
146 void AliHMPIDQualAssDataMaker::InitESDs()
148 //create ESDs histograms in ESDs subdir
149 fhCkovP = new TH2F("CkovP" , "#theta_{c}, [rad];P, [GeV]" , 150, 0, 7 ,100, 0, 1) ;
150 fhSigP = new TH2F("SigP" ,"#sigma_{#theta_c} [mrad];[GeV]", 150, 0, 7 ,100, 0, 1) ;
151 fhMipXY = new TH2F("MipXY" ,"mip position" , 260, 0,130 ,252, 0,126) ;
152 fhDifXY = new TH2F("DifXY" ,"diff" , 200, -10, 10 ,200,-10,10) ;
153 fhPid[0] = new TH1F("PidE" ,"PID: e yellow #mu magenta" ,100,0,1) ;
154 fhPid[1] = new TH1F("PidMu","pid of #mu" ,100,0,1) ;
155 fhPid[2] = new TH1F("PidPi","PID: #pi red K green p blue",100,0,1) ;
156 fhPid[3] = new TH1F("PidK" ,"pid of K" ,100,0,1) ;
157 fhPid[4] = new TH1F("PidP" ,"pid of p" ,100,0,1) ;
160 //____________________________________________________________________________
161 void AliHMPIDQualAssDataMaker::MakeHits()
163 //fills QA histos for Hits
164 TClonesArray * hits = dynamic_cast<TClonesArray*>(fData) ;
167 while ( hit = dynamic_cast<AliHMPIDHit *>(next()) ) {
168 if(hit->Pid()<500000) fhHitQdc->Fill(hit->Q()) ;
169 if(hit->Pid()<500000) fhHitMap[hit->Ch()]->Fill(hit->LorsX(),hit->LorsY());
173 //____________________________________________________________________________
174 void AliHMPIDQualAssDataMaker::MakeDigits()
176 //fills QA histos for Digits
177 TObjArray *chambers = dynamic_cast<TObjArray*>(fData);
178 for(Int_t i =0; i< chambers->GetEntries(); i++)
180 TClonesArray * digits = dynamic_cast<TClonesArray*>(chambers->At(i));
181 fhDigChEvt->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
183 AliHMPIDDigit * digit;
184 while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
185 fhDigPcEvt->Fill(10.*i+digit->Pc(),1./(48.*80.));
186 fhDigQ->Fill(digit->Q());
191 //____________________________________________________________________________
192 void AliHMPIDQualAssDataMaker::MakeSDigits()
194 //fills QA histos for SDigits
195 TClonesArray * sdigits = dynamic_cast<TClonesArray*>(fData) ;
196 AliHMPIDDigit *ref = (AliHMPIDDigit *)sdigits->At(0);
197 Float_t zero = ref->GetTrack(0);
198 TIter next(sdigits) ;
199 AliHMPIDDigit * sdigit ;
200 while ( (sdigit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
201 fhSDigits->Fill(sdigit->Q()) ;
202 if(zero == sdigit->GetTrack(0)) continue;
203 else zero == sdigit->GetTrack(0);
207 void AliHMPIDQualAssDataMaker::MakeRecPoints()
209 //fills QA histos for clusters
210 TObjArray *chambers = dynamic_cast<TObjArray*>(fData);
212 for(Int_t i =0; i< chambers->GetEntries(); i++)
214 TClonesArray * clusters = dynamic_cast<TClonesArray*>(chambers->At(i));
215 fhCluEvt->Fill(i,clusters->GetEntries());
216 TIter next(clusters);
217 AliHMPIDCluster *clu;
218 while ( (clu = dynamic_cast<AliHMPIDCluster *>(next())) ) {;
219 fhCluFlg->Fill(clu->Status()); fhCluChi2->Fill(clu->Chi2()); fhCluSize->Fill(clu->Size());
220 fhCluQ->Fill(clu->Q());
223 fhMipCluSize->SetTitle(Form("Mip cluster size at a Qcut = %i ADC",qCut));
224 fhMipCluSize->Fill(clu->Size());
230 //____________________________________________________________________________
231 void AliHMPIDQualAssDataMaker::MakeESDs()
233 //fills QA histos for ESD
234 AliESDEvent * esd = dynamic_cast<AliESDEvent*>(fData) ;
235 for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
236 AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
237 fhCkovP->Fill(pTrk->GetP(),pTrk->GetHMPIDsignal());
238 fhSigP->Fill( pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
239 Float_t xm,ym; Int_t q,np;
240 pTrk->GetHMPIDmip(xm,ym,q,np); //mip info
241 fhMipXY->Fill(xm,ym);
242 Float_t xRad,yRad,th,ph;
243 pTrk->GetHMPIDtrk(xRad,yRad,th,ph); //track info at the middle of the radiator
244 Float_t xPc = xRad+9.25*TMath::Tan(th)*TMath::Cos(ph); // temporar: linear extrapol (B=0!)
245 Float_t yPc = yRad+9.25*TMath::Tan(th)*TMath::Sin(ph); // temporar: "
246 fhDifXY->Fill(xm-xPc,ym-yPc); //track info
247 Double_t pid[5] ; pTrk->GetHMPIDpid(pid) ;
248 for(Int_t i = 0 ; i < 5 ; i++) fhPid[i]->Fill(pid[i]) ;