Fix from v4-11-Release: 1. Possibility to run over a local raw-data chunk (just provi...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Mar 2008 08:54:03 +0000 (08:54 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Mar 2008 08:54:03 +0000 (08:54 +0000)
test/cosmic/rec.C

index d426b872d85c868ba29f87fa309f565b86df29aa..af1d2bc128952b479da3b482eae242b363efd831 100644 (file)
@@ -2,44 +2,53 @@ void rec(Int_t runNumber = 0, const char* year = "08", const char *localFileName
 {\r
   // Offline shifter reconstruction macro\r
 \r
-  cout << "Going to run the reconstruction for run: " << runNumber << endl;\r
+  TString filename;\r
 \r
-  // connect to the grid \r
-  TGrid * grid = 0x0 ; \r
-  grid = TGrid::Connect("alien://") ; \r
+  if (!localFileName) {\r
+\r
+    cout << "Going to run the reconstruction for run: " << runNumber << endl;\r
+\r
+    // connect to the grid \r
+    TGrid * grid = 0x0 ; \r
+    grid = TGrid::Connect("alien://") ; \r
                \r
-  // make the file name pattern year and run number\r
-  TString pattern;\r
-  pattern.Form("%9d",runNumber);\r
-  pattern.ReplaceAll(" ", "0") ; \r
-  pattern.Prepend(year);\r
-  pattern.Append("*0.root");\r
+    // make the file name pattern year and run number\r
+    TString pattern;\r
+    pattern.Form("%9d",runNumber);\r
+    pattern.ReplaceAll(" ", "0") ; \r
+    pattern.Prepend(year);\r
+    pattern.Append("*0.root");\r
 \r
-  // find the files associated to this run\r
-  // get the list of files from AliEn directly \r
-  TString baseDir; \r
-  baseDir.Form("/alice/data/20%s/",year);\r
+    // find the files associated to this run\r
+    // get the list of files from AliEn directly \r
+    TString baseDir; \r
+    baseDir.Form("/alice/data/20%s/",year);\r
 \r
-  cout << "Looking for raw-data files with pattern " << pattern << " in folder " << baseDir << endl;\r
+    cout << "Looking for raw-data files with pattern " << pattern << " in folder " << baseDir << endl;\r
 \r
-  TGridResult *result = grid->Query(baseDir, pattern);\r
+    TGridResult *result = grid->Query(baseDir, pattern);\r
 \r
-  TList *fileList = result->GetFileInfoList();\r
+    TList *fileList = result->GetFileInfoList();\r
 \r
-  cout << fileList->GetEntries() << " raw-data files found" << endl;\r
-  if ( fileList->GetEntries() == 0) {\r
-    cout << "Exiting..." << endl;\r
-    return;\r
-  }\r
+    cout << fileList->GetEntries() << " raw-data files found" << endl;\r
+    if ( fileList->GetEntries() == 0) {\r
+      cout << "Exiting..." << endl;\r
+      return;\r
+    }\r
 \r
-  // Take the first (or last?) file...\r
-  TFileInfo *fi =  (TFileInfo *)fileList->At(0); \r
-  //  TFileInfo *fi =  (TFileInfo *)fileList->At(fileList->GetEntries()-1); \r
+    // Take the first (or last?) file...\r
+    TFileInfo *fi =  (TFileInfo *)fileList->At(0); \r
+    //  TFileInfo *fi =  (TFileInfo *)fileList->At(fileList->GetEntries()-1); \r
 \r
-  cout << "Getting the file:" << fi->GetCurrentUrl()->GetUrl() << endl;\r
-  fi->Dump();\r
+    cout << "Getting the file:" << fi->GetCurrentUrl()->GetUrl() << endl;\r
+    fi->Dump();\r
 \r
-  TString filename(fi->GetCurrentUrl()->GetUrl());\r
+    filename = fi->GetCurrentUrl()->GetUrl();\r
+  }\r
+  else {\r
+    // In case of local raw-data file...\r
+    filename = localFileName;\r
+  }\r
 \r
   AliLog::Flush();\r
 \r
@@ -54,12 +63,12 @@ void rec(Int_t runNumber = 0, const char* year = "08", const char *localFileName
   //  man->SetDefaultStorage("local://LocalCDB");\r
   man->SetDefaultStorage("alien://folder=/alice/data/2008/LHC08a/OCDB/");\r
   \r
-  // Files that we can not read from alien...\r
-  man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local://$ALICE_ROOT");\r
-  man->SetSpecificStorage("ITS/Calib/MapsTimeSDD","local://$ALICE_ROOT");\r
-  man->SetSpecificStorage("TPC/Calib/ExB","local://$ALICE_ROOT");\r
+  // Files that we can not read from alien...solved\r
+  //  man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local://$ALICE_ROOT");\r
+  //  man->SetSpecificStorage("ITS/Calib/MapsTimeSDD","local://$ALICE_ROOT");\r
+  //  man->SetSpecificStorage("TPC/Calib/ExB","local://$ALICE_ROOT");\r
 \r
-  // Objects not found if using LHC07w database\r
+  // Objects not found if using LHC07w database...solved\r
   //  man->SetSpecificStorage("ITS/Calib/MapsAnodeSDD","local:///afs/cern.ch/user/c/cheshkov/public/OCDB");\r
   // man->SetSpecificStorage("GRP/GRP/Data","local://$ALICE_ROOT");\r
   // man->SetSpecificStorage("ITS/Calib/DDLMapSDD","local://$ALICE_ROOT");\r
@@ -88,6 +97,9 @@ void rec(Int_t runNumber = 0, const char* year = "08", const char *localFileName
   AliTPCReconstructor::SetRecoParam(tpcRecoParam);\r
   AliTPCReconstructor::SetStreamLevel(1);\r
 \r
+  // TRD setting\r
+  AliTRDrawStreamBase::SetRawStreamVersion("TB");\r
+\r
   // PHOS settings\r
   AliPHOSRecoParam* recEmc = new AliPHOSRecoParamEmc();\r
   recEmc->SetSubtractPedestals(kTRUE);\r