]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/TestZDCPreprocessor.C
store pt in the tracklet instead of momentum
[u/mrichter/AliRoot.git] / ZDC / TestZDCPreprocessor.C
index 71db0f02247df92cb6a7d378a3c633b5e320e7bf..280de423d52350826192d2473fed31f6f050bd73 100644 (file)
@@ -8,24 +8,23 @@
 //   ReadDCSAliasMap() reads from a file
 //   CreateInputFilesMap() creates a list of local files, that can be accessed by the shuttle
 
-void TestZDCPreprocessor()
+void TestZDCPreprocessor(Int_t obj=0)
 {
   // load library
   gSystem->Load("libTestShuttle.so");
 
   // create AliTestShuttle instance
   // The parameters are run, startTime, endTime
-  AliTestShuttle* shuttle = new AliTestShuttle(7, 0, 1);
+  AliTestShuttle* shuttle = new AliTestShuttle(0, 0, 1);
 
   // TODO if needed, change location of OCDB and Reference test folders
   // by default they are set to $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB and TestReference
-  AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
-  AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference");
+  AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB");
+  AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestReference");
 
   printf("Test OCDB storage Uri: %s\n", AliShuttleInterface::GetMainCDB().Data());
   printf("Test Reference storage Uri: %s\n", AliShuttleInterface::GetMainRefStorage().Data());
 
-
   // TODO(1)
   //
   // The shuttle can read DCS data, if the preprocessor should be tested to process DCS data,
@@ -61,20 +60,28 @@ void TestZDCPreprocessor()
   // Three files originating from different LDCs but with the same id are also added
   // Note that the test preprocessor name is TPC. The name of the detector's preprocessor must follow
   // the "online" naming convention ALICE-INT-2003-039.
-  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "ALL", "LDC0", "ZDCChMapping.dat");
   //
   shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "PEDESTALS", "LDC0", "ZDCPedestal.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "LASER",     "LDC0", "ZDCLaserCalib.dat");
-  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDCALIB",  "LDC0", "ZDCEMDCalib.dat");
+  //
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "LASER", "LDC0", "ZDCLaserCalib.dat");
+  //
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDCALIB", "LDC0", "ZDCEMDCalib.dat");
+  //
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "PHYSICS", "LDC0", "ZDCChMapping.dat");
+  //
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "BC", "LDC0", "ZDCChMapping.dat");
 
   // TODO(3)
   //
   // The shuttle can read run type stored in the DAQ logbook.
   // To test it, we must provide the run type manually. They will be retrieved in the preprocessor
   // using GetRunType function.
-  //shuttle->SetInputRunType("STANDALONE_PEDESTAL");
-  shuttle->SetInputRunType("STANDALONE_LASER");
-  //shuttle->SetInputRunType("STANDALONE_EMD");
+  if(obj==1)      shuttle->SetInputRunType("STANDALONE_PEDESTAL");
+  else if(obj==2) shuttle->SetInputRunType("STANDALONE_LASER");
+  else if(obj==3) shuttle->SetInputRunType("STANDALONE_EMD");
+  else if(obj==4) shuttle->SetInputRunType("STANDALONE_COSMIC");
+  else if(obj==5) shuttle->SetInputRunType("STANDALONE_BC");
+  else if(obj==6) shuttle->SetInputRunType("PHYSICS");
 
   // TODO(4)
   //
@@ -82,8 +89,8 @@ void TestZDCPreprocessor()
   // To test it, we must provide the run parameters manually. They will be retrieved in the preprocessor
   // using GetRunParameter function.
   // In real life the parameters will be retrieved automatically from the run logbook;
-  shuttle->AddInputRunParameter("beamType", "Pb-Pb");
-  //shuttle->AddInputRunParameter("beamType", "p-p");
+  //shuttle->AddInputRunParameter("beamType", "Pb-Pb");
+  shuttle->AddInputRunParameter("beamType", "p-p");
   shuttle->AddInputRunParameter("totalEvents", "1000");
   shuttle->AddInputRunParameter("NumberOfGDCs", "1");
 
@@ -125,27 +132,32 @@ void TestZDCPreprocessor()
   //
   // Check the file which should have been created
   AliCDBEntry* chkEntry0 = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
-                       ->Get("ZDC/Calib/ChMap", 7);
-  /*AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
-                       ->Get("ZDC/Calib/Pedestals", 7);
-  */
-  /*AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
-                       ->Get("ZDC/Calib/EMDCalib", 7);
-  */
-  AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
-                       ->Get("ZDC/Calib/LaserCalib", 7);
+                       ->Get("ZDC/Calib/ChMap", 0);
+  AliCDBEntry* chkEntry1;
+  if(obj==1) chkEntry1 = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("ZDC/Calib/Pedestals", 0);
+  else if(obj==2) chkEntry1 = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("ZDC/Calib/LaserCalib", 0);
+  else if(obj==3) chkEntry1 = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("ZDC/Calib/EMDCalib", 0);
   
   
-  if (!chkEntry)
-  {
-    printf("The file is not there. Something went wrong.\n");
+  if(!chkEntry0){
+    printf("No file in \n ZDC/Calib/ChMap\n");
     return;
   }
+  if(!chkEntry1){
+    if(obj==1) printf("No file in \n ZDC/Calib/Pedestal\n");
+    else if(obj==2) printf("No file in \n ZDC/Calib/LaserCalib\n");
+    else if(obj==3) printf("No file in \n ZDC/Calib/EMDCalib\n");
+    return;
+  }
+  
 
-  AliTestDataDCS* output = dynamic_cast<AliTestDataDCS*> (chkEntry->GetObject());
+  /*AliTestDataDCS* output = dynamic_cast<AliTestDataDCS*> (chkEntry1->GetObject());
   // If everything went fine, draw the result
   if (output)
-    output->Draw();
+    output->Draw();*/
 }
 
 TMap* CreateDCSAliasMap()
@@ -269,7 +281,7 @@ void WriteDCSAliasMap()
   AliCDBId id("ZDC/DCS/Data", 0, 0);
 
   // initialize location of CDB
-  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestCDB");
 
   AliCDBManager::Instance()->Put(dcsAliasMap, id, &metaData);
 }