remoe duplicate QA initialisation and do ESD QA for same detectors as RecPoint QA
[u/mrichter/AliRoot.git] / MUON / AliMUONQADataMakerSim.cxx
CommitLineData
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
44ClassImp(AliMUONQADataMakerSim)
45/// \endcond
46
47//____________________________________________________________________________
48AliMUONQADataMakerSim::AliMUONQADataMakerSim() :
3770be44 49 AliQADataMakerSim(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker"),
50 fHitStore(0x0),
51 fDigitStore(0x0)
04236e67 52{
53 /// ctor
54}
55
56//____________________________________________________________________________
57AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) :
4a3224ff 58 AliQADataMakerSim(),
59 fHitStore(0x0),
60 fDigitStore(0x0)
04236e67 61{
4a3224ff 62 ///copy ctor
63 if ( qadm.fHitStore )
64 {
65 fHitStore = static_cast<AliMUONVHitStore*>(qadm.fHitStore->Clone());
66 }
67 if ( qadm.fDigitStore )
68 {
69 fDigitStore = static_cast<AliMUONVDigitStore*>(qadm.fDigitStore->Clone());
70 }
04236e67 71 SetName((const char*)qadm.GetName()) ;
72 SetTitle((const char*)qadm.GetTitle());
73}
74
75//__________________________________________________________________
76AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm )
77{
78 /// Equal operator.
79 this->~AliMUONQADataMakerSim();
80 new(this) AliMUONQADataMakerSim(qadm);
81 return *this;
82}
83
84//__________________________________________________________________
85AliMUONQADataMakerSim::~AliMUONQADataMakerSim()
86{
87 /// dtor
3770be44 88 delete fHitStore;
89 delete fDigitStore;
90}
91
92//__________________________________________________________________
93void AliMUONQADataMakerSim::InitHits()
94{
95 /// Initialized hit spectra
96 TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits", 1400, 100., 1500.);
97 Add2HitsList(h0, 0);
98
99 TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits ", 300, 0., 300.);
100 Add2HitsList(h1, 1);
101 return;
102}
103
104//__________________________________________________________________
105void AliMUONQADataMakerSim::InitSDigits()
106{
107 /// Initialized SDigits spectra
108 TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits", 1400, 100, 1500);
109 Add2SDigitsList(h0, 0);
110
111 TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits", 4096, 0, 4095);
112 Add2SDigitsList(h1, 1);
113
114}
115
116//__________________________________________________________________
117void AliMUONQADataMakerSim::InitDigits()
118{
119 /// Initialized Digits spectra
120 TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits", 1400, 100, 1500);
121 Add2DigitsList(h0, 0);
122
123 TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits", 4096, 0, 4095);
124 Add2DigitsList(h1, 1);
125
126}
127
128//__________________________________________________________________
129void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)
130{
131 /// makes data from Hits
132 if (!fHitStore)
133 fHitStore = AliMUONVHitStore::Create(*hitsTree);
134 fHitStore->Connect(*hitsTree, false);
135 hitsTree->GetEvent(0);
136
137 TIter next(fHitStore->CreateIterator());
138
139 AliMUONHit* hit = 0x0;
140
141 while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
142 {
143 GetHitsData(0)->Fill(hit->DetElemId());
144 GetHitsData(1)->Fill(hit->Momentum());
145 }
146
147
04236e67 148}
149
3770be44 150//__________________________________________________________________
151void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)
152{
153 /// makes data from SDigits
154 if (!fDigitStore)
155 fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
156 fDigitStore->Connect(*sdigitsTree, false);
157 sdigitsTree->GetEvent(0);
158
159 TIter next(fDigitStore->CreateIterator());
160
161 AliMUONVDigit* dig = 0x0;
162
163 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
164 {
165 GetSDigitsData(0)->Fill(dig->DetElemId());
166 GetSDigitsData(1)->Fill(dig->Charge());
167 }
168}
169
170//__________________________________________________________________
171void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)
172{
173 /// makes data from Digits
174 if (!fDigitStore)
175 fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
176 fDigitStore->Connect(*digitsTree, false);
177 digitsTree->GetEvent(0);
178
179 TIter next(fDigitStore->CreateIterator());
180
181 AliMUONVDigit* dig = 0x0;
182
183 while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
184 {
185 GetDigitsData(0)->Fill(dig->DetElemId());
186 GetDigitsData(1)->Fill(dig->ADC());
187 }
188}
189
04236e67 190//____________________________________________________________________________
92a357bf 191void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list)
04236e67 192{
193 ///Detector specific actions at end of cycle
194 // do the QA checking
195 AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
196}
197
198
199//____________________________________________________________________________
200void AliMUONQADataMakerSim::StartOfDetectorCycle()
201{
202 /// Detector specific actions at start of cycle
203
204}