]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDQADataMakerSim.cxx
Fixes for bug #49914: Compilation breaks in trunk, and bug #48629: Trunk cannot read...
[u/mrichter/AliRoot.git] / TRD / AliTRDQADataMakerSim.cxx
index 927a37730aae491728e72815812f040c990a7bf7..86dd97cc6eb6e282e3368a4a3a26345e9ba5b3ad 100644 (file)
@@ -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,7 @@ ClassImp(AliTRDQADataMakerSim)
 
 //____________________________________________________________________________ 
   AliTRDQADataMakerSim::AliTRDQADataMakerSim() : 
-  AliQADataMakerSim(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+  AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kTRD), "TRD Quality Assurance Data Maker")
 {
   //
   // Default constructor
@@ -87,7 +88,7 @@ AliTRDQADataMakerSim& AliTRDQADataMakerSim::operator=(const AliTRDQADataMakerSim
 }
 
 //____________________________________________________________________________ 
-void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
+void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
 {
   //
   // Detector specific actions at end of cycle
@@ -96,7 +97,7 @@ void AliTRDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray *
   //AliInfo(Form("EndOfCycle", "Fitting RecPoints %d", task));
 
   // call the checker
-  AliQAChecker::Instance()->Run(AliQA::kTRD, task, list) ;    
+  AliQAChecker::Instance()->Run(AliQAv1::kTRD, task, list) ;    
 
 
 }
@@ -136,7 +137,7 @@ void AliTRDQADataMakerSim::InitDigits()
 
   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, 0, 100.);
+  hist[2] = new TH1D("qaTRD_digits_amp", ";Amplitude", 100, -5.5, 94.5);
 
   for(Int_t i=0; i<kNhist; i++) {
     hist[i]->Sumw2();
@@ -218,6 +219,8 @@ void AliTRDQADataMakerSim::MakeHits(TTree * hitTree)
   tmp->Delete();
   delete tmp;
   MakeHits(hits);
+  hits->Delete();
+  delete hits;
 
 }
 
@@ -230,7 +233,11 @@ void AliTRDQADataMakerSim::MakeDigits(TClonesArray * digits)
 
   TIter next(digits) ; 
   AliTRDdigit * digit ; 
+  
+  // Info("Make digits", "From the arrya");
+  
   while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
+    if (digit->GetAmp() < 1) continue;
     GetDigitsData(0)->Fill(digit->GetDetector());
     GetDigitsData(1)->Fill(digit->GetTime());
     GetDigitsData(2)->Fill(digit->GetAmp());
@@ -245,41 +252,46 @@ void AliTRDQADataMakerSim::MakeDigits(TTree * digits)
   // Makes data from digits tree
   //
 
+  // Info("Make digits", "From a tree");
+
   AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
   digitsManager->CreateArrays();
   digitsManager->ReadDigits(digits);
 
-  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);
-         GetDigitsData(0)->Fill(i);
-         GetDigitsData(1)->Fill(time);
-         GetDigitsData(2)->Fill(signal);
-       }
+  TH1D *histDet = (TH1D*)GetDigitsData(0);
+  TH1D *histTime = (TH1D*)GetDigitsData(1);
+  TH1D *histSignal = (TH1D*)GetDigitsData(2);
+
+  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;
-
 }
 
 //____________________________________________________________________________
@@ -307,41 +319,46 @@ void AliTRDQADataMakerSim::MakeSDigits(TTree * digits)
   //
 
   AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
+  digitsManager->SetSDigits(kTRUE);
   digitsManager->CreateArrays();
   digitsManager->ReadDigits(digits);
 
-  for (Int_t i = 0; i < AliTRDgeometry::kNdet; i++) {
-
-    AliTRDdataArrayS *digitsIn = (AliTRDdataArrayS *) digitsManager->GetDigits(i);      
+  TH1D *histDet = (TH1D*)GetSDigitsData(0);
+  TH1D *histTime = (TH1D*)GetSDigitsData(1);
+  TH1D *histSignal = (TH1D*)GetSDigitsData(2);
 
+  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 <= 0) continue;
-         GetSDigitsData(0)->Fill(i);
-         GetSDigitsData(1)->Fill(time);
-         GetSDigitsData(2)->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;
-
 }
 
 //____________________________________________________________________________