]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0QADataMakerSim.cxx
Fix for ESD analysis
[u/mrichter/AliRoot.git] / T0 / AliT0QADataMakerSim.cxx
index 8e830aad4ceb6ded54a8b5196779cfc2c9832c71..ddb2ee1b2dc17e75b090574cc1ff9f39a114acb7 100644 (file)
@@ -18,8 +18,8 @@
 
 //---
 //  Produces the data needed to calculate the quality assurance. 
-//  All data must be mergeable objects.
-//  A. Mastroserio
+//  Alla.Maevskaya@cern.ch
+//  
 //---
 
 // --- ROOT system ---
@@ -40,6 +40,8 @@
 #include "AliQAChecker.h"
 #include "AliT0RawReader.h"
 
+#include <Riostream.h>
+
 ClassImp(AliT0QADataMakerSim)
            
 //____________________________________________________________________________ 
@@ -48,16 +50,6 @@ ClassImp(AliT0QADataMakerSim)
 
 {
   // ctor
-  /*
-  for(Int_t i=0; i<24; i++) {
-    fhHitsTime[i]=0x0;
-   fhDigCFD[i]=0x0;
-    fhDigLEDamp[i]=0x0;
-    fhRecCFD[i]=0x0;
-    fhRecLEDamp[i]=0x0;
-    fhRecQTC[i]=0x0;
-  }
-  */
  //   fDetectorDir = fOutput->GetDirectory(GetName()) ;  
 //   if (!fDetectorDir) 
 //     fDetectorDir = fOutput->mkdir(GetName()) ;  
@@ -68,16 +60,6 @@ AliT0QADataMakerSim::AliT0QADataMakerSim(const AliT0QADataMakerSim& qadm) :
   AliQADataMakerSim() 
 {
   //copy ctor 
-  /*
-  for(Int_t i=0; i<24; i++) {
-    fhHitsTime[i]=0x0;
-    fhDigCFD[i]=0x0;
-    fhDigLEDamp[i]=0x0;
-    fhRecCFD[i]=0x0;
-    fhRecLEDamp[i]=0x0;
-    fhRecQTC[i]=0x0;
-  }
-  */
   SetName((const char*)qadm.GetName()) ; 
   SetTitle((const char*)qadm.GetTitle()); 
 }
@@ -88,7 +70,7 @@ AliT0QADataMakerSim& AliT0QADataMakerSim::operator = (const AliT0QADataMakerSim&
   // Equal operator.
   this->~AliT0QADataMakerSim();
   new(this) AliT0QADataMakerSim(qadm);
-  return *this;
+  return *this; 
 }
 //____________________________________________________________________________
 void AliT0QADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
@@ -115,10 +97,14 @@ void AliT0QADataMakerSim::InitHits()
 
   TString timename;
   
-  TH2F *fhHitsTimeA = new TH2F("hHitsTimeA", "Hits Efficiency", 25, 0, 25, 100,12,15 );
+  TH2F *fhHitsTimeA = new TH2F("hHitsTimeA", "Hits Efficiency;#PMT; Time [ns];", 13, 12, 25, 100,12,15 );
+  fhHitsTimeA->SetOption("COLZ");
   Add2HitsList(fhHitsTimeA,0, !expert, image);
-  TH2F *fhHitsTimeC = new TH2F("hHitsTimeC", "Hits Efficiency", 25, 0, 25, 100,2,5 );
+  TH2F *fhHitsTimeC = new TH2F("hHitsTimeC", "Hits Efficiency;#PMT; Time [ns];", 13, 0, 13, 100,2,5 );
+  fhHitsTimeC->SetOption("COLZ");
   Add2HitsList(fhHitsTimeC,1, !expert, image);
+  //
+  ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
 }
 
 //____________________________________________________________________________ 
@@ -128,15 +114,17 @@ void AliT0QADataMakerSim::InitDigits()
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
   
