]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFQADataMakerRec.cxx
Fixes to remove compilation warnings
[u/mrichter/AliRoot.git] / TOF / AliTOFQADataMakerRec.cxx
index 573db59a05867e102b8b45827998477db30cd7b6..0da99374cd35b45bd22338f39662f97a99186bad 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliTOFRawStream.h"
 #include "AliTOFrawData.h"
 #include "AliTOFGeometry.h"
+#include "AliTOFdigit.h"
 
 ClassImp(AliTOFQADataMakerRec)
            
@@ -83,31 +84,53 @@ void AliTOFQADataMakerRec::InitRaws()
   const Bool_t saveCorr = kTRUE ; 
   const Bool_t image    = kTRUE ; 
   
-  TH1F * h0 = new TH1F("hTOFRaws",    "Number of TOF Raws ",301, -1.02, 5.) ;
+  TH1F * h0 = new TH1F("hTOFRaws",    "Number of TOF Raws;TOF raw number [10 power];Counts ",301, -1.02, 5.) ;
   h0->Sumw2() ;
-  h0->GetXaxis()->SetTitle("TOF raw number [10 power]");
   Add2RawsList(h0, 0, !expert, image, !saveCorr) ;
 
-  TH1F * h1  = new TH1F("hTOFRawsTime", "Raws Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
+  TH1F * h1  = new TH1F("hTOFRawsTime", "Raws Time Spectrum in TOF (ns);Measured TOF time [ns];Counts", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  h1->GetXaxis()->SetTitle("Measured TOF time [ns]");
   Add2RawsList(h1, 1, !expert, image, !saveCorr) ;
 
-  TH1F * h2  = new TH1F("hTOFRawsToT", "Raws ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
+  TH1F * h2  = new TH1F("hTOFRawsToT", "Raws ToT Spectrum in TOF (ns);Measured TOT time [ns];Counts", 500, 0., 50) ; 
   h2->Sumw2() ;
-  h2->GetXaxis()->SetTitle("Measured TOT [ns]");
-  h2->GetYaxis()->SetTitle("Measured TOF time [ns]");
   Add2RawsList(h2, 2, !expert, image, !saveCorr) ;
 
-  TH2F * h3  = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; 
+  TH2F * h3  = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi;2*strip+padz (eta);48*sector+padx (phi)",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h3->Sumw2() ;
-  h3->GetXaxis()->SetTitle("2*strip+padz (eta)");
-  h3->GetYaxis()->SetTitle("48*sector+padx (phi)");
   h3->GetYaxis()->SetTitleOffset(1.15);
   Add2RawsList(h3, 3, !expert, image, !saveCorr) ;
 
 }
 
+//____________________________________________________________________________ 
+void AliTOFQADataMakerRec::InitDigits()
+{
+  //
+  // create Digits histograms in Digits subdir
+  //
+  
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F * h0 = new TH1F("hTOFDigits",    "Number of TOF Digits;TOF digit number [10 power];Counts ",301, -1.02, 5.) ;
+  h0->Sumw2() ;
+  Add2DigitsList(h0, 0, !expert, image) ;
+  
+  TH1F * h1  = new TH1F("hTOFDigitsTime", "Digits Time Spectrum in TOF (ns);Digitized TOF time [ns];Counts", 2000, 0., 200) ; 
+  h1->Sumw2() ;
+  Add2DigitsList(h1, 1, !expert, image) ;
+  
+  TH1F * h2  = new TH1F("hTOFDigitsToT", "Digits ToT Spectrum in TOF (ns);Digitized TOF time [ns];Counts", 500, 0., 50) ; 
+  h2->Sumw2() ;
+  Add2DigitsList(h2, 2, !expert, image) ;
+  
+  TH2F * h3  = new TH2F("hTOFDigitsClusMap","Digits vs TOF eta-phi;2*strip+padz (eta);48*sector+padx (phi)",183, -0.5, 182.5,865,-0.5,864.5) ; 
+  h3->Sumw2() ;
+  h3->GetYaxis()->SetTitleOffset(1.15);
+  Add2DigitsList(h3, 3, !expert, image) ;
+}
+
 //____________________________________________________________________________ 
 void AliTOFQADataMakerRec::InitRecPoints()
 {
@@ -117,35 +140,27 @@ void AliTOFQADataMakerRec::InitRecPoints()
 
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
-  
-  TH1F * h0 = new TH1F("hTOFRecPoints",    "Number of TOF RecPoints ",301, -1.02, 5.) ;
+
+  TH1F * h0 = new TH1F("hTOFRecPoints",    "Number of TOF RecPoints;TOF recPoint number [10 power];Counts",301, -1.02, 5.) ;
   h0->Sumw2() ;
-  h0->GetXaxis()->SetTitle("TOF recPoint number [10 power]");
   Add2RecPointsList(h0, 0, !expert, image) ;
 
-  TH1F * h1  = new TH1F("hTOFRecPointsTime", "RecPoints Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
+  TH1F * h1  = new TH1F("hTOFRecPointsTime", "RecPoints Time Spectrum in TOF (ns);Calibrated TOF time [ns];Counts", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  h1->GetXaxis()->SetTitle("Calibrated TOF time [ns]");
   Add2RecPointsList(h1, 1, !expert, image) ;
 
-  TH1F * h2  = new TH1F("hTOFRecPointsRawTime", "RecPoints raw Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
+  TH1F * h2  = new TH1F("hTOFRecPointsRawTime", "RecPoints raw Time Spectrum in TOF (ns);Measured TOF time [ns];Counts", 2000, 0., 200) ; 
   h2->Sumw2() ;
-  h2->GetXaxis()->SetTitle("Measured TOT [ns]");
-  h2->GetYaxis()->SetTitle("Measured TOF time [ns]");
   Add2RecPointsList(h2, 2, !expert, image) ;
 
-  TH1F * h3  = new TH1F("hTOFRecPointsToT", "RecPoints ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
+  TH1F * h3  = new TH1F("hTOFRecPointsToT", "RecPoints ToT Spectrum in TOF (ns);Measured TOT [ns];Counts", 500, 0., 50) ; 
   h3->Sumw2() ;
-  h3->GetXaxis()->SetTitle("Measured TOT [ns]");
   Add2RecPointsList(h3, 3, !expert, image) ;
 
-  TH2F * h4  = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF phi-eta",183, -0.5, 182.5,865,-0.5,864.5) ; 
+  TH2F * h4  = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF phi-eta;2*strip+padz (eta);48*sector+padx (phi)",183, -0.5, 182.5,865,-0.5,864.5) ; 
   h4->Sumw2() ;
-  h4->GetXaxis()->SetTitle("2*strip+padz (eta)");
-  h4->GetYaxis()->SetTitle("48*sector+padx (phi)");
   h4->GetYaxis()->SetTitleOffset(1.15);
   Add2RecPointsList(h4, 4, !expert, image) ;
-
 }
 
 //____________________________________________________________________________ 
@@ -157,29 +172,24 @@ void AliTOFQADataMakerRec::InitESDs()
 
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
-  TH1F * h0 = new TH1F("hTOFESDs",    "Number of matched TOF tracks over ESDs",       250, -1., 4.) ;  
+  TH1F * h0 = new TH1F("hTOFESDs",    "Number of matched TOF tracks over ESDs;Number of TOF matched ESD tracks [10 power];Counts",       250, -1., 4.) ;  
   h0->Sumw2() ; 
-  h0->GetXaxis()->SetTitle("Number of TOF matched ESD tracks [10 power]");
   Add2ESDsList(h0, 0, !expert, image) ;
 
-  TH1F * h1  = new TH1F("hTOFESDsTime", "Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
+  TH1F * h1  = new TH1F("hTOFESDsTime", "Time Spectrum in TOF (ns);Calibrated TOF time [ns];Counts", 2000, 0., 200) ; 
   h1->Sumw2() ;
-  h1->GetXaxis()->SetTitle("Calibrated TOF time [ns]");
   Add2ESDsList(h1, 1, !expert, image) ;
 
-  TH1F * h2  = new TH1F("hTOFESDsRawTime", "raw Time Spectrum in TOF (ns)", 2000, 0., 200) ; 
+  TH1F * h2  = new TH1F("hTOFESDsRawTime", "raw Time Spectrum in TOF (ns);Measured TOF time [ns];Counts", 2000, 0., 200) ; 
   h2->Sumw2() ;
-  h2->GetXaxis()->SetTitle("Measured TOF time [ns]");
   Add2ESDsList(h2, 2, !expert, image) ;
 
-  TH1F * h3  = new TH1F("hTOFESDsToT", "ToT Spectrum in TOF (ns)", 500, 0., 50) ; 
+  TH1F * h3  = new TH1F("hTOFESDsToT", "ToT Spectrum in TOF (ns);Measured TOF time [ns];Counts", 500, 0., 50) ; 
   h3->Sumw2() ;
-  h3->GetXaxis()->SetTitle("Measured TOT [ns]");
   Add2ESDsList(h3, 3, !expert, image) ;
 
-  TH1F * h4 = new TH1F("hTOFESDsPID",    "Fraction of matched TOF tracks with good PID flag (%)", 101, 0., 101.) ;  
+  TH1F * h4 = new TH1F("hTOFESDsPID",    "Fraction of matched TOF tracks with good PID flag (%);Fraction of TOF matched ESD tracks with good flag [%];Counts", 101, 0., 101.) ;  
   h4->Sumw2() ; 
-  h4->GetXaxis()->SetTitle("Fraction of TOF matched ESD tracks with good flag [%]");
   Add2ESDsList(h4, 4, !expert, image) ;
 }
 
@@ -189,7 +199,11 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   //
   // makes data from Raws
   //
-
+  
+  // Check id histograms already created for this Event Specie
+  if ( ! GetRawsData(0) )
+    InitRaws() ;
+  
   Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
   Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
 
@@ -235,6 +249,64 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   }
 }
 
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::MakeDigits(TClonesArray * digits)
+{
+  //
+  // makes data from Digits
+  //
+  Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
+  Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
+  Int_t in[5];
+  Int_t out[5];
+  
+  Int_t nentries=digits->GetEntriesFast();
+  if(nentries<=0){
+    GetDigitsData(0)->Fill(-1.) ; 
+  }else{
+    GetDigitsData(0)->Fill(TMath::Log10(nentries)) ; 
+  } 
+  
+  TIter next(digits) ; 
+  AliTOFdigit * digit ; 
+  while ( (digit = dynamic_cast<AliTOFdigit *>(next())) ) {
+    
+    GetDigitsData(1)->Fill( digit->GetTdc()*tdc2ns) ;//in ns
+    GetDigitsData(2)->Fill( digit->GetToT()*tot2ns) ;//in ns
+      
+      in[0] = digit->GetSector();
+      in[1] = digit->GetPlate();
+      in[2] = digit->GetStrip();
+      in[3] = digit->GetPadx();
+      in[4]= digit->GetPadz();
+      GetMapIndeces(in,out);
+      GetDigitsData(3)->Fill( out[0],out[1]) ;//digit map
+  }
+}
+
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::MakeDigits(TTree * digitTree)
+{
+  //
+  // makes data from Digit Tree
+  //
+  // Check id histograms already created for this Event Specie
+  if ( ! GetDigitsData(0) )
+    InitDigits() ;
+  
+  TClonesArray * digits = new TClonesArray("AliTOFdigit", 1000) ; 
+  
+  TBranch * branch = digitTree->GetBranch("TOF") ;
+  if ( ! branch ) {
+    AliError("TOF branch in Digit Tree not found") ; 
+    return;
+  }
+  branch->SetAddress(&digits) ;
+  branch->GetEntry(0) ; 
+  MakeDigits(digits) ; 
+}
+
 //____________________________________________________________________________
 void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
 {
@@ -242,6 +314,10 @@ void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
   // Make data from Clusters
   //
 
+  // Check id histograms already created for this Event Specie
+  if ( ! GetRecPointsData(0) )
+    InitRecPoints() ;
+  
   Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
   Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
 
@@ -294,6 +370,10 @@ void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
   //
   // make QA data from ESDs
   //  
+  // Check id histograms already created for this Event Specie
+  if ( ! GetESDsData(0) )
+    InitESDs() ;
+  
   Int_t ntrk = esd->GetNumberOfTracks() ; 
   Int_t ntof=0;
   Int_t ntofpid=0;
@@ -325,7 +405,6 @@ void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
     Float_t ratio = (Float_t)ntofpid/(Float_t)ntof*100.;
     GetESDsData(4)->Fill(ratio) ;
   }
-
 }
 
 //____________________________________________________________________________ 
@@ -341,7 +420,6 @@ void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArr
 {
   //Detector specific actions at end of cycle
   // do the QA checking
-
   AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ;  
 }
 //____________________________________________________________________________