]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0QADataMakerSim.cxx
1.The QA data created on demand according to the event species at filling time. 2...
[u/mrichter/AliRoot.git] / T0 / AliT0QADataMakerSim.cxx
index 5f51c6e5ae58b540c166f1bab826b9b217532d99..a5ce970b9f0983a73c3939efa09011e39622681e 100644 (file)
@@ -1,4 +1,4 @@
-/**************************************************************************
+;/**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
@@ -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 ---
 #include "AliQAChecker.h"
 #include "AliT0RawReader.h"
 
+#include <Riostream.h>
+
 ClassImp(AliT0QADataMakerSim)
            
 //____________________________________________________________________________ 
   AliT0QADataMakerSim::AliT0QADataMakerSim() : 
-  AliQADataMakerSim(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker")
+  AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kT0), "T0 Quality Assurance Data Maker")
 
 {
   // 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,14 +70,14 @@ AliT0QADataMakerSim& AliT0QADataMakerSim::operator = (const AliT0QADataMakerSim&
   // Equal operator.
   this->~AliT0QADataMakerSim();
   new(this) AliT0QADataMakerSim(qadm);
-  return *this;
+  return *this; 
 }
 //____________________________________________________________________________
-void AliT0QADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list)
+void AliT0QADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
-  AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ;
+  AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ;
 }
 
 //____________________________________________________________________________
@@ -110,26 +92,30 @@ void AliT0QADataMakerSim::InitHits()
 {
   // create Hits histograms in Hits subdir
   // create Hits histograms in Hits subdir
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+
   TString timename;
   
-  TH2F *fhHitsTimeA = new TH2F("hHitsTimeA", "Hits Efficiency", 25, 0, 25, 100,12,15 );
-  Add2HitsList(fhHitsTimeA,0);
-  TH2F *fhHitsTimeC = new TH2F("hHitsTimeC", "Hits Efficiency", 25, 0, 25, 100,2,5 );
-  Add2HitsList(fhHitsTimeC,1);
+  TH2F *fhHitsTimeA = new TH2F("hHitsTimeA", "Hits Efficiency;#PMT; Time [ns];", 13, 12, 25, 100,12,15 );
+  Add2HitsList(fhHitsTimeA,0, !expert, image);
+  TH2F *fhHitsTimeC = new TH2F("hHitsTimeC", "Hits Efficiency;#PMT; Time [ns];", 13, 0, 13, 100,2,5 );
+  Add2HitsList(fhHitsTimeC,1, !expert, image);
 }
 
 //____________________________________________________________________________ 
 void AliT0QADataMakerSim::InitDigits()
 {
   // create Digits histograms in Digits subdir
-
+  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);
   Add2DigitsList( fhDigCFD,0);
-  TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits",25,-0.5,24.5,100,100,1000);
-  Add2DigitsList( fhDigLEDamp,1);
-  TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits",25,-0.5,24.5,100,100,1000);
-  Add2DigitsList( fhDigQTC,2);
+  TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; amplitude  LED-CFD [#channel]",25,-0.5,24.5,100,100,1000);
+  Add2DigitsList( fhDigLEDamp,1, !expert, image);
+  TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; amplitude QTC [#channel]",25,-0.5,24.5,200,500,10000);
+  Add2DigitsList( fhDigQTC,2, !expert, image);
   
   
    
@@ -157,6 +143,11 @@ void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
     
     if (ntracks<=0) return;
     // Start loop on tracks in the hits containers
+
+    // Check id histograms already created for this Event Specie
+    if ( ! GetHitsData(0) )
+      InitHits() ;
+
     for (Int_t track=0; track<ntracks;track++) {
       branch->GetEntry(track);
       Int_t nhits = hits->GetEntriesFast();
@@ -195,6 +186,11 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
     AliError(Form("EXEC Branch T0 digits not found"));
      return;
   }
+
+  // Check id histograms already created for this Event Specie
+  if ( ! GetDigitsData(0) )
+    InitDigits() ;
+
   digitsTree->GetEvent(0);
   digitsTree->GetEntry(0);
   brDigits->GetEntry(0);
@@ -203,6 +199,7 @@ 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) {
@@ -210,6 +207,7 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
        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)));
+
       }
     }