1 /**************************************************************************
2 * Copyright(c) 2004, 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 **************************************************************************/
15 // --- ROOT system ---
17 #include <TClonesArray.h>
22 // --- AliRoot header files ---
23 #include "AliESDEvent.h"
25 #include "AliFMDQADataMakerSim.h"
26 #include "AliFMDDigit.h"
27 #include "AliFMDHit.h"
28 #include "AliQAChecker.h"
29 #include "AliFMDParameters.h"
31 //_____________________________________________________________________
32 // This is the class that collects the QA data for the FMD during simulation.
33 // The following data types are picked up:
36 // The following data types are not supported (yet):
39 // Author : Hans Hjersing Dalsgaard, Niels Bohr Institute, hans.dalsgaard@cern.ch
40 //_____________________________________________________________________
42 ClassImp(AliFMDQADataMakerSim)
44 ; // This line is for Emacs - do not delete!
46 //_____________________________________________________________________
47 AliFMDQADataMakerSim::AliFMDQADataMakerSim()
48 : AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD),
49 "FMD Quality Assurance Data Maker"),
50 fDigitsArray("AliFMDDigit", 1000),
51 fHitsArray("AliFMDHit", 10)
57 //_____________________________________________________________________
58 AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm)
59 : AliQADataMakerSim(),
60 fDigitsArray(qadm.fDigitsArray),
61 fHitsArray(qadm.fHitsArray)
66 // qadm Object to copy from
69 //_____________________________________________________________________
70 AliFMDQADataMakerSim& AliFMDQADataMakerSim::operator = (const AliFMDQADataMakerSim& qadm )
72 fDigitsArray = qadm.fDigitsArray;
73 fHitsArray = qadm.fHitsArray;
77 //_____________________________________________________________________
78 AliFMDQADataMakerSim::~AliFMDQADataMakerSim()
83 //_____________________________________________________________________
84 void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task,
87 //Detector specific actions at end of cycle
89 AliLog::Message(5,"FMD: end of detector cycle",
90 "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
91 "AliFMDQADataMakerSim::EndOfDetectorCycle",
92 "AliFMDQADataMakerSim.cxx",83);
93 AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ;
97 //____________________________________________________________________
98 void AliFMDQADataMakerSim::InitHits()
100 // create Digits histograms in Digits subdir
101 TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3);
102 hEnergyOfHits->SetXTitle("Edep");
103 hEnergyOfHits->SetYTitle("Counts");
104 Add2HitsList(hEnergyOfHits, 0);
107 //_____________________________________________________________________
108 void AliFMDQADataMakerSim::InitDigits()
110 // create Digits histograms in Digits subdir
111 TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024);
112 hADCCounts->SetXTitle("ADC counts");
113 Add2DigitsList(hADCCounts, 0);
116 //_____________________________________________________________________
117 void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits)
121 while ((hit = static_cast<AliFMDHit *>(next())))
122 GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032);
125 //_____________________________________________________________________
126 void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
128 // make QA data from Hit Tree
132 TBranch * branch = hitTree->GetBranch("FMD") ;
134 AliWarning("FMD branch in Hit Tree not found") ;
138 TClonesArray* hitsAddress = &fHitsArray;
140 branch->SetAddress(&hitsAddress) ;
142 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
143 branch->GetEntry(ientry);
144 MakeHits(hitsAddress); //tmp);
149 //_____________________________________________________________________
150 void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits)
152 // makes data from Digits
155 for(Int_t i = 0 ; i < digits->GetEntriesFast() ; i++) {
157 AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
158 GetDigitsData(0)->Fill(digit->Counts());
162 //_____________________________________________________________________
163 void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
166 fDigitsArray.Clear();
167 TBranch * branch = digitTree->GetBranch("FMD") ;
169 AliWarning("FMD branch in Digit Tree not found") ;
172 TClonesArray* digitAddress = &fDigitsArray;
173 branch->SetAddress(&digitAddress) ;
174 branch->GetEntry(0) ;
175 MakeDigits(digitAddress) ;
178 //_____________________________________________________________________
179 void AliFMDQADataMakerSim::StartOfDetectorCycle()
183 //_____________________________________________________________________