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 **************************************************************************/
18 #include "AliMUONQADataMakerSim.h"
19 #include "AliMUONHit.h"
20 #include "AliMUONDigit.h"
21 #include "AliMUONVHitStore.h"
22 #include "AliMUONVDigitStore.h"
24 // --- AliRoot header files ---
26 #include "AliQAChecker.h"
28 // --- ROOT system ---
29 #include <TClonesArray.h>
36 //-----------------------------------------------------------------------------
37 /// \class AliMUONQADataMakerSim
39 /// MUON base class for quality assurance data (histo) maker
44 ClassImp(AliMUONQADataMakerSim)
47 //____________________________________________________________________________
48 AliMUONQADataMakerSim::AliMUONQADataMakerSim() :
49 AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
53 /// Default constructor
55 AliDebug(AliQAv1::GetQADebugLevel(),"");
58 //____________________________________________________________________________
59 AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) :
66 AliDebug(AliQAv1::GetQADebugLevel(),"");
70 fHitStore = static_cast<AliMUONVHitStore*>(qadm.fHitStore->Clone());
72 if ( qadm.fDigitStore )
74 fDigitStore = static_cast<AliMUONVDigitStore*>(qadm.fDigitStore->Clone());
76 SetName((const char*)qadm.GetName()) ;
77 SetTitle((const char*)qadm.GetTitle());
80 //__________________________________________________________________
81 AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm )
83 /// Assignment operator
85 AliDebug(AliQAv1::GetQADebugLevel(),"");
87 this->~AliMUONQADataMakerSim();
88 new(this) AliMUONQADataMakerSim(qadm);
92 //__________________________________________________________________
93 AliMUONQADataMakerSim::~AliMUONQADataMakerSim()
97 AliDebug(AliQAv1::GetQADebugLevel(),"");
103 //__________________________________________________________________
104 void AliMUONQADataMakerSim::InitHits()
106 /// Initialized hit spectra
107 const Bool_t expert = kTRUE ;
108 const Bool_t image = kTRUE ;
110 TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits;Detection element Id;Counts", 1400, 100., 1500.);
111 Add2HitsList(h0, 0, !expert, image);
113 TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits;P [erg];Counts ", 300, 0., 300.);
114 Add2HitsList(h1, 1, !expert, image);
116 ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
119 //__________________________________________________________________
120 void AliMUONQADataMakerSim::InitSDigits()
122 /// Initialized SDigits spectra
123 const Bool_t expert = kTRUE ;
124 const Bool_t image = kTRUE ;
126 TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits;Detection element Id;Counts", 1400, 100, 1500);
127 Add2SDigitsList(h0, 0, !expert, image);
129 TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits;Charge [??];Counts", 4096, 0, 4095);
130 Add2SDigitsList(h1, 1, !expert, image);
132 ClonePerTrigClass(AliQAv1::kSDIGITS); // this should be the last line
135 //__________________________________________________________________
136 void AliMUONQADataMakerSim::InitDigits()
138 /// Initialized Digits spectra
139 const Bool_t expert = kTRUE ;
140 const Bool_t image = kTRUE ;
142 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
143 Add2DigitsList(h0, 0, !expert, image);
145 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
146 Add2DigitsList(h1, 1, !expert, image);
148 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
151 //__________________________________________________________________
152 void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)
154 /// makes data from Hits
157 fHitStore = AliMUONVHitStore::Create(*hitsTree);
158 fHitStore->Connect(*hitsTree, false);
159 hitsTree->GetEvent(0);
161 TIter next(fHitStore->CreateIterator());
163 AliMUONHit* hit = 0x0;
165 while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
167 FillHitsData(0,hit->DetElemId());
168 FillHitsData(1,hit->Momentum());
171 IncEvCountCycleHits();
172 IncEvCountTotalHits();
176 //__________________________________________________________________
177 void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)
179 /// makes data from SDigits
182 fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
183 fDigitStore->Connect(*sdigitsTree, false);
184 sdigitsTree->GetEvent(0);
186 TIter next(fDigitStore->CreateIterator());
188 AliMUONVDigit* dig = 0x0;
190 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
192 FillSDigitsData(0,dig->DetElemId());
193 FillSDigitsData(1,dig->Charge());
196 IncEvCountCycleSDigits();
197 IncEvCountTotalSDigits();
201 //__________________________________________________________________
202 void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)
204 /// makes data from Digits
207 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
208 fDigitStore->Connect(*digitsTree, false);
209 digitsTree->GetEvent(0);
211 TIter next(fDigitStore->CreateIterator());
213 AliMUONVDigit* dig = 0x0;
215 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
217 FillDigitsData(0,dig->DetElemId());
218 FillDigitsData(1,dig->ADC());
221 IncEvCountCycleDigits();
222 IncEvCountTotalDigits();
226 //____________________________________________________________________________
227 void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
229 ///Detector specific actions at end of cycle
230 // do the QA checking
231 ResetEventTrigClasses();
232 AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
236 //____________________________________________________________________________
237 void AliMUONQADataMakerSim::StartOfDetectorCycle()
239 /// Detector specific actions at start of cycle