-  TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits",25,-0.5,24.5,100,100,1000);
+  TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD time [#channel]",25,-0.5,24.5,100,0,1000);
+  fhDigCFD->SetOption("COLZ");
   Add2DigitsList( fhDigCFD,0);
-  TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits",25,-0.5,24.5,100,100,1000);
+  TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; amplitude  LED-CFD [#channel]",25,-0.5,24.5,100,100,1000);
+  fhDigLEDamp->SetOption("COLZ");
   Add2DigitsList( fhDigLEDamp,1, !expert, image);
-  TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits",25,-0.5,24.5,100,100,1000);
+  TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; amplitude QTC [#channel]",25,-0.5,24.5,200,500,10000);
+  fhDigQTC->SetOption("COLZ");
   Add2DigitsList( fhDigQTC,2, !expert, image);
-  
-  
-   
+  //
+  ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line 
 }
 
 //____________________________________________________________________________
@@ -144,7 +132,10 @@ void AliT0QADataMakerSim::InitDigits()
 void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
 {
   //fills QA histos for Hits
-  TClonesArray * hits = new TClonesArray("AliT0hit", 1000);
+  if (fHitsArray) 
+    fHitsArray->Clear() ; 
+  else 
+    fHitsArray = new TClonesArray("AliT0hit", 1000);
   
   TBranch * branch = hitTree->GetBranch("T0") ;
   if ( ! branch ) {
@@ -152,7 +143,7 @@ void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
   } else {
 
    if (branch) {
-      branch->SetAddress(&hits);
+      branch->SetAddress(&fHitsArray);
     }else{
       AliError("Branch T0 hit not found");
       exit(111);
@@ -161,23 +152,28 @@ void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
     
     if (ntracks<=0) return;
     // Start loop on tracks in the hits containers
+
     for (Int_t track=0; track<ntracks;track++) {
       branch->GetEntry(track);
-      Int_t nhits = hits->GetEntriesFast();
+      Int_t nhits = fHitsArray->GetEntriesFast();
       for (Int_t ihit=0;ihit<nhits;ihit++) 
        {
-         AliT0hit  * startHit   = (AliT0hit*) hits->UncheckedAt(ihit);
+         AliT0hit  * startHit   = (AliT0hit*) fHitsArray->UncheckedAt(ihit);
          if (!startHit) {
            AliError("The unchecked hit doesn't exist");
            continue;
          }
          Int_t pmt=startHit->Pmt();
          Float_t time = 0.001 * startHit->Time();
-         if(pmt<13)GetHitsData(1)->Fill(pmt,time) ;
-         if(pmt>12)GetHitsData(0)->Fill(pmt,time) ;
+         if(pmt<13) FillHitsData(1,pmt,time) ;
+         if(pmt>12) FillHitsData(0,pmt,time) ;
        }
     }
   }
+  //
+  IncEvCountCycleHits();
+  IncEvCountTotalHits();
+  //
 }
 
 //____________________________________________________________________________
@@ -199,6 +195,7 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
     AliError(Form("EXEC Branch T0 digits not found"));
      return;
   }
+
   digitsTree->GetEvent(0);
   digitsTree->GetEntry(0);
   brDigits->GetEntry(0);
@@ -207,13 +204,15 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
   fDigits->GetQT0(*digQT0);
   fDigits->GetQT1(*digQT1);
   refpoint = fDigits->RefPoint();
+
    for (Int_t i=0; i<24; i++)
     {
       if (digCFD->At(i)>0) {
        Int_t cfd=digCFD->At(i)- refpoint;
-       GetDigitsData(0) ->Fill(i,cfd);
-       GetDigitsData(1) -> Fill(i,(digLED->At(i) - digCFD->At(i)));
-       GetDigitsData(2) -> Fill(i, (digQT1->At(i) - digQT0->At(i)));
+       FillDigitsData(0, i,cfd);
+       FillDigitsData(1, i,(digLED->At(i) - digCFD->At(i)));
+       FillDigitsData(2, i, (digQT1->At(i) - digQT0->At(i)));
+
       }
     }  
       
@@ -221,5 +220,8 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
   delete digLED;
   delete digQT0;
   delete digQT1;
-
+  //
+  IncEvCountCycleDigits();
+  IncEvCountTotalDigits();
+  //
 }