]>
Commit | Line | Data |
---|---|---|
508b9fc0 | 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: AliVZEROQADataMakerSim.cxx 23123 2007-12-18 09:08:18Z hristov $ */ | |
18 | ||
19 | //--- | |
20 | // Produces the data needed to calculate the quality assurance. | |
21 | // All data must be mergeable objects. | |
22 | // Author : BC | |
23 | //--- | |
24 | ||
25 | // --- ROOT system --- | |
26 | #include <TClonesArray.h> | |
27 | #include <TFile.h> | |
28 | #include <TH1F.h> | |
29 | #include <TDirectory.h> | |
30 | // --- Standard library --- | |
31 | ||
32 | // --- AliRoot header files --- | |
33 | #include "AliESDEvent.h" | |
34 | #include "AliLog.h" | |
35 | #include "AliVZEROdigit.h" | |
36 | #include "AliVZEROhit.h" | |
37 | #include "AliVZEROQADataMakerSim.h" | |
38 | #include "AliQAChecker.h" | |
39 | ||
40 | ClassImp(AliVZEROQADataMakerSim) | |
41 | ||
42 | //____________________________________________________________________________ | |
43 | AliVZEROQADataMakerSim::AliVZEROQADataMakerSim() : | |
44 | AliQADataMakerSim(AliQA::GetDetName(AliQA::kVZERO), "VZERO Quality Assurance Data Maker") | |
45 | ||
46 | { | |
47 | // constructor | |
48 | ||
49 | ||
50 | } | |
51 | ||
52 | //____________________________________________________________________________ | |
53 | AliVZEROQADataMakerSim::AliVZEROQADataMakerSim(const AliVZEROQADataMakerSim& qadm) : | |
54 | AliQADataMakerSim() | |
55 | { | |
56 | //copy constructor | |
57 | ||
58 | SetName((const char*)qadm.GetName()) ; | |
59 | SetTitle((const char*)qadm.GetTitle()); | |
60 | } | |
61 | ||
62 | //__________________________________________________________________ | |
63 | AliVZEROQADataMakerSim& AliVZEROQADataMakerSim::operator = (const AliVZEROQADataMakerSim& qadm ) | |
64 | { | |
65 | // Assign operator. | |
66 | this->~AliVZEROQADataMakerSim(); | |
67 | new(this) AliVZEROQADataMakerSim(qadm); | |
68 | return *this; | |
69 | } | |
70 | //____________________________________________________________________________ | |
71 | void AliVZEROQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list) | |
72 | { | |
73 | //Detector specific actions at end of cycle | |
74 | // do the QA checking | |
75 | AliQAChecker::Instance()->Run(AliQA::kVZERO, task, list) ; | |
76 | } | |
77 | ||
78 | ||
79 | //____________________________________________________________________________ | |
80 | void AliVZEROQADataMakerSim::InitHits() | |
81 | { | |
82 | // create Hits histograms in Hits subdir | |
83 | char timename[10]; | |
84 | char chargename[12]; | |
85 | TH1F *fhHitTime[72]; | |
86 | TH1F *fhHitCharge[72]; | |
87 | char texte[25]; | |
88 | ||
89 | // create Hits histograms in Hits subdir | |
90 | TH1F * h0 = new TH1F("hHitMultiplicity", "Hits multiplicity distribution in VZERO", 300, 0., 299.) ; | |
91 | h0->Sumw2() ; | |
92 | Add2HitsList(h0, 0) ; | |
93 | ||
94 | for (Int_t i=0; i<72; i++) | |
95 | { | |
96 | sprintf(timename,"hHitTime%d",i); | |
97 | sprintf(texte,"Hit Time in VZERO cell %d",i); | |
98 | fhHitTime[i] = new TH1F(timename,texte,300,0.,149.); | |
99 | ||
100 | sprintf(chargename,"hHitCharge%d",i); | |
101 | sprintf(texte,"Hit Charge in VZERO cell %d",i); | |
102 | fhHitCharge[i]= new TH1F(chargename,texte,1024,0.,1023.); | |
103 | ||
104 | Add2HitsList( fhHitTime[i],i+1); | |
105 | Add2HitsList( fhHitCharge[i],i+1+72); | |
106 | } | |
107 | ||
108 | } | |
109 | ||
110 | //____________________________________________________________________________ | |
111 | void AliVZEROQADataMakerSim::InitDigits() | |
112 | { | |
113 | // create Digits histograms in Digits subdir | |
114 | ||
115 | ||
116 | char TDCname[10]; | |
117 | char ADCname[12]; | |
118 | TH1F *fhDigTDC[64]; | |
119 | TH1F *fhDigADC[64]; | |
120 | char texte[30]; | |
121 | ||
122 | // create Digits histograms in Digits subdir | |
123 | TH1I * h0 = new TH1I("hDigitMultiplicity", "Digits multiplicity distribution in VZERO", 100, 0., 99.) ; | |
124 | h0->Sumw2() ; | |
125 | Add2DigitsList(h0, 0) ; | |
126 | ||
127 | for (Int_t i=0; i<64; i++) | |
128 | { | |
129 | sprintf(TDCname, "hDigitTDC%d", i); | |
130 | sprintf(texte,"Digit TDC in cell %d",i); | |
131 | fhDigTDC[i] = new TH1F(TDCname,texte,300,0.,149.); | |
132 | ||
133 | sprintf(ADCname,"hDigitADC%d",i); | |
134 | sprintf(texte,"Digit ADC in cell %d",i); | |
135 | fhDigADC[i]= new TH1F(ADCname,texte,1024,0.,1023.); | |
136 | ||
137 | Add2DigitsList(fhDigTDC[i],i+1); | |
138 | Add2DigitsList(fhDigADC[i],i+1+64); | |
139 | } | |
140 | } | |
141 | ||
142 | ||
143 | //____________________________________________________________________________ | |
144 | void AliVZEROQADataMakerSim::MakeHits(TClonesArray * hits) | |
145 | { | |
146 | //make QA data from Hits | |
147 | ||
148 | GetHitsData(0)->Fill(hits->GetEntriesFast()) ; // fills Hit multiplicity | |
149 | Int_t nhits = hits->GetEntriesFast(); | |
150 | for (Int_t ihit=0;ihit<nhits;ihit++) | |
151 | { | |
152 | AliVZEROhit * VZEROHit = (AliVZEROhit*) hits->UncheckedAt(ihit); | |
153 | if (!VZEROHit) { | |
154 | AliError("The unchecked hit doesn't exist"); | |
155 | break; | |
156 | } | |
157 | Int_t cell = VZEROHit->Cell(); | |
158 | GetHitsData(cell+1)->Fill(VZEROHit->Tof()); | |
159 | GetHitsData(cell+1+72)->Fill(VZEROHit->Charge()); | |
160 | } | |
161 | } | |
162 | ||
163 | ||
164 | //____________________________________________________________________________ | |
165 | ||
166 | void AliVZEROQADataMakerSim::MakeHits(TTree *hitTree) | |
167 | { | |
168 | //fills QA histos for Hits | |
169 | TClonesArray * hits = new TClonesArray("AliVZEROhit", 1000); | |
170 | ||
171 | TBranch * branch = hitTree->GetBranch("VZERO") ; | |
172 | if ( ! branch ) { | |
173 | AliWarning("VZERO branch in Hit Tree not found") ; | |
174 | } else { | |
175 | ||
176 | if (branch) { | |
177 | branch->SetAddress(&hits); | |
178 | }else{ | |
179 | AliError("Branch VZERO hit not found"); | |
180 | exit(111); | |
181 | } | |
182 | Int_t ntracks = (Int_t) hitTree->GetEntries(); | |
183 | ||
184 | if (ntracks<=0) return; | |
185 | // Start loop on tracks in the hits containers | |
186 | for (Int_t track=0; track<ntracks;track++) { | |
187 | branch->GetEntry(track); | |
188 | GetHitsData(0)->Fill(hits->GetEntriesFast()) ; // fills Hit multiplicity | |
189 | Int_t nhits = hits->GetEntriesFast(); | |
190 | for (Int_t ihit=0;ihit<nhits;ihit++) | |
191 | { | |
192 | AliVZEROhit * VZEROHit = (AliVZEROhit*) hits->UncheckedAt(ihit); | |
193 | if (!VZEROHit) { | |
194 | AliError("The unchecked hit doesn't exist"); | |
195 | break; | |
196 | } | |
197 | Int_t cell = VZEROHit->Cell(); | |
198 | GetHitsData(cell+1)->Fill(VZEROHit->Tof()); | |
199 | GetHitsData(cell+1+72)->Fill(VZEROHit->Charge()); | |
200 | } | |
201 | } | |
202 | } | |
203 | } | |
204 | ||
205 | ||
206 | //____________________________________________________________________________ | |
207 | void AliVZEROQADataMakerSim::MakeDigits(TClonesArray * digits) | |
208 | { | |
209 | // makes data from Digits | |
210 | ||
211 | GetDigitsData(0)->Fill(digits->GetEntriesFast()) ; | |
212 | TIter next(digits) ; | |
213 | AliVZEROdigit *VZERODigit ; | |
214 | while ( (VZERODigit = dynamic_cast<AliVZEROdigit *>(next())) ) { | |
215 | Int_t PMNumber = VZERODigit->PMNumber(); | |
216 | GetDigitsData(PMNumber +1)->Fill( VZERODigit->Time()) ; // in 100 of picoseconds | |
217 | GetDigitsData(PMNumber +1+64)->Fill( VZERODigit->ADC()) ; | |
218 | } | |
219 | } | |
220 | ||
221 | ||
222 | //____________________________________________________________________________ | |
223 | void AliVZEROQADataMakerSim::MakeDigits(TTree *digitTree) | |
224 | { | |
225 | // makes data from Digit Tree | |
226 | ||
227 | TClonesArray * digits = new TClonesArray("AliVZERODigit", 1000) ; | |
228 | ||
229 | TBranch * branch = digitTree->GetBranch("VZERO") ; | |
230 | if ( ! branch ) { | |
231 | AliWarning("VZERO branch in Digit Tree not found") ; | |
232 | } else { | |
233 | branch->SetAddress(&digits) ; | |
234 | branch->GetEntry(0) ; | |
235 | MakeDigits(digits) ; | |
236 | } | |
237 | } | |
238 | ||
239 | ||
240 | //____________________________________________________________________________ | |
241 | void AliVZEROQADataMakerSim::StartOfDetectorCycle() | |
242 | { | |
243 | //Detector specific actions at start of cycle | |
244 | ||
245 | } |