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(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"),
56 //____________________________________________________________________________
57 AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) :
61 SetName((const char*)qadm.GetName()) ;
62 SetTitle((const char*)qadm.GetTitle());
65 //__________________________________________________________________
66 AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm )
69 this->~AliMUONQADataMakerSim();
70 new(this) AliMUONQADataMakerSim(qadm);
74 //__________________________________________________________________
75 AliMUONQADataMakerSim::~AliMUONQADataMakerSim()
82 //__________________________________________________________________
83 void AliMUONQADataMakerSim::InitHits()
85 /// Initialized hit spectra
86 TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits", 1400, 100., 1500.);
89 TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits ", 300, 0., 300.);
94 //__________________________________________________________________
95 void AliMUONQADataMakerSim::InitSDigits()
97 /// Initialized SDigits spectra
98 TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits", 1400, 100, 1500);
99 Add2SDigitsList(h0, 0);
101 TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits", 4096, 0, 4095);
102 Add2SDigitsList(h1, 1);
106 //__________________________________________________________________
107 void AliMUONQADataMakerSim::InitDigits()
109 /// Initialized Digits spectra
110 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits", 1400, 100, 1500);
111 Add2DigitsList(h0, 0);
113 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits", 4096, 0, 4095);
114 Add2DigitsList(h1, 1);
118 //__________________________________________________________________
119 void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)
121 /// makes data from Hits
123 fHitStore = AliMUONVHitStore::Create(*hitsTree);
124 fHitStore->Connect(*hitsTree, false);
125 hitsTree->GetEvent(0);
127 TIter next(fHitStore->CreateIterator());
129 AliMUONHit* hit = 0x0;
131 while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
133 GetHitsData(0)->Fill(hit->DetElemId());
134 GetHitsData(1)->Fill(hit->Momentum());
140 //__________________________________________________________________
141 void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)
143 /// makes data from SDigits
145 fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
146 fDigitStore->Connect(*sdigitsTree, false);
147 sdigitsTree->GetEvent(0);
149 TIter next(fDigitStore->CreateIterator());
151 AliMUONVDigit* dig = 0x0;
153 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
155 GetSDigitsData(0)->Fill(dig->DetElemId());
156 GetSDigitsData(1)->Fill(dig->Charge());
160 //__________________________________________________________________
161 void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)
163 /// makes data from Digits
165 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
166 fDigitStore->Connect(*digitsTree, false);
167 digitsTree->GetEvent(0);
169 TIter next(fDigitStore->CreateIterator());
171 AliMUONVDigit* dig = 0x0;
173 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
175 GetDigitsData(0)->Fill(dig->DetElemId());
176 GetDigitsData(1)->Fill(dig->ADC());
180 //____________________________________________________________________________
181 void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray* list)
183 ///Detector specific actions at end of cycle
184 // do the QA checking
185 AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
189 //____________________________________________________________________________
190 void AliMUONQADataMakerSim::StartOfDetectorCycle()
192 /// Detector specific actions at start of cycle