#include <TProfile.h>
#include <TF1.h>
#include <TCanvas.h>
+#include <TStopwatch.h>
// --- AliRoot header files ---
#include "AliESDEvent.h"
#include "AliTRDQADataMaker.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDgeometry.h"
-#include "AliTRDdataArrayI.h"
-#include "AliTRDRawStreamTB.h"
-
+#include "AliTRDarrayADC.h"
+#include "AliTRDrawStream.h"
#include "AliQAChecker.h"
ClassImp(AliTRDQADataMaker)
//____________________________________________________________________________
AliTRDQADataMaker::AliTRDQADataMaker() :
- AliQADataMaker(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+ AliQADataMaker(AliQAv1::GetDetName(AliQAv1::kTRD), "TRD Quality Assurance Data Maker")
{
//
// Default constructor
}
//____________________________________________________________________________
-void AliTRDQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+void AliTRDQADataMaker::EndOfDetectorCycle(AliQAv1::TASKINDEX task, TObjArray * list)
{
//
// Detector specific actions at end of cycle
//
+ //TStopwatch watch;
+ //watch.Start();
- //AliInfo(Form("EndOfCycle", "Fitting RecPoints %d", task));
-
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("EndOfCycle", "Fitting RecPoints %d", task))
+ TH1D *hist = new TH1D("fitHist", "", 200, -0.5, 199.5);
- if (task == AliQA::kRECPOINTS) {
+ if (task == AliQAv1::kRECPOINTS) {
//list->Print();
// Rec points full chambers
- if (((TH2D*)list->At(1))->GetEntries() > 1e4) {
- for (Int_t i=0; i<540; i++) {
-
- TH1D *h = ((TH2D*)list->At(1))->ProjectionY(Form("qaTRD_recPoints_amp_%d",i), i+1, i+1);
- if (h->GetSum() < 100) continue; // chamber not present
+ for (Int_t i=0; i<540; i++) {
- h->Fit("landau", "q0", "goff", 10, 180);
- TF1 *fit = h->GetFunction("landau");
- ((TH1D*)list->At(12))->Fill(fit->GetParameter(1));
- ((TH1D*)list->At(13))->Fill(fit->GetParameter(2));
- delete h;
+ //TH1D *h = ((TH2D*)list->At(1))->ProjectionY(Form("qaTRD_recPoints_amp_%d",i), i+1, i+1);
+ hist->Reset();
+ for(Int_t b=1; b<hist->GetXaxis()->GetNbins()-1; b++) {
+ Double_t xvalue = hist->GetBinCenter(b);
+ Int_t bin = ((TH2D*)list->At(1))->FindBin(i,xvalue);
+ Double_t value = ((TH2D*)list->At(1))->GetBinContent(bin);
+ hist->SetBinContent(b, value);
}
+
+ //printf("Sum = %d %f\n", i, hist->GetSum());
+ if (hist->GetSum() < 100) continue; // chamber not present
+
+ hist->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = hist->GetFunction("landau");
+ ((TH1D*)list->At(12))->Fill(fit->GetParameter(1));
+ ((TH1D*)list->At(13))->Fill(fit->GetParameter(2));
}
-
-
- if (((TH2D*)list->At(10))->GetEntries() > 1e5) {
- for (Int_t i=0; i<540; i++) {
-
- TH1D *test = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, 0, 35);
- if (test->GetSum() < 100) continue;
+
+ // time-bin by time-bin
+ for (Int_t i=0; i<540; i++) {
- //AliInfo(Form("fitting det = %d", i));
+ //TH1D *test = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, 0, 35);
+ //if (test->GetSum() < 100) continue;
+
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("fitting det = %d", i));
+
+ for(Int_t j=0; j<35; j++) {
- for(Int_t j=0; j<35; j++) {
-
- TH1D *h = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1);
- if (h->GetSum() < 50) continue;
-
- h->Fit("landau", "q0", "goff", 10, 180);
- TF1 *fit = h->GetFunction("landau");
-
- Int_t sm = i/18;
- Int_t det = i%18;
- TH2D *h2 = (TH2D*)list->At(14+sm);
- Int_t bin = h2->FindBin(det,j);
- // printf("%d %d %d\n", det, j, bin);
- h2->SetBinContent(bin, fit->GetParameter(1));
+ //TH1D *h = ((TH3D*)list->At(10))->ProjectionZ(Form("ampTime_%d",i), i+1, i+1, j+1, j+1);
+ hist->Reset();
+ for(Int_t b=1; b<hist->GetXaxis()->GetNbins()-1; b++) {
+ Double_t xvalue = hist->GetBinCenter(b);
+ Int_t bin = ((TH3D*)list->At(10))->FindBin(i,j,xvalue);
+ Double_t value = ((TH3D*)list->At(10))->GetBinContent(bin);
+ //printf("v = %f\n", value);
+ hist->SetBinContent(b, value);
}
+
+ if (hist->GetSum() < 100) continue;
+ //printf("fitting %d %d %f\n", i, j, hist->GetSum());
+
+ hist->Fit("landau", "q0", "goff", 10, 180);
+ TF1 *fit = hist->GetFunction("landau");
+
+ Int_t sm = i/18;
+ Int_t det = i%18;
+ TH2D *h2 = (TH2D*)list->At(14+sm);
+ Int_t bin = h2->FindBin(det,j);
+ // printf("%d %d %d\n", det, j, bin);
+ h2->SetBinContent(bin, fit->GetParameter(1));
}
}
}
+ delete hist;
+
// call the checker
- AliQAChecker::Instance()->Run(AliQA::kTRD, task, list) ;
-
+ AliQAChecker::Instance()->Run(AliQAv1::kTRD, task, list) ;
+ //watch.Stop();
+ //watch.Print();
}
//____________________________________________________________________________
hist[i]->Sumw2();
Add2DigitsList(hist[i], i);
}
-
}
//____________________________________________________________________________
hist[9] = new TH1D("qaTRD_recPoints_nCls", ";number of clusters", 500, -0.5, 499.5);
hist[10] = new TH3D("qaTRD_recPoints_sigTime", ";chamber;time bin;signal",
- 540, -0.5, 539.5, 35, -0.5, 34.5, 100, 0, 200);
+ 540, -0.5, 539.5, 35, -0.5, 34.5, 200, 0.5, 199.5);
hist[11] = new TProfile("qaTRD_recPoints_prf", ";distance;center of gravity"
, 120, -0.6, 0.6, -1.2, 1.2, "");
// .. in the acceptance
Int_t sector = GetSector(paramOut->GetAlpha());
- GetESDsData(1)->Fill(sector);
UInt_t u = 1;
UInt_t status = track->GetStatus();
//fSignal->Fill(track->GetTRDsignal());
GetESDsData(18)->Fill(track->GetP(), track->GetTRDsignal());
+ GetESDsData(1)->Fill(sector);
/*
// PID only
for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
- AliTRDdataArrayI *digitsIn = digitsManager->GetDigits(i);
+ AliTRDarrayADC *digitsIn = (AliTRDarrayADC *) digitsManager->GetDigits(i);
// This is to take care of switched off super modules
if (digitsIn->GetNtime() == 0) continue;
- digitsIn->Expand();
+ digitsIn->Expand();
//AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
//if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
for(Int_t row = 0; row < nRows; row++)
for(Int_t col = 0; col < nCols; col++)
- for(Int_t time = 0; time < nTbins; time++) {
-
- Float_t signal = digitsIn->GetDataUnchecked(row,col,time);
- GetDigitsData(0)->Fill(i);
- GetDigitsData(1)->Fill(time);
- GetDigitsData(2)->Fill(signal);
- }
+ for(Int_t time = 0; time < nTbins; time++)
+ {
+ Float_t signal = digitsIn->GetData(row,col,time);
+ GetDigitsData(0)->Fill(i);
+ GetDigitsData(1)->Fill(time);
+ GetDigitsData(2)->Fill(signal);
+ }
//delete digitsIn;
}
digitsManager->CreateArrays();
digitsManager->ReadDigits(digits);
- for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
-
- AliTRDdataArrayI *digitsIn = digitsManager->GetDigits(i);
+ for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++)
+ {
+ AliTRDarrayADC *digitsIn = (AliTRDarrayADC *) digitsManager->GetDigits(i);
// This is to take care of switched off super modules
if (digitsIn->GetNtime() == 0) continue;
- digitsIn->Expand();
+ digitsIn->Expand();
//AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
//if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
for(Int_t row = 0; row < nRows; row++)
for(Int_t col = 0; col < nCols; col++)
- for(Int_t time = 0; time < nTbins; time++) {
-
- Float_t signal = digitsIn->GetDataUnchecked(row,col,time);
- if (signal <= 0) continue;
- GetSDigitsData(0)->Fill(i);
- GetSDigitsData(1)->Fill(time);
- GetSDigitsData(2)->Fill(signal);
- }
-
+ for(Int_t time = 0; time < nTbins; time++)
+ {
+ Float_t signal = digitsIn->GetData(row,col,time);
+ if (signal <= 0) continue;
+ GetSDigitsData(0)->Fill(i);
+ GetSDigitsData(1)->Fill(time);
+ GetSDigitsData(2)->Fill(signal);
+ }
+
// delete digitsIn;
}
const Int_t kMCM = 16;
// const Int_t kADC = 22;
- AliTRDRawStreamTB *raw = new AliTRDRawStreamTB(rawReader);
-
+ AliTRDrawStream *raw = new AliTRDrawStream(rawReader);
raw->SetRawVersion(3);
raw->Init();
GetRawsData(3)->Fill(sm);
GetRawsData(4+sm)->Fill(index);
}
+
+ delete raw;
+
}
//____________________________________________________________________________