]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFQADataMakerRec.cxx
Coding convention violations: suppression
[u/mrichter/AliRoot.git] / TOF / AliTOFQADataMakerRec.cxx
index 98ad4d4231fb86022dcb8d5d4e96182b65fecf22..ef18d79a6107ea543bcf44fe0bfe316e8528df56 100644 (file)
@@ -38,6 +38,7 @@
 #include "AliTOFRawStream.h"
 #include "AliTOFrawData.h"
 #include "AliTOFGeometry.h"
+#include "AliTOFdigit.h"
 
 ClassImp(AliTOFQADataMakerRec)
            
@@ -83,23 +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.) ;   h0->Sumw2() ;
+  TH1F * h0 = new TH1F("hTOFRaws",    "Number of TOF Raws;TOF raw number [10 power];Counts ",301, -1.02, 5.) ;
+  h0->Sumw2() ;
   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", 20000, 0., 2000) ; 
   h1->Sumw2() ;
   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() ;
   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->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", 20000, 0., 2000) ; 
+  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()
 {
@@ -109,29 +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.) ;   h0->Sumw2() ;
+
+  TH1F * h0 = new TH1F("hTOFRecPoints",    "Number of TOF RecPoints;TOF recPoint number [10 power];Counts",301, -1.02, 5.) ;
+  h0->Sumw2() ;
   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", 20000, 0., 2000) ; 
   h1->Sumw2() ;
   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", 20000, 0., 2000) ; 
   h2->Sumw2() ;
   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() ;
   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) ;
-
 }
 
 //____________________________________________________________________________ 
@@ -143,23 +172,23 @@ 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() ; 
   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", 20000, 0., 2000) ; 
   h1->Sumw2() ;
   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", 20000, 0., 2000) ; 
   h2->Sumw2() ;
   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() ;
   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() ; 
   Add2ESDsList(h4, 4, !expert, image) ;
 }
@@ -170,7 +199,7 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   //
   // makes data from Raws
   //
-
+  
   Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
   Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
 
@@ -216,13 +245,71 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   }
 }
 
+//____________________________________________________________________________
+void AliTOFQADataMakerRec::MakeDigits()
+{
+  //
+  // 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=fDigitsArray->GetEntriesFast();
+  if(nentries<=0){
+    GetDigitsData(0)->Fill(-1.) ; 
+  }else{
+    GetDigitsData(0)->Fill(TMath::Log10(nentries)) ; 
+  } 
+  
+  TIter next(fDigitsArray) ; 
+  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
+  //
+  
+  if (fDigitsArray) 
+    fDigitsArray->Clear() ; 
+  else
+    fDigitsArray = new TClonesArray("AliTOFdigit", 1000) ; 
+  
+  TBranch * branch = digitTree->GetBranch("TOF") ;
+  if ( ! branch ) {
+    AliError("TOF branch in Digit Tree not found") ; 
+    return;
+  }
+  branch->SetAddress(&fDigitsArray) ;
+  branch->GetEntry(0) ; 
+  MakeDigits() ; 
+}
+
 //____________________________________________________________________________
 void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
 {
   //
   // Make data from Clusters
   //
-
   Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
   Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
 
@@ -275,6 +362,7 @@ void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
   //
   // make QA data from ESDs
   //  
+  
   Int_t ntrk = esd->GetNumberOfTracks() ; 
   Int_t ntof=0;
   Int_t ntofpid=0;
@@ -302,9 +390,10 @@ void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
     GetESDsData(0)->Fill(TMath::Log10(nentries)) ;
   }
 
-  Float_t ratio = (Float_t)ntofpid/(Float_t)ntof*100.;
-  if(ntof>0)GetESDsData(4)->Fill(ratio) ;
-
+  if(ntof>0) {
+    Float_t ratio = (Float_t)ntofpid/(Float_t)ntof*100.;
+    GetESDsData(4)->Fill(ratio) ;
+  }
 }
 
 //____________________________________________________________________________ 
@@ -320,7 +409,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) ;  
 }
 //____________________________________________________________________________