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);
118 //__________________________________________________________________
119 void AliMUONQADataMakerSim::InitSDigits()
121 /// Initialized SDigits spectra
122 const Bool_t expert = kTRUE ;
123 const Bool_t image = kTRUE ;
125 TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits;Detection element Id;Counts", 1400, 100, 1500);
126 Add2SDigitsList(h0, 0, !expert, image);
128 TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits;Charge [??];Counts", 4096, 0, 4095);
129 Add2SDigitsList(h1, 1, !expert, image);
133 //__________________________________________________________________
134 void AliMUONQADataMakerSim::InitDigits()
136 /// Initialized Digits spectra
137 const Bool_t expert = kTRUE ;
138 const Bool_t image = kTRUE ;
140 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
141 Add2DigitsList(h0, 0, !expert, image);
143 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
144 Add2DigitsList(h1, 1, !expert, image);
148 //__________________________________________________________________
149 void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)
151 /// makes data from Hits
153 fHitStore = AliMUONVHitStore::Create(*hitsTree);
154 fHitStore->Connect(*hitsTree, false);
155 hitsTree->GetEvent(0);
157 TIter next(fHitStore->CreateIterator());
159 AliMUONHit* hit = 0x0;
161 while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
163 GetHitsData(0)->Fill(hit->DetElemId());
164 GetHitsData(1)->Fill(hit->Momentum());
170 //__________________________________________________________________
171 void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)
173 /// makes data from SDigits
175 fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
176 fDigitStore->Connect(*sdigitsTree, false);
177 sdigitsTree->GetEvent(0);
179 TIter next(fDigitStore->CreateIterator());
181 AliMUONVDigit* dig = 0x0;
183 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
185 GetSDigitsData(0)->Fill(dig->DetElemId());
186 GetSDigitsData(1)->Fill(dig->Charge());
190 //__________________________________________________________________
191 void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)
193 /// makes data from Digits
195 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
196 fDigitStore->Connect(*digitsTree, false);
197 digitsTree->GetEvent(0);
199 TIter next(fDigitStore->CreateIterator());
201 AliMUONVDigit* dig = 0x0;
203 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
205 GetDigitsData(0)->Fill(dig->DetElemId());
206 GetDigitsData(1)->Fill(dig->ADC());
210 //____________________________________________________________________________
211 void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
213 ///Detector specific actions at end of cycle
214 // do the QA checking
215 AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
219 //____________________________________________________________________________
220 void AliMUONQADataMakerSim::StartOfDetectorCycle()
222 /// Detector specific actions at start of cycle