new T0 QA from Alla
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Mar 2011 14:05:09 +0000 (14:05 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Mar 2011 14:05:09 +0000 (14:05 +0000)
PWG1/CMakelibPWG1.pkg
PWG1/PWG1LinkDef.h
PWG1/PilotTrain/PilotAnalysis.C
PWG1/T0/AddTaskT0QA.C [new file with mode: 0644]
PWG1/T0/AliT0AnalysisTaskQA.cxx [new file with mode: 0644]
PWG1/T0/AliT0AnalysisTaskQA.h [new file with mode: 0644]

index de6f470..0af27e8 100644 (file)
@@ -38,14 +38,15 @@ file (GLOB SRCS10 "TRD/info/*.cxx" )
 file (GLOB SRCS11 "background/*.cxx" )
 file (GLOB SRCS12 "Centrality/*.cxx" )
 file (GLOB SRCS13 "ZDC/*.cxx" )
+file (GLOB SRCS14 "T0/*.cxx" )
 
-list(APPEND SRCS ${SRCS1} ${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} ${SRCS8} ${SRCS9} ${SRCS10} ${SRCS11} ${SRCS12} ${SRCS13})
+list(APPEND SRCS ${SRCS1} ${SRCS2} ${SRCS3} ${SRCS4} ${SRCS5} ${SRCS6} ${SRCS7} ${SRCS8} ${SRCS9} ${SRCS10} ${SRCS11} ${SRCS12} ${SRCS13} ${SRCS14})
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
 
 set ( DHDR  PWG1LinkDef.h)
 
-set ( EINCLUDE  STEER TPC ITS TRD TOF TRD/Cal ANALYSIS/Tender ANALYSIS PWG1/comparison PWG1/cosmic PWG1/global PWG1/tender PWG1/ITS PWG1/TPC PWG1/TOF PWG1/TRD PWG1/TRD/info PWG1/background PWG1/Centrality HMPID)
+set ( EINCLUDE  STEER TPC ITS TRD TOF TRD/Cal ANALYSIS/Tender ANALYSIS PWG1/comparison PWG1/cosmic PWG1/global PWG1/tender PWG1/ITS PWG1/TPC PWG1/TOF PWG1/TRD PWG1/TRD/info PWG1/background PWG1/Centrality HMPID PWG1/ZDC PWG1/T0)
 
   if( ALICE_TARGET STREQUAL "win32gcc")
        
index 5e7dcf2..5a0bbcd 100644 (file)
 #pragma link C++ class  AliAnalysisTaskHIMultCorr+;
 // ZDC
 #pragma link C++ class  AliAnalysisTaskZDC+;
+// T0
+#pragma link C++ class  AliT0AnalysisTaskQA+;
 #
 #pragma link C++ class  AliTrackComparison+;
 #pragma link C++ class  AliTrackComparisonESD+;
index 593de9b..1a5ace8 100644 (file)
@@ -5,12 +5,12 @@ class AliAnalysisAlien;
 AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode);
 
 // Collision type: 0 = p-p   1 = Pb-Pb
-Int_t  iCollisionType = 1;
-Int_t runNumbers[5] = {137844};
+Int_t  iCollisionType = 0;
+Int_t runNumbers[5] = {145384};
 
 Bool_t doCDBconnect   = 1;
 Bool_t doEventStat    = 1;
-Bool_t doCentrality   = 1;
+Bool_t doCentrality   = 0;
 Bool_t doQAsym        = 1;
 Bool_t doVZERO        = 1;   // there is a 2nd file
 Bool_t doVertex       = 1;
@@ -18,33 +18,36 @@ Bool_t doSPD          = 1;   // needs RP
 Bool_t doTPC          = 1;
 Bool_t doSDD          = 1;   // needs RP
 Bool_t doSSDdEdx      = 1;
-// new 
-Bool_t doTRD          = 1;
+
+Bool_t doTRD          = 0;
 Bool_t doITS          = 1;
+Bool_t doITSsaTracks  = 1;   // new
+Bool_t doITSalign     = 0;   // new (try to load geom)
 Bool_t doCALO         = 1;
 Bool_t doMUONTrig     = 1;
 Bool_t doImpParRes    = 1;
 Bool_t doMUON         = 1;
 Bool_t doTOF          = 1;
 Bool_t doHMPID        = 1;
-Bool_t doZDC          = 1;
+Bool_t doT0           = 1; // new
+Bool_t doZDC          = 0;
 
 Bool_t doMUONEff      = 0;   // NEEDS geometry
 Bool_t doV0           = 0;   // NEEDS MCtruth 
 
 TString     train_name         = "QA";      // QA local folder name
-TString     train_tag          = "_Pb-Pb_";        // Train special tag appended to 
+TString     train_tag          = (iCollisionType)?"_Pb-Pb":"_p-p";        // Train special tag appended to 
                                             // visible name. ("sim", "pp", ...)
                // Name in train page (DON'T CHANGE)
 TString     visible_name       = Form("QA$2_$3%s", train_tag.Data()); //# FIXED #
-TString     job_comment        = "PWG1 QA train "; // Can add observations here
+TString     job_comment        = "PWG1 QA train(no TRD, no ZDC)"; // Can add observations here
                // Job tag (DON'T CHANGE)
 TString     job_tag            = Form("%s: %s", visible_name.Data(), job_comment.Data());
                // Package versions - Modify as needed
-TString     root_version       = "v5-27-06c";
-TString     aliroot_version    = "v4-21-15-AN";
+TString     root_version       = "v5-28-00a";
+TString     aliroot_version    = "v4-21-17b-AN";
                // Production directory - change as needed for test mode
-TString     grid_datadir       = "/alice/data/2010/LHC10h";
+TString     grid_datadir       = "/alice/data/2011/LHC11a";
                // Work directory in GRID (DON'T CHANGE)
 TString     grid_workdir       = "/alice/cern.ch/user/a/alidaq/QA/QA$2";
                // Job splitting
@@ -54,7 +57,7 @@ Int_t       debug_level        = 1;        // Debugging
                // File merging
 Int_t       maxMergeFiles      = 10;       // Max files to merge in a chunk
                // Data pattern - change as needed for test mode
-TString     data_pattern       = "*ESDs/pass1/*ESDs.root";
+TString     data_pattern       = "*ESDs/Pass1/*ESDs.root";
                // Output directory (DON'T CHANGE)
 TString     alien_outdir       = "$1/QA$2";
                // Input collection (production mode)
@@ -102,13 +105,18 @@ void PilotAnalysis(const char *plugin_mode = "full")
   out << "   doSSDdEdx       = " << doSSDdEdx << ";" << endl;
   out << "   doTPC           = " << doTPC << ";" << endl;
   out << "   doTRD           = " << doTRD << ";" << endl;
+  out << "   doITS           = " << doITS << ";" << endl;
+  out << "   doITSsaTracks   = " << doITSsaTracks << ";" << endl;
+  out << "   doITSalign      = " << doITSalign << ";" << endl;
   out << "   doZDC           = " << doZDC << ";" << endl;
   out << "   doImpParRes     = " << doImpParRes << ";" << endl;
   out << "   doMUON          = " << doMUON << ";" << endl;
   out << "   doTOF           = " << doTOF << ";" << endl;
   out << "   doHMPID         = " << doHMPID << ";" << endl;
+  out << "   doZDC           = " << doZDC << ";" << endl;
+  out << "   doT0            = " << doT0 << ";" << endl;
   out << "   doEventStat     = " << doEventStat << ";" << endl;
-  out << "   doCentrality    = " << doCentrality << ";" << endl;
+  if (iCollisionType) out << "   doCentrality    = " << doCentrality << ";" << endl;
   out << "}" << endl;
   out.close();
   
@@ -118,7 +126,6 @@ void PilotAnalysis(const char *plugin_mode = "full")
   // Create manager
   AliAnalysisManager *mgr  = new AliAnalysisManager("PilotAnalysis", "Production train");
   mgr->SetNSysInfo(100);
-  mgr->SetDebugLevel(1);
   // Input handler
   AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP();
   esdHandler->SetReadFriends(kTRUE);
@@ -148,11 +155,10 @@ void LoadLibraries()
   gSystem->Load("libPWG0dep.so");
   gSystem->Load("libPWG0selectors.so");
   gSystem->Load("libPWG1.so");
-  gSystem->Load("libPWG2.so");
-  gSystem->Load("libPWG2forward.so");
 
   if (doCALO) {
      gSystem->Load("libEMCALUtils");
+     gSystem->Load("libPHOSUtils");
      gSystem->Load("libPWG4PartCorrBase");
      gSystem->Load("libPWG4PartCorrDep");
   }  
@@ -194,11 +200,13 @@ void AddAnalysisTasks()
   // Centrality (A. Toia)
   //
   if (doCentrality) {
-     gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
-     AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
-// J.Thaeder
-//     gROOT->LoadMacro("$ALICE_ROOT/PWG1/Centrality/AddTaskHIMultCorr.C");
-//     AliAnalysisTaskHIMultCorr *taskHIcentrality = AddTaskHIMultCorr();
+     if (!iCollisionType) {
+        printf("Disabling centrality task for p-p\n");
+        doCentrality = kFALSE;
+     } else {           
+        gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
+        AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
+     }   
   }   
   
   // Vertexing (A. Dainese)
@@ -281,6 +289,17 @@ void AddAnalysisTasks()
       }
   }
   //
+  // ITS saTracks, align (F.Prino)
+  //
+  if (doITSsaTracks) {
+     gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskITSsaTracks.C");
+     AliAnalysisTaskITSsaTracks *itssaTracks = AddTaskITSsaTracks(kFALSE,kFALSE);
+  }   
+  if (doITSalign) {
+     gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskITSAlign.C");
+     AliAnalysisTaskITSAlignQA *itsAlign = AddTaskITSAlign(0,2011);
+  }   
+  //
   // TRD (Alex Bercuci, M. Fasel) 
   //
   if(doTRD) {
@@ -309,7 +328,7 @@ void AddAnalysisTasks()
 
   if(doCALO) {
       gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/QA/AddTaskCalorimeterQA.C");
-      AliAnalysisTaskParticleCorrelation *taskCaloQA = AddTaskCalorimeterQA("ESD", kTRUE, kFALSE);
+      AliAnalysisTaskParticleCorrelation *taskCaloQA = AddTaskCalorimeterQA("ESD", 2011, kFALSE, kFALSE);
       taskCaloQA->SetDebugLevel(0);
   }
 
@@ -374,6 +393,11 @@ void AddAnalysisTasks()
     gROOT->LoadMacro("$ALICE_ROOT/PWG1/HMPID/AddTaskHmpidQA.C");
     AliAnalysisTaskSE* taskhmpidqa= AddTaskHmpidQA(kFALSE);
   }      
+  // T0 QA (Alla Mayevskaya
+  if (doT0) {
+    gROOT->LoadMacro("$ALICE_ROOT/PWG1/T0/AddTaskT0QA.C");
+    AliT0AnalysisTaskQA* tast0qa= AddTaskT0QA();
+  }      
 }
 
 //______________________________________________________________________________
@@ -391,10 +415,9 @@ AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode)
       plugin->AddDataFile(data_collection);
    }   
    plugin->SetJobTag(job_tag);
-   plugin->SetNtestFiles(10);
+   plugin->SetNtestFiles(1);
    plugin->SetCheckCopy(kFALSE);
    plugin->SetMergeDirName(mergeDirName);
-//   plugin->SetOneStageMerging(kTRUE);
 // Set versions of used packages
    plugin->SetAPIVersion("V1.1x");
    plugin->SetROOTVersion(root_version);
@@ -407,7 +430,7 @@ AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode)
    plugin->SetDataPattern(data_pattern);
 // ...then add run numbers to be considered
 //   if (!iAODanalysis) plugin->SetRunRange(run_range[0], run_range[1]);
-//   plugin->SetOutputSingleFolder("output");
+//   plugin->SetOutputSingleFolder("outpu$ALICE_ROOT/PWG1/T0/Addt");
    if (!useProductionMode) {
       plugin->SetRunPrefix("000");
       plugin->SetOutputToRunNo();
@@ -436,12 +459,11 @@ AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode)
 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
    plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD");
    
-   plugin->SetAdditionalLibs("libCORRFW.so libTENDER.so libPWG0base.so libPWG0dep.so libPWG0selectors.so libPWG1.so libPWG2.so \
-                              libPWG2forward.so libEMCALUtils.so libPWG4PartCorrBase.so libPWG4PartCorrDep.so \
+   plugin->SetAdditionalLibs("libCORRFW.so libTENDER.so libPWG0base.so libPWG0dep.so libPWG0selectors.so libPWG1.so \
+                              libEMCALUtils.so libPHOSUtils.so libPWG4PartCorrBase.so libPWG4PartCorrDep.so \
                               libPWG3base.so libPWG3muon.so libPWG3muondep.so");
      
 // Declare the output file names separated by blancs.
-// (can be like: file.root or file.root@ALICE::Niham::File)
    plugin->SetDefaultOutputs();
    plugin->SetMaxMergeFiles(maxMergeFiles);
    plugin->SetNrunsPerMaster(1);
@@ -462,7 +484,7 @@ AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode)
 // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
 //   plugin->SetMaxInitFailed(5);
 // Optionally modify the number of replicas
-   plugin->SetNumberOfReplicas(4);
+   plugin->SetNumberOfReplicas(5);
 // Optionally resubmit threshold.
 //   plugin->SetMasterResubmitThreshold(90);
 // Optionally set time to live (default 30000 sec)
diff --git a/PWG1/T0/AddTaskT0QA.C b/PWG1/T0/AddTaskT0QA.C
new file mode 100644 (file)
index 0000000..fdd871a
--- /dev/null
@@ -0,0 +1,40 @@
+AliAnalysisTaskSE* AddTaskT0QA()
+{
+  // Creates a QA task to check T0 data
+  
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskT0QA", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  //==============================================================================
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskT0QA", "This task requires an input event handler");
+    return NULL;
+  }
+   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+  
+   // Configure analysis
+   //===========================================================================
+   
+   AliT0AnalysisTaskQA* task = new AliT0AnalysisTaskQA("AliAnaT0QA");
+   mgr->AddTask(task);
+  
+  AliAnalysisDataContainer *coutput = mgr->CreateContainer("QAT0chists", TObjArray::Class(), 
+                                                          AliAnalysisManager::kOutputContainer, Form("%s:T0_Performance",
+                                                                                                     mgr->GetCommonFileName()));
+
+  
+   mgr->ConnectInput  (task, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput (task, 1, coutput);
+
+   return task;   
+}
+
+
diff --git a/PWG1/T0/AliT0AnalysisTaskQA.cxx b/PWG1/T0/AliT0AnalysisTaskQA.cxx
new file mode 100644 (file)
index 0000000..f65560b
--- /dev/null
@@ -0,0 +1,179 @@
+#include "TChain.h"
+#include "TTree.h"
+#include "TH1F.h"
+#include "TF1.h"
+#include "TH2F.h"
+#include "TCanvas.h"
+#include "TObjArray.h"
+
+#include "AliAnalysisTask.h"
+#include "AliAnalysisManager.h"
+
+#include "AliESDEvent.h"
+#include "AliESDInputHandler.h"
+
+#include "AliT0AnalysisTaskQA.h"
+
+//#include "AliCDBMetaData.h"
+//#include "AliCDBId.h"
+//#include "AliCDBEntry.h"
+//#include "AliCDBManager.h"
+//#include "AliCDBStorage.h"
+
+// Task should calculate channels offset 
+// Authors: Alla 
+
+ClassImp(AliT0AnalysisTaskQA)
+//________________________________________________________________________
+AliT0AnalysisTaskQA::AliT0AnalysisTaskQA() 
+  : AliAnalysisTaskSE(),  fESD(0x0), fTzeroObject(0x0),
+  fTzeroORA(0x0), fTzeroORC(0x0), fResolution(0x0), fTzeroORAplusORC(0x0),
+    fRunNumber(0),fTimeVSAmplitude(0x0),fCFDVSPmtId(0x0),fSPDVertexVST0Vertex(0x0),
+    fOrAvsNtracks(0), fOrCvsNtracks(0), fT0vsNtracks(0) 
+{
+  // Constructor
+
+  // Define input and output slots here
+  // Input slot #0 works with a TChain
+
+// ########### NEVER define slots in the IO constructor
+//  DefineInput(0,  TChain::Class());
+//  DefineOutput(1, TObjArray::Class());
+}
+
+
+//________________________________________________________________________
+AliT0AnalysisTaskQA::AliT0AnalysisTaskQA(const char *name) 
+  : AliAnalysisTaskSE(name),  fESD(0x0), fTzeroObject(0x0),
+  fTzeroORA(0x0), fTzeroORC(0x0), fResolution(0x0), fTzeroORAplusORC(0x0),
+    fRunNumber(0),fTimeVSAmplitude(0x0),fCFDVSPmtId(0x0),fSPDVertexVST0Vertex(0x0),
+    fOrAvsNtracks(0), fOrCvsNtracks(0), fT0vsNtracks(0) 
+{
+  // Constructor
+  // Define input and output slots here
+  // Input slot #0 works with a TChain
+  DefineInput(0, TChain::Class());
+  DefineOutput(1, TObjArray::Class());
+  // Output slot #0 id reserved by the base class for AOD
+  // Output slot #1 writes into a TH1 container
+}
+
+//________________________________________________________________________
+AliT0AnalysisTaskQA::~AliT0AnalysisTaskQA() 
+{
+  // Destructor
+  // printf("AliT0CalibOffsetChannels~AliT0CalibOffsetChannels() ");
+  delete fTzeroObject; // This deletes everything ...
+}
+
+//------------------------------------------------------------------
+void AliT0AnalysisTaskQA::UserCreateOutputObjects()
+{
+  // Create histograms
+ fTimeVSAmplitude = new TH2F*[NPMT0];
+
+ for (Int_t i=0; i<NPMT0; i++) {
+    fTimeVSAmplitude[i]= new TH2F (Form("fTimeVSAmplitude%d",i+1),"fTimeVsAmplitude",60, -10, 50,500,6000,7000);
+  }
+
+  fTzeroORAplusORC = new TH1F("fTzeroORAplusORC","ORA+ORC /2",100,-2000,2000);   //or A plus or C 
+  fResolution      = new TH1F("fResolution","fResolution",100,-2000,2000);// or A minus or C spectrum
+  fTzeroORA        = new TH1F("fTzeroORA","fTzeroORA",100,-2000,2000);// or A spectrum
+  fTzeroORC        = new TH1F("fTzeroORC","fTzeroORC",100,-2000,2000);// or C spectrum
+  fCFDVSPmtId      = new TH2F("fCFDVSPmtId","fCFDVSPmtId",24,0,24,250,6000,7000);  // 
+  fSPDVertexVST0Vertex = new TH2F("fSPDVertexVST0Vertex","fSPDVertexVST0Vertex",30,-30,30,30,-30,30);
+  fOrAvsNtracks    = new TH2F("fAvstracks", "Avstracks",200, 0, 1000, 500, -1000, 1000);
+  fOrCvsNtracks    = new TH2F("fCvstracks", "Cvstracks",200, 0, 1000, 500, -1000, 1000);
+  fT0vsNtracks     = new TH2F("fT0ACvstrackles", "T0ACvstracks",200, 0, 1000, 500, -1000, 1000); 
+
+  fTzeroObject     = new TObjArray();
+  fTzeroObject->SetOwner(kTRUE);
+  
+  for (Int_t i=0; i<24; i++)
+    fTzeroObject->AddAtAndExpand(fTimeVSAmplitude[i],i);
+
+  fTzeroObject->AddAtAndExpand(fCFDVSPmtId,24);
+  fTzeroObject->AddAtAndExpand(fSPDVertexVST0Vertex,25);
+  fTzeroObject->AddAtAndExpand(fTzeroORAplusORC, 26);
+  fTzeroObject->AddAtAndExpand(fResolution, 27);
+  fTzeroObject->AddAtAndExpand(fTzeroORA, 28);
+  fTzeroObject->AddAtAndExpand(fTzeroORC, 29);
+  fTzeroObject->AddAtAndExpand(fT0vsNtracks, 30);
+  fTzeroObject->AddAtAndExpand(fOrAvsNtracks,31);
+  fTzeroObject->AddAtAndExpand(fOrCvsNtracks, 32);
+
+  PostData(1, fTzeroObject);
+  // Called once
+}
+
+//________________________________________________________________________
+void AliT0AnalysisTaskQA::UserExec(Option_t *) 
+{
+  // Main loop
+  // Called for each event
+
+  // Post output data.
+  fESD = dynamic_cast<AliESDEvent*>(InputEvent());
+  if (!fESD) {
+    printf("ERROR: fESD not available\n");
+    return;
+  }
+
+  fRunNumber =  fESD->GetRunNumber() ; 
+
+  const Double32_t* time = fESD->GetT0time();
+  const Double32_t* amplitude = fESD->GetT0amplitude();
+
+  for (Int_t i=0; i<24; i++) {
+    if(time[i]<9999 &&abs(time[i])>1e-8 && amplitude[i]<9999&&abs(amplitude[i])>1e-8 )
+      {
+       //      cout<<"time "<<time[i]<<" amplitude "<<amplitude[i]<<endl;
+       fTimeVSAmplitude[i]->Fill(amplitude[i],time[i]);
+       fCFDVSPmtId->Fill(i,time[i]);
+      }
+  }
+
+  const Double32_t* mean = fESD->GetT0TOF();
+  Double32_t orA = mean[1];
+  Double32_t orC = mean[2];
+  Int_t ntracks = fESD->GetNumberOfTracks(); 
+
+  if(orA<9999){
+    fTzeroORA->Fill(orA);
+    fOrAvsNtracks->Fill(ntracks, orA);
+  }
+  if(orC<9999) {
+    fTzeroORC->Fill(orC);
+    fOrCvsNtracks->Fill(ntracks, orC);
+  }
+  if(orA<9999 && orC<9999) {
+    fResolution->Fill((orA-orC)/2.);
+    fTzeroORAplusORC->Fill(mean[0]);
+    fT0vsNtracks->Fill(ntracks, mean[0]);
+  }
+  
+  Double32_t t0vertex = fESD->GetT0zVertex();
+  //  cout << "t0 vertex "<<t0vertex<<endl;
+  Double32_t esdzvertex;
+  const AliESDVertex * esdvertex = fESD->GetPrimaryVertex();
+  Int_t nofcontrib=-1;
+  if(esdvertex && t0vertex<999)
+    {
+      nofcontrib=esdvertex->GetNContributors();
+      if(nofcontrib>1)
+       {
+         esdzvertex=esdvertex->GetZv();
+         //      cout << "esd vertex "<<esdzvertex<<endl;
+         fSPDVertexVST0Vertex->Fill(t0vertex,esdzvertex);
+       }
+    }
+  // printf("%f   %f  %f\n",orA,orC,time);
+  PostData(1, fTzeroObject);
+}      
+ //________________________________________________________________________
+void AliT0AnalysisTaskQA::Terminate(Option_t *) 
+{
+  
+   // Called once at the end of the query
+}
diff --git a/PWG1/T0/AliT0AnalysisTaskQA.h b/PWG1/T0/AliT0AnalysisTaskQA.h
new file mode 100644 (file)
index 0000000..6d6330e
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef AliT0AnalysisTaskQA_cxx
+#define AliT0AnalysisTaskQA_cxx
+
+// task determines mean and sigma of T0 signals  ORA, ORC, ORA-ORC, ORA+ORC/2  
+// Authors: FK  
+
+#define NPMT0 24  //number T0 of photomultipliers
+
+class TH1F;
+class TObjArray; 
+class AliESDEvent;
+class TH2F;
+
+#ifndef ALIANALYSISTASKSE_H
+#include "AliAnalysisTaskSE.h"
+#endif
+
+class AliT0AnalysisTaskQA : public AliAnalysisTaskSE {
+ public:
+  AliT0AnalysisTaskQA();
+  AliT0AnalysisTaskQA(const char *name);
+  virtual ~AliT0AnalysisTaskQA(); 
+  
+  virtual void   UserCreateOutputObjects();
+  virtual void   UserExec(Option_t *option);
+  virtual void   Terminate(Option_t *);
+  TObjArray* GetOffsetHistos() {return fTzeroObject;}
+  
+ private:
+  AliESDEvent *fESD;          //! ESD object
+  TObjArray   *fTzeroObject;  // array with CFDi-CFD1 and  CFDi
+  TH1F        *fTzeroORA;     //! or A spectrum    
+  TH1F        *fTzeroORC;     //! or C spectrum    
+  TH1F        *fResolution;   //! or A minus or C spectrum    
+  TH1F        *fTzeroORAplusORC; //! ORA+ORC /2 
+  int         fRunNumber;
+  TH2F        **fTimeVSAmplitude; //! Time vs. Amplitude
+  TH2F        *fCFDVSPmtId;   //! CFDi vs pmt id
+  TH2F        *fSPDVertexVST0Vertex; //! SPD vertex vs T0 vertex   
+  TH2F        *fOrAvsNtracks; //! T0A vs Ntracks
+  TH2F        *fOrCvsNtracks; //! T0C vs Ntracks
+  TH2F        *fT0vsNtracks; //! T0A vs Ntracks
+  
+  AliT0AnalysisTaskQA(const AliT0AnalysisTaskQA&); // not implemented
+  AliT0AnalysisTaskQA& operator=(const AliT0AnalysisTaskQA&); // not implemented
+  
+  ClassDef(AliT0AnalysisTaskQA, 1); // example of analysis
+};
+
+#endif