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"
31 #include "AliFMDRawReader.h"
33 //_____________________________________________________________________
34 // This is the class that collects the QA data for the FMD during
37 // The following data types are picked up:
41 // The following data types are not supported (yet):
43 // Author : Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
44 //_____________________________________________________________________
46 ClassImp(AliFMDQADataMakerRec)
48 ; // For Emacs - do not delete!
51 //_____________________________________________________________________
52 AliFMDQADataMakerRec::AliFMDQADataMakerRec() :
53 AliQADataMakerRec(AliQA::GetDetName(AliQA::kFMD),
54 "FMD Quality Assurance Data Maker"),
55 fDigitsArray("AliFMDDigit", 1000),
56 fRecPointsArray("AliFMDRecPoints", 1000)
62 //_____________________________________________________________________
63 AliFMDQADataMakerRec::AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm)
64 : AliQADataMakerRec(AliQA::GetDetName(AliQA::kFMD),
65 "FMD Quality Assurance Data Maker"),
66 fDigitsArray(qadm.fDigitsArray),
67 fRecPointsArray(qadm.fRecPointsArray)
71 // qadm Object to copy from
74 //_____________________________________________________________________
75 AliFMDQADataMakerRec& AliFMDQADataMakerRec::operator = (const AliFMDQADataMakerRec& qadm )
77 fDigitsArray = qadm.fDigitsArray;
78 fRecPointsArray = qadm.fRecPointsArray;
82 //_____________________________________________________________________
83 AliFMDQADataMakerRec::~AliFMDQADataMakerRec()
89 //_____________________________________________________________________
92 AliFMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task,
95 // Detector specific actions at end of cycle
97 AliLog::Message(5,"FMD: end of detector cycle",
98 "AliFMDQADataMakerRec","AliFMDQADataMakerRec",
99 "AliFMDQADataMakerRec::EndOfDetectorCycle",
100 "AliFMDQADataMakerRec.cxx",95);
101 AliQAChecker::Instance()->Run(AliQA::kFMD, task, list);
104 //_____________________________________________________________________
105 void AliFMDQADataMakerRec::InitESDs()
107 // create Digits histograms in Digits subdir
108 TH1F* hEnergyOfESD = new TH1F("hEnergyOfESD","Energy distribution",100,0,3);
109 hEnergyOfESD->SetXTitle("Edep/Emip");
110 hEnergyOfESD->SetYTitle("Counts");
111 Add2ESDsList(hEnergyOfESD, 0);
115 //_____________________________________________________________________
116 /*void AliFMDQADataMakerRec::InitDigits()
118 // create Digits histograms in Digits subdir
119 TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",
121 hADCCounts->SetXTitle("ADC counts");
122 hADCCounts->SetYTitle("");
123 Add2DigitsList(hADCCounts, 0);
127 //_____________________________________________________________________
128 void AliFMDQADataMakerRec::InitRecPoints()
130 TH1F* hEnergyOfRecpoints = new TH1F("hEnergyOfRecpoints",
131 "Energy Distribution",100,0,3);
132 hEnergyOfRecpoints->SetXTitle("Edep/Emip");
133 hEnergyOfRecpoints->SetYTitle("");
134 Add2RecPointsList(hEnergyOfRecpoints,0);
137 //_____________________________________________________________________
138 void AliFMDQADataMakerRec::InitRaws()
140 TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",
142 hADCCounts->SetXTitle("ADC counts");
143 hADCCounts->SetYTitle("");
144 Add2RawsList(hADCCounts, 0);
148 //_____________________________________________________________________
149 void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
152 AliError("FMD ESD object not found!!") ;
155 AliESDFMD* fmd = esd->GetFMDData();
158 for(UShort_t det=1;det<=3;det++) {
159 for (UShort_t ir = 0; ir < 2; ir++) {
160 Char_t ring = (ir == 0 ? 'I' : 'O');
161 UShort_t nsec = (ir == 0 ? 20 : 40);
162 UShort_t nstr = (ir == 0 ? 512 : 256);
163 for(UShort_t sec =0; sec < nsec; sec++) {
164 for(UShort_t strip = 0; strip < nstr; strip++) {
165 Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
166 if(mult == AliESDFMD::kInvalidMult) continue;
168 GetESDsData(0)->Fill(mult);
176 //_____________________________________________________________________
177 void AliFMDQADataMakerRec::MakeDigits(TClonesArray * digits)
179 // makes data from Digits
181 AliError("FMD Digit object not found!!") ;
184 for(Int_t i=0;i<digits->GetEntriesFast();i++) {
186 AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
187 GetDigitsData(0)->Fill(digit->Counts());
191 //_____________________________________________________________________
192 void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
195 fDigitsArray.Clear();
196 TBranch* branch = digitTree->GetBranch("FMD");
198 AliWarning("FMD branch in Digit Tree not found") ;
201 TClonesArray* digitsAddress = &fDigitsArray;
202 branch->SetAddress(&digitsAddress);
204 MakeDigits(digitsAddress);
207 //_____________________________________________________________________
208 void AliFMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
210 fDigitsArray.Clear();
211 AliFMDRawReader fmdReader(rawReader,0);
212 TClonesArray* digitsAddress = &fDigitsArray;
213 fmdReader.ReadAdcs(digitsAddress);
215 for(Int_t i=0;i<fDigitsArray.GetEntriesFast();i++) {
217 AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray.At(i));
218 GetDigitsData(0)->Fill(digit->Counts());
223 //_____________________________________________________________________
224 void AliFMDQADataMakerRec::MakeRecPoints(TTree* clustersTree)
226 // makes data from RecPoints
227 fRecPointsArray.Clear();
228 TBranch *fmdbranch = clustersTree->GetBranch("FMD");
230 AliError("can't get the branch with the FMD recpoints !");
234 TClonesArray* RecPointsAddress = &fRecPointsArray;
236 fmdbranch->SetAddress(&RecPointsAddress);
237 fmdbranch->GetEntry(0);
239 TIter next(RecPointsAddress) ;
240 AliFMDRecPoint * rp ;
241 while ((rp = static_cast<AliFMDRecPoint*>(next()))) {
242 GetRecPointsData(0)->Fill(rp->Edep()) ;
247 //_____________________________________________________________________
248 void AliFMDQADataMakerRec::StartOfDetectorCycle()
254 //_____________________________________________________________________