Line data Source code
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 :
18 : //---
19 : // Produces the data needed to calculate the quality assurance.
20 : // All data must be mergeable objects.
21 :
22 : // Authors:
23 : //
24 : // Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
25 : // Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
26 : // Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
27 : //
28 : // Created: June 13th 2008
29 : //---
30 : // Last Update: Aug. 27th 2008 ---> Implementation to declare QA expert histogram
31 :
32 :
33 : // --- ROOT system ---
34 : #include <TClonesArray.h>
35 : #include <TFile.h>
36 : #include <TH1F.h>
37 : #include <TH2F.h>
38 : #include <TDirectory.h>
39 : // --- Standard library ---
40 :
41 : // --- AliRoot header files ---
42 : #include "AliESDEvent.h"
43 : #include "AliLog.h"
44 : #include "AliACORDEdigit.h"
45 : #include "AliACORDEhit.h"
46 : #include "AliACORDEQADataMakerSim.h"
47 : #include "AliQAChecker.h"
48 : #include "AliACORDERawReader.h"
49 12 : ClassImp(AliACORDEQADataMakerSim)
50 :
51 : //____________________________________________________________________________
52 3 : AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")
53 5 : {
54 2 : }
55 : //____________________________________________________________________________
56 : AliACORDEQADataMakerSim::AliACORDEQADataMakerSim(const AliACORDEQADataMakerSim& qadm) :
57 0 : AliQADataMakerSim()
58 0 : {
59 0 : SetName((const char*)qadm.GetName()) ;
60 0 : SetTitle((const char*)qadm.GetTitle());
61 0 : }
62 : //__________________________________________________________________
63 : AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQADataMakerSim& qadm )
64 : {
65 : // Equal operator.
66 0 : this->~AliACORDEQADataMakerSim();
67 0 : new(this) AliACORDEQADataMakerSim(qadm);
68 0 : return *this;
69 0 : }
70 : //____________________________________________________________________________
71 : void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
72 : {
73 : //Detector specific actions at end of cycle
74 : // do the QA checking
75 18 : ResetEventTrigClasses(); // reset triggers list to select all histos
76 27 : AliDebug(AliQAv1::GetQADebugLevel(), "ACORDE---->Detector specific actions at END of cycle\n................\n");
77 :
78 9 : AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;
79 9 : }
80 : //____________________________________________________________________________
81 : void AliACORDEQADataMakerSim::StartOfDetectorCycle()
82 : {
83 : //Detector specific actions at start of cycle
84 24 : AliDebug(AliQAv1::GetQADebugLevel(), "ACORDE---->Detector specific actions at START of cycle\n................\n");
85 6 : }
86 : //____________________________________________________________________________
87 : void AliACORDEQADataMakerSim::InitHits()
88 : {
89 : // create Hits histograms in Hits subdir
90 :
91 : const Bool_t expert = kTRUE ;
92 : const Bool_t image = kTRUE ;
93 :
94 : TH1F * fHitsACORDE;
95 :
96 0 : fHitsACORDE = new TH1F("ACORDEBitPatternfromHits","Distribution of ACORDE fired modules from HITS",60,1,60);
97 0 : Add2HitsList(fHitsACORDE,0,!expert,image);
98 :
99 0 : const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
100 : "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
101 : "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
102 : "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
103 : "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
104 : "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
105 :
106 :
107 0 : fHitsACORDE->SetXTitle("Modules");
108 0 : fHitsACORDE->SetYTitle("Counts");
109 0 : for (Int_t i=0;i<60;i++)
110 : {
111 0 : fHitsACORDE->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
112 : }
113 : //
114 : //
115 0 : ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
116 0 : }
117 :
118 : //____________________________________________________________________________
119 : void AliACORDEQADataMakerSim::InitDigits()
120 : {
121 : // create Digits histograms in Digits subdir
122 :
123 : const Bool_t expert = kTRUE ;
124 : const Bool_t image = kTRUE ;
125 :
126 : TH1F * fhDigitsModule;
127 0 : fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE fired modules from DIGITS",60,1,60);
128 0 : Add2DigitsList(fhDigitsModule,0,!expert,image);
129 0 : const char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
130 : "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
131 : "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
132 : "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
133 : "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
134 : "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
135 :
136 :
137 0 : fhDigitsModule->SetXTitle("Modules");
138 0 : fhDigitsModule->SetYTitle("Counts");
139 0 : for (Int_t i=0;i<60;i++)
140 : {
141 0 : fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
142 : }
143 : //
144 0 : ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
145 0 : }
146 :
147 : //____________________________________________________________________________
148 : void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
149 : {
150 : // Here we fill the QA histos for Hits declared above
151 8 : IncEvCountCycleHits();
152 4 : IncEvCountTotalHits();
153 :
154 4 : if (fHitsArray)
155 3 : fHitsArray->Clear() ;
156 : else
157 2 : fHitsArray = new TClonesArray("AliACORDEhit",1000);
158 4 : TBranch * branch = hitTree->GetBranch("ACORDE");
159 4 : if (!branch)
160 : {
161 0 : AliWarning("ACORDE branch in Hit Tree not found");
162 0 : } else
163 : {
164 4 : branch->SetAddress(&fHitsArray);
165 232 : for(Int_t track = 0 ; track < branch->GetEntries() ; track++)
166 : {
167 112 : branch->GetEntry(track);
168 224 : for(Int_t ihit=0 ; ihit < fHitsArray->GetEntriesFast() ; ihit++)
169 : {
170 0 : AliACORDEhit *AcoHit = (AliACORDEhit*) fHitsArray->UncheckedAt(ihit);
171 0 : if(!AcoHit)
172 : {
173 0 : AliError("The unchecked hit doesn't exist");
174 0 : continue ;
175 : }
176 0 : FillHitsData(0,AcoHit->GetModule());
177 0 : }
178 : }
179 : }
180 :
181 4 : }
182 : //____________________________________________________________________________
183 : void AliACORDEQADataMakerSim::MakeDigits( TTree *digitsTree)
184 : {
185 : //fills QA histos for Digits
186 8 : IncEvCountCycleDigits();
187 4 : IncEvCountTotalDigits();
188 :
189 4 : if (fDigitsArray)
190 3 : fDigitsArray->Clear() ;
191 : else
192 2 : fDigitsArray = new TClonesArray("AliACORDEdigit",1000);
193 :
194 4 : TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
195 4 : if (!branch) {
196 0 : AliWarning("ACORDE branch in Digits Tree not found");
197 0 : } else {
198 4 : branch->SetAddress(&fDigitsArray);
199 16 : for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
200 4 : branch->GetEntry(track);
201 8 : for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {
202 0 : AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);
203 0 : if (!AcoDigit) {
204 0 : AliError("The unchecked digit doesn't exist");
205 0 : continue ;
206 : }
207 0 : FillDigitsData(0,AcoDigit->GetModule());
208 0 : }
209 : }
210 : }
211 4 : }
|