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 **************************************************************************/
16 // Produces the data needed to calculate the quality assurance.
17 // All data must be mergeable objects.
22 // Luciano Diaz Gonzalez <luciano.diaz@nucleares.unam.mx> (ICN-UNAM)
23 // Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch> (FCFM-BUAP)
24 // Arturo Fernandez Tellez <afernan@mail.cern.ch (FCFM-BUAP)
26 // Created: June 13th 2008
28 // Last Update: Aug. 27th 2008 --> Implementation to declare QA expert histogram
31 // --- ROOT system ---
32 #include <TClonesArray.h>
35 #include <TDirectory.h>
36 // --- Standard library ---
38 // --- AliRoot header files ---
39 #include "AliESDEvent.h"
41 #include "AliACORDEdigit.h"
42 #include "AliACORDEhit.h"
43 #include "AliACORDEDigit.h"
44 #include "AliACORDEQADataMakerRec.h"
45 #include "AliQAChecker.h"
46 #include "AliACORDERawReader.h"
47 #include "AliACORDERawStream.h"
48 ClassImp(AliACORDEQADataMakerRec)
50 //____________________________________________________________________________
51 AliACORDEQADataMakerRec::AliACORDEQADataMakerRec():AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kACORDE), "ACORDE Quality Assurance Data Maker")
55 //____________________________________________________________________________
56 AliACORDEQADataMakerRec::AliACORDEQADataMakerRec(const AliACORDEQADataMakerRec& qadm):AliQADataMakerRec()
58 SetName((const char*)qadm.GetName()) ;
59 SetTitle((const char*)qadm.GetTitle());
61 //__________________________________________________________________
62 AliACORDEQADataMakerRec& AliACORDEQADataMakerRec::operator = (const AliACORDEQADataMakerRec& qadm )
65 this->~AliACORDEQADataMakerRec();
66 new(this) AliACORDEQADataMakerRec(qadm);
69 //____________________________________________________________________________
70 void AliACORDEQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
72 //Detector specific actions at end of cycle
74 AliQAChecker::Instance()->Run(AliQAv1::kACORDE, task, list) ;
77 //____________________________________________________________________________
78 void AliACORDEQADataMakerRec::StartOfDetectorCycle()
80 //Detector specific actions at start of cycle
84 //____________________________________________________________________________
85 void AliACORDEQADataMakerRec::InitRaws()
87 // create Raw histograms in Raw subdir
89 const Bool_t expert = kTRUE ;
90 const Bool_t saveCorr = kTRUE ;
91 const Bool_t image = kTRUE ;
93 TH1D *fhACORDEBitPattern[4];
94 fhACORDEBitPattern[0] = new TH1D("ACORDERawDataSM","ACORDE-SingleMuon",60,1,60);//AcordeSingleMuon BitPattern
95 fhACORDEBitPattern[1] = new TH1D("ACORDERawDataMM","ACORDE-MultiMuon",60,1,60);//AcordeMultiMuon BitPattern
96 fhACORDEBitPattern[2] = new TH1D("ACORDERawDataSMM","ACORDE-SingleMuonMultiplicity",60,1,60);//AcordeSingleMuon Multiplicity
97 fhACORDEBitPattern[3] = new TH1D("ACORDERawDataMMM","ACORDE-MultiMuonMultiplicity",60,1,60);//AcordeMultiMuon Multiplicity
98 for(Int_t i=0;i<4;i++)
99 Add2RawsList(fhACORDEBitPattern[i],i,!expert, image, !saveCorr);
101 //____________________________________________________________________________
102 void AliACORDEQADataMakerRec::InitDigits()
104 // create Digits histograms in Digits subdir
106 const Bool_t expert = kTRUE ;
107 const Bool_t image = kTRUE ;
109 TH1F * fhDigitsModule;
111 modulename = "hDigitsModule";
112 fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle",60,0,60);
113 Add2DigitsList(fhDigitsModule,0,!expert,image);
117 //____________________________________________________________________________
119 void AliACORDEQADataMakerRec::InitRecPoints()
121 // create cluster histograms in RecPoint subdir
122 // Not needed for ACORDE by now !!!
124 //____________________________________________________________________________
125 void AliACORDEQADataMakerRec::InitESDs()
127 //create ESDs histograms in ESDs subdir
129 const Bool_t expert = kTRUE ;
130 const Bool_t image = kTRUE ;
137 name = "hESDsSingle";
138 fhESDsSingle = new TH1F(name.Data(),"hESDsSingle",60,0,60);
139 Add2ESDsList(fhESDsSingle,0,!expert,image);
142 fhESDsMulti = new TH1F(name.Data(),"hESDsMulti",60,0,60);
143 Add2ESDsList(fhESDsMulti,1,!expert,image);
145 //____________________________________________________________________________
146 void AliACORDEQADataMakerRec::MakeRaws(AliRawReader* rawReader)
148 //fills QA histos for RAW
150 AliACORDERawStream rawStream(rawReader);
155 bool kroSingle[60],kroMulti[60];
158 for(Int_t m=0;m<60;m++) {kroSingle[m]=0;kroMulti[m]=0;}
162 dy[0]=rawStream.GetWord(0);
163 dy[1]=rawStream.GetWord(1);
164 dy[2]=rawStream.GetWord(2);
165 dy[3]=rawStream.GetWord(3);
167 for(Int_t r=0;r<30;++r)
169 kroSingle[r] = tmpDy & 1;
173 for(Int_t r=30;r<60;++r)
175 kroSingle[r] = tmpDy & 1;
179 for(Int_t r=0;r<30;++r)
181 kroMulti[r] = tmpDy & 1;
185 for(Int_t r=30;r<60;++r)
187 kroMulti[r] = tmpDy & 1;
192 for(Int_t r=0;r<60;++r)
196 GetRawsData(0)->Fill(r+1);
197 contSingle=contSingle+1;
201 GetRawsData(1)->Fill(r+1);
205 }GetRawsData(2)->Fill(contSingle);GetRawsData(3)->Fill(contMulti);
208 //____________________________________________________________________________
209 void AliACORDEQADataMakerRec::MakeDigits( TTree *digitsTree)
211 //fills QA histos for Digits
212 TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
213 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
215 AliWarning("ACORDE branch in Digits Tree not found");
217 branch->SetAddress(&digits);
218 for(Int_t track = 0 ; track < branch->GetEntries() ; track++) {
219 branch->GetEntry(track);
220 for(Int_t idigit = 0 ; idigit < digits->GetEntriesFast() ; idigit++) {
221 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
223 AliError("The unchecked digit doesn't exist");
226 GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);
232 //____________________________________________________________________________
233 void AliACORDEQADataMakerRec::MakeESDs(AliESDEvent * esd)
235 //fills QA histos for ESD
237 AliESDACORDE * fESDACORDE= esd->GetACORDEData();
238 Int_t *fACORDEMultiMuon =fESDACORDE->GetACORDEMultiMuon();
239 Int_t *fACORDESingleMuon=fESDACORDE->GetACORDESingleMuon();
241 for(int i=0;i<60;i++){
242 if(fACORDESingleMuon[i]==1)
243 GetESDsData(0) -> Fill(i);
244 if(fACORDEMultiMuon[i]==1)
245 GetESDsData(1) -> Fill(i);