Add output of VZERO reco directly to multCorr
[u/mrichter/AliRoot.git] / HLT / global / physics / AliHLTMultiplicityCorrelations.cxx
index 44bf349514bb188e08830b5d8a8ced7f783d0100..4be147ae4fc528c5ddfd787635a7104ddc173e5d 100644 (file)
@@ -57,6 +57,7 @@ AliHLTMultiplicityCorrelations::AliHLTMultiplicityCorrelations() :
   fTpcTracks(0), fTpcTracksA(0),
   fVzeroMult(0.), fVzeroMultA(0.), fVzeroMultC(0.),
   fVzeroMultFlagged(0.), fVzeroMultFlaggedA(0.), fVzeroMultFlaggedC(0.),
+  fSpdNClusters(0),
   fVzeroBinning(350), fVzeroBinningMin(0.), fVzeroBinningMax(35000.),
   fTpcBinning(200),fTpcBinningMin(0.),fTpcBinningMax(8000.),
   fZdcBinning(280),fZdcBinningMin(0.),fZdcBinningMax(140.),
@@ -64,7 +65,8 @@ AliHLTMultiplicityCorrelations::AliHLTMultiplicityCorrelations() :
   fZnpBinning(200),fZnpBinningMin(0.),fZnpBinningMax(100.),
   fProcessPhos(true), fProcessEmcal(true),
   fPhosTotalEt(0.0), fEmcalTotalEt(0.0),
-  fCaloBinning(100),fCaloBinningMin(0.),fCaloBinningMax(100.){
+  fCaloBinning(100),fCaloBinningMin(0.),fCaloBinningMax(100.),
+  fSpdBinning(200),fSpdBinningMin(0.),fSpdBinningMax(15000.) {
   // see header file for class documentation
   // or
   // refer to README to build package
@@ -98,7 +100,7 @@ Int_t AliHLTMultiplicityCorrelations::Initialize() {
 
   fHistList = new TList();
   fHistList->SetOwner(kTRUE);
-
+  fHistList->SetName("MultiplicityCorrelations");
   iResult = SetupHistograms();
 
   return iResult;
@@ -111,7 +113,8 @@ Int_t AliHLTMultiplicityCorrelations::Initialize() {
  */
 
 //##################################################################################
-Int_t AliHLTMultiplicityCorrelations::ProcessEvent( AliESDEvent *esd ) {
+Int_t AliHLTMultiplicityCorrelations::ProcessEvent( AliESDEvent *esd, AliESDVZERO* esdVZERO, 
+                                                   Int_t nSpdClusters) {
   // see header file for class documentation  
 
   Int_t iResult = 0;
@@ -120,10 +123,16 @@ Int_t AliHLTMultiplicityCorrelations::ProcessEvent( AliESDEvent *esd ) {
     HLTWarning("No ESD event.");
     return -1;
   }
+  
+  if ( esdVZERO )
+    fESDVZERO = esdVZERO;
 
   // -- TPC .. To be done before the others
   if (fESDEvent->GetNumberOfTracks() > 0)
     iResult = ProcessTPC();
+
+  fSpdNClusters = nSpdClusters;
+  iResult = ProcessSPD();
   
   // -- CALO, process with or without clusters, we want the zero-bin
   iResult = ProcessCALO();
@@ -136,6 +145,8 @@ Int_t AliHLTMultiplicityCorrelations::ProcessEvent( AliESDEvent *esd ) {
   if (fESDZDC)
     iResult = ProcessZDC();
 
+  
+
 
   return iResult;
 }
@@ -195,6 +206,7 @@ Int_t AliHLTMultiplicityCorrelations::SetupHistograms() {
   iResult = SetupZDC();
   iResult = SetupTPC();
   iResult = SetupCALO();
+  iResult = SetupSPD();
   iResult = SetupCorrelations();
 
   return iResult;
@@ -212,6 +224,9 @@ Int_t AliHLTMultiplicityCorrelations::SetupVZERO() {
   fHistList->Add(new TH1F("fVzeroMultC", "Multiplicity^{VZERO} C;Multiplicity^{VZERO};N_{Events}", 
                          fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
 
+  fHistList->Add(new TH2F("fVzeroMultAC", "Multiplicity^{VZERO} A vs C;Multiplicity^{VZERO}A ;Multiplicity^{VZERO} C", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
+
   // Flagged VzeroMult
   fHistList->Add(new TH1F("fVzeroFlaggedMult",  "Multiplicity_{flagged}^{VZERO};Multiplicity^{VZERO};N_{Events}",   
                          fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
@@ -220,6 +235,9 @@ Int_t AliHLTMultiplicityCorrelations::SetupVZERO() {
   fHistList->Add(new TH1F("fVzeroFlaggedMultC", "Multiplicity_{flagged}^{VZERO} C;Multiplicity^{VZERO};N_{Events}", 
                          fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
   
+  fHistList->Add(new TH2F("fVzeroFlaggedMultAC", "Multiplicity_flagged^{VZERO} A vs C;Multiplicity^{VZERO}A ;Multiplicity^{VZERO} C", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
+
   fHistList->Add(new TH1F("fVzeroTime",  "Time;Time;N_{Events}",   500, 0, 1000));
   fHistList->Add(new TH1F("fVzeroTimeA", "Time A;Time;N_{Events}", 500, 0, 1000));
   fHistList->Add(new TH1F("fVzeroTimeC", "Time B;Time;N_{Events}", 500, 0, 1000));
@@ -547,44 +565,115 @@ Int_t AliHLTMultiplicityCorrelations::SetupCorrelations() {
   //   ZDC vs CALO
   // ----------------------------------------------------
   fHistList->Add(new TH2F("fCorrZdcTotEvsPhosTotEt", 
-                         "Total E_{ZDC} vs Total E_{T} in PHOS C;Total E_{ZDC} (TeV);E_{T} (GeV)", 
+                         "Total E_{ZDC} vs Total E_{T} in PHOS;Total E_{ZDC} (TeV);E_{T} (GeV)", 
                          fZdcBinning,fZdcBinningMin,fZdcBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
   fHistList->Add(new TH2F("fCorrZdcTotEvsEmcalTotEt", 
-                         "Total E_{ZDC} vs Total E_{T} in EMCAL C;Total E_{ZDC} (TeV);E_{T} (GeV)", 
+                         "Total E_{ZDC} vs Total E_{T} in EMCAL;Total E_{ZDC} (TeV);E_{T} (GeV)", 
                          fZdcBinning,fZdcBinningMin,fZdcBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
   fHistList->Add(new TH2F("fCorrZdcTotEvsTotEt", 
-                         "Total E_{ZDC} vs Total E_{T} in calorimeters C;Total E_{ZDC} (TeV);E_{T} (GeV)", 
+                         "Total E_{ZDC} vs Total E_{T} in calorimeters;Total E_{ZDC} (TeV);E_{T} (GeV)", 
                          fZdcBinning,fZdcBinningMin,fZdcBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
-                         
+  
   // ----------------------------------------------------
-  //  
+  //   VZERO vs CALO
   // ----------------------------------------------------
+  fHistList->Add(new TH2F("fCorrVzerovsPhosTotEt", 
+                         "Multiplicity^{VZERO} vs Total E_{T} in PHOS;Multiplicity^{VZERO};E_{T} (GeV)", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
+  fHistList->Add(new TH2F("fCorrVzerovsEmcalTotEt", 
+                         "Multiplicity^{VZERO} vs Total E_{T} in EMCAL;Multiplicity^{VZERO};E_{T} (GeV)", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
+  fHistList->Add(new TH2F("fCorrVzerovsTotEt", 
+                         "Multiplicity^{VZERO} vs Total E_{T} in Calorimeters;Multiplicity^{VZERO};E_{T} (GeV)", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
+  
+  fHistList->Add(new TH2F("fCorrVzeroFlaggedvsPhosTotEt", 
+                         "Multiplicity_{flagged}^{VZERO} vs Total E_{T} in PHOS;Multiplicity_{flagged}^{VZERO};E_{T} (GeV)", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
+  fHistList->Add(new TH2F("fCorrVzeroFlaggedvsEmcalTotEt", 
+                         "Multiplicity_{flagged}^{VZERO} vs Total E_{T} in EMCAL;Multiplicity_{flagged}^{VZERO};E_{T} (GeV)", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
+  fHistList->Add(new TH2F("fCorrVzeroFlaggedvsTotEt", 
+                         "Multiplicity_{flagged}^{VZERO} vs Total E_{T} in Calorimeters;Multiplicity_{flagged}^{VZERO};E_{T} (GeV)", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
+  
+  // ----------------------------------------------------
+  //   SPD vs TPC
+  // ----------------------------------------------------
+
+  fHistList->Add(new TH2F("fCorrSpdTpcNch", "N_{clusters}^{SPD} vs N_{ch}^{TPC};N_{clusters}^{SPD};N_{ch}^{TPC}",   
+                         fSpdBinning,fSpdBinningMin,fSpdBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));  
+
+  // ----------------------------------------------------
+  //   SPD vs VZERO
+  // ----------------------------------------------------
+
+  fHistList->Add(new TH2F("fCorrVzeroSpd", 
+                         "Multiplicity^{VZERO} vs N_{ch}^{SPD};Multiplicity^{VZERO};N^{SPD}", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  fHistList->Add(new TH2F("fCorrVzeroASpd", 
+                         "Multiplicity^{VZERO} vs N_{ch}^{SPD} A;Multiplicity^{VZERO};N^{SPD}", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  fHistList->Add(new TH2F("fCorrVzeroCSpd", 
+                         "Multiplicity^{VZERO} vs N_{ch}^{SPD} C;Multiplicity^{VZERO};N^{SPD}", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+
+  fHistList->Add(new TH2F("fCorrVzeroFSpd", 
+                         "Multiplicity^{VZERO} vs N_{ch}^{SPD};Multiplicity_{flagged}^{VZERO};N^{SPD}", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  fHistList->Add(new TH2F("fCorrVzeroFASpd", 
+                         "Multiplicity^{VZERO} vs N_{ch}^{SPD} A;Multiplicity_{flagged}^{VZERO};N^{SPD}", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  fHistList->Add(new TH2F("fCorrVzeroFCSpd", 
+                         "Multiplicity^{VZERO} vs N_{ch}^{SPD} C;Multiplicity_{flagged}^{VZERO};N^{SPD}", 
+                         fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+
+  // ----------------------------------------------------
+  //   SPD vs ZDC
+  // ----------------------------------------------------
+
+  // E_{ZDC} vs Multiplicty SPD
+  fHistList->Add(new TH2F("fCorrEzdcSpd", "E_{ZDC} vs N_{ch}^{SPD};E_{ZDC} (TeV);N^{SPD}",   
+                         fZdcBinning,fZdcBinningMin,fZdcBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  fHistList->Add(new TH2F("fCorrEzdcASpd","E_{ZDC} vs N_{ch}^{SPD} A;E_{ZDC} (TeV);N^{SPD}", 
+                         fZdcBinning,fZdcBinningMin,fZdcBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  fHistList->Add(new TH2F("fCorrEzdcCSpd","E_{ZDC} vs N_{ch}^{SPD} C;E_{ZDC} (TeV);N^{SPD}", 
+                         fZdcBinning,fZdcBinningMin,fZdcBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+  
 
   return 0;
 }
 
 //##################################################################################
-Int_t AliHLTMultiplicityCorrelations::SetupCALO()
-{
-  // Calo histos
-  if(fProcessPhos)
-  {
+Int_t AliHLTMultiplicityCorrelations::SetupCALO() {
+  // see header file for class documentation  
+
+  if(fProcessPhos) {
     fHistList->Add(new TH1F("fPhosEt",  "Total E_{T} in PHOS:E (GeV)",   
                            fCaloBinning,fCaloBinningMin,fCaloBinningMax));
   }
-  if(fProcessEmcal)
-  {
+  if(fProcessEmcal) {
     fHistList->Add(new TH1F("fEmcalEt",  "Total E_{T} in EMCAL:E (GeV)",   
                            fCaloBinning,fCaloBinningMin,fCaloBinningMax));
   }
-  if(fProcessPhos || fProcessEmcal)
-  {
+  if(fProcessPhos || fProcessEmcal) {
     fHistList->Add(new TH1F("fTotalEt",  "Total E_{T} in calorimeters:E (GeV)",   
                            fCaloBinning,fCaloBinningMin,fCaloBinningMax));
   }
   return 0;
 }
 
+//##################################################################################
+Int_t AliHLTMultiplicityCorrelations::SetupSPD() {
+  // see header file for class documentation  
+  
+  fHistList->Add(new TH1F("fSpdNClusters", "Multplicity_{SPD};Multplicity_{SPD};N_{Events}",   
+                         fSpdBinning,fSpdBinningMin,fSpdBinningMax));
+
+  return 0;
+}
+
+
 /*
  * ---------------------------------------------------------------------------------
  *                               Process - private
@@ -593,6 +682,7 @@ Int_t AliHLTMultiplicityCorrelations::SetupCALO()
 
 //##################################################################################
 Int_t AliHLTMultiplicityCorrelations::ProcessTPC() {
+  // see header file for class documentation  
 
   Int_t iResult = 0 ;
 
@@ -654,6 +744,7 @@ Int_t AliHLTMultiplicityCorrelations::ProcessTPC() {
 
 //##################################################################################
 Int_t AliHLTMultiplicityCorrelations::ProcessVZERO() {
+  // see header file for class documentation  
 
   Int_t iResult = 0 ;
 
@@ -664,7 +755,8 @@ Int_t AliHLTMultiplicityCorrelations::ProcessVZERO() {
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroMult")))->Fill(fVzeroMult);
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroMultA")))->Fill(fVzeroMultA);
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroMultC")))->Fill(fVzeroMultC);
-  
+  (static_cast<TH1F*>(fHistList->FindObject("fVzeroMultAC")))->Fill(fVzeroMultA,fVzeroMultC);
+
   fVzeroMultFlaggedA = 0.;
   fVzeroMultFlaggedC = 0.;
   
@@ -696,7 +788,8 @@ Int_t AliHLTMultiplicityCorrelations::ProcessVZERO() {
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMult")))->Fill(fVzeroMultFlagged);
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMultA")))->Fill(fVzeroMultFlaggedA);
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMultC")))->Fill(fVzeroMultFlaggedC);
-  
+  (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMultAC")))->Fill(fVzeroMultFlaggedA,fVzeroMultFlaggedC);
+
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroTime")))->Fill(vzeroTime);
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroTimeA")))->Fill(vzeroTimeA);
   (static_cast<TH1F*>(fHistList->FindObject("fVzeroTimeC")))->Fill(vzeroTimeC);
@@ -716,11 +809,38 @@ Int_t AliHLTMultiplicityCorrelations::ProcessVZERO() {
     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFCNch")))->Fill(fVzeroMultFlaggedC, fTpcTracksA);
   }
 
+  // -- VZERO - SPD correlations
+  if (fESDEvent->GetNumberOfTracks() > 0) {
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroSpd")))->Fill(fVzeroMult, fSpdNClusters);
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroASpd")))->Fill(fVzeroMultA, fSpdNClusters);
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroCSpd")))->Fill(fVzeroMultC, fSpdNClusters);
+    
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFSpd")))->Fill(fVzeroMultFlagged, fSpdNClusters);
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFASpd")))->Fill(fVzeroMultFlaggedA, fSpdNClusters);
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFCSpd")))->Fill(fVzeroMultFlaggedC, fSpdNClusters);
+  }
+  
+  // -- VZERO - CALO correlations
+  if (fProcessPhos || fProcessEmcal) {
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzerovsTotEt")))->Fill(fVzeroMult, fPhosTotalEt + fEmcalTotalEt);
+    (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFlaggedvsTotEt")))->Fill(fVzeroMultFlagged, fPhosTotalEt + fEmcalTotalEt);
+    if(fProcessPhos)
+    {
+      (static_cast<TH2F*>(fHistList->FindObject("fCorrVzerovsPhosTotEt")))->Fill(fVzeroMult, fPhosTotalEt);
+      (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFlaggedvsPhosTotEt")))->Fill(fVzeroMultFlagged, fPhosTotalEt);
+    }
+    if(fProcessEmcal)
+    {
+      (static_cast<TH2F*>(fHistList->FindObject("fCorrVzerovsEmcalTotEt")))->Fill(fVzeroMult, fEmcalTotalEt);
+      (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFlaggedvsEmcalTotEt")))->Fill(fVzeroMultFlagged, fEmcalTotalEt);
+    }
+  }
   return iResult;
 }
 
 //##################################################################################
 Int_t AliHLTMultiplicityCorrelations::ProcessZDC() {
+  // see header file for class documentation  
 
   Int_t iResult = 0 ;
 
@@ -794,8 +914,14 @@ Int_t AliHLTMultiplicityCorrelations::ProcessZDC() {
     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbANch")))->Fill(fESDZDC->GetImpactParamSideA(), fTpcTracksA);
     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbCNch")))->Fill(fESDZDC->GetImpactParamSideC(), fTpcTracksA);
   }
+  
+  // -- ZDC - SPD correlations
+  (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcSpd")))->Fill(zdcE, fSpdNClusters);
+  (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcASpd")))->Fill(zdcEA, fSpdNClusters);
+  (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcCSpd")))->Fill(zdcEC, fSpdNClusters);
+    
 
-  // -- VZERO - TPC correlations
+  // -- VZERO - ZDC correlations
   if (fESDVZERO) {
     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzero")))->Fill(zdcE, fVzeroMult);
     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzeroA")))->Fill(zdcEA, fVzeroMultA);
@@ -865,9 +991,8 @@ Int_t AliHLTMultiplicityCorrelations::ProcessZDC() {
 }
 
 //##################################################################################
-Int_t AliHLTMultiplicityCorrelations::ProcessCALO()
-{
-  // CALO 
+Int_t AliHLTMultiplicityCorrelations::ProcessCALO() {
+  // see header file for class documentation  
   
   TH1F* hPhosEt = static_cast<TH1F*>(fHistList->FindObject("fPhosEt")); // PHOS Tot E_T
   TH1F* hEmcalEt = static_cast<TH1F*>(fHistList->FindObject("fEmcalEt")); // EMCAL Tot E_T
@@ -896,3 +1021,13 @@ Int_t AliHLTMultiplicityCorrelations::ProcessCALO()
   
   return 0;
 }
+
+//##################################################################################
+Int_t AliHLTMultiplicityCorrelations::ProcessSPD() {
+  // see header file for class documentation
+  
+  (static_cast<TH2F*>(fHistList->FindObject("fSpdNClusters")))->Fill(fSpdNClusters);
+  (static_cast<TH2F*>(fHistList->FindObject("fCorrSpdTpcNch")))->Fill(fSpdNClusters,fTpcTracksA);
+
+  return 0;
+}