X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDQADataMakerSim.cxx;h=c50360dbd1b7f917c330c0b6ec419659dca67fb2;hb=c8fe2783489236d4d3aff0b807d1f507720af244;hp=8945f4acb63e3fd60758ab0ce0fc835cf4a613a0;hpb=3590bda87aa57a61c7bf9e54279e9ae76ae1bd4b;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDQADataMakerSim.cxx b/TRD/AliTRDQADataMakerSim.cxx index 8945f4acb63..c50360dbd1b 100644 --- a/TRD/AliTRDQADataMakerSim.cxx +++ b/TRD/AliTRDQADataMakerSim.cxx @@ -45,8 +45,9 @@ #include "AliTRDQADataMakerSim.h" #include "AliTRDdigitsManager.h" #include "AliTRDgeometry.h" -#include "AliTRDdataArrayS.h" -//#include "AliTRDrawStreamTB.h" +#include "AliTRDarrayADC.h" +#include "AliTRDarraySignal.h" +//#include "AliTRDrawStream.h" #include "AliQAChecker.h" @@ -54,7 +55,8 @@ ClassImp(AliTRDQADataMakerSim) //____________________________________________________________________________ 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 @@ -62,7 +64,8 @@ ClassImp(AliTRDQADataMakerSim) //____________________________________________________________________________ AliTRDQADataMakerSim::AliTRDQADataMakerSim(const AliTRDQADataMakerSim& qadm) : - AliQADataMakerSim() + AliQADataMakerSim(), + fTmpHits(NULL) { // // Copy constructor @@ -87,16 +90,25 @@ AliTRDQADataMakerSim& AliTRDQADataMakerSim::operator=(const AliTRDQADataMakerSim } //____________________________________________________________________________ -void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX 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) ; } @@ -107,19 +119,21 @@ void AliTRDQADataMakerSim::InitHits() // // 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; iSumw2(); - Add2HitsList(hist[i], i); + Add2HitsList(hist[i], i, !expert, image); } } @@ -130,17 +144,19 @@ void AliTRDQADataMakerSim::InitDigits() // // 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; iSumw2(); - Add2DigitsList(hist[i], i); + Add2DigitsList(hist[i], i, !expert, image); } } @@ -151,29 +167,31 @@ void AliTRDQADataMakerSim::InitSDigits() // // 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; iSumw2(); - 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(next())) ) { @@ -198,37 +216,33 @@ void AliTRDQADataMakerSim::MakeHits(TTree * hitTree) 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; jAt(j); - new((*hits)[index++]) AliTRDhit(*hit); - } + MakeHits(); + fHitsArray->Clear() ; } - - tmp->Delete(); - delete tmp; - MakeHits(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"); @@ -248,7 +262,6 @@ void AliTRDQADataMakerSim::MakeDigits(TTree * digits) // // Makes data from digits tree // - // Info("Make digits", "From a tree"); AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager(); @@ -259,48 +272,49 @@ void AliTRDQADataMakerSim::MakeDigits(TTree * digits) 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(next())) ) { GetDigitsData(0)->Fill(digit->GetDetector()); @@ -316,8 +330,12 @@ void AliTRDQADataMakerSim::MakeSDigits(TTree * digits) // // 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(); digitsManager->ReadDigits(digits); @@ -325,38 +343,38 @@ void AliTRDQADataMakerSim::MakeSDigits(TTree * digits) 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); - + 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; - } //____________________________________________________________________________