]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ZDC/TestZDCPreprocessor.C
Correct use of ROOT_INCLUDE_DIR
[u/mrichter/AliRoot.git] / ZDC / TestZDCPreprocessor.C
index 933f2fab88246dd0177cfba584f8fa22b4e50902..b66059cd2c722c619c5b37a6de791dab608c13f7 100644 (file)
@@ -11,7 +11,7 @@
 void TestZDCPreprocessor(const char* runType="PHYSICS")
 {
   // load library
-  gSystem->Load("libTestShuttle.so");
+  gSystem->Load("libTestShuttle");
 
   // create AliTestShuttle instance
   // The parameters are run, startTime, endTime
@@ -19,7 +19,8 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
 
   // 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::SetMainCDB("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+  AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/OCDB");
   //AliTestShuttle::SetMainCDB("alien://folder=/alice/data/2009/OCDB/");
   AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference");
 
@@ -36,13 +37,13 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
   //     the format of the file is explained in ReadDCSAliasMap()
   //     To use it uncomment the following line:
   //
-  TMap* dcsAliasMap = ReadDCSAliasMap();
-  //dcsAliasMap->Print("");
+  //TMap* dcsAliasMap = ReadDCSAliasMap();
   //
   // (b) generated in this macro: Use CreateDCSAliasMap() and its documentation
   //     To use it uncomment the following line:
   //
-  //TMap* dcsAliasMap = CreateDCSAliasMap();
+  TMap* dcsAliasMap = CreateDCSAliasMap();
+  dcsAliasMap->Print("");
   //WriteDCSAliasMap();
 
   // now give the alias map to the shuttle
@@ -72,9 +73,13 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
   shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDENERGYCALIB", "LDC", "ZDCEnergyCalib.dat");
   shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "EMDTOWERCALIB", "LDC", "ZDCTowerCalib.dat");
   //
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "MBCALIB", "LDC", "ZDCMBCalib.root");
+  //
   shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "MAPPING", "MON", "ZDCChMapping.dat");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "TDCDATA", "MON", "ZDCTDCCalib.dat");
+  shuttle->AddInputFile(AliTestShuttle::kDAQ, "ZDC", "TDCHISTOS", "MON", "ZDCTDCHisto.root");
 
-  // TODO(3)
+  // 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
@@ -87,8 +92,9 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
   // 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", "A-A");
-  shuttle->AddInputRunParameter("beamType", "p-p");
+  shuttle->AddInputRunParameter("beamType", "A-A");
+  shuttle->AddInputRunParameter("beamEnergy", "1380");
+  //shuttle->AddInputRunParameter("beamType", "p-p");
   shuttle->AddInputRunParameter("totalEvents", "1000");
   shuttle->AddInputRunParameter("NumberOfGDCs", "1");
 
@@ -123,6 +129,7 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
   
   // Test the preprocessor
   shuttle->Process();
+  //printf(" Back to test macro: final checks! \n");
 
   // TODO(7)
   // In the preprocessor AliShuttleInterface::Store should be called to put the final
@@ -140,6 +147,8 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
                        ->Get("ZDC/Calib/LaserCalib", 0);
   else if((str.CompareTo("CALIBRATION_EMD")) == 0) chkEntry1 = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
                        ->Get("ZDC/Calib/EnergyCalib", 0);
+  else if((str.CompareTo("PHYSICS")) == 0) chkEntry1 = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("ZDC/Calib/TDCCalib", 0);
   
   
   if(!chkEntry0){
@@ -150,6 +159,7 @@ void TestZDCPreprocessor(const char* runType="PHYSICS")
     if((str.CompareTo("STANDALONE_PEDESTAL")) == 0)  printf("No file in ZDC/Calib/Pedestal\n");
     else if((str.CompareTo("STANDALONE_LASER")) == 0) printf("No file in ZDC/Calib/LaserCalib\n");
     else if((str.CompareTo("CALIBRATION_EMD")) == 0)  printf("No file in ZDC/Calib/EnergyCalib\n");
+    else if((str.CompareTo("PHYSICS")) == 0)  printf("No file in ZDC/Calib/TDCCalib\n");
     return;
   }
   
@@ -185,8 +195,7 @@ TMap* CreateDCSAliasMap()
   aliasNames[2] = "ZDC_ZNC_POS.actual.position";
   aliasNames[3] = "ZDC_ZPC_POS.actual.position";
   //
-  for(int nAlias=0; nAlias<4; nAlias++)
-  {
+  for(int nAlias=0; nAlias<4; nAlias++){
     TObjArray* valueSet = new TObjArray;
     valueSet->SetOwner(1);
 
@@ -194,8 +203,8 @@ TMap* CreateDCSAliasMap()
     //printf("\n\n alias: %s\n\n",aliasName.Data());
 
     Float_t simVal = (Float_t) (random.Rndm()*0.025+random.Rndm()*0.1);
-    int timeStamp1[3] = {0,500,1000};
-    for(int i=0;i<3;i++){
+    int timeStamp1[5] = {0,500,1000,1500,2000};
+    for(int i=0;i<5;i++){
       AliDCSValue* dcsVal = new AliDCSValue(simVal, timeStamp1[i]);
       //printf("%s\n",dcsVal->ToString());
       valueSet->Add(dcsVal);
@@ -233,22 +242,22 @@ TMap* CreateDCSAliasMap()
   aliasNames[26]  = "ZDC_REFA_HV.actual.vMon";
   aliasNames[27]  = "ZDC_REFC_HV.actual.vMon";
   //
-  for(int nAlias=4;nAlias<28;nAlias++)
-  {
-    TObjArray* valueSet = new TObjArray;
-    valueSet->SetOwner(1);
+  for(int nAlias=4;nAlias<28;nAlias++){
+//   if(nAlias<14 || nAlias>18){
+     TObjArray* valueSet = new TObjArray;
+     valueSet->SetOwner(1);
    
-    TString aliasName = aliasNames[nAlias];
-    //printf("\n\n alias: %s\n\n",aliasName.Data());
-
-    for(int timeStamp=0;timeStamp<=1000;timeStamp+=500)
-    {
-      Float_t simVal = (Float_t) (random.Gaus()*600.+1800.);
-      AliDCSValue* dcsVal = new AliDCSValue(simVal, timeStamp);
-      //printf("%s\n",dcsVal->ToString());
-      valueSet->Add(dcsVal);
-    }
-    aliasMap->Add(new TObjString(aliasName), valueSet);
+     TString aliasName = aliasNames[nAlias];
+     //printf("\n\n alias: %s\n\n",aliasName.Data());
+
+     for(int timeStamp=0;timeStamp<=2000;timeStamp+=500){
+       Float_t simVal = (Float_t) (random.Gaus()*600.+1800.);
+       AliDCSValue* dcsVal = new AliDCSValue(simVal, timeStamp);
+       //printf("%s\n",dcsVal->ToString());
+       valueSet->Add(dcsVal);
+     }
+     aliasMap->Add(new TObjString(aliasName), valueSet);
+//   }
   }
 
   return aliasMap;
@@ -265,7 +274,7 @@ TMap* ReadDCSAliasMap()
   AliCDBManager *manager = AliCDBManager::Instance();
   AliCDBStorage *sto = manager->GetStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB/");
   AliCDBId id("ZDC/DCS/Data",0,999999999);
-  AliCDBEntry *entry = sto->Get("ZDC/DCS/Data", 0, 0, 0);
+  AliCDBEntry *entry = sto->Get("ZDC/DCS/Data", 0);
   if(!entry) printf("TestZDCPreprocessor.C -> ERROR! No entry found as DCS Map! \n");
   return dynamic_cast<TMap*> (entry->GetObject());
 }