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 "AliHMPIDQADataMakerSim.h"
37 #include "AliHMPIDParam.h"
38 #include "AliHMPIDRawStream.h"
40 ClassImp(AliHMPIDQADataMakerSim)
42 //____________________________________________________________________________
43 AliHMPIDQADataMakerSim::AliHMPIDQADataMakerSim() :
44 AliQADataMakerSim(AliQA::GetDetName(AliQA::kHMPID), "HMPID Quality Assurance Data Maker")
49 //____________________________________________________________________________
50 AliHMPIDQADataMakerSim::AliHMPIDQADataMakerSim(const AliHMPIDQADataMakerSim& qadm) :
54 SetName((const char*)qadm.GetName()) ;
55 SetTitle((const char*)qadm.GetTitle());
58 //__________________________________________________________________
59 AliHMPIDQADataMakerSim& AliHMPIDQADataMakerSim::operator = (const AliHMPIDQADataMakerSim& qadm )
62 this->~AliHMPIDQADataMakerSim();
63 new(this) AliHMPIDQADataMakerSim(qadm);
67 //____________________________________________________________________________
68 void AliHMPIDQADataMakerSim::InitHits()
70 // create Hits histograms in Hits subdir
71 TH1F *hHitQdc=new TH1F("HitQdc","HMPID Hit Qdc all chamber;QDC",500,0,4000);
72 Add2HitsList(hHitQdc,0);
74 for(Int_t iCh=0;iCh<7;iCh++) {
75 hHitMap[iCh]=new TH2F(Form("HMPID HitMap%i",iCh),Form("Ch%i;x_{Hit};y_{Hit}",iCh),162,-1,161,146,-1,145);
76 Add2HitsList(hHitMap[iCh],iCh+1);
81 //____________________________________________________________________________
82 void AliHMPIDQADataMakerSim::InitDigits()
84 // create Digits histograms in Digits subdir
85 TH1F *hDigPcEvt = new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
86 TH1F *hDigQ = new TH1F("Q ","Charge of digits (ADC) ",3000,0,3000);
87 TH1F *hDigChEvt = new TH1F("hDigChEvt","Chamber occupancy per event",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
89 TProfile *tDigHighQ = new TProfile("tDigHighQ","Highest charge in chamber ",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
90 TProfile *tDigChEvt = new TProfile("tDigChEvt","Chamber occupancy per event (profile)",AliHMPIDParam::kMaxCh+1,AliHMPIDParam::kMinCh,AliHMPIDParam::kMaxCh+1);
92 Add2DigitsList(hDigPcEvt,0);
93 Add2DigitsList(hDigQ ,1);
94 Add2DigitsList(hDigChEvt,2);
95 Add2DigitsList(tDigHighQ,3);
96 Add2DigitsList(tDigChEvt,4);
99 //____________________________________________________________________________
100 void AliHMPIDQADataMakerSim::InitSDigits()
102 // create SDigits histograms in SDigits subdir
103 TH1F *hSDigits = new TH1F("hHmpidSDigits", "SDigits Q distribution in HMPID", 500, 0., 5000.) ;
105 Add2SDigitsList(hSDigits,0);
108 //____________________________________________________________________________
110 void AliHMPIDQADataMakerSim::MakeHits(TClonesArray * data)
113 //filling QA histos for Hits
115 TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
117 AliError("Wrong type of hits container") ;
121 while ( (hit = dynamic_cast<AliHMPIDHit *>(next())) ) {
122 if(hit->Pid()<500000) GetHitsData(0)->Fill(hit->Q()) ;
123 if(hit->Pid()<500000) GetHitsData(hit->Ch()+1)->Fill(hit->LorsX(),hit->LorsY());
128 //___________________________________________________________________________
129 void AliHMPIDQADataMakerSim::MakeHits(TTree * data)
132 //Opening of the Hit TTree
134 TClonesArray *pHits=new TClonesArray("AliHMPIDHit"); data->SetBranchAddress("HMPID",&pHits);
135 for(Int_t iEnt=0;iEnt<data->GetEntriesFast();iEnt++){//entries loop
136 data->GetEntry(iEnt);
140 //____________________________________________________________________________
141 void AliHMPIDQADataMakerSim::MakeDigits(TClonesArray * data)
144 //filling QA histos for Digits
146 TObjArray *chamber = dynamic_cast<TObjArray*>(data);
148 AliError("Wrong type of digits container") ;
150 for(Int_t i =0; i< chamber->GetEntries(); i++)
152 TClonesArray * digits = dynamic_cast<TClonesArray*>(chamber->At(i));
153 GetDigitsData(2)->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
154 GetDigitsData(4)->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
157 AliHMPIDDigit * digit;
158 while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
159 GetDigitsData(0)->Fill(10.*i+digit->Pc(),1./(48.*80.));
160 GetDigitsData(1)->Fill(digit->Q());
161 if(digit->Q()>highQ) highQ = digit->Q();
163 GetDigitsData(3)->Fill(i,highQ);
168 //___________________________________________________________________________
169 void AliHMPIDQADataMakerSim::MakeDigits(TTree * data)
172 //Opening the Digit Tree
174 TObjArray *pObjDig=new TObjArray(AliHMPIDParam::kMaxCh+1);
175 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
176 TClonesArray *pCA=new TClonesArray("AliHMPIDDigit");
177 pObjDig->AddAt(pCA,iCh);
180 pObjDig->SetOwner(kTRUE);
182 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){
183 data->SetBranchAddress(Form("HMPID%i",iCh),&(*pObjDig)[iCh]);
187 MakeDigits((TClonesArray *)pObjDig);
189 //____________________________________________________________________________
191 void AliHMPIDQADataMakerSim::MakeSDigits(TClonesArray * data)
194 //filling QA histos for SDigits
196 TClonesArray * sdigits = dynamic_cast<TClonesArray *>(data) ;
198 AliError("Wrong type of sdigits container") ;
200 TIter next(sdigits) ;
201 AliHMPIDDigit * sdigit ;
202 while ( (sdigit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
203 GetSDigitsData(0)->Fill(sdigit->Q());
207 //___________________________________________________________________________
208 void AliHMPIDQADataMakerSim::MakeSDigits(TTree * data)
211 // Opening the SDigit Tree
213 TClonesArray * sdigits = new TClonesArray("AliHMPIDDigit", 1000) ;
215 TBranch * branch = data->GetBranch("HMPID") ;
217 AliError("HMPID SDigit Tree not found") ;
220 branch->SetAddress(&sdigits) ;
221 branch->GetEntry(0) ;
222 MakeSDigits(sdigits) ;
224 //____________________________________________________________________________
225 void AliHMPIDQADataMakerSim::StartOfDetectorCycle()
227 //Detector specific actions at start of cycle
231 void AliHMPIDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX, TObjArray *)
233 //Detector specific actions at end of cycle
234 // do the QA checking
235 // AliQAChecker::Instance()->Run(AliQA::kHMPID, task, obj) ;