3 // This class contains a number of histograms for diagnostics of a TPC
4 // read out chamber from the raw data
11 #include "AliTPCRawHistograms.h"
21 #include <AliTPCRawStream.h>
25 //____________________________________________________________________
26 ClassImp(AliTPCRawHistograms)
28 //____________________________________________________________________
29 AliTPCRawHistograms::AliTPCRawHistograms()
34 // default constructor
37 //____________________________________________________________________
38 AliTPCRawHistograms::AliTPCRawHistograms(Int_t detector, const Char_t* /* comment */, Int_t timeStart, Int_t timeStop)
46 // make name and title
47 if (detector < 0 || detector >= 72) {
48 AliDebug(AliLog::kError, Form("Detector %d does not exist", detector));
52 Int_t sector = detector%18;
55 if (detector<18 || ( detector>=36 && detector<54))
66 name.Form("sector_%s%d_%s", side.Data(), sector, inout.Data());
69 SetTitle(Form("%s (detector %d)",name.Data(), detector));
71 fTimeStart = timeStart;
77 if (TString(name).Contains("IROC")) {
82 // 1 bin for each 0.5 cm
83 Int_t nBinsY = Int_t(4*yRange);
85 // TODO do NOT attach to the directory!
86 fhDigits = new TH3F("fhDigits", Form("signal distribution;row;pad;time", name.Data()), nPadRows, -0.5, -0.5 + nPadRows, 120, -0.5, 119.5, 100, 0, 1200);
87 fhSignal = new TH1F("fhSignal", "fhSignal", 200, 0, 2000);
89 fDigitTree = new TNtuple("fDigitTree", "fDigitTree", "row:pad:time:signal");
92 //____________________________________________________________________
93 AliTPCRawHistograms::AliTPCRawHistograms(const AliTPCRawHistograms& c) : TNamed(c)
97 ((AliTPCRawHistograms &)c).Copy(*this);
100 //____________________________________________________________________
101 AliTPCRawHistograms::~AliTPCRawHistograms()
109 //____________________________________________________________________
110 AliTPCRawHistograms &AliTPCRawHistograms::operator=(const AliTPCRawHistograms &c)
112 // assigment operator
115 ((AliTPCRawHistograms &) c).Copy(*this);
121 //____________________________________________________________________
122 Long64_t AliTPCRawHistograms::Merge(TCollection* list)
124 // Merge a list of AliTPCRawHistograms objects with this (needed for
126 // Returns the number of merged objects (including this).
134 TIterator* iter = list->MakeIterator();
140 // collections of measured and generated histograms
141 TList* collectionQmaxVsRow = new TList;
142 TList* collectionQtotVsRow = new TList;
143 TList* collectionSigmaYVsRow = new TList;
144 TList* collectionSigmaZVsRow = new TList;
146 TList* collectionQmaxProfileYVsRow = new TList;
147 TList* collectionQtotProfileYVsRow = new TList;
148 TList* collectionSigmaYProfileYVsRow = new TList;
149 TList* collectionSigmaZProfileYVsRow = new TList;
151 TList* collectionQmaxProfileZVsRow = new TList;
152 TList* collectionQtotProfileZVsRow = new TList;
153 TList* collectionSigmaYProfileZVsRow = new TList;
154 TList* collectionSigmaZProfileZVsRow = new TList;
156 TList* collectionQtotVsTime = new TList;
157 TList* collectionQmaxVsTime = new TList;
159 while ((obj = iter->Next())) {
161 AliTPCRawHistograms* entry = dynamic_cast<AliTPCRawHistograms*> (obj);
165 collectionQmaxVsRow ->Add(entry->fhQmaxVsRow );
166 collectionQtotVsRow ->Add(entry->fhQtotVsRow );
167 collectionSigmaYVsRow ->Add(entry->fhSigmaYVsRow );
168 collectionSigmaZVsRow ->Add(entry->fhSigmaZVsRow );
170 collectionQmaxProfileYVsRow ->Add(entry->fhQmaxProfileYVsRow );
171 collectionQtotProfileYVsRow ->Add(entry->fhQtotProfileYVsRow );
172 collectionSigmaYProfileYVsRow->Add(entry->fhSigmaYProfileYVsRow);
173 collectionSigmaZProfileYVsRow->Add(entry->fhSigmaZProfileYVsRow);
175 collectionQmaxProfileZVsRow ->Add(entry->fhQmaxProfileZVsRow );
176 collectionQtotProfileZVsRow ->Add(entry->fhQtotProfileZVsRow );
177 collectionSigmaYProfileZVsRow->Add(entry->fhSigmaYProfileZVsRow);
178 collectionSigmaZProfileZVsRow->Add(entry->fhSigmaZProfileZVsRow);
180 collectionQtotVsTime->Add(entry->fhQtotVsTime);
181 collectionQmaxVsTime->Add(entry->fhQmaxVsTime);
187 fhQmaxVsRow ->Merge(collectionQmaxVsRow );
188 fhQtotVsRow ->Merge(collectionQtotVsRow );
189 fhSigmaYVsRow ->Merge(collectionSigmaYVsRow );
190 fhSigmaZVsRow ->Merge(collectionSigmaZVsRow );
192 fhQmaxProfileYVsRow ->Merge(collectionQmaxProfileYVsRow );
193 fhQtotProfileYVsRow ->Merge(collectionQtotProfileYVsRow );
194 fhSigmaYProfileYVsRow->Merge(collectionSigmaYProfileYVsRow);
195 fhSigmaZProfileYVsRow->Merge(collectionSigmaZProfileYVsRow);
197 fhQmaxProfileZVsRow ->Merge(collectionQmaxProfileZVsRow );
198 fhQtotProfileZVsRow ->Merge(collectionQtotProfileZVsRow );
199 fhSigmaYProfileZVsRow->Merge(collectionSigmaYProfileZVsRow);
200 fhSigmaZProfileZVsRow->Merge(collectionSigmaZProfileZVsRow);
202 fhQtotVsTime->Merge(collectionQtotVsTime);
203 fhQmaxVsTime->Merge(collectionQmaxVsTime);
205 delete collectionQmaxVsRow;
206 delete collectionQtotVsRow;
207 delete collectionSigmaYVsRow;
208 delete collectionSigmaZVsRow;
210 delete collectionQmaxProfileYVsRow;
211 delete collectionQtotProfileYVsRow;
212 delete collectionSigmaYProfileYVsRow;
213 delete collectionSigmaZProfileYVsRow;
215 delete collectionQmaxProfileZVsRow;
216 delete collectionQtotProfileZVsRow;
217 delete collectionSigmaYProfileZVsRow;
218 delete collectionSigmaZProfileZVsRow;
220 delete collectionQtotVsTime;
221 delete collectionQmaxVsTime;*/
226 //____________________________________________________________________
227 void AliTPCRawHistograms::FillDigit(AliTPCRawStream* rawStream, Int_t time)
230 // Fills the different histograms with the information from a raw digit
233 Int_t signal = rawStream->GetSignal();
234 Int_t row = rawStream->GetRow();
235 Int_t pad = rawStream->GetPad();
236 Int_t timeBin = rawStream->GetTime();
239 fhDigits->Fill(row, pad, timeBin, signal);
241 fhSignal->Fill(signal);
243 //fDigitTree->Fill(row, pad, timeBin, signal);
246 //____________________________________________________________________
247 void AliTPCRawHistograms::SaveHistograms()
250 // saves the histograms
253 gDirectory->mkdir(fName.Data());
254 gDirectory->cd(fName.Data());
260 gDirectory->cd("../");
263 //____________________________________________________________________
264 TCanvas* AliTPCRawHistograms::DrawHistograms(const Char_t* opt) {
266 // Draws some histograms and save the canvas as eps and gif file.
269 TCanvas* c = new TCanvas(Form("plots_%s",fName.Data()), fName.Data(), 1200, 1000);
271 gStyle->SetOptStat(0);
272 gStyle->SetOptFit(0);
274 gStyle->SetPadLeftMargin(0.05);
282 // this is not really a nice way to do it...
283 c->GetPad(1)->Delete();
285 TLatex* name = new TLatex(0.1,0.8,fName.Data());
286 name->SetTextSize(0.02);