1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\r
7 * Permission to use, copy, modify and distribute this software and its *
\r
8 * documentation strictly for non-commercial purposes is hereby granted *
\r
9 * without fee, provided that the above copyright notice appears in all *
\r
10 * copies and that both the copyright notice and this permission notice *
\r
11 * appear in the supporting documentation. The authors make no claims *
\r
12 * about the suitability of this software for any purpose. It is *
\r
13 * provided "as is" without express or implied warranty. *
\r
14 **************************************************************************/
\r
16 // Produces the data needed to calculate the quality assurance.
\r
17 // All data must be mergeable objects.
\r
22 // Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
\r
23 // Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
\r
24 // Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
\r
26 // Created: June 13th 2008
\r
28 // Last Update: Aug. 27th 2008 --> Implementation to declare QA expert histogram
\r
29 // Last update: Nov. 14t 2009 --> MRC <mrodrigu@mail.cern.ch> (FCFM-BUAP)
\r
30 // |--> Change in Multiplicity histogram for AMORE (to detect empty triggers events of ACORDE)
\r
34 // --- ROOT system ---
\r
35 #include <TClonesArray.h>
\r
38 #include <TDirectory.h>
\r
39 // --- Standard library ---
\r
41 // --- AliRoot header files ---
\r
42 #include "AliESDEvent.h"
\r
44 #include "AliACORDEdigit.h"
\r
45 #include "AliACORDEhit.h"
\r
46 #include "AliACORDEQADataMakerRec.h"
\r
47 #include "AliQAChecker.h"
\r
48 #include "AliACORDERawReader.h"
\r
49 #include "AliACORDERawStream.h"
\r
50 ClassImp(AliACORDEQADataMakerRec)
\r
52 //____________________________________________________________________________
\r
53 AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")
\r
57 //____________________________________________________________________________
\r
58 AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):AliQADataMakerRec()
\r
60 SetName((const char*)qadm.GetName()) ;
\r
61 SetTitle((const char*)qadm.GetTitle());
\r
63 //__________________________________________________________________
\r
64 AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )
\r
67 this->~AliACORDEQADataMakerRec();
\r
68 new(this) AliACORDEQADataMakerRec(qadm);
\r
71 //____________________________________________________________________________
\r
72 void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
\r
74 //Detector specific actions at end of cycle
\r
75 // do the QA checking
\r
76 AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;
\r
79 //____________________________________________________________________________
\r
80 void AliACORDEQADataMakerRec::StartOfDetectorCycle()
\r
82 //Detector specific actions at start of cycle
\r
86 //____________________________________________________________________________
\r
87 void AliACORDEQADataMakerRec::InitRaws()
\r
89 // create Raw histograms in Raw subdir
\r
91 const Bool_t expert = kTRUE ;
\r
92 const Bool_t saveCorr = kTRUE ;
\r
93 const Bool_t image = kTRUE ;
\r
94 char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
\r
95 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
\r
96 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
\r
97 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
\r
98 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
\r
99 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
\r
102 TH1F *fhACORDEBitPattern[4];
\r
103 fhACORDEBitPattern[0] = new TH1F("ACORDEBitPatternfromRAWSingle","Distribution of ACORDE fired modules from RAW-Single;Modules;Counts",60,-0.5,59.5);//AcordeSingleMuon BitPattern
\r
104 fhACORDEBitPattern[1] = new TH1F("ACORDEBitPatternfromRAWMulti","Distribution of ACORDE fired modules from RAW-Multi;Modules;Counts",60,-0.5,59.5);//AcordeMultiMuon BitPattern
\r
105 fhACORDEBitPattern[2] = new TH1F("ACORDEMultiplicityfromRAWSingle","Number of fired ACORDE modules;No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);//AcordeSingleMuon Multiplicity
\r
106 fhACORDEBitPattern[3] = new TH1F("ACORDEMultiplicityfromRAWMulti","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);//AcordeMultiMuon Multiplicity
\r
107 for(Int_t i=0;i<4;i++)
\r
108 Add2RawsList(fhACORDEBitPattern[i],i,!expert, image, !saveCorr);
\r
110 for (Int_t iModule = 0; iModule<60; iModule++)
\r
112 fhACORDEBitPattern[0]->GetXaxis()->SetBinLabel(iModule+1,acoModule[iModule]);
\r
113 fhACORDEBitPattern[1]->GetXaxis()->SetBinLabel(iModule+1,acoModule[iModule]);
\r
117 //____________________________________________________________________________
\r
118 void AliACORDEQADataMakerRec::InitDigits()
\r
120 // create Digits histograms in Digits subdir
\r
122 const Bool_t expert = kTRUE ;
\r
123 const Bool_t image = kTRUE ;
\r
124 TH1F * fhDigitsModule;
\r
125 char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
\r
126 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
\r
127 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
\r
128 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
\r
129 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
\r
130 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
\r
133 fhDigitsModule = new TH1F("ACORDEBitPatternfromDigits","Distribution of ACORDE from DIGITS;Modules;Counts",60,1,60);
\r
134 Add2DigitsList(fhDigitsModule,0,!expert,image);
\r
135 for (Int_t i=0;i<60;i++) fhDigitsModule->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
\r
138 //____________________________________________________________________________
\r
140 void AliACORDEQADataMakerRec::InitRecPoints()
\r
142 // create cluster histograms in RecPoint subdir
\r
143 // Not needed for ACORDE by now !!!
\r
146 //____________________________________________________________________________
\r
147 void AliACORDEQADataMakerRec::InitESDs()
\r
149 //create ESDs histograms in ESDs subdir
\r
151 const Bool_t expert = kTRUE ;
\r
152 const Bool_t image = kTRUE ;
\r
154 TH1F * fhESDsSingle;
\r
155 TH1F * fhESDsMulti;
\r
156 TH1F * fhESDsMultiplicity;
\r
157 char *acoModule[60]={"0_0","0_1","0_2","0_3","0_4","0_5","0_6","0_7","0_8","0_9",
\r
158 "1_0","1_1","1_2","1_3","1_4","1_5","1_6","1_7","1_8","1_9",
\r
159 "2_0","2_1","2_2","2_3","2_4","2_5","2_6","2_7","2_8","2_9",
\r
160 "3_0","3_1","3_2","3_3","3_4","3_5","3_6","3_7","3_8","3_9",
\r
161 "4_0","4_1","4_2","4_3","4_4","4_5","4_6","4_7","4_8","4_9",
\r
162 "5_0","5_1","5_2","5_3","5_4","5_5","5_6","5_7","5_8","5_9"};
\r
165 fhESDsSingle = new TH1F("ACORDEBitPatternfromESDsSingle","Distribution of ACORDE fired modules from ESDs-Single;Modules;Counts",60,1,60);
\r
166 Add2ESDsList(fhESDsSingle,0,!expert,image);
\r
168 fhESDsMulti = new TH1F("ACORDEBitPatternfromESDsMulti","Distribution of ACORDE fired modules from ESDs-Multi;Modules;Counts",60,1,60);
\r
169 Add2ESDsList(fhESDsMulti,1,!expert,image);
\r
171 fhESDsMultiplicity = new TH1F("ACORDEMultiplicityfromESD","Number of fired ACORDE modules; No. of fired ACORDE modules;No. of events in ACORDE",60,-0.5,60);
\r
172 Add2ESDsList(fhESDsMultiplicity,2,!expert,image);
\r
173 for (Int_t i=0;i<60;i++)
\r
175 fhESDsSingle->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
\r
176 fhESDsMulti->GetXaxis()->SetBinLabel(i+1,acoModule[i]);
\r
181 //____________________________________________________________________________
\r
182 void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)
\r
184 //fills QA histos for RAW
\r
186 rawReader->Reset();
\r
187 AliACORDERawStream rawStream(rawReader);
\r
188 size_t contSingle=0;
\r
189 size_t contMulti=0;
\r
192 bool kroSingle[60],kroMulti[60];
\r
195 for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}
\r
197 if(rawStream.Next())
\r
199 dy[0]=rawStream.GetWord(0);
\r
200 dy[1]=rawStream.GetWord(1);
\r
201 dy[2]=rawStream.GetWord(2);
\r
202 dy[3]=rawStream.GetWord(3);
\r
204 for(Int_t r=0;r<30;r++)
\r
206 kroSingle[r] = tmpDy & 1;
\r
210 for(Int_t r=30;r<60;r++)
\r
212 kroSingle[r] = tmpDy & 1;
\r
216 for(Int_t r=0;r<30;r++)
\r
218 kroMulti[r] = tmpDy & 1;
\r
222 for(Int_t r=30;r<60;r++)
\r
224 kroMulti[r] = tmpDy & 1;
\r
229 for(Int_t r=0;r<60;r++)
\r
231 if(kroSingle[r]==1)
\r
233 GetRawsData(0)->Fill(r+1);
\r
234 contSingle=contSingle+1;
\r
238 GetRawsData(1)->Fill(r+1);
\r
242 }GetRawsData(2)->Fill(contSingle);GetRawsData(3)->Fill(contMulti);
\r
245 //____________________________________________________________________________
\r
246 void AliACORDEQADataMakerRec::MakeDigits( TTree *digitsTree)
\r
248 //fills QA histos for Digits
\r
250 fDigitsArray->Clear() ;
\r
252 fDigitsArray = new TClonesArray("AliACORDEdigit",1000);
\r
253 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
\r
255 AliWarning("ACORDE branch in Digits Tree not found");
\r
257 branch->SetAddress(&fDigitsArray);
\r
258 for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
\r
259 branch->GetEntry(track);
\r
260 for(Int_t idigit = 0 ; idigit < fDigitsArray->GetEntriesFast() ; idigit++) {
\r
261 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) fDigitsArray->UncheckedAt(idigit);
\r
263 AliError("The unchecked digit doesn't exist");
\r
266 GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
\r
272 //____________________________________________________________________________
\r
273 void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)
\r
275 //fills QA histos for ESD
\r
277 AliESDACORDE * fESDACORDE= esd->GetACORDEData();
\r
279 for(int i=0;i<60;i++)
\r
281 if(fESDACORDE->GetHitChannel(i))
\r
283 GetESDsData(0)->Fill(i+1);
\r
284 GetESDsData(1)->Fill(i+1);
\r
287 }GetESDsData(2)->Fill(acoMulti);
\r