cope with the new CalibObjects.root file structure (TPC calib in TDirectories)
authormkrzewic <mkrzewic@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Jan 2013 17:26:47 +0000 (17:26 +0000)
committermkrzewic <mkrzewic@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Jan 2013 17:26:47 +0000 (17:26 +0000)
when producing the statistics summaries

PWGPP/CalibMacros/CPass0/makeOCDB.C
PWGPP/CalibMacros/CPass1/makeOCDB.C

index 9616d21..ac62db2 100644 (file)
@@ -250,13 +250,19 @@ void printCalibStat(Int_t run, const char * fname,  TTreeSRedirector * pcstream)
   //
   Int_t tpcEvents=0;
   Int_t tpcTracks=0;
-  TList * TPCCalib = (TList*)fin->Get("TPCCalib");      
-  if (TPCCalib) {
-    AliTPCcalibTime  * calibTime = (AliTPCcalibTime  *)TPCCalib->FindObject("calibTime");
-    if (calibTime){
+  TObject* obj = dynamic_cast<TObject*>(fin->Get("TPCCalib"));
+  TObjArray* array = dynamic_cast<TObjArray*>(obj);
+  TDirectory* dir = dynamic_cast<TDirectory*>(obj);
+  AliTPCcalibTime  * calibTime = NULL;
+  if (dir) {
+    calibTime = dynamic_cast<AliTPCcalibTime*>(dir->Get("calibTime"));
+  }
+  else if (array){
+    calibTime = (AliTPCcalibTime *)array->FindObject("calibTime");
+  }
+  if (calibTime) {
       tpcEvents = TMath::Nint(calibTime->GetTPCVertexHisto(0)->GetEntries());
       tpcTracks = TMath::Nint(calibTime->GetResHistoTPCITS(0)->GetEntries());
-    }
   }
   printf("Monalisa TPCevents\t%d\n",tpcEvents);
   if (pcstream) (*pcstream)<<"calibStatAll"<<"TPCevents="<<tpcEvents;
index ef79805..c9fdd39 100644 (file)
@@ -248,13 +248,19 @@ void printCalibStat(Int_t run, const char * fname,  TTreeSRedirector * pcstream)
   //
   Int_t tpcEvents=0;
   Int_t tpcTracks=0;
-  TList * TPCCalib = (TList*)fin->Get("TPCCalib");      
-  if (TPCCalib) {
-    AliTPCcalibTime  * calibTime = (AliTPCcalibTime  *)TPCCalib->FindObject("calibTime");
-    if (calibTime){
+  TObject* obj = dynamic_cast<TObject*>(fin->Get("TPCCalib"));
+  TObjArray* array = dynamic_cast<TObjArray*>(obj);
+  TDirectory* dir = dynamic_cast<TDirectory*>(obj);
+  AliTPCcalibTime  * calibTime = NULL;
+  if (dir) {
+    calibTime = dynamic_cast<AliTPCcalibTime*>(dir->Get("calibTime"));
+  }
+  else if (array){
+    calibTime = (AliTPCcalibTime *)array->FindObject("calibTime");
+  }
+  if (calibTime) {
       tpcEvents = TMath::Nint(calibTime->GetTPCVertexHisto(0)->GetEntries());
       tpcTracks = TMath::Nint(calibTime->GetResHistoTPCITS(0)->GetEntries());
-    }
   }
   printf("Monalisa TPCevents\t%d\n",tpcEvents);
   if (pcstream) (*pcstream)<<"calibStatAll"<<"TPCevents="<<tpcEvents;