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
30 // Last Update: Aug. 27th 2008 ---> Implementation to declare QA expert histogram
33 // --- ROOT system ---
34 #include <TClonesArray.h>
38 #include <TDirectory.h>
39 // --- Standard library ---
41 // --- AliRoot header files ---
42 #include "AliESDEvent.h"
44 #include "AliACORDEdigit.h"
45 #include "AliACORDEhit.h"
46 #include "AliACORDEQADataMakerSim.h"
47 #include "AliQAChecker.h"
48 #include "AliACORDERawReader.h"
49 ClassImp(AliACORDEQADataMakerSim)
51 //____________________________________________________________________________
52 AliACORDEQADataMakerSim::AliACORDEQADataMakerSim():AliQADataMakerSim(AliQA::GetDetName(AliQA::kACORDE), "ACORDE Quality Assurance Data Maker")
55 //____________________________________________________________________________
56 AliACORDEQADataMakerSim::AliACORDEQADataMakerSim(const AliACORDEQADataMakerSim& qadm) :
59 SetName((const char*)qadm.GetName()) ;
60 SetTitle((const char*)qadm.GetTitle());
62 //__________________________________________________________________
63 AliACORDEQADataMakerSim& AliACORDEQADataMakerSim::operator = (const AliACORDEQADataMakerSim& qadm )
66 this->~AliACORDEQADataMakerSim();
67 new(this) AliACORDEQADataMakerSim(qadm);
70 //____________________________________________________________________________
71 void AliACORDEQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list)
73 //Detector specific actions at end of cycle
75 AliInfo("ACORDE---->Detector specific actions at END of cycle\n................\n");
77 AliQAChecker::Instance()->Run(AliQA::kACORDE, task, list) ;
79 //____________________________________________________________________________
80 void AliACORDEQADataMakerSim::StartOfDetectorCycle()
82 //Detector specific actions at start of cycle
83 AliInfo("ACORDE---->Detector specific actions at START of cycle\n................\n");
85 //____________________________________________________________________________
86 void AliACORDEQADataMakerSim::InitHits()
88 // create Hits histograms in Hits subdir
91 fHitsACORDE = new TH1F("hACORDEBitPattern","Distribution of fired modules",60,0,60);
92 Add2HitsList(fHitsACORDE,0,kFALSE);
94 //____________________________________________________________________________
95 void AliACORDEQADataMakerSim::InitDigits()
97 // create Digits histograms in Digits subdir
99 TH1F * fhDigitsModule;
101 modulename = "hDigitsModule";
102 fhDigitsModule = new TH1F(modulename.Data(),"hDigitsModuleSingle",60,0,60);
103 Add2DigitsList(fhDigitsModule,0,kFALSE);
106 //____________________________________________________________________________
108 void AliACORDEQADataMakerSim::MakeHits(TTree *hitTree)
110 // Here we fill the QA histos for Hits declared above
112 TClonesArray * hits = new TClonesArray("AliACORDEhit",1000);
113 TBranch * branch = hitTree->GetBranch("ACORDE");
116 AliWarning("ACORDE branch in Hit Tree not found");
121 branch->SetAddress(&hits);
124 AliError("Branch ACORDE hit not found");
127 Int_t ntracks = (Int_t)hitTree->GetEntries();
128 if (ntracks<=0) return;
129 for(Int_t track=0;track<ntracks;track++)
131 branch->GetEntry(track);
132 Int_t nhits = hits->GetEntriesFast();
133 for(Int_t ihit=1;ihit<=nhits;ihit++)
135 AliACORDEhit *AcoHit = (AliACORDEhit*) hits->UncheckedAt(ihit);
138 AliError("The unchecked hit doesn't exist");
141 GetHitsData(0)->Fill(AcoHit->GetModule()-1);
147 //____________________________________________________________________________
148 void AliACORDEQADataMakerSim::MakeDigits( TTree *digitsTree)
150 //fills QA histos for Digits
153 TClonesArray * digits = new TClonesArray("AliACORDEdigit",1000);
154 TBranch * branch = digitsTree->GetBranch("ACORDEdigit");
157 AliWarning("ACORDE branch in Digits Tree not found");
162 branch->SetAddress(&digits);
165 AliError("Branch ACORDE digit not found");
168 Int_t ntracks = (Int_t)digitsTree->GetEntries();
169 if (ntracks<=0) return;
170 printf("Entries in DigitsTree:%d\n",ntracks);
171 for(Int_t track=0;track<ntracks;track++)
173 branch->GetEntry(track);
174 Int_t ndigits = digits->GetEntriesFast();
175 for(Int_t idigit=0;idigit<ndigits;idigit++)
177 AliACORDEdigit *AcoDigit = (AliACORDEdigit*) digits->UncheckedAt(idigit);
180 AliError("The unchecked digit doesn't exist");
183 GetDigitsData(0)->Fill(AcoDigit->GetModule()-1);