]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added graphical reference to help DQM shifter. Updated sim TOF QA histograms. (F...
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Apr 2010 08:25:56 +0000 (08:25 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Apr 2010 08:25:56 +0000 (08:25 +0000)
TOF/AliTOFQADataMakerRec.cxx
TOF/AliTOFQADataMakerRec.h

index 51c5e3d2f686f18baa6b16f262886a3db92b6891..12d470fdf537dd42ba9496b92df1a0a158cc24d9 100644 (file)
 //  QA objects are 1 & 2 Dimensional histograms.                     //
 //  author: S.Arcelli                                                //
 //                                                                   //
-// last modified by F. Bellini (fbellini@cern.ch) on 02/03/2010      //
 ///////////////////////////////////////////////////////////////////////
 
-/* Modified by fbellini on 30/03/2010
-   Changed raws time histos range to 610ns
-   Added FilterLTMData() and FilterSpare() methods
-   Added check on enabled channels for raw data                
-   Updated RecPoints QA
-  
-*/
-
-/* Modified by fbellini on 02/03/2010
-   Fixed raw data decoding methods (use AliTOFRawStream::LoadRawDataBuffer())
-   Added filter for noisy channels and read map from OCDB
-   Added GetCalibData() method
-   Added CheckVolumeID() and CheckEquipID() methods  
-   Updated Raw QA
+/* Modified by fbellini on 16/04/2010
+   - Added EnableDqmShifterOpt() 
+   - Modified EndOfDetectorCycle() with options for DQM                
+   - Updated ESDs QA
+
+   Modified by fbellini on 30/03/2010
+   - Changed raws time histos range to 610ns
+   - Added FilterLTMData() and FilterSpare() methods
+   - Added check on enabled channels for raw data              
+   - Updated RecPoints QA
+
+   Modified by fbellini on 02/03/2010
+   - Fixed raw data decoding methods (use AliTOFRawStream::LoadRawDataBuffer())
+   - Added filter for noisy channels and read map from OCDB
+   - Added GetCalibData() method
+   - Added CheckVolumeID() and CheckEquipID() methods  
+   - Updated Raw QA
 */
 
 #include <TClonesArray.h>
 #include <TH1F.h> 
 #include <TH2F.h> 
-
+#include <TLine.h>
 
 #include "AliCDBManager.h"
 #include "AliCDBEntry.h"
@@ -63,24 +65,31 @@ ClassImp(AliTOFQADataMakerRec)
   AliTOFQADataMakerRec::AliTOFQADataMakerRec() : 
   AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"),
   fCalibData(0x0),
-  fEnableNoiseFiltering(kFALSE)
+  fEnableNoiseFiltering(kFALSE),
+    fEnableDqmShifterOpt(kFALSE),
+    fProcessedRawEventN(0)
 {
   //
   // ctor
   //
+   
 }
 
 //____________________________________________________________________________ 
 AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) :
   AliQADataMakerRec(),
   fCalibData(qadm.fCalibData),
-  fEnableNoiseFiltering(qadm.fEnableNoiseFiltering)
+  fEnableNoiseFiltering(qadm.fEnableNoiseFiltering),
+  fEnableDqmShifterOpt(qadm.fEnableDqmShifterOpt),
+  fProcessedRawEventN(qadm.fProcessedRawEventN)
 {
   //
   //copy ctor 
   //
   SetName((const char*)qadm.GetName()) ; 
   SetTitle((const char*)qadm.GetTitle()); 
+  
 }
 
 //__________________________________________________________________
@@ -133,85 +142,93 @@ void AliTOFQADataMakerRec::InitRaws()
   const Bool_t saveCorr = kTRUE ; 
   const Bool_t image    = kTRUE ; 
 
-  TH1F * h0 =  new TH1F("hTOFRaws",      "Number of TOF Raw Hits; TOF raw hits number;Counts ",1001, -1., 1000.) ;
-  TH1F * h1 =  new TH1F("hTOFRawsIA",    "Number of TOF Raw Hits - I/A side; TOF raw hits number ;Counts ",1001, -1., 1000.) ;
-  TH1F * h2 =  new TH1F("hTOFRawsOA",    "Number of TOF Raw Hits - O/A side; TOF raw hits number ;Counts ",1001, -1., 1000.) ;
-  TH1F * h3 =  new TH1F("hTOFRawsIC",    "Number of TOF Raw Hits - I/C side; TOF raw hits number ;Counts ",1001, -1., 1000.) ;
-  TH1F * h4 =  new TH1F("hTOFRawsOC",    "Number of TOF Raw Hits - O/C side; TOF raw hits number  ;Counts ",1001, -1., 1000.) ;
-  TH1F * h5  = new TH1F("hTOFRawsTimeIA", "Raws Time Spectrum in TOF (ns) - I/A side;Measured raw TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h6  = new TH1F("hTOFRawsTimeOA", "Raws Time Spectrum in TOF (ns) - O/A side;Measured raw TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h7  = new TH1F("hTOFRawsTimeIC", "Raws Time Spectrum in TOF (ns) - I/C side;Measured raw TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h8  = new TH1F("hTOFRawsTimeOC", "Raws Time Spectrum in TOF (ns) - O/C side;Measured raw TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h9  = new TH1F("hTOFRawsToTIA",  "Raws ToT Spectrum in TOF (ns) - I/A side;Measured raw ToT [ns];Counts", 1000, 0., 244.) ; 
-  TH1F * h10  = new TH1F("hTOFRawsToTOA", "Raws ToT Spectrum in TOF (ns) - O/A side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; 
-  TH1F * h11  = new TH1F("hTOFRawsToTIC", "Raws ToT Spectrum in TOF (ns) - I/C side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; 
-  TH1F * h12  = new TH1F("hTOFRawsToTOC", "Raws ToT Spectrum in TOF (ns) - O/C side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; 
-
-  TH1F * h13  = new TH1F("hTOFRawsTRMHitRate035", "TRM hit rate - crates 0 to 35 ;TRM index = DDL*10+TRM(0-9);Counts",  361, 0., 361.) ; 
-  TH1F * h14  = new TH1F("hTOFRawsTRMHitRate3671","TRM hit rate - crates 36 to 71 ;TRM index = DDL*10+TRM(0-9);Counts", 361, 361., 722.) ; 
-  TH1F * h15 = new TH1F("hTOFRawsLTMHitRate", "LTM hit rate; Crate; Counts",  72, 0., 72.);
-  
-  TH1F * h16  = new TH1F("hTOFRawsVolumeErrorCounter","Invalid hit/volume association error counter per DDL; DDL; error counter ",73, -1., 72.) ; 
-  TH1F * h17  = new TH1F("hTOFRawsEquipErrorCounter",  "Invalid hit/equipment association error counter per DDL; DDL; error counter ",73, -1., 72.) ; 
-  TH1F * h18  = new TH1F("hTOFOrphansTime", "Raws Time Spectrum in TOF (ns) for hits with no ToT measurement;Measured raw TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h19 = new TH1F("hTOFRawsWords",    "Number of TOF Raw words per event; TOF raw words number;Counts ",1001, -1., 1000.) ;
-  TH2F * h20 = new TH2F("hTOFRawTimeVsDDL",    "TOF raw time spectrum vs DDL; TOF raw time [ns];DDL ",1000,0. ,2440., 72, 0., 72.) ;
-  TH2F * h21 = new TH2F("hTOFRawToTVsDDL",     "TOF raw ToT spectrum vs DDL; TOF raw ToT [ns];DDL ",   100, 0., 244., 72, 0., 72.) ;
-  TH2F * h22  = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi;eta (2*strip+padz);phi (48*sector+padx)",183, -0.5, 182.5,865,-0.5,864.5) ; 
+  TH1F * h0 =  new TH1F("hTOFRaws",      "TOF raw hit multiplicity; TOF raw hits number;Counts ",201, -1., 200.) ;
+
+  TH1F * h1 =  new TH1F("hTOFRawsIA",    "TOF raw hit multiplicity - I/A side; TOF raw hits number ;Counts ",201, -1., 200.) ;
+  TH1F * h2 =  new TH1F("hTOFRawsOA",    "TOF raw hit multiplicity - O/A side; TOF raw hits number ;Counts ",201, -1., 200.) ;
+  TH1F * h3 =  new TH1F("hTOFRawsIC",    "TOF raw hit multiplicity - I/C side; TOF raw hits number ;Counts ",201, -1., 200.) ;
+  TH1F * h4 =  new TH1F("hTOFRawsOC",    "TOF raw hit multiplicity - O/C side; TOF raw hits number ;Counts ",201, -1., 200.) ;
+
+  TH1F * h5  = new TH1F("hTOFRawsTime", "TOF Raws - Hit time (ns);Measured Hit time [ns];Counts", 25000,0. ,610.) ; 
+
+  TH1F * h6  = new TH1F("hTOFRawsTimeIA", "TOF Raws - Hit time (ns) - I/A side;Measured Hit time [ns];Counts", 25000,0. ,610.) ; 
+  TH1F * h7  = new TH1F("hTOFRawsTimeOA", "TOF Raws - Hit time (ns) - O/A side;Measured Hit time [ns];Counts", 25000,0. ,610.) ; 
+  TH1F * h8  = new TH1F("hTOFRawsTimeIC", "TOF Raws - Hit time (ns) - I/C side;Measured Hit time [ns];Counts", 25000,0. ,610.) ; 
+  TH1F * h9  = new TH1F("hTOFRawsTimeOC", "TOF Raws - Hit time (ns) - O/C side;Measured Hit time [ns];Counts", 25000,0. ,610.) ; 
+
+  TH1F * h10  = new TH1F("hTOFRawsToT", "TOF Raws - Hit ToT (ns);Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ; 
+
+  TH1F * h11  = new TH1F("hTOFRawsToTIA", "TOF Raws - Hit ToT (ns) - I/A side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ; 
+  TH1F * h12  = new TH1F("hTOFRawsToTOA", "TOF Raws - Hit ToT (ns) - O/A side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ; 
+  TH1F * h13  = new TH1F("hTOFRawsToTIC", "TOF Raws - Hit ToT (ns) - I/C side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ; 
+  TH1F * h14  = new TH1F("hTOFRawsToTOC", "TOF Raws - Hit ToT (ns) - O/C side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ; 
+
+  TH1F * h15 = new TH1F("hTOFRawsLTMHits", "LTM hits ; Crate; Counts",  72, 0., 72.);
+  TH1F * h16  = new TH1F("hTOFRawsTRMHits035", "TRM hits  - crates 0 to 35 ;TRM index = SMid*10+TRM(0-9);Hits",  361, 0., 361.) ; 
+  TH1F * h17  = new TH1F("hTOFRawsTRMHits3671","TRM hits  - crates 36 to 71 ;TRM index = SMid*10+TRM(0-9);Hits", 361, 361., 722.) ; 
   
- // TH1F * h23 = new TH1F("hTOFRawsDecodingErr","Decoding errors counts per DDL; DDL;Counts",72,0,72);
- // TH1F * h24 = new TH1F("hTOFRawsEventsPerDDL","Events number per DDL; DDL; Event Number",72,0,72);
+  TH1F * h18 = new TH1F("hTOFRawChannelHits","TOF channel hits count; Channel ID; Hits", 158000, 0., 158000);
   
+  TH1F * h19  = new TH1F("hTOFOrphansTime", "TOF Raws - Orphans time (ns);Measured Hit time [ns];Counts", 25000, 0. ,610.) ; 
+  TH2F * h20 = new TH2F("hTOFRawTimeVsTRM035", "TOF raws - Hit time vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF raw time [ns]", 361, 0., 361., 250, 0., 610.0) ;
+  TH2F * h21 = new TH2F("hTOFRawTimeVsTRM3671", "TOF raws - Hit time vs TRM - crates 36 to 72; TRM index = DDL**10+TRM(0-9);TOF raw time [ns]", 361, 361., 722., 250, 0., 610.0) ;
+  TH2F * h22 = new TH2F("hTOFRawToTVsTRM035",  "TOF raws - Hit ToT vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF raw ToT [ns] ", 361, 0., 361., 100, 0., 48.8) ;
+  TH2F * h23 = new TH2F("hTOFRawToTVsTRM3671",  "TOF raws - Hit ToT vs TRM - crates 36 to 72; TRM index = DDL*10+TRM(0-9);TOF raw ToT [ns] ", 361, 361., 722., 100, 0., 48.8) ;
+  TH2F * h24 = new TH2F("hTOFTimeVsStrip","TOF Raws - Hit time vs. strip (theta); Strip index;Raws TOF time (ns) ", 91,0.,91, 250, 0., 610.) ; 
   
-    h0->Sumw2() ;
-    h1->Sumw2() ;
-    h2->Sumw2() ;
-    h3->Sumw2() ;
-    h4->Sumw2() ;
-    h5->Sumw2() ;
-    h6->Sumw2() ;
-    h7->Sumw2() ;
-    h8->Sumw2() ;
-    h9->Sumw2() ;
-    h10->Sumw2() ;
-    h11->Sumw2() ;
-    h12->Sumw2() ;
-    h13->Sumw2() ;
-    h14->Sumw2() ;
-    h15->Sumw2() ;
-    h16->Sumw2() ;
-    h17->Sumw2() ;
-    h18->Sumw2() ;
-    h19->Sumw2() ;
-    h20->Sumw2() ;
-    h21->Sumw2() ; 
-    h22->Sumw2() ;
-   
+// TH2F * h25 = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi;eta (2*strip+padz);phi (48*sector+padx)",183, -0.5, 182.5,865,-0.5,864.5) ; 
+
+  h0->Sumw2() ;
+  h1->Sumw2() ;
+  h2->Sumw2() ;
+  h3->Sumw2() ;
+  h4->Sumw2() ;
+  h5->Sumw2() ;
+  h6->Sumw2() ;
+  h7->Sumw2() ;
+  h8->Sumw2() ;
+  h9->Sumw2() ;
+  h10->Sumw2() ;
+  h11->Sumw2() ;
+  h12->Sumw2() ;
+  h13->Sumw2() ;
+  h14->Sumw2() ;
+  h15->Sumw2() ;
+  h16->Sumw2() ;
+  h17->Sumw2() ;
+  h18->Sumw2() ;
+  h19->Sumw2() ;
+  h20->Sumw2() ;
+  h21->Sumw2() ;
+  h22->Sumw2() ;
+  h23->Sumw2() ;
+  h24->Sumw2() ;
+
   Add2RawsList(h0,   0, !expert,  image, !saveCorr) ;
   Add2RawsList(h1,   1,  expert, !image, !saveCorr) ;
   Add2RawsList(h2,   2,  expert, !image, !saveCorr) ;
   Add2RawsList(h3,   3,  expert, !image, !saveCorr) ;
   Add2RawsList(h4,   4,  expert, !image, !saveCorr) ;
   Add2RawsList(h5,   5, !expert,  image, !saveCorr) ;
-  Add2RawsList(h6,   6, !expert,  image, !saveCorr) ;
-  Add2RawsList(h7,   7, !expert,  image, !saveCorr) ;
-  Add2RawsList(h8,   8, !expert,  image, !saveCorr) ;
-  Add2RawsList(h9,   9, !expert,  image, !saveCorr) ;
+  Add2RawsList(h6,   6,  expert, !image, !saveCorr) ;
+  Add2RawsList(h7,   7,  expert, !image, !saveCorr) ;
+  Add2RawsList(h8,   8,  expert, !image, !saveCorr) ;
+  Add2RawsList(h9,   9,  expert, !image, !saveCorr) ;
   Add2RawsList(h10, 10, !expert,  image, !saveCorr) ;
-  Add2RawsList(h11, 11, !expert,  image, !saveCorr) ;
-  Add2RawsList(h12, 12, !expert,  image, !saveCorr) ;
+  Add2RawsList(h11, 11,  expert, !image, !saveCorr) ;
+  Add2RawsList(h12, 12,  expert, !image, !saveCorr) ;
   Add2RawsList(h13, 13,  expert, !image, !saveCorr) ;
   Add2RawsList(h14, 14,  expert, !image, !saveCorr) ;
-  Add2RawsList(h15, 15,  expert, !image, !saveCorr) ;
-  Add2RawsList(h16, 16,  expert, !image, !saveCorr) ;
-  Add2RawsList(h17, 17,  expert, !image, !saveCorr) ;
+  Add2RawsList(h15, 15, !expert,  image, !saveCorr) ;
+  Add2RawsList(h16, 16, !expert,  image, !saveCorr) ;
+  Add2RawsList(h17, 17, !expert,  image, !saveCorr) ;
   Add2RawsList(h18, 18,  expert, !image, !saveCorr) ;
   Add2RawsList(h19, 19,  expert, !image, !saveCorr) ;
   Add2RawsList(h20, 20,  expert, !image, !saveCorr) ;
   Add2RawsList(h21, 21,  expert, !image, !saveCorr) ;
-  Add2RawsList(h22, 22, !expert,  image, !saveCorr) ;
-  
+  Add2RawsList(h22, 22,  expert, !image, !saveCorr) ;
+  Add2RawsList(h23, 23,  expert, !image, !saveCorr) ;
+  Add2RawsList(h24, 24,  expert, !image, !saveCorr) ;
 
 }
 
@@ -225,24 +242,32 @@ void AliTOFQADataMakerRec::InitRecPoints()
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
 
-  TH1F * h0 = new TH1F("hTOFRecPoints",    "Number of TOF RecPoints per event;TOF recPoints number;Counts",1001, -1., 1000.) ;
-  TH1F * h1  = new TH1F("hTOFRecPointsTimeIA", "RecPoints Time Spectrum in TOF (ns) - I/A side;Calibrated TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h2 = new TH1F("hTOFRecPointsTimeOA", "RecPoints Time Spectrum in TOF (ns)- O/A side;Calibrated TOF time [ns];Counts", 25000,0. ,610.) ;
-  TH1F * h3  = new TH1F("hTOFRecPointsTimeIC", "RecPoints Time Spectrum in TOF (ns)- I/C side;Calibrated TOF time [ns];Counts", 25000,0. ,610.) ;
-  TH1F * h4  = new TH1F("hTOFRecPointsTimeOC", "RecPoints Time Spectrum in TOF (ns)- O/C side;Calibrated TOF time [ns];Counts", 25000,0. ,610.) ;
+  TH1F * h0 = new TH1F("hTOFRecPoints",    "TOF RecPoints multiplicity ; TOF RecPoints number;Counts",201, -1., 200.) ;
+
+  TH1F * h1 = new TH1F("hTOFRecPointsTimeIA", "RecPoints Time Spectrum in TOF (ns)- I/A side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ; 
+  TH1F * h2 = new TH1F("hTOFRecPointsTimeOA", "RecPoints Time Spectrum in TOF (ns)- O/A side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
+  TH1F * h3 = new TH1F("hTOFRecPointsTimeIC", "RecPoints Time Spectrum in TOF (ns)- I/C side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
+  TH1F * h4 = new TH1F("hTOFRecPointsTimeOC", "RecPoints Time Spectrum in TOF (ns)- O/C side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
   
-  TH1F * h5  = new TH1F("hTOFRecPointsRawTimeIA", "RecPoints raw Time Spectrum in TOF (ns)-I/A side ;Measured TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h6  = new TH1F("hTOFRecPointsRawTimeOA", "RecPoints raw Time Spectrum in TOF (ns)-O/A side;Measured TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h7  = new TH1F("hTOFRecPointsRawTimeIC", "RecPoints raw Time Spectrum in TOF (ns)-I/C side;Measured TOF time [ns];Counts", 25000,0. ,610.) ; 
-  TH1F * h8  = new TH1F("hTOFRecPointsRawTimeOC", "RecPoints raw Time Spectrum in TOF (ns)-O/C side;Measured TOF time [ns];Counts", 25000,0. ,610.) ; 
+  TH1F * h5  = new TH1F("hTOFRecPointsRawTimeIA", "RecPoints raw Time Spectrum in TOF (ns)-I/A side; Measured TOF time [ns];Counts", 25000, 0., 610.) ; 
+  TH1F * h6  = new TH1F("hTOFRecPointsRawTimeOA", "RecPoints raw Time Spectrum in TOF (ns)-O/A side; Measured TOF time [ns];Counts", 25000, 0., 610.) ; 
+  TH1F * h7  = new TH1F("hTOFRecPointsRawTimeIC", "RecPoints raw Time Spectrum in TOF (ns)-I/C side; Measured TOF time [ns];Counts", 25000, 0., 610.) ; 
+  TH1F * h8  = new TH1F("hTOFRecPointsRawTimeOC", "RecPoints raw Time Spectrum in TOF (ns)-O/C side; Measured TOF time [ns];Counts", 25000, 0., 610.) ; 
+  TH1F * h9   = new TH1F("hTOFRecPointsToTIA", "RecPoints ToT Spectrum in TOF (ns)-I/A side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ; 
+  TH1F * h10  = new TH1F("hTOFRecPointsToTOA", "RecPoints ToT Spectrum in TOF (ns)-O/A side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ; 
+  TH1F * h11  = new TH1F("hTOFRecPointsToTIC", "RecPoints ToT Spectrum in TOF (ns)-I/C side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ; 
+  TH1F * h12  = new TH1F("hTOFRecPointsToTOC", "RecPoints ToT Spectrum in TOF (ns)-O/C side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ; 
+  TH1F * h13 = new TH1F("hTOFRawChannelHits","TOF channel hits count; Channel ID; Hits", 158000, 0., 158000);
+
+  TH2F * h14 = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF phi-eta; eta (2*strip+padz);phi (48*sector+padx)",183, -0.5, 182.5,865,-0.5,864.5) ; 
+  TH2F * h15 = new TH2F("hTOFRecTimeVsStrip","RecPoints TOF time vs. strip (theta); Strip index; RecPoints TOF time (ns) ",92,-1.,91, 250, 0., 610.) ;
+
+  TH2F * h16 = new TH2F("hTOFRecPointsTimeVsTRM035","TOF RecPoints time vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF time [ns]", 361, 0., 361., 250, 0., 610.0) ;
+  TH2F * h17 = new TH2F("hTOFRecPointsTimeVsTRM3671","TOF RecPoints time vs TRM - crates 36 to 72; TRM index = DDL**10+TRM(0-9);TOF time [ns]", 361, 361., 722., 250, 0., 610.0) ;
+  TH2F * h18 = new TH2F("hTOFRecPointsToTVsTRM035","TOF RecPoints ToT vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF ToT [ns] ", 361, 0., 361., 100, 0., 48.8) ;
+  TH2F * h19 = new TH2F("hTOFRecPointsToTVsTRM3671","TOF RecPoints ToT vs TRM - crates 36 to 72; TRM index = DDL*10+TRM(0-9);TOF ToT [ns] ", 361, 361., 722., 100, 0., 48.8) ;
  
-  TH1F * h9  = new TH1F("hTOFRecPointsToTIA", "RecPoints ToT Spectrum in TOF (ns)-I/A side;Measured TOT [ns];Counts",10000, 0., 244. ) ; 
-  TH1F * h10  = new TH1F("hTOFRecPointsToTOA", "RecPoints ToT Spectrum in TOF (ns)-O/A side;Measured TOT [ns];Counts",10000, 0., 244. ) ; 
-  TH1F * h11  = new TH1F("hTOFRecPointsToTIC", "RecPoints ToT Spectrum in TOF (ns)-I/C side;Measured TOT [ns];Counts",10000, 0., 244. ) ; 
-  TH1F * h12  = new TH1F("hTOFRecPointsToTOC", "RecPoints ToT Spectrum in TOF (ns)-O/C side;Measured TOT [ns];Counts",10000, 0., 244. ) ; 
-  
-  TH2F * h13  = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF phi-eta; eta (2*strip+padz);phi (48*sector+padx)",183, -0.5, 182.5,865,-0.5,864.5) ; 
-
     h0->Sumw2() ;
     h1->Sumw2() ;
     h2->Sumw2() ;
@@ -257,22 +282,33 @@ void AliTOFQADataMakerRec::InitRecPoints()
     h11->Sumw2() ;
     h12->Sumw2() ;
     h13->Sumw2() ;
-    
-  Add2RecPointsList(h0, 0, !expert, image) ;
-  Add2RecPointsList(h1, 1, !expert, image) ;
-  Add2RecPointsList(h2, 2, !expert, image) ;
-  Add2RecPointsList(h3, 3, !expert, image) ;
-  Add2RecPointsList(h4, 4, !expert, image) ;
-  Add2RecPointsList(h5, 5, expert, !image) ;
-  Add2RecPointsList(h6, 6, expert, !image) ;
-  Add2RecPointsList(h7, 7, expert, !image) ;
-  Add2RecPointsList(h8, 8, expert, !image) ;
-  Add2RecPointsList(h9, 9,   !expert, image) ;
-  Add2RecPointsList(h10, 10, !expert, image) ;
-  Add2RecPointsList(h11, 11, !expert, image) ;
-  Add2RecPointsList(h12, 12, !expert, image) ;
-  Add2RecPointsList(h13, 13, expert, !image) ;
+    h14->Sumw2() ;
+    h15->Sumw2() ;
+    h16->Sumw2() ;
+    h17->Sumw2() ;
+    h18->Sumw2() ;
+    h19->Sumw2() ;
 
+  Add2RecPointsList(h0, 0,   !expert,  image) ;
+  Add2RecPointsList(h1, 1,   !expert,  image) ;
+  Add2RecPointsList(h2, 2,   !expert,  image) ;
+  Add2RecPointsList(h3, 3,   !expert,  image) ;
+  Add2RecPointsList(h4, 4,   !expert,  image) ;
+  Add2RecPointsList(h5, 5,    expert, !image) ;
+  Add2RecPointsList(h6, 6,    expert, !image) ;
+  Add2RecPointsList(h7, 7,    expert, !image) ;
+  Add2RecPointsList(h8, 8,    expert, !image) ;
+  Add2RecPointsList(h9, 9,   !expert,  image) ;
+  Add2RecPointsList(h10, 10, !expert,  image) ;
+  Add2RecPointsList(h11, 11, !expert,  image) ;
+  Add2RecPointsList(h12, 12, !expert,  image) ;
+  Add2RecPointsList(h13, 13,  expert, !image) ;
+  Add2RecPointsList(h14, 14,  expert, !image) ;
+  Add2RecPointsList(h15, 15,  expert, !image) ;
+  Add2RecPointsList(h16, 16,  expert, !image) ;
+  Add2RecPointsList(h17, 17,  expert, !image) ;
+  Add2RecPointsList(h18, 18,  expert, !image) ;
+  Add2RecPointsList(h19, 19,  expert, !image) ;
 }
 
 //____________________________________________________________________________ 
@@ -282,29 +318,46 @@ void AliTOFQADataMakerRec::InitESDs()
   //create ESDs histograms in ESDs subdir
   //
 
-  Bool_t expert = kFALSE;
-
-  TH1F * h0 = new TH1F("hTOFESDs",    "Number of matched TOF tracks over ESDs",       250, -1., 4.) ;  
-  h0->Sumw2() ; 
-  Add2ESDsList(h0, 0, expert) ;
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
 
-  TH1F * h1  = new TH1F("hTOFESDsTime", "Time Spectrum in TOF (ns)", 1000, 0., 244) ; 
+  TH1F * h0  = new TH1F("hTOFESDs", "Number of matched TOF tracks per event;Number of TOF matched ESD tracks;Counts", 201, -1., 200.) ;  
+  TH1F * h1  = new TH1F("hTOFESDsTime", "Matched  ESDs tracks: TOF Time spectrum; Calibrated TOF time [ns];Counts", 25000, 0., 610. ) ; 
+  TH1F * h2  = new TH1F("hTOFESDsRawTime", "Matched ESDs tracks: TOF raw Time spectrum;Measured TOF time [ns];Counts", 25000, 0., 610.) ; 
+  TH1F * h3  = new TH1F("hTOFESDsToT", "Matched ESDs tracks: TOF ToT spectrum; ESDs ToT [ns];Counts",1000, 0., 48.8) ; 
+  TH1F * h4  = new TH1F("hTOFESDsPIDoverMatched", "Fraction of TOF identified tracks over matched TOF tracks per event; identified by TOF / matched tracks [%];Counts", 101, -1., 100.) ;  
+  TH1F * h5  = new TH1F("hTOFESDsPID", "Fraction of TOF identified tracks over ESD identified tracks per event;  identified by TOF / ESD identified [%];Counts", 101, -1., 100.) ;  
+  TH1F * h6  = new TH1F("hTOFESDsTPCmatched", "TPC-TOF matched tracks momentum distribution (GeV/c); p (GeV/c);Counts", 50, 0.20, 5.00) ;  
+  TH1F * h7  = new TH1F("hTOFESDsMatchingProb", "TPC-TOF track-matching probability per event;TPC-TOF track-matching probability (%)  ;Counts",101, -1.0, 100) ;  
+  TH1F * h8  = new TH1F("hTOFESDsHitOverTracked", "Fraction of TOF matching tracks over propagated tracks per event; TOF matched / propagated to TOF [%];Counts",101, -1.0, 100.0) ;  
+  TH1F * h9  = new TH1F("hTOFESDsDiffTime", "ESDs t_{TOF}-t_{exp} spectrum in TOF (ps); t_{TOF}-t_{exp} [ps];Counts", 200, -2440., 2440.) ; 
+  TH1F * h10  = new TH1F("hTOFHitsLength", "Matched ESDs tracks: Length Spectrum; Track length [cm];Counts", 800, 0., 800) ; 
+  h0->Sumw2() ;
   h1->Sumw2() ;
-  Add2ESDsList(h1, 1, expert) ;
-
-  TH1F * h2  = new TH1F("hTOFESDsRawTime", "raw Time Spectrum in TOF (ns)", 1000, 0., 244) ; 
   h2->Sumw2() ;
-  Add2ESDsList(h2, 2, expert) ;
-
-  TH1F * h3  = new TH1F("hTOFESDsToT", "ToT Spectrum in TOF (ns)", 1000, 0., 244) ; 
   h3->Sumw2() ;
-  Add2ESDsList(h3, 3, expert) ;
-
-  TH1F * h4 = new TH1F("hTOFESDsPID",    "Fraction of matched TOF tracks with good PID glag", 100, 0., 1.) ;  
-  h4->Sumw2() ; 
-  Add2ESDsList(h4, 4, expert) ;
+  h4->Sumw2() ;
+  h5->Sumw2() ;
+  h6->Sumw2() ;
+  h7->Sumw2() ;
+  h8->Sumw2() ;
+  h9->Sumw2() ;
+  h10->Sumw2() ;
+
+  Add2ESDsList(h0, 0, !expert,  image) ;
+  Add2ESDsList(h1, 1, !expert,  image) ;
+  Add2ESDsList(h2, 2,  expert,  image) ;
+  Add2ESDsList(h3, 3, !expert,  image) ;
+  Add2ESDsList(h4, 4,  expert,  image) ;
+  Add2ESDsList(h5, 5,  expert,  image) ;
+  Add2ESDsList(h6, 6,  expert,  image) ; 
+  Add2ESDsList(h7, 7,  expert,  image) ; 
+  Add2ESDsList(h8, 8,  expert,  image) ; 
+  Add2ESDsList(h9, 9, !expert,  image) ;
+  Add2ESDsList(h10, 10, !expert,  image) ;
 }
 
+
 //____________________________________________________________________________
 void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 {
@@ -312,7 +365,7 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   // makes data from Raws
   //
   
-  Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
+  Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;//in ns
   Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
 
   Int_t nentries=0;
@@ -347,8 +400,7 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
            equipmentID[3]=tofRawDatum->GetTDC();
            equipmentID[4]=tofRawDatum->GetTDCchannel();
            
-           if (!CheckEquipID(equipmentID)) GetRawsData(17)->Fill(equipmentID[0]);
-           else {
+           if (CheckEquipID(equipmentID)){
                tofInput.EquipmentId2VolumeId(iDDL, 
                                              tofRawDatum->GetTRM(), 
                                              tofRawDatum->GetTRMchain(),
@@ -356,73 +408,83 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
                                              tofRawDatum->GetTDCchannel(), 
                                              volumeID);
                if (FilterSpare(equipmentID)) continue;
-               if (FilterLTMData(equipmentID)) GetRawsData(15)->Fill(equipmentID[0]);
-                else {
-                 if (!CheckVolumeID(volumeID)) GetRawsData(16)->Fill(equipmentID[0]);  
-                       else {
+               if (FilterLTMData(equipmentID)){ //counts LTM hits
+                   if (tofRawDatum->GetTOT()) GetRawsData(15)->Fill(equipmentID[0]);
+               } else {
+                   if (CheckVolumeID(volumeID)){  
                        
-                   GetMapIndeces(volumeID,out);
-                   
-                   volumeID2[0]=volumeID[0];
-                   volumeID2[1]=volumeID[1];
-                   volumeID2[2]=volumeID[2];
-                   volumeID2[3]=volumeID[4];
-                   volumeID2[4]=volumeID[3];
-                   chIndex=AliTOFGeometry::GetIndex(volumeID2);
-                   
-                   if (tofRawDatum->GetTOT()){     
-                       if (!(fCalibData->GetNoiseStatus(chIndex)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
-                        && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk)) {//noise and enabled filter
-                           ntof[0]++; //counter for tof hits
-                           if (volumeID2[0]>4 && volumeID2[0]<14){       //I side
-                               if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
-                                   ntof[1]++;
-                                   GetRawsData(5)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
-                                   GetRawsData(9)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
-                               } else {
-                                   if ((iDDL%4==2)|| (iDDL%4==3)){//C side
-                                       ntof[3]++;
-                                       GetRawsData(7)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
-                                       GetRawsData(11)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
-                                   }
-                               }
-                           } else {
-                               if (volumeID2[0]<5 || volumeID2[0]>13){       //O side
+                       GetMapIndeces(volumeID,out);
+                       volumeID2[0]=volumeID[0];
+                       volumeID2[1]=volumeID[1];
+                       volumeID2[2]=volumeID[2];
+                       volumeID2[3]=volumeID[4];
+                       volumeID2[4]=volumeID[3];
+                       chIndex=AliTOFGeometry::GetIndex(volumeID2);
+                       
+                       if (tofRawDatum->GetTOT()){         
+                           if (!(fCalibData->GetNoiseStatus(chIndex)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
+                               && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk)) {//noise and enabled filter
+                               ntof[0]++; //counter for tof hits
+
+                               //fill global spectra for DQM plots
+                               GetRawsData(5)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
+                               GetRawsData(10)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
+                               
+                               //fill side-related spectra for experts plots
+                               if (volumeID2[0]>4 && volumeID2[0]<14){       //I side
                                    if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
-                                       ntof[2]++;
-                                       GetRawsData(6)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
-                                       GetRawsData(10)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
+                                       ntof[1]++;
+                                       GetRawsData(6)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
+                                       GetRawsData(11)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
                                    } else {
                                        if ((iDDL%4==2)|| (iDDL%4==3)){//C side
-                                           ntof[4]++;
-                                           GetRawsData(8)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
-                                           GetRawsData(12)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
+                                           ntof[3]++;
+                                           GetRawsData(8)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
+                                           GetRawsData(13)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
                                        }
                                    }
+                               } else {                                    
+                                   if (volumeID2[0]<5 || volumeID2[0]>13){   //O side
+                                       if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
+                                           ntof[2]++;
+                                           GetRawsData(7)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
+                                           GetRawsData(12)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
+                                       } else {
+                                           if ((iDDL%4==2)|| (iDDL%4==3)){//C side
+                                               ntof[4]++;
+                                               GetRawsData(9)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
+                                               GetRawsData(14)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
+                                           }
+                                       }
+                                   }   
+                               }
+                               GetRawsData(18)->Fill(chIndex);
+                               //compute TRM offset
+                               Int_t trm= iDDL*10+(equipmentID[1]-3);
+                               if (iDDL>=0 && iDDL<36) {
+                                   GetRawsData(16)->Fill(trm) ;
+                                   GetRawsData(20)->Fill(trm,tofRawDatum->GetTOF()*tdc2ns);
+                                   GetRawsData(22)->Fill(trm,tofRawDatum->GetTOT()*tot2ns);
                                }
-                           }
-                           //compute TRM offset
-                           Int_t trm= iDDL*10+(equipmentID[1]-3);
-                           if (iDDL>=0 && iDDL<36) GetRawsData(13)->Fill(trm) ;//in ns 
-                           if (iDDL>=36 && iDDL<72) GetRawsData(14)->Fill(trm) ;//in ns 
-                           GetRawsData(22)->Fill( out[0],out[1]) ;//raw map
-                           
-                           GetRawsData(20)->Fill(tofRawDatum->GetTOF()*tdc2ns,iDDL);
-                           GetRawsData(21)->Fill(tofRawDatum->GetTOT()*tot2ns,iDDL);
-                           
-                       }//noise filter
-                   }//end hit selection
-                   else { //orphans
-                       if (!(fCalibData->GetNoiseStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
-                        && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk))
-                           GetRawsData(18)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
-                   }//end orphans
+                               if (iDDL>=36 && iDDL<72) {
+                                   GetRawsData(17)->Fill(trm) ;//in ns 
+                                   GetRawsData(21)->Fill(trm,tofRawDatum->GetTOF()*tdc2ns);
+                                   GetRawsData(23)->Fill(trm,tofRawDatum->GetTOT()*tot2ns);
+                               }                               
+                               GetRawsData(24)->Fill(GetStripIndex(volumeID),tofRawDatum->GetTOF()*tdc2ns) ;
+                               //GetRawsData(25)->Fill( out[0],out[1]) ;//raw map
+                           }//noise filter
+                       }//end hit selection
+                       else { //orphans
+                           if (!(fCalibData->GetNoiseStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
+                               && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk))
+                               GetRawsData(19)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
+                       }//end orphans
                    }//end volumeID check
-                   }//end LTM filter
+               }//end LTM filter
            }//end equipID check
        }
-    } // while loop
-    
+    } //while loop
     clonesRawData->Clear();
   } // DDL Loop
   
@@ -430,9 +492,8 @@ void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       if(ntof[j]<=0) GetRawsData(j)->Fill(-1.) ; 
       else GetRawsData(j)->Fill(ntof[j]);
   }
-  if (nentries<=0) GetRawsData(19)->Fill(-1.) ;
-  else GetRawsData(19)->Fill(nentries) ;
-  
+  fProcessedRawEventN++;
+  EnableDqmShifterOpt(kTRUE);
 }
 
 //____________________________________________________________________________
@@ -485,9 +546,10 @@ void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
       }
       
       GetMapIndeces(volumeID,out);
-      //Int_t chIndex=AliTOFGeometry::GetIndex(volumeID2);
+      Int_t chIndex=AliTOFGeometry::GetIndex(volumeID2);
       Int_t iDDL=AliTOFRawStream::Geant2DDL(volumeID2);
-      
+      Int_t iTRM=AliTOFRawStream::Geant2TRM(volumeID2);
+
       if (c->GetTDCRAW() && c->GetTDC() && c->GetToT()){
          if (volumeID2[0]>4 && volumeID2[0]<14){       //I side
              if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
@@ -517,58 +579,111 @@ void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
                  }
              }
          }
-         GetRecPointsData(13)->Fill(out[0],out[1]);
-         
-      }
-       
+         GetRecPointsData(14)->Fill(out[0],out[1]);
+         GetRecPointsData(15)->Fill(GetStripIndex(volumeID), c->GetTDC()*tdc2ns) ;
+         Int_t trm= iDDL*10+(iTRM-3);
+         if (iDDL>=0 && iDDL<36) {
+             GetRecPointsData(16)->Fill(trm,c->GetTDC()*tdc2ns);
+             GetRecPointsData(18)->Fill(trm,c->GetToT()*tot2ns);
+         }
+         if (iDDL>=36 && iDDL<72) {
+             GetRecPointsData(17)->Fill(trm,c->GetTDC()*tdc2ns);
+             GetRecPointsData(19)->Fill(trm,c->GetToT()*tot2ns);
+         }
+         GetRecPointsData(13)->Fill(chIndex) ;//in ns
+      }//hit selection
   }//end while  
  
-  
+  EnableDqmShifterOpt(kFALSE);
 }
 
 //____________________________________________________________________________
-void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * const esd)
+void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
 {
   //
   // make QA data from ESDs
   //  
-  Int_t ntrk = esd->GetNumberOfTracks() ; 
-  Int_t ntof=0;
-  Int_t ntofpid=0;
-  while (ntrk--) {
-    AliESDtrack *track=esd->GetTrack(ntrk);
-    Double_t tofTime=track->GetTOFsignal()*1E-3;//in ns
-    Double_t tofTimeRaw=track->GetTOFsignalRaw()*1E-3;//in ns
-    Double_t tofToT=track->GetTOFsignalToT(); //in ns
-    if(!(tofTime>0))continue;
-    ntof++;
-    GetESDsData(1)->Fill(tofTime);
-    GetESDsData(2)->Fill(tofTimeRaw); 
-    GetESDsData(3)->Fill(tofToT);
-    //check how many tracks where ESD PID is ok 
-    UInt_t status=track->GetStatus();
-    if (((status&AliESDtrack::kESDpid)==0) || 
-       ((status&AliESDtrack::kTOFpid)==0)) continue;
-    ntofpid++;
-  }
-  
-  Int_t nentries=ntof;
-  if(nentries<=0){
-    GetESDsData(0)->Fill(-1.) ;
-  }else{
-    GetESDsData(0)->Fill(TMath::Log10(nentries)) ;
-  }
-
-  if(ntof>0)GetESDsData(4)->Fill(ntofpid/ntof) ;
-
+    const Double_t speedOfLight = TMath::C()*1E2*1E-12; // cm/ps
+    const Double_t pionMass = 0.13957018; //GeV/c^2
+
+    Int_t ntrk = esd->GetNumberOfTracks() ; 
+    Int_t ntof=0;
+    Int_t ntofpid=0;
+    Int_t nesdpid=0;
+    Int_t ntpc=0;
+    Int_t ntpctof=0;
+    Int_t ntofout=0;
+    
+    while (ntrk--) {
+       AliESDtrack *track=esd->GetTrack(ntrk);
+       Double_t tofTime=track->GetTOFsignal();//in ps
+       Double_t tofTimeRaw=track->GetTOFsignalRaw();//in ps
+       Double_t tofToT=track->GetTOFsignalToT(); //in ps
+
+       UInt_t status=track->GetStatus();
+       if (track->IsOn(AliESDtrack::kTPCrefit)) {
+           ntpc++;
+           Double_t y=track->Eta();
+           if ((status&AliESDtrack::kTOFout)!=0) {
+               ntofout++;
+               if (tofTime>0){
+                   ntof++;
+                   
+                   if (TMath::Abs(y)<0.9) {
+                       GetESDsData(6)->Fill(track->Pt());
+                       ntpctof++;
+                   }
+                   GetESDsData(1)->Fill(tofTime*1E-3);
+                   GetESDsData(2)->Fill(tofTimeRaw*1E-3); 
+                   GetESDsData(3)->Fill(tofToT*1E-3);
+                   //check how many tracks where ESD PID is ok 
+                   if ((status&AliESDtrack::kESDpid)!=0) nesdpid++; 
+                   if (((status&AliESDtrack::kESDpid)&AliESDtrack::kTOFpid)!=0) ntofpid++;
+                   
+                   Double_t length =track->GetIntegratedLength();
+                   Double_t mom2=(track->Pt()*track->Pt())+(track->Pz()*track->Pz());
+                   Double_t eTexp = TMath::Sqrt(1+(pionMass*pionMass/mom2))*length/speedOfLight; //in ps
+                   GetESDsData(9)->Fill(tofTime-eTexp);
+                   GetESDsData(10)->Fill(length);
+               } //end check on matched tracks
+           }
+       }//end check on TPCrefit
+    }
+    Int_t nentries=ntof;
+    if(nentries<=0){
+       GetESDsData(0)->Fill(-1.) ;
+    }else{
+       GetESDsData(0)->Fill(nentries) ;
+    }
+    
+    if(ntof>0) {
+       Float_t ratio = (Int_t)ntofpid/(Int_t)ntof*100; //identified by TOF over matched
+       GetESDsData(4)->Fill(ratio) ;
+    }
+    
+    if(nesdpid>0) {
+       Float_t ratio = (Float_t)ntofpid/(Float_t)nesdpid *100; //identified by TOF over identified
+       GetESDsData(5)->Fill(ratio) ;
+    }
+    
+    if(ntpc>0){
+       Float_t ratio = (Float_t)ntof/(Float_t)ntpc*100.; //matching probability
+       GetESDsData(7)->Fill(ratio) ;
+    }
+    
+    if(ntofout>0) {
+       Float_t ratio = (Float_t)ntof/(Float_t)ntofout*100; //matched over propagated to TOF outer radius
+       GetESDsData(8)->Fill(ratio) ;
+    }
+    EnableDqmShifterOpt(kFALSE);
 }
+
 //____________________________________________________________________________ 
 void AliTOFQADataMakerRec::StartOfDetectorCycle()
 {
   //
   //Detector specific actions at start of cycle
-  //to be implemented  
-
   fCalibData = GetCalibData();
 
 }
@@ -578,8 +693,91 @@ 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) ;  
+    
+    for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
+       if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) 
+           continue ; 
+       
+       AliInfo(Form("Processed %i raw events",fProcessedRawEventN));
+
+       if (fEnableDqmShifterOpt){
+           // Help make the raw qa histogram easier to interpret for the DQM shifter
+           if (!GetRawsData(0) || !GetRawsData(5) || !GetRawsData(10) 
+               || !GetRawsData(15) || !GetRawsData(16) || !GetRawsData(17)) {
+               printf("No histogram for DQM found - Possible memory corruption ???. Please check\n") ; 
+               continue;
+           }
+           
+           Double_t yTimeMin = GetRawsData(5)->GetMinimum();
+           Double_t yTimeMax = GetRawsData(5)->GetMaximum();
+           Double_t yTotMin = GetRawsData(10)->GetMinimum();
+           Double_t yTotMax = GetRawsData(10)->GetMaximum();
+           
+           TLine* lineExpTimeMin = new TLine(200., yTimeMin, 200., yTimeMax);
+           lineExpTimeMin->SetLineColor(kGreen);
+           lineExpTimeMin->SetLineWidth(2);
+           
+           TLine* lineExpTimeMax = new TLine(250., yTimeMin, 250., yTimeMax);
+           lineExpTimeMax->SetLineColor(kGreen);
+           lineExpTimeMax->SetLineWidth(2);
+           
+           TLine* lineExpTotMin = new TLine( 5., yTotMin, 5., yTotMax);
+           lineExpTotMin->SetLineColor(kGreen);
+           lineExpTotMin->SetLineWidth(2);
+           
+           TLine* lineExpTotMax = new TLine(20., yTotMin, 20., yTotMax);
+           lineExpTotMax->SetLineColor(kGreen);
+           lineExpTotMax->SetLineWidth(2);
+           
+           for(Int_t j=0;j<5;j++){
+               //make up for hits count
+               GetRawsData(j)->SetMarkerColor(kRed);
+               GetRawsData(j)->SetMarkerStyle(7);
+               
+               //make up for time spectra
+               ((TH1F*)GetRawsData(j+5))->GetListOfFunctions()->Add(lineExpTimeMin);
+               ((TH1F*)GetRawsData(j+5))->GetListOfFunctions()->Add(lineExpTimeMax);
+               GetRawsData(j+5)->SetLineColor(kBlue+1);
+               GetRawsData(j+5)->SetMarkerColor(kBlue+1);
+               
+               //make up for tot spectra
+               ((TH1F*)GetRawsData(j+10))->GetListOfFunctions()->Add(lineExpTotMin);
+               ((TH1F*)GetRawsData(j+10))->GetListOfFunctions()->Add(lineExpTotMax);
+               GetRawsData(j+10)->SetLineColor(kBlue+1);
+               GetRawsData(j+10)->SetMarkerColor(kBlue+1);
+           }
+           
+           //make up for equipment hits count 
+           for(Int_t j=15;j<18;j++){
+             GetRawsData(j)->SetDrawOption("hist");
+             GetRawsData(j)->SetLineColor(kBlue+1);
+             GetRawsData(j)->SetFillColor(kBlue+1);
+             GetRawsData(j)->SetLineWidth(1);
+             if (j==15) {
+                 GetRawsData(j)->SetMarkerStyle(8);
+                 GetRawsData(j)->SetMarkerColor(kBlue+2);
+             }
+             /*else {
+                 Int_t ySMmax=GetRawsData(j)->GetMaximum();
+                 TLine* lineSMid[18];
+                 for (Int_t sm=0;sm<18;sm++){
+                     lineSMid[sm] = new TLine(40*sm, 0,40*sm, ySMmax);
+                     lineSMid[sm]->SetLineColor(kMagenta);
+                     lineSMid[sm]->SetLineWidth(2);
+                     if ((40*sm>=j*360) && (40*sm<=(j+1)*360)) ((TH1F*)GetRawsData(j))->GetListOfFunctions()->Add(lineSMid[sm]);
+                 }
+             }
+             */
+          }
+           
+          //make up for orphans histo
+          GetRawsData(19)->SetLineColor(kBlue+1);
+          GetRawsData(19)->SetMarkerColor(kBlue+1);
+          ((TH1F*)GetRawsData(19))->GetListOfFunctions()->Add(lineExpTimeMin);
+          ((TH1F*)GetRawsData(19))->GetListOfFunctions()->Add(lineExpTimeMax);
+        }
+    }
+    AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ;  
 }
 //____________________________________________________________________________
 void AliTOFQADataMakerRec::GetMapIndeces(const Int_t* const in , Int_t* out)
@@ -626,6 +824,50 @@ void AliTOFQADataMakerRec::GetMapIndeces(const Int_t* const in , Int_t* out)
   out[0]=zindex;  
   out[1]=phiindex;  
   
+}
+
+//---------------------------------------------------------------
+Int_t AliTOFQADataMakerRec::GetStripIndex(const Int_t * const in)
+{
+    /* return tof strip index between 0 and 91 */
+
+  Int_t nStripA = AliTOFGeometry::NStripA();
+  Int_t nStripB = AliTOFGeometry::NStripB();
+  Int_t nStripC = AliTOFGeometry::NStripC();
+
+  // Int_t isector = in[0];
+  Int_t iplate = in[1];
+  Int_t istrip = in[2];
+  //Int_t ipadX = in[3]; 
+  //Int_t ipadZ = in[4]; 
+  
+  Int_t stripOffset = 0;
+  switch (iplate) {
+  case 0:
+    stripOffset = 0;
+      break;
+  case 1:
+    stripOffset = nStripC;
+    break;
+  case 2:
+    stripOffset = nStripC+nStripB;
+    break;
+  case 3:
+    stripOffset = nStripC+nStripB+nStripA;
+    break;
+  case 4:
+    stripOffset = nStripC+nStripB+nStripA+nStripB;
+    break;
+  default:
+      AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
+      stripOffset=-1;
+      break;
+  };
+  
+  if (stripOffset<0 || stripOffset>92) return -1;
+  else 
+      return (stripOffset+istrip);
+  
 }
 //---------------------------------------------------------------
 Bool_t  AliTOFQADataMakerRec::CheckVolumeID(const Int_t * const volumeID)
@@ -662,7 +904,7 @@ Bool_t  AliTOFQADataMakerRec::CheckEquipID(const Int_t * const equipmentID)
 Bool_t  AliTOFQADataMakerRec::FilterLTMData(const Int_t * const equipmentID) const
 {
   /*It returns kTRUE if data come from LTM.
-    It thus filter trigger-related signals  */
+    It thus filters trigger-related signals  */
 
   Int_t ddl, trm, tdc;
   //if (!CheckEquipID(equipmentID)) return kFALSE;
index 322e31117886a8e649b078d47852f36b2b3c6b76..5220261e820d44d4074bbb38fffd62495eeb56dc 100644 (file)
@@ -43,14 +43,21 @@ private:
   virtual void   StartOfDetectorCycle() ; 
   virtual void   EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) ;
   virtual void   GetMapIndeces(const Int_t * const in, Int_t *out) ; 
-             Int_t  GetStripIndex(const Int_t * const in);
+         Int_t  GetStripIndex(const Int_t * const in);
   virtual void   EnableNoiseFiltering(Bool_t enable){fEnableNoiseFiltering = enable;};
+  virtual void   EnableDqmShifterOpt(Bool_t enable){ fEnableDqmShifterOpt = enable;};
           Bool_t CheckVolumeID(const Int_t * const equipmentID); 
           Bool_t CheckEquipID( const Int_t * const equipmentID); 
-          Bool_t FilterLTMData(const Int_t * const equipmentID) const; 
-          Bool_t FilterSpare(  const Int_t * const equipmentID) const;
+          Bool_t FilterLTMData(const Int_t * const equipmentID) const ; 
+          Bool_t FilterSpare(  const Int_t * const equipmentID) const ;
+         
+         Bool_t fEnableNoiseFiltering; //the choice is not implemented so far
+         Bool_t fEnableDqmShifterOpt;  // draw option flag to help
+                                       // DQM shifter in the
+                                       // interpretation of the TOF
+                                       // raw QA histograms
+         Int_t  fProcessedRawEventN;   // number of processed rawData events
 
-  Bool_t fEnableNoiseFiltering; //the choice is not implemented so far
   ClassDef(AliTOFQADataMakerRec,2)  // description 
 
 };