1 /**************************************************************************
2 * Copyright(c) 2004, 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 **************************************************************************/
15 // --- ROOT system ---
17 #include <TClonesArray.h>
22 // --- AliRoot header files ---
23 #include "AliESDEvent.h"
25 #include "AliFMDQADataMakerRec.h"
26 #include "AliFMDDigit.h"
27 #include "AliFMDRecPoint.h"
28 #include "AliQAChecker.h"
29 #include "AliESDFMD.h"
30 #include "AliFMDParameters.h"
32 //_____________________________________________________________________
33 // This is the class that collects the QA data for the FMD during
36 // The following data types are picked up:
40 // The following data types are not supported (yet):
42 // Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
43 //_____________________________________________________________________
45 ClassImp(AliFMDQADataMakerRec)
47 ; // For Emacs - do not delete!
50 //_____________________________________________________________________
51 AliFMDQADataMakerRec::AliFMDQADataMakerRec() :
52 AliQADataMakerRec(AliQA::GetDetName(AliQA::kFMD),
53 "FMD Quality Assurance Data Maker")
58 //_____________________________________________________________________
59 AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm) :
64 // qadm Object to copy from
69 //_____________________________________________________________________
72 AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task,
75 // Detector specific actions at end of cycle
77 AliLog::Message(5,"FMD: end of detector cycle","AliFMDQADataMakerRec","AliFMDQADataMakerRec","AliFMDQADataMakerRec::EndOfDetectorCycle","AliFMDQADataMakerRec.cxx",95);
78 AliQAChecker::Instance()->Run(AliQA::kFMD, task, list);
81 //_____________________________________________________________________
82 void AliFMDQADataMakerRec::InitESDs()
84 // create Digits histograms in Digits subdir
85 TH1F* hEnergyOfESD = new TH1F("hEnergyOfESD","Energy distribution",100,0,3);
86 hEnergyOfESD->SetXTitle("Edep/Emip");
87 hEnergyOfESD->SetYTitle("Counts");
88 Add2ESDsList(hEnergyOfESD, 0);
92 //_____________________________________________________________________
93 void AliFMDQADataMakerRec::InitDigits()
95 // create Digits histograms in Digits subdir
96 TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",
98 // TH1F* hEnergyOfDigits = new TH1F("hEnergyOfDigits", "Energy distribution",
100 hADCCounts->SetXTitle("ADC counts");
101 hADCCounts->SetYTitle("");
102 // hEnergyOfDigits->SetXTitle("Edep/Emip");
103 // hEnergyOfDigits->SetYTitle("Counts");
104 Add2DigitsList(hADCCounts, 0);
105 // Add2DigitsList(hEnergyOfDigits, 1);
109 //_____________________________________________________________________
110 void AliFMDQADataMakerRec::InitRecPoints()
112 TH1F* hEnergyOfRecpoints = new TH1F("hEnergyOfRecpoints",
113 "Energy Distribution",100,0,3);
114 hEnergyOfRecpoints->SetXTitle("Edep/Emip");
115 hEnergyOfRecpoints->SetYTitle("");
116 Add2RecPointsList(hEnergyOfRecpoints,0);
119 //_____________________________________________________________________
120 void AliFMDQADataMakerRec::InitRaws()
125 //_____________________________________________________________________
126 void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
129 AliError("FMD ESD object not found!!") ;
132 AliESDFMD* fmd = esd->GetFMDData();
135 for(UShort_t det=1;det<=3;det++) {
136 for (UShort_t ir = 0; ir < 2; ir++) {
137 Char_t ring = (ir == 0 ? 'I' : 'O');
138 UShort_t nsec = (ir == 0 ? 20 : 40);
139 UShort_t nstr = (ir == 0 ? 512 : 256);
140 for(UShort_t sec =0; sec < nsec; sec++) {
141 for(UShort_t strip = 0; strip < nstr; strip++) {
142 Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
143 if(mult == AliESDFMD::kInvalidMult) continue;
145 GetESDsData(0)->Fill(mult);
152 //_____________________________________________________________________
153 void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
155 // makes data from Digits
157 AliError("FMD Digit object not found!!") ;
160 for(Int_t i=0;i<digits->GetEntries();i++) {
162 AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
163 GetDigitsData(0)->Fill(digit->Counts());
167 //_____________________________________________________________________
168 void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
171 TClonesArray* digits = new TClonesArray("AliFMDDigit", 1000) ;
172 TBranch* branch = digitTree->GetBranch("FMD") ;
174 AliWarning("FMD branch in Digit Tree not found") ;
178 branch->SetAddress(&digits) ;
179 branch->GetEntry(0) ;
183 //_____________________________________________________________________
184 void AliFMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
189 //_____________________________________________________________________
190 void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
192 // makes data from RecPoints
193 TBranch *fmdbranch = clustersTree->GetBranch("FMD");
195 AliError("can't get the branch with the FMD recpoints !");
199 TClonesArray * fmdrecpoints = new TClonesArray("AliFMDRecPoint", 1000) ;
200 fmdbranch->SetAddress(&fmdrecpoints);
201 fmdbranch->GetEntry(0);
203 TIter next(fmdrecpoints) ;
204 AliFMDRecPoint * rp ;
205 while ((rp = static_cast<AliFMDRecPoint*>(next()))) {
206 GetRecPointsData(0)->Fill(rp->Particles()) ;
208 fmdrecpoints->Delete();
213 //_____________________________________________________________________
214 void AliFMDQADataMakerRec::StartOfDetectorCycle()
220 //_____________________________________________________________________