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 **************************************************************************/
19 // Produces the data needed to calculate the quality assurance.
20 // All data must be mergeable objects.
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)
28 // Created: June 13th 2008
31 // --- ROOT system ---
32 #include <TClonesArray.h>
36 #include <TDirectory.h>
37 // --- Standard library ---
39 // --- AliRoot header files ---
40 #include "AliESDEvent.h"
42 #include "AliACORDEdigit.h"
43 #include "AliACORDEhit.h"
44 #include "AliACORDEQADataMakerSim.h"
45 #include "AliQAChecker.h"
46 #include "AliACORDERawReader.h"
47 ClassImp(AliACORDEQADataMakerSim)
49 //____________________________________________________________________________
50 AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
53 //____________________________________________________________________________
54 AliACORDEQADataMakerSim::AliACORDEQADataMakerSim(const AliACORDEQADataMakerSim& qadm) :
57 SetName((const char*)qadm.GetName()) ;
58 SetTitle((const char*)qadm.GetTitle());
60 //__________________________________________________________________
61 AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQADataMakerSim& qadm )
64 this->~AliACORDEQADataMakerSim();
65 new(this) AliACORDEQADataMakerSim(qadm);
68 //____________________________________________________________________________
69 void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
71 //Detector specific actions at end of cycle
73 printf("ACORDE---->Detector specific actions at END of cycle\n................\n");
75 AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ;
77 //____________________________________________________________________________
78 void AliACORDEQADataMakerSim::StartOfDetectorCycle()
80 //Detector specific actions at start of cycle
81 printf("ACORDE---->Detector specific actions at START of cycle\n................\n");
83 //____________________________________________________________________________
84 void AliACORDEQADataMakerSim::InitHits()
86 // create Hits histograms in Hits subdir
89 fHitsACORDE = new TH1F("hACORDEBitPattern","Distribution of fired modules",60,0,60);
90 Add2HitsList(fHitsACORDE,0);
92 //____________________________________________________________________________
93 void AliACORDEQADataMakerSim::InitDigits()
95 // create Digits histograms in Digits subdir
97 TH1F * fhDigitsModule;
99 modulename = "hDigitsModule";
100 fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle",60,0,60);
101 Add2DigitsList( fhDigitsModule,0);
104 //____________________________________________________________________________
106 void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
108 // Here we fill the QA histos for Hits declared above
110 TClonesArray * hits = new TClonesArray("AliACORDEhit",1000);
111 TBranch * branch = hitTree->GetBranch("ACORDE");
114 AliWarning("ACORDE branch in Hit Tree not found");
119 branch->SetAddress(&hits);
122 AliError("Branch ACORDE hit not found");
125 Int_t ntracks = (Int_t)hitTree->GetEntries();
126 if (ntracks<=0) return;
127 for(Int_t track=0;track<ntracks;track++)
129 branch->GetEntry(track);
130 Int_t nhits = hits->GetEntriesFast();
131 for(Int_t ihit=1;ihit<=nhits;ihit++)
133 AliACORDEhit *AcoHit = (AliACORDEhit*) hits->UncheckedAt(ihit);
136 AliError("The unchecked hit doesn't exist");
139 GetHitsData(0)->Fill(AcoHit->GetModule()-1);
145 //____________________________________________________________________________
146 void AliACORDEQADataMakerSim::MakeDigits( TTree *digitsTree)
148 //fills QA histos for Digits
151 TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
152 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
155 AliWarning("ACORDE branch in Digits Tree not found");
160 branch->SetAddress(&digits);
163 AliError("Branch ACORDE digit not found");
166 Int_t ntracks = (Int_t)digitsTree->GetEntries();
167 if (ntracks<=0) return;
168 printf("Entries in DigitsTree:%d\n",ntracks);
169 for(Int_t track=0;track<ntracks;track++)
171 branch->GetEntry(track);
172 Int_t ndigits = digits->GetEntriesFast();
173 for(Int_t idigit=0;idigit<ndigits;idigit++)
175 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
178 AliError("The unchecked digit doesn't exist");
181 GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);