AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONQADataMakerSim.cxx
Go to the documentation of this file.
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 
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"
27 
28 // --- ROOT system ---
29 #include <TClonesArray.h>
30 #include <TFile.h>
31 #include <TH1F.h>
32 #include <TH1I.h>
33 #include <TH2F.h>
34 #include <TTree.h>
35 
36 //-----------------------------------------------------------------------------
42 
46 
47 //____________________________________________________________________________
49  AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
50  fHitStore(0x0),
51  fDigitStore(0x0)
52 {
54 
55  AliDebug(AliQAv1::GetQADebugLevel(),"");
56 }
57 
58 //____________________________________________________________________________
60  AliQADataMakerSim(),
61  fHitStore(0x0),
62  fDigitStore(0x0)
63 {
65 
66  AliDebug(AliQAv1::GetQADebugLevel(),"");
67 
68  if ( qadm.fHitStore )
69  {
70  fHitStore = static_cast<AliMUONVHitStore*>(qadm.fHitStore->Clone());
71  }
72  if ( qadm.fDigitStore )
73  {
74  fDigitStore = static_cast<AliMUONVDigitStore*>(qadm.fDigitStore->Clone());
75  }
76  SetName((const char*)qadm.GetName()) ;
77  SetTitle((const char*)qadm.GetTitle());
78 }
79 
80 //__________________________________________________________________
82 {
84 
85  AliDebug(AliQAv1::GetQADebugLevel(),"");
86 
87  this->~AliMUONQADataMakerSim();
88  new(this) AliMUONQADataMakerSim(qadm);
89  return *this;
90 }
91 
92 //__________________________________________________________________
94 {
96 
97  AliDebug(AliQAv1::GetQADebugLevel(),"");
98 
99  delete fHitStore;
100  delete fDigitStore;
101 }
102 
103 //__________________________________________________________________
105 {
107  const Bool_t expert = kTRUE ;
108  const Bool_t image = kTRUE ;
109 
110  TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits;Detection element Id;Counts", 1400, 100., 1500.);
111  Add2HitsList(h0, 0, !expert, image);
112 
113  TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits;P [erg];Counts ", 300, 0., 300.);
114  Add2HitsList(h1, 1, !expert, image);
115  //
116  ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
117 }
118 
119 //__________________________________________________________________
121 {
123  const Bool_t expert = kTRUE ;
124  const Bool_t image = kTRUE ;
125 
126  TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits;Detection element Id;Counts", 1400, 100, 1500);
127  Add2SDigitsList(h0, 0, !expert, image);
128 
129  TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits;Charge [??];Counts", 4096, 0, 4095);
130  Add2SDigitsList(h1, 1, !expert, image);
131  //
132  ClonePerTrigClass(AliQAv1::kSDIGITS); // this should be the last line
133 }
134 
135 //__________________________________________________________________
137 {
139  const Bool_t expert = kTRUE ;
140  const Bool_t image = kTRUE ;
141 
142  TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
143  Add2DigitsList(h0, 0, !expert, image);
144 
145  TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
146  Add2DigitsList(h1, 1, !expert, image);
147  //
148  ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
149 }
150 
151 //__________________________________________________________________
152 void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)
153 {
155 
156  if (!fHitStore)
157  fHitStore = AliMUONVHitStore::Create(*hitsTree);
158  fHitStore->Connect(*hitsTree, false);
159  hitsTree->GetEvent(0);
160 
161  TIter next(fHitStore->CreateIterator());
162 
163  AliMUONHit* hit = 0x0;
164 
165  while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
166  {
167  FillHitsData(0,hit->DetElemId());
168  FillHitsData(1,hit->Momentum());
169  }
170  //
171  IncEvCountCycleHits();
172  IncEvCountTotalHits();
173  //
174 }
175 
176 //__________________________________________________________________
177 void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)
178 {
180 
181  if (!fDigitStore)
182  fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
183  fDigitStore->Connect(*sdigitsTree, false);
184  sdigitsTree->GetEvent(0);
185 
186  TIter next(fDigitStore->CreateIterator());
187 
188  AliMUONVDigit* dig = 0x0;
189 
190  while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
191  {
192  FillSDigitsData(0,dig->DetElemId());
193  FillSDigitsData(1,dig->Charge());
194  }
195  //
196  IncEvCountCycleSDigits();
197  IncEvCountTotalSDigits();
198  //
199 }
200 
201 //__________________________________________________________________
202 void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)
203 {
205 
206  if (!fDigitStore)
208  fDigitStore->Connect(*digitsTree, false);
209  digitsTree->GetEvent(0);
210 
211  TIter next(fDigitStore->CreateIterator());
212 
213  AliMUONVDigit* dig = 0x0;
214 
215  while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
216  {
217  FillDigitsData(0,dig->DetElemId());
218  FillDigitsData(1,dig->ADC());
219  }
220  //
221  IncEvCountCycleDigits();
222  IncEvCountTotalDigits();
223  //
224 }
225 
226 //____________________________________________________________________________
227 void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
228 {
230  // do the QA checking
231  ResetEventTrigClasses();
232  AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
233 }
234 
235 
236 //____________________________________________________________________________
238 {
240 
241 }
virtual void MakeHits()
make hits QA from Array (not implemented)
Interface for a digit container.
virtual void InitDigits()
init SDigits QA from Array
Virtual store to hold digit.
#define TObjArray
virtual void EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray **list)
virtual void InitHits()
init hits QA from Array
virtual TIterator * CreateIterator() const =0
Create an iterator to loop over all our digits.
AliMUONQADataMakerSim & operator=(const AliMUONQADataMakerSim &qadm)
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual void InitSDigits()
init SDigits QA from Array
virtual void MakeDigits()
make Digits QA from Array (not implemented)
virtual AliMUONVDigitStore * Create() const =0
Create an (empty) object of the same concrete class as *this.
virtual AliMUONVStore * Create() const =0
Create an empty copy of this.
MUON Quality assurance data maker.
virtual void MakeSDigits()
make SDigits QA from Array (not implemented)
AliMUONVHitStore * fHitStore
! pointer to hit store
MonteCarlo hit.
Definition: AliMUONHit.h:24
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over hits.
ABC of a MUON digit.
Definition: AliMUONVDigit.h:18
virtual Bool_t Connect(TTree &tree, Bool_t alone=kTRUE) const
Connect us to a TTree (only valid if CanConnect()==kTRUE)
AliMUONVDigitStore * fDigitStore
! pointer to digit store