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"),
54 fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ;
55 fHitsArray = new TClonesArray("AliFMDHit", 10);
58 //_____________________________________________________________________
59 AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& /*qadm*/)
64 // qadm Object to copy from
67 //_____________________________________________________________________
68 AliFMDQADataMakerSim::~AliFMDQADataMakerSim()
74 //_____________________________________________________________________
75 void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task,
78 //Detector specific actions at end of cycle
80 AliLog::Message(5,"FMD: end of detector cycle",
81 "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
82 "AliFMDQADataMakerSim::EndOfDetectorCycle",
83 "AliFMDQADataMakerSim.cxx",83);
84 AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ;
88 //____________________________________________________________________
89 void AliFMDQADataMakerSim::InitHits()
91 // create Digits histograms in Digits subdir
92 TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3);
93 hEnergyOfHits->SetXTitle("Edep");
94 hEnergyOfHits->SetYTitle("Counts");
95 Add2HitsList(hEnergyOfHits, 0);
98 //_____________________________________________________________________
99 void AliFMDQADataMakerSim::InitDigits()
101 // create Digits histograms in Digits subdir
102 TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024);
103 hADCCounts->SetXTitle("ADC counts");
104 Add2DigitsList(hADCCounts, 0);
107 //_____________________________________________________________________
108 void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits)
110 TIter next(fHitsArray);
112 while ((hit = static_cast<AliFMDHit *>(next())))
113 GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032);
116 //_____________________________________________________________________
117 void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
119 // make QA data from Hit Tree
121 TBranch * branch = hitTree->GetBranch("FMD") ;
123 AliWarning("FMD branch in Hit Tree not found") ;
127 branch->SetAddress(&fHitsArray) ;
129 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
130 branch->GetEntry(ientry);
131 MakeHits(fHitsArray); //tmp);
136 //_____________________________________________________________________
137 void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits)
139 // makes data from Digits
142 for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) {
144 AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
145 GetDigitsData(0)->Fill(digit->Counts());
149 //_____________________________________________________________________
150 void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
153 fDigitsArray->Clear();
154 TBranch * branch = digitTree->GetBranch("FMD") ;
156 AliWarning("FMD branch in Digit Tree not found") ;
159 branch->SetAddress(&fDigitsArray) ;
160 branch->GetEntry(0) ;
161 MakeDigits(fDigitsArray) ;
164 //_____________________________________________________________________
165 void AliFMDQADataMakerSim::StartOfDetectorCycle()
169 //_____________________________________________________________________