]>
Commit | Line | Data |
---|---|---|
04236e67 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
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 | ||
3770be44 | 16 | // $Id$ |
17 | ||
18 | #include "AliMUONQADataMakerSim.h" | |
19 | #include "AliMUONHit.h" | |
20 | #include "AliMUONDigit.h" | |
21 | #include "AliMUONVHitStore.h" | |
22 | #include "AliMUONVDigitStore.h" | |
23 | ||
24 | // --- AliRoot header files --- | |
25 | #include "AliLog.h" | |
26 | #include "AliQAChecker.h" | |
04236e67 | 27 | |
28 | // --- ROOT system --- | |
29 | #include <TClonesArray.h> | |
30 | #include <TFile.h> | |
31 | #include <TH1F.h> | |
32 | #include <TH1I.h> | |
33 | #include <TH2F.h> | |
3770be44 | 34 | #include <TTree.h> |
04236e67 | 35 | |
36 | //----------------------------------------------------------------------------- | |
37 | /// \class AliMUONQADataMakerSim | |
38 | /// | |
39 | /// MUON base class for quality assurance data (histo) maker | |
40 | /// | |
41 | /// \author C. Finck | |
42 | ||
43 | /// \cond CLASSIMP | |
44 | ClassImp(AliMUONQADataMakerSim) | |
45 | /// \endcond | |
46 | ||
47 | //____________________________________________________________________________ | |
48 | AliMUONQADataMakerSim::AliMUONQADataMakerSim() : | |
3770be44 | 49 | AliQADataMakerSim(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"), |
50 | fHitStore(0x0), | |
51 | fDigitStore(0x0) | |
04236e67 | 52 | { |
53 | /// ctor | |
d874bd09 | 54 | AliDebug(1,""); |
04236e67 | 55 | } |
56 | ||
57 | //____________________________________________________________________________ | |
58 | AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) : | |
4a3224ff | 59 | AliQADataMakerSim(), |
60 | fHitStore(0x0), | |
61 | fDigitStore(0x0) | |
04236e67 | 62 | { |
d874bd09 | 63 | AliDebug(1,""); |
64 | ||
4a3224ff | 65 | ///copy ctor |
66 | if ( qadm.fHitStore ) | |
67 | { | |
68 | fHitStore = static_cast<AliMUONVHitStore*>(qadm.fHitStore->Clone()); | |
69 | } | |
70 | if ( qadm.fDigitStore ) | |
71 | { | |
72 | fDigitStore = static_cast<AliMUONVDigitStore*>(qadm.fDigitStore->Clone()); | |
73 | } | |
04236e67 | 74 | SetName((const char*)qadm.GetName()) ; |
75 | SetTitle((const char*)qadm.GetTitle()); | |
76 | } | |
77 | ||
78 | //__________________________________________________________________ | |
79 | AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm ) | |
80 | { | |
d874bd09 | 81 | AliDebug(1,""); |
82 | ||
04236e67 | 83 | /// Equal operator. |
84 | this->~AliMUONQADataMakerSim(); | |
85 | new(this) AliMUONQADataMakerSim(qadm); | |
86 | return *this; | |
87 | } | |
88 | ||
89 | //__________________________________________________________________ | |
90 | AliMUONQADataMakerSim::~AliMUONQADataMakerSim() | |
91 | { | |
d874bd09 | 92 | AliDebug(1,""); |
93 | ||
04236e67 | 94 | /// dtor |
3770be44 | 95 | delete fHitStore; |
96 | delete fDigitStore; | |
97 | } | |
98 | ||
99 | //__________________________________________________________________ | |
100 | void AliMUONQADataMakerSim::InitHits() | |
101 | { | |
102 | /// Initialized hit spectra | |
103 | TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits", 1400, 100., 1500.); | |
104 | Add2HitsList(h0, 0); | |
105 | ||
106 | TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits ", 300, 0., 300.); | |
107 | Add2HitsList(h1, 1); | |
108 | return; | |
109 | } | |
110 | ||
111 | //__________________________________________________________________ | |
112 | void AliMUONQADataMakerSim::InitSDigits() | |
113 | { | |
114 | /// Initialized SDigits spectra | |
115 | TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits", 1400, 100, 1500); | |
116 | Add2SDigitsList(h0, 0); | |
117 | ||
118 | TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits", 4096, 0, 4095); | |
119 | Add2SDigitsList(h1, 1); | |
120 | ||
121 | } | |
122 | ||
123 | //__________________________________________________________________ | |
124 | void AliMUONQADataMakerSim::InitDigits() | |
125 | { | |
126 | /// Initialized Digits spectra | |
127 | TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits", 1400, 100, 1500); | |
128 | Add2DigitsList(h0, 0); | |
129 | ||
130 | TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits", 4096, 0, 4095); | |
131 | Add2DigitsList(h1, 1); | |
132 | ||
133 | } | |
134 | ||
135 | //__________________________________________________________________ | |
136 | void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree) | |
137 | { | |
138 | /// makes data from Hits | |
139 | if (!fHitStore) | |
140 | fHitStore = AliMUONVHitStore::Create(*hitsTree); | |
141 | fHitStore->Connect(*hitsTree, false); | |
142 | hitsTree->GetEvent(0); | |
143 | ||
144 | TIter next(fHitStore->CreateIterator()); | |
145 | ||
146 | AliMUONHit* hit = 0x0; | |
147 | ||
148 | while ( ( hit = static_cast<AliMUONHit*>(next()) ) ) | |
149 | { | |
150 | GetHitsData(0)->Fill(hit->DetElemId()); | |
151 | GetHitsData(1)->Fill(hit->Momentum()); | |
152 | } | |
153 | ||
154 | ||
04236e67 | 155 | } |
156 | ||
3770be44 | 157 | //__________________________________________________________________ |
158 | void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree) | |
159 | { | |
160 | /// makes data from SDigits | |
161 | if (!fDigitStore) | |
162 | fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree); | |
163 | fDigitStore->Connect(*sdigitsTree, false); | |
164 | sdigitsTree->GetEvent(0); | |
165 | ||
166 | TIter next(fDigitStore->CreateIterator()); | |
167 | ||
168 | AliMUONVDigit* dig = 0x0; | |
169 | ||
170 | while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) ) | |
171 | { | |
172 | GetSDigitsData(0)->Fill(dig->DetElemId()); | |
173 | GetSDigitsData(1)->Fill(dig->Charge()); | |
174 | } | |
175 | } | |
176 | ||
177 | //__________________________________________________________________ | |
178 | void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree) | |
179 | { | |
180 | /// makes data from Digits | |
181 | if (!fDigitStore) | |
182 | fDigitStore = AliMUONVDigitStore::Create(*digitsTree); | |
183 | fDigitStore->Connect(*digitsTree, false); | |
184 | digitsTree->GetEvent(0); | |
185 | ||
186 | TIter next(fDigitStore->CreateIterator()); | |
187 | ||
188 | AliMUONVDigit* dig = 0x0; | |
189 | ||
190 | while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) ) | |
191 | { | |
192 | GetDigitsData(0)->Fill(dig->DetElemId()); | |
193 | GetDigitsData(1)->Fill(dig->ADC()); | |
194 | } | |
195 | } | |
196 | ||
04236e67 | 197 | //____________________________________________________________________________ |
57acd2d2 | 198 | void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray** list) |
04236e67 | 199 | { |
200 | ///Detector specific actions at end of cycle | |
201 | // do the QA checking | |
202 | AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ; | |
203 | } | |
204 | ||
205 | ||
206 | //____________________________________________________________________________ | |
207 | void AliMUONQADataMakerSim::StartOfDetectorCycle() | |
208 | { | |
209 | /// Detector specific actions at start of cycle | |
210 | ||
211 | } |