]>
Commit | Line | Data |
---|---|---|
c9dd1c4d | 1 | /************************************************************************** |
ffa78f64 | 2 | * Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. * |
c9dd1c4d | 3 | * * |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 --- | |
16 | #include <iostream> | |
17 | #include <TClonesArray.h> | |
18 | #include <TFile.h> | |
19 | #include <TH1F.h> | |
20 | #include <TH1I.h> | |
21 | ||
22 | // --- AliRoot header files --- | |
23 | #include "AliESDEvent.h" | |
24 | #include "AliLog.h" | |
25 | #include "AliFMDQADataMakerSim.h" | |
26 | #include "AliFMDDigit.h" | |
27 | #include "AliFMDHit.h" | |
28 | #include "AliQAChecker.h" | |
29 | #include "AliFMDParameters.h" | |
30 | ||
31 | //_____________________________________________________________________ | |
32 | // This is the class that collects the QA data for the FMD during simulation. | |
33 | // The following data types are picked up: | |
34 | // - hits | |
35 | // - digits | |
36 | // The following data types are not supported (yet): | |
37 | // - raws | |
38 | // - sdigits | |
39 | // Author : Hans Hjersing Dalsgaard, Niels Bohr Institute, hans.dalsgaard@cern.ch | |
40 | //_____________________________________________________________________ | |
41 | ||
42 | ClassImp(AliFMDQADataMakerSim) | |
ffa78f64 | 43 | #if 0 |
44 | ; // This line is for Emacs - do not delete! | |
45 | #endif | |
c9dd1c4d | 46 | //_____________________________________________________________________ |
ffa78f64 | 47 | AliFMDQADataMakerSim::AliFMDQADataMakerSim() |
48 | : AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD), | |
9bd2ccc2 | 49 | "FMD Quality Assurance Data Maker"), |
50 | fDigitsArray(0), | |
51 | fHitsArray(0) | |
c9dd1c4d | 52 | { |
53 | // ctor | |
9bd2ccc2 | 54 | fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ; |
55 | fHitsArray = new TClonesArray("AliFMDHit", 10); | |
c9dd1c4d | 56 | } |
57 | ||
58 | //_____________________________________________________________________ | |
c61a7285 | 59 | AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& /*qadm*/) |
ffa78f64 | 60 | : AliQADataMakerSim() |
c9dd1c4d | 61 | { |
62 | //copy ctor | |
63 | // Parameters: | |
64 | // qadm Object to copy from | |
65 | ||
66 | } | |
9bd2ccc2 | 67 | //_____________________________________________________________________ |
68 | AliFMDQADataMakerSim::~AliFMDQADataMakerSim() | |
69 | { | |
70 | delete fDigitsArray; | |
71 | delete fHitsArray; | |
72 | } | |
c9dd1c4d | 73 | |
74 | //_____________________________________________________________________ | |
92a357bf | 75 | void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, |
ffa78f64 | 76 | TObjArray * list) |
c9dd1c4d | 77 | { |
78 | //Detector specific actions at end of cycle | |
79 | // do the QA checking | |
ffa78f64 | 80 | AliLog::Message(5,"FMD: end of detector cycle", |
81 | "AliFMDQADataMakerSim","AliFMDQADataMakerSim", | |
82 | "AliFMDQADataMakerSim::EndOfDetectorCycle", | |
83 | "AliFMDQADataMakerSim.cxx",83); | |
c9dd1c4d | 84 | AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ; |
85 | ||
86 | } | |
87 | ||
88 | //____________________________________________________________________ | |
89 | void AliFMDQADataMakerSim::InitHits() | |
90 | { | |
91 | // create Digits histograms in Digits subdir | |
ffa78f64 | 92 | TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3); |
c9dd1c4d | 93 | hEnergyOfHits->SetXTitle("Edep"); |
94 | hEnergyOfHits->SetYTitle("Counts"); | |
95 | Add2HitsList(hEnergyOfHits, 0); | |
96 | } | |
97 | ||
98 | //_____________________________________________________________________ | |
99 | void AliFMDQADataMakerSim::InitDigits() | |
100 | { | |
101 | // create Digits histograms in Digits subdir | |
102 | TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024); | |
c9dd1c4d | 103 | hADCCounts->SetXTitle("ADC counts"); |
c9dd1c4d | 104 | Add2DigitsList(hADCCounts, 0); |
c9dd1c4d | 105 | } |
106 | ||
107 | //_____________________________________________________________________ | |
108 | void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits) | |
109 | { | |
9bd2ccc2 | 110 | TIter next(fHitsArray); |
c9dd1c4d | 111 | AliFMDHit * hit; |
112 | while ((hit = static_cast<AliFMDHit *>(next()))) | |
113 | GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032); | |
114 | } | |
115 | ||
116 | //_____________________________________________________________________ | |
117 | void AliFMDQADataMakerSim::MakeHits(TTree * hitTree) | |
118 | { | |
119 | // make QA data from Hit Tree | |
120 | ||
121 | TBranch * branch = hitTree->GetBranch("FMD") ; | |
122 | if (!branch) { | |
123 | AliWarning("FMD branch in Hit Tree not found") ; | |
124 | return; | |
125 | } | |
9bd2ccc2 | 126 | fHitsArray->Clear(); |
127 | branch->SetAddress(&fHitsArray) ; | |
c9dd1c4d | 128 | |
129 | for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) { | |
130 | branch->GetEntry(ientry); | |
9bd2ccc2 | 131 | MakeHits(fHitsArray); //tmp); |
c9dd1c4d | 132 | } |
9bd2ccc2 | 133 | |
c9dd1c4d | 134 | } |
135 | ||
136 | //_____________________________________________________________________ | |
137 | void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits) | |
138 | { | |
139 | // makes data from Digits | |
140 | if(!digits) return; | |
141 | ||
9bd2ccc2 | 142 | for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) { |
c9dd1c4d | 143 | //Raw ADC counts |
144 | AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i)); | |
145 | GetDigitsData(0)->Fill(digit->Counts()); | |
146 | } | |
147 | } | |
148 | ||
149 | //_____________________________________________________________________ | |
150 | void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree) | |
151 | { | |
152 | ||
9bd2ccc2 | 153 | fDigitsArray->Clear(); |
c9dd1c4d | 154 | TBranch * branch = digitTree->GetBranch("FMD") ; |
155 | if (!branch) { | |
156 | AliWarning("FMD branch in Digit Tree not found") ; | |
157 | return; | |
158 | } | |
9bd2ccc2 | 159 | branch->SetAddress(&fDigitsArray) ; |
c9dd1c4d | 160 | branch->GetEntry(0) ; |
9bd2ccc2 | 161 | MakeDigits(fDigitsArray) ; |
c9dd1c4d | 162 | } |
163 | ||
164 | //_____________________________________________________________________ | |
165 | void AliFMDQADataMakerSim::StartOfDetectorCycle() | |
166 | { | |
167 | ||
168 | } | |
169 | //_____________________________________________________________________ | |
170 | // | |
171 | // EOF | |
172 | // |