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 ---
37 #include "AliHMPIDDigit.h"
38 #include "AliHMPIDHit.h"
39 #include "AliHMPIDQADataMakerSim.h"
41 ClassImp(AliHMPIDQADataMakerSim)
43 //____________________________________________________________________________
44 AliHMPIDQADataMakerSim::AliHMPIDQADataMakerSim() :
45 AliQADataMakerSim(AliQA::GetDetName(AliQA::kHMPID), "HMPID Quality Assurance Data Maker"),
63 for(Int_t i=0; i<7; i++) fhHitMap[i]=0x0;
64 // for(Int_t j=0; j<5; j++) fhPid[j]=0x0;
65 // fDetectorDir = fOutput->GetDirectory(GetName()) ;
67 // fDetectorDir = fOutput->mkdir(GetName()) ;
70 //____________________________________________________________________________
71 AliHMPIDQADataMakerSim::AliHMPIDQADataMakerSim(const AliHMPIDQADataMakerSim& qadm) :
73 fhHitQdc(qadm.fhHitQdc),
74 fhSDigits(qadm.fhSDigits),
75 fhDigPcEvt(qadm.fhDigPcEvt),
76 fhDigChEvt(qadm.fhDigChEvt),
78 // fhCluEvt(qadm.fhCluEvt),
79 // fhCluChi2(qadm.fhCluChi2),
80 // fhCluQ(qadm.fhCluQ),
81 // fhCluFlg(qadm.fhCluFlg),
82 // fhCluSize(qadm.fhCluSize),
83 // fhMipCluSize(qadm.fhMipCluSize),
84 // fhCkovP(qadm.fhCkovP),
85 // fhSigP(qadm.fhSigP),
86 // fhMipXY(qadm.fhMipXY),
87 // fhDifXY(qadm.fhDifXY)
90 for(Int_t i=0; i<7; i++) fhHitMap[i]=qadm.fhHitMap[i];
91 // for(Int_t j=0; j<5; j++) fhPid[j]=qadm.fhPid[j];
93 SetName((const char*)qadm.GetName()) ;
94 SetTitle((const char*)qadm.GetTitle());
97 //__________________________________________________________________
98 AliHMPIDQADataMakerSim& AliHMPIDQADataMakerSim::operator = (const AliHMPIDQADataMakerSim& qadm )
101 this->~AliHMPIDQADataMakerSim();
102 new(this) AliHMPIDQADataMakerSim(qadm);
106 //____________________________________________________________________________
107 void AliHMPIDQADataMakerSim::InitHits()
109 // create Hits histograms in Hits subdir
110 fhHitQdc=new TH1F("HitQdc","HMPID Hit Qdc all chamber;QDC",500,0,4000);
111 for(Int_t iCh=0;iCh<7;iCh++)
112 fhHitMap[iCh]=new TH2F(Form("HMPID HitMap%i",iCh),Form("Ch%i;x_{Hit};y_{Hit}",iCh),162,-1,161,146,-1,145);
115 //____________________________________________________________________________
116 void AliHMPIDQADataMakerSim::InitDigits()
118 // create Digits histograms in Digits subdir
119 fhDigPcEvt=new TH1F("hDigPcEvt","PC occupancy",156,-1,77);
120 fhDigChEvt=new TH1F("hDigChEvt","Chamber occupancy",32,-1,7);
121 fhDigQ =new TH1F("Q "," digit charge ",3000,0,3000);
124 //____________________________________________________________________________
125 void AliHMPIDQADataMakerSim::InitSDigits()
127 // create SDigits histograms in SDigits subdir
128 fhSDigits = new TH1F("hHmpidSDigits", "SDigits Q distribution in HMPID", 500, 0., 5000.) ;
131 //____________________________________________________________________________
132 void AliHMPIDQADataMakerSim::MakeHits(TObject * data)
134 //fills QA histos for Hits
135 TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
137 AliError("Wrong type of hits container") ;
141 while ( (hit = dynamic_cast<AliHMPIDHit *>(next())) ) {
142 if(hit->Pid()<500000) fhHitQdc->Fill(hit->Q()) ;
143 if(hit->Pid()<500000) fhHitMap[hit->Ch()]->Fill(hit->LorsX(),hit->LorsY());
148 //____________________________________________________________________________
149 void AliHMPIDQADataMakerSim::MakeDigits( TObject * data)
151 //fills QA histos for Digits
152 TObjArray *chambers = dynamic_cast<TObjArray*>(data);
154 AliError("Wrong type of digits container") ;
156 for(Int_t i =0; i< chambers->GetEntries(); i++)
158 TClonesArray * digits = dynamic_cast<TClonesArray*>(chambers->At(i));
159 fhDigChEvt->Fill(i,digits->GetEntriesFast()/(48.*80.*6.));
161 AliHMPIDDigit * digit;
162 while ( (digit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
163 fhDigPcEvt->Fill(10.*i+digit->Pc(),1./(48.*80.));
164 fhDigQ->Fill(digit->Q());
170 //____________________________________________________________________________
171 void AliHMPIDQADataMakerSim::MakeSDigits( TObject * data)
173 //fills QA histos for SDigits
174 TClonesArray * sdigits = dynamic_cast<TClonesArray *>(data) ;
176 AliError("Wrong type of sdigits container") ;
178 AliHMPIDDigit *ref = (AliHMPIDDigit *)sdigits->At(0);
179 Float_t zero = ref->GetTrack(0);
180 TIter next(sdigits) ;
181 AliHMPIDDigit * sdigit ;
182 while ( (sdigit = dynamic_cast<AliHMPIDDigit *>(next())) ) {
183 fhSDigits->Fill(sdigit->Q()) ;
184 if(zero == sdigit->GetTrack(0)) continue;
185 else zero = sdigit->GetTrack(0);