]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0QADataMakerSim.cxx
3 hisograms for online satellite monitoring added
[u/mrichter/AliRoot.git] / T0 / AliT0QADataMakerSim.cxx
index 80e7711b55dd165da8829853b1d796d6ce4748df..d6eb86cb1a6a077c007e77ae2bc9c9efcaa297de 100644 (file)
 
 //---
 //  Produces the data needed to calculate the quality assurance. 
-//  All data must be mergeable objects.
-//  A. Mastroserio
+//  Alla.Maevskaya@cern.ch
+//  
 //---
 
 // --- ROOT system ---
 #include <TClonesArray.h>
 #include <TFile.h> 
 #include <TH1F.h> 
+#include <TH2F.h> 
 #include <TDirectory.h>
 // --- Standard library ---
 
 #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()) ;  
@@ -67,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()); 
 }
@@ -87,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 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) ;
 }
 
 //____________________________________________________________________________
@@ -108,66 +91,39 @@ void AliT0QADataMakerSim::StartOfDetectorCycle()
 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;
-  TH1F *    fhHitsTime[24];
-  for (Int_t i=0; i<24; i++)
-    {
-      timename ="hHitTime";
-      timename += i;
-      if(i<12)  fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,2000,3000);
-      else  
-       fhHitsTime[i] = new TH1F(timename.Data(),timename.Data(),100,12000,13000);
-       Add2HitsList( fhHitsTime[i],i);
-    }
-  /*
-  TH2F *fhHitsEffA = new TH2F("hHitsEffA", "Hits Efficiency A side", 25,-0.5,24.5, 100,12,13 );
-  Add2HitsList(fhHitsEffA,0);
-  TH2F *fhHitsEffC = new TH2F("hHitsEffC", "Hits Efficiency C side", 25,-0.5,24.5, 100,2,3 );
-  Add2HitsList(fhHitsEffC,1);
-  */
+  
+  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;#PMT; Time [ns];", 13, 0, 13, 100,2,5 );
+  fhHitsTimeC->SetOption("COLZ");
+  Add2HitsList(fhHitsTimeC,1, !expert, image);
 }
 
 //____________________________________________________________________________ 
 void AliT0QADataMakerSim::InitDigits()
 {
   // create Digits histograms in Digits subdir
-
-  /*
-  TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits",25,-0.5,24.5,100,100,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);
-  TH1F * fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
-  Add2DigitsList( fhDigMean,23);
-  */
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
   
-  TString timename, ampname, qtcname;
-
-  TH1F *fhDigCFD[24]; TH1F * fhDigLEDamp[24]; TH1F *fhDigQTC[24];
-
-  for (Int_t i=0; i<24; i++)
-    {
-      timename ="hDigCFD";
-      ampname = "hDigLED";
-      qtcname = "hDigQTC";
-      timename += i;
-      ampname += i;
-      qtcname += i;
-      fhDigCFD[i] = new TH1F(timename.Data(), timename.Data(),100,100,5000);
-      Add2DigitsList( fhDigCFD[i],i);
-      fhDigLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,120000,150000);
-      Add2DigitsList( fhDigLEDamp[i],i+24);
-      fhDigQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,100,500);
-      Add2DigitsList( fhDigQTC[i],i+48);
-     }
+  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; #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; #PMT; amplitude QTC [#channel]",25,-0.5,24.5,200,500,10000);
+  fhDigQTC->SetOption("COLZ");
+  Add2DigitsList( fhDigQTC,2, !expert, image);
   
-  TH1F* fhDigEff = new TH1F("hDigEff","digits efficiency", 25,-0.5,24.5);
-  Add2DigitsList( fhDigEff,72);
-  TH1F* fhDigMean = new TH1F("hDigMean","online mean signal", 100,500,600);
-  Add2DigitsList( fhDigMean,73);
   
+   
 }
 
 //____________________________________________________________________________
@@ -175,7 +131,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 ) {
@@ -183,7 +142,7 @@ void AliT0QADataMakerSim::MakeHits(TTree *hitTree)
   } else {
 
    if (branch) {
-      branch->SetAddress(&hits);
+      branch->SetAddress(&fHitsArray);
     }else{
       AliError("Branch T0 hit not found");
       exit(111);
@@ -192,18 +151,21 @@ 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");
-           break;
+           continue;
          }
          Int_t pmt=startHit->Pmt();
-         GetHitsData(pmt-1)->Fill(startHit->Time()) ;
+         Float_t time = 0.001 * startHit->Time();
+         if(pmt<13)GetHitsData(1)->Fill(pmt,time) ;
+         if(pmt>12)GetHitsData(0)->Fill(pmt,time) ;
        }
     }
   }
@@ -220,7 +182,7 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
   TArrayI *digQT1 = new TArrayI(24);
   Int_t refpoint=0;
 
-   TBranch *brDigits=digitsTree->GetBranch("T0");
+  TBranch *brDigits=digitsTree->GetBranch("T0");
   AliT0digit *fDigits = new AliT0digit() ;
   if (brDigits) {
     brDigits->SetAddress(&fDigits);
@@ -228,7 +190,7 @@ void AliT0QADataMakerSim::MakeDigits( TTree *digitsTree)
     AliError(Form("EXEC Branch T0 digits not found"));
      return;
   }
-  
+
   digitsTree->GetEvent(0);
   digitsTree->GetEntry(0);
   brDigits->GetEntry(0);
@@ -237,13 +199,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(i) ->Fill(cfd);
-       GetDigitsData(i+24) -> Fill(digLED->At(i) - digCFD->At(i));
-       GetDigitsData(i+48) -> Fill(digQT1->At(i) - digQT0->At(i));
+       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)));
+
       }
     }