Warning printout when histograms are read.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 14:20:01 +0000 (14:20 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Feb 2011 14:20:01 +0000 (14:20 +0000)
C. Loizides

ANALYSIS/AliCentralitySelectionTask.cxx

index d3ab613..20c9645 100644 (file)
@@ -504,23 +504,35 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
 //________________________________________________________________________\r
 void AliCentralitySelectionTask::ReadCentralityHistos(TString fCentfilename) \r
 {\r
-  //  Read centrality histograms\r
-  TDirectory *owd = gDirectory;\r
-  // Check if the file is present\r
-  TString path = gSystem->ExpandPathName(fCentfilename.Data());\r
-  if (gSystem->AccessPathName(path)) {\r
-     AliError(Form("File %s does not exist", path.Data()));\r
-     return;\r
-  }\r
-  fFile  = TFile::Open(fCentfilename);\r
-  owd->cd();\r
-  fHtempV0M  = (TH1F*) (fFile->Get("hmultV0_percentile"));\r
-  fHtempFMD  = (TH1F*) (fFile->Get("hmultFMD_percentile"));\r
-  fHtempTRK  = (TH1F*) (fFile->Get("hNtracks_percentile"));\r
-  fHtempTKL  = (TH1F*) (fFile->Get("hNtracklets_percentile"));\r
-  fHtempCL0  = (TH1F*) (fFile->Get("hNclusters0_percentile"));\r
-  fHtempCL1  = (TH1F*) (fFile->Get("hNclusters1_percentile"));\r
-  owd->cd();\r
+    //  Read centrality histograms\r
+    TDirectory *owd = gDirectory;\r
+    // Check if the file is present\r
+    TString path = gSystem->ExpandPathName(fCentfilename.Data());\r
+    if (gSystem->AccessPathName(path)) {\r
+       AliError(Form("File %s does not exist", path.Data()));\r
+       return;\r
+    }\r
+    fFile  = TFile::Open(fCentfilename);\r
+    owd->cd();\r
+    fHtempV0M  = (TH1F*) (fFile->Get("hmultV0_percentile"));\r
+    if (!fHtempV0M) \r
+       AliWarning(Form("Calibration for V0M does not exist in %s", path.Data()));\r
+    fHtempFMD  = (TH1F*) (fFile->Get("hmultFMD_percentile"));\r
+    if (!fHtempFMD) \r
+       AliWarning(Form("Calibration for FMD does not exist in %s", path.Data()));\r
+    fHtempTRK  = (TH1F*) (fFile->Get("hNtracks_percentile"));\r
+    if (!fHtempTRK) \r
+       AliWarning(Form("Calibration for TRK does not exist in %s", path.Data()));\r
+    fHtempTKL  = (TH1F*) (fFile->Get("hNtracklets_percentile"));\r
+    if (!fHtempTKL) \r
+       AliWarning(Form("Calibration for TKL does not exist in %s", path.Data()));\r
+    fHtempCL0  = (TH1F*) (fFile->Get("hNclusters0_percentile"));\r
+    if (!fHtempCL0) \r
+       AliWarning(Form("Calibration for CL0 does not exist in %s", path.Data()));\r
+    fHtempCL1  = (TH1F*) (fFile->Get("hNclusters1_percentile"));\r
+    if (!fHtempCL1) \r
+       AliWarning(Form("Calibration for CL1 does not exist in %s", path.Data()));\r
+    owd->cd();\r
 }  \r
 \r
 //________________________________________________________________________\r
@@ -533,11 +545,18 @@ void AliCentralitySelectionTask::ReadCentralityHistos2(TString fCentfilename2)
      AliError(Form("File %s does not exist", path.Data()));\r
      return;\r
   }   \r
+\r
   fFile2  = TFile::Open(fCentfilename2);\r
   owd->cd();\r
   fHtempV0MvsFMD =  (TH1F*) (fFile2->Get("hmultV0vsmultFMD_all_percentile"));\r
+  if (!fHtempV0MvsFMD) \r
+      AliWarning(Form("Calibration for V0MvsFMD does not exist in %s", path.Data()));\r
   fHtempTKLvsV0M  = (TH1F*) (fFile2->Get("hNtrackletsvsmultV0_all_percentile"));\r
+  if (!fHtempTKLvsV0M) \r
+      AliWarning(Form("Calibration for TKLvsV0M does not exist in %s", path.Data()));\r
   fHtempZEMvsZDC  = (TH1F*) (fFile2->Get("hEzemvsEzdc_all_percentile"));\r
+  if (!fHtempZEMvsZDC) \r
+      AliWarning(Form("Calibration for ZEMvsZDC does not exist in %s", path.Data()));\r
   owd->cd();\r
 }\r
 \r