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")
56 fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ;
57 fRecPointsArray = new TClonesArray("AliFMDRecPoints", 1000) ;
60 //_____________________________________________________________________
61 AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& /*qadm*/)
66 // qadm Object to copy from
69 //_____________________________________________________________________
70 AliFMDQADataMakerRec::~AliFMDQADataMakerRec()
73 delete fRecPointsArray;
77 //_____________________________________________________________________
80 AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task,
83 // Detector specific actions at end of cycle
85 AliLog::Message(5,"FMD: end of detector cycle",
86 "AliFMDQADataMakerRec","AliFMDQADataMakerRec",
87 "AliFMDQADataMakerRec::EndOfDetectorCycle",
88 "AliFMDQADataMakerRec.cxx",95);
89 AliQAChecker::Instance()->Run(AliQA::kFMD, task, list);
92 //_____________________________________________________________________
93 void AliFMDQADataMakerRec::InitESDs()
95 // create Digits histograms in Digits subdir
96 TH1F* hEnergyOfESD = new TH1F("hEnergyOfESD","Energy distribution",100,0,3);
97 hEnergyOfESD->SetXTitle("Edep/Emip");
98 hEnergyOfESD->SetYTitle("Counts");
99 Add2ESDsList(hEnergyOfESD, 0);
103 //_____________________________________________________________________
104 void AliFMDQADataMakerRec::InitDigits()
106 // create Digits histograms in Digits subdir
107 TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",
109 hADCCounts->SetXTitle("ADC counts");
110 hADCCounts->SetYTitle("");
111 Add2DigitsList(hADCCounts, 0);
115 //_____________________________________________________________________
116 void AliFMDQADataMakerRec::InitRecPoints()
118 TH1F* hEnergyOfRecpoints = new TH1F("hEnergyOfRecpoints",
119 "Energy Distribution",100,0,3);
120 hEnergyOfRecpoints->SetXTitle("Edep/Emip");
121 hEnergyOfRecpoints->SetYTitle("");
122 Add2RecPointsList(hEnergyOfRecpoints,0);
125 //_____________________________________________________________________
126 void AliFMDQADataMakerRec::InitRaws()
131 //_____________________________________________________________________
132 void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
135 AliError("FMD ESD object not found!!") ;
138 AliESDFMD* fmd = esd->GetFMDData();
141 for(UShort_t det=1;det<=3;det++) {
142 for (UShort_t ir = 0; ir < 2; ir++) {
143 Char_t ring = (ir == 0 ? 'I' : 'O');
144 UShort_t nsec = (ir == 0 ? 20 : 40);
145 UShort_t nstr = (ir == 0 ? 512 : 256);
146 for(UShort_t sec =0; sec < nsec; sec++) {
147 for(UShort_t strip = 0; strip < nstr; strip++) {
148 Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
149 if(mult == AliESDFMD::kInvalidMult) continue;
151 GetESDsData(0)->Fill(mult);
158 //_____________________________________________________________________
159 void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
161 // makes data from Digits
163 AliError("FMD Digit object not found!!") ;
166 for(Int_t i=0;i<fDigitsArray->GetEntriesFast();i++) {
168 AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
169 GetDigitsData(0)->Fill(digit->Counts());
173 //_____________________________________________________________________
174 void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
177 fDigitsArray->Clear();
178 TBranch* branch = digitTree->GetBranch("FMD");
180 AliWarning("FMD branch in Digit Tree not found") ;
184 branch->SetAddress(&fDigitsArray);
186 MakeDigits(fDigitsArray);
189 //_____________________________________________________________________
190 void AliFMDQADataMakerRec::MakeRaws(AliRawReader* /*rawReader*/)
195 //_____________________________________________________________________
196 void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
198 // makes data from RecPoints
199 fRecPointsArray->Clear();
200 TBranch *fmdbranch = clustersTree->GetBranch("FMD");
202 AliError("can't get the branch with the FMD recpoints !");
207 fmdbranch->SetAddress(&fRecPointsArray);
208 fmdbranch->GetEntry(0);
210 TIter next(fRecPointsArray) ;
211 AliFMDRecPoint * rp ;
212 while ((rp = static_cast<AliFMDRecPoint*>(next()))) {
213 GetRecPointsData(0)->Fill(rp->Particles()) ;
218 //_____________________________________________________________________
219 void AliFMDQADataMakerRec::StartOfDetectorCycle()
225 //_____________________________________________________________________