#include "AliTRDQADataMakerSim.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDgeometry.h"
-#include "AliTRDdataArrayS.h"
-#include "AliTRDdataArrayF.h"
-//#include "AliTRDrawStreamTB.h"
+#include "AliTRDarrayADC.h"
+#include "AliTRDarraySignal.h"
+//#include "AliTRDrawStream.h"
#include "AliQAChecker.h"
//____________________________________________________________________________
AliTRDQADataMakerSim::AliTRDQADataMakerSim() :
- AliQADataMakerSim(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+ AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kTRD), "TRD Quality Assurance Data Maker"),
+ fTmpHits(NULL)
{
//
// Default constructor
//____________________________________________________________________________
AliTRDQADataMakerSim::AliTRDQADataMakerSim(const AliTRDQADataMakerSim& qadm) :
- AliQADataMakerSim()
+ AliQADataMakerSim(),
+ fTmpHits(NULL)
{
//
// Copy constructor
}
//____________________________________________________________________________
-void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
+AliTRDQADataMakerSim::~AliTRDQADataMakerSim()
+{
+ if (fTmpHits) {
+ fTmpHits->Clear() ;
+ delete fTmpHits ;
+ }
+}
+
+//____________________________________________________________________________
+void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
{
//
// Detector specific actions at end of cycle
//
- //AliInfo(Form("EndOfCycle", "Fitting RecPoints %d", task));
+ //AliDebug(AliQAv1::GetQADebugLevel(), Form("EndOfCycle", "Fitting RecPoints %d", task));
// call the checker
- AliQAChecker::Instance()->Run(AliQA::kTRD, task, list) ;
+ AliQAChecker::Instance()->Run(AliQAv1::kTRD, task, list) ;
}
//
// Create Hits histograms in Hits subdir
//
-
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
const Int_t kNhist = 4;
TH1D *hist[kNhist];
- hist[0] = new TH1D("qaTRD_hits_det", ";Detector Id of the hit", 540, -0.5, 539.5) ;
+ hist[0] = new TH1D("qaTRD_hits_det", "TRD hits det;Detector Id of the hit;Counts", 540, -0.5, 539.5) ;
- hist[1] = new TH1D("qaTRD_hist_Qdrift", ";Charge from tracks", 100, 0, 100);
- hist[2] = new TH1D("qaTRD_hist_Qamp", ";Charge from TRD photon", 100, 0, 100);
- hist[3] = new TH1D("qaTRD_hist_Qphoton", ";Charge from TRD photon", 100, 0, 100);
+ hist[1] = new TH1D("qaTRD_hist_Qdrift", "TRD hits Qdrift;Charge from tracks;Counts", 100, 0, 100);
+ hist[2] = new TH1D("qaTRD_hist_Qamp", "TRD hits Qamp;Charge from TRD photon;Counts", 100, 0, 100);
+ hist[3] = new TH1D("qaTRD_hist_Qphoton", "TRD hits Qphoton;Charge from TRD photon;Counts", 100, 0, 100);
for(Int_t i=0; i<kNhist; i++) {
//hist[i]->Sumw2();
- Add2HitsList(hist[i], i);
+ Add2HitsList(hist[i], i, !expert, image);
}
}
//
// Create Digits histograms in Digits subdir
//
-
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
const Int_t kNhist = 3;
TH1D *hist[kNhist];
- hist[0] = new TH1D("qaTRD_digits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
- hist[1] = new TH1D("qaTRD_digits_time", ";Time bin", 40, -0.5, 39.5);
- hist[2] = new TH1D("qaTRD_digits_amp", ";Amplitude", 100, -5.5, 94.5);
+ hist[0] = new TH1D("qaTRD_digits_det", "TRD digits det;Detector Id of the digit;Counts", 540, -0.5, 539.5);
+ hist[1] = new TH1D("qaTRD_digits_time", "TRDdigits time;Time bin;Counts", 40, -0.5, 39.5);
+ hist[2] = new TH1D("qaTRD_digits_amp", "TRD digits amp;Amplitude;Counts", 100, -5.5, 94.5);
for(Int_t i=0; i<kNhist; i++) {
hist[i]->Sumw2();
- Add2DigitsList(hist[i], i);
+ Add2DigitsList(hist[i], i, !expert, image);
}
}
//
// Create SDigits histograms in SDigits subdir
//
-
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
const Int_t kNhist = 3;
TH1D *hist[kNhist];
- hist[0] = new TH1D("qaTRD_sdigits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
- hist[1] = new TH1D("qaTRD_sdigits_time", ";Time bin", 40, -0.5, 39.5);
- hist[2] = new TH1D("qaTRD_sdigits_amp", ";Amplitude", 100, 0, 1e7);
+ hist[0] = new TH1D("qaTRD_sdigits_det", "TRD sdigits det;Detector Id of the digit;Counts", 540, -0.5, 539.5);
+ hist[1] = new TH1D("qaTRD_sdigits_time", "TRD sdigits time;Time bin;Counts", 40, -0.5, 39.5);
+ hist[2] = new TH1D("qaTRD_sdigits_amp", "TRD sdigits amp;Amplitude;Counts", 100, 0, 1e7);
for(Int_t i=0; i<kNhist; i++) {
hist[i]->Sumw2();
- Add2SDigitsList(hist[i], i);
+ Add2SDigitsList(hist[i], i, !expert, image);
}
}
//____________________________________________________________________________
-void AliTRDQADataMakerSim::MakeHits(TClonesArray * hits)
+void AliTRDQADataMakerSim::MakeHits()
{
//
// Make QA data from Hits
//
-
- TIter next(hits);
+
+ TIter next(fHitsArray);
AliTRDhit * hit;
while ( (hit = dynamic_cast<AliTRDhit *>(next())) ) {
TBranch *branch = hitTree->GetBranch("TRD");
if (!CheckPointer(branch, "TRD hits branch")) return;
-
+
Int_t nhits = (Int_t)(hitTree->GetTotBytes()/sizeof(AliTRDhit));
- TClonesArray *hits = new TClonesArray("AliTRDhit", nhits+1000);
- TClonesArray *tmp = new TClonesArray("AliTRDhit", 1000);
- branch->SetAddress(&tmp);
-
- Int_t index = 0;
+ if (fHitsArray)
+ fHitsArray->Clear() ;
+ else
+ fHitsArray = new TClonesArray("AliTRDhit", nhits+1000);
+
+ //Int_t index = 0;
Int_t nEntries = (Int_t)branch->GetEntries();
for(Int_t i = 0; i < nEntries; i++) {
branch->GetEntry(i);
- Int_t nHits = (Int_t)tmp->GetEntries();
- for(Int_t j=0; j<nHits; j++) {
- AliTRDhit *hit = (AliTRDhit*)tmp->At(j);
- new((*hits)[index++]) AliTRDhit(*hit);
- }
+ MakeHits();
+ fHitsArray->Clear() ;
}
-
- tmp->Delete();
- delete tmp;
- MakeHits(hits);
- hits->Delete();
- delete hits;
-
}
//____________________________________________________________________________
-void AliTRDQADataMakerSim::MakeDigits(TClonesArray * digits)
+void AliTRDQADataMakerSim::MakeDigits()
{
//
// Makes data from Digits
//
- TIter next(digits) ;
+ if (!fDigitsArray)
+ return ;
+
+ TIter next(fDigitsArray) ;
AliTRDdigit * digit ;
// Info("Make digits", "From the arrya");
//
// Makes data from digits tree
//
-
// Info("Make digits", "From a tree");
AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
TH1D *histTime = (TH1D*)GetDigitsData(1);
TH1D *histSignal = (TH1D*)GetDigitsData(2);
- for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
-
- AliTRDdataArrayS *digitsIn = (AliTRDdataArrayS *) digitsManager->GetDigits(i);
-
- // This is to take care of switched off super modules
- if (digitsIn->GetNtime() == 0) continue;
-
- digitsIn->Expand();
-
- //AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
- //if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
-
- Int_t nRows = digitsIn->GetNrow();
- Int_t nCols = digitsIn->GetNcol();
- Int_t nTbins = digitsIn->GetNtime();
-
- 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 < 1) continue;
- histDet->Fill(i);
- histTime->Fill(time);
- histSignal->Fill(signal);
- }
-
- //delete digitsIn;
- }
-
+ 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();
+
+ //AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
+ //if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
+
+ Int_t nRows = digitsIn->GetNrow();
+ Int_t nCols = digitsIn->GetNcol();
+ Int_t nTbins = digitsIn->GetNtime();
+
+ 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->GetData(row,col,time);
+ if (signal < 1) continue;
+ histDet->Fill(i);
+ histTime->Fill(time);
+ histSignal->Fill(signal);
+ }
+
+ //delete digitsIn;
+ }
delete digitsManager;
-
}
//____________________________________________________________________________
-void AliTRDQADataMakerSim::MakeSDigits(TClonesArray * sdigits)
+void AliTRDQADataMakerSim::MakeSDigits()
{
//
// Makes data from Digits
//
- TIter next(sdigits) ;
+ if (!fSDigitsArray)
+ return ;
+
+ TIter next(fSDigitsArray) ;
AliTRDdigit * digit ;
while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
GetDigitsData(0)->Fill(digit->GetDetector());
//
// Makes data from SDigits
//
-
+ // Check id histograms already created for this Event Specie
+ if ( ! GetSDigitsData(0) )
+ InitSDigits() ;
+
AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
digitsManager->SetSDigits(kTRUE);
digitsManager->CreateArrays();
TH1D *histTime = (TH1D*)GetSDigitsData(1);
TH1D *histSignal = (TH1D*)GetSDigitsData(2);
- for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
-
- //AliTRDdataArrayS *digitsIn = (AliTRDdataArrayS *) digitsManager->GetDigits(i);
- AliTRDdataArrayF *digitsIn = (AliTRDdataArrayF *) digitsManager->GetDigits(i);
-
+ for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++)
+ {
+ AliTRDarraySignal *digitsIn = (AliTRDarraySignal *) digitsManager->GetSDigits(i);
+
// This is to take care of switched off super modules
- if (digitsIn->GetNtime() == 0) continue;
-
- digitsIn->Expand();
-
- //AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
- //if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
-
- Int_t nRows = digitsIn->GetNrow();
- Int_t nCols = digitsIn->GetNcol();
- Int_t nTbins = digitsIn->GetNtime();
-
- 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 < 1) continue;
- histDet->Fill(i);
- histTime->Fill(time);
- histSignal->Fill(signal);
- }
-
- // delete digitsIn;
- }
-
+ if (digitsIn->GetNtime() == 0) continue;
+
+ digitsIn->Expand();
+
+ //AliTRDSignalIndex* indexes = digitsManager->GetIndexes(i);
+ //if (indexes->IsAllocated() == kFALSE) digitsManager->BuildIndexes(i);
+ Int_t nRows = digitsIn->GetNrow();
+ Int_t nCols = digitsIn->GetNcol();
+ Int_t nTbins = digitsIn->GetNtime();
+
+ 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->GetData(row,col,time);
+ if (signal < 1) continue;
+ histDet->Fill(i);
+ histTime->Fill(time);
+ histSignal->Fill(signal);
+ }
+ }
+ }
+ // delete digitsIn;
+ }
delete digitsManager;
-
}
//____________________________________________________________________________