Setting correctly secondary flag
[u/mrichter/AliRoot.git] / GRP / TestGRPPreprocessor.C
index a42d719..84da139 100644 (file)
@@ -17,6 +17,7 @@
 // 5 --> DCS DPs error
 // 6 --> Missing beamEnergy
 // 7 --> null buffer for Trigger Config
+// 8 --> Missing LTU configuration
 
 // Need to include dummy files in TestShuttle/TestCDB for CTP Configuration and Scalers 
 // (see macro $ALICE_ROOT/GRP/MakeCTPDummyEntries.C)
@@ -30,7 +31,7 @@ using namespace std;
 
 void TestGRPPreprocessor(const char* runtype="PHYSICS", TString partition="ALICE", TString detector="", TString beamType = "p-p", Int_t errorLevel=0)
 {
-  gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle.so");
+  gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle");
 
   AliLog::SetClassDebugLevel("AliGRPPreprocessor",3);
   Int_t kRun = 7;
@@ -45,23 +46,56 @@ void TestGRPPreprocessor(const char* runtype="PHYSICS", TString partition="ALICE
   // setting runtype
   shuttle->SetInputRunType(runtype);
 
+  Int_t detectorMask = 1074200319;
+  TString detectorMask_Str(Form("%d",detectorMask));
+  shuttle->AddInputRunParameter("detectorMask", detectorMask_Str.Data());
+
+  TString* ltu = new TString[3];
+  ltu[0] = "2000";
+  ltu[1] = "6000";
+  ltu[2] = "8000";
+  for (Int_t i = 0; i<AliDAQ::kNDetectors-2; i++){
+         if ((detectorMask >> i) & 0x1) {
+                 TString detOnlineName = AliDAQ::DetectorName(i);
+                 if (detOnlineName == "VZERO"){
+                         ltu[0] = "3000";
+                         ltu[1] = "7000";
+                         ltu[2] = "9000";
+                 }
+                 if (errorLevel != 8 && !partition.IsNull() && detector.IsNull()){
+                         shuttle->SetLTUConfig(ltu,detOnlineName.Data());
+                 }
+         }
+  }
+
   // simulating DCS DPs
   TMap* dcsAliasMap = CreateDCSAliasMap(errorLevel);
   shuttle->SetDCSInput(dcsAliasMap);
 
   // simulating input from DAQ FXS
   if (errorLevel != 2){
+         
          //$ALICE_ROOT to be expanded manually by the user for this test macro 
          shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC35", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc035_Period_LHC09c.Seq_0.tag.root");
          shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC36", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc036_Period_LHC09c.Seq_0.tag.root");
          shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC44", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc044_Period_LHC09c.Seq_0.tag.root");
          shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
+         shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SPD", "VertexDiamond", "gdc-GLOBAL-01", "$ALICE_ROOT/GRP/ShuttleInput/run000104892_SPD_mon-DA-SPD-0_VertexDiamond");
+         shuttle->AddInputFile(AliShuttleInterface::kDCS, "GRP", "LHCData", "", "$ALICE_ROOT/GRP/ShuttleInput/testRun_GRP_run_number_testRun_data.txt");
+         shuttle->AddInputFile(AliShuttleInterface::kDQM, "GRP", "TriggerClassesAndHistosToClone", "DQM", "$ALICE_ROOT/GRP/ShuttleInput/run000158496_GRP_DQM_TriggerClassesAndHistosToClone");
+         shuttle->AddInputFile(AliShuttleInterface::kDQM, "ACO", "QAThresholds", "DQM", "$ALICE_ROOT/GRP/ShuttleInput/run000168322_ACO_DQM_QAThresholds");
+         shuttle->AddInputFile(AliShuttleInterface::kDQM, "TPC", "QAThresholds", "DQM", "$ALICE_ROOT/GRP/ShuttleInput/run000168322_TPC_DQM_QAThresholds");
+          
+         /*
          // for example:
-         //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC35", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc035_Period_LHC09c.Seq_0.tag.root");
-         //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC36", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc036_Period_LHC09c.Seq_0.tag.root");
-         //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC44", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc044_Period_LHC09c.Seq_0.tag.root");
-         //shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
          
+         shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC35", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc035_Period_LHC09c.Seq_0.tag.root");
+         shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC36", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc036_Period_LHC09c.Seq_0.tag.root");
+         shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC44", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc044_Period_LHC09c.Seq_0.tag.root");
+         shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
+         shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SPD", "VertexDiamond", "gdc-GLOBAL-01", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/run000104892_SPD_mon-DA-SPD-0_VertexDiamond");
+         shuttle->AddInputFile(AliShuttleInterface::kDCS, "GRP", "LHCData", "", "/home/zampolli/SOFT/AliRoot/AliRoot_Trunk/GRP/ShuttleInput/testRun_GRP_run_number_testRun_data.txt");
+         */  
   }
 
   // simulating input from DCS FXS
@@ -115,13 +149,12 @@ void TestGRPPreprocessor(const char* runtype="PHYSICS", TString partition="ALICE
        shuttle->AddInputRunParameter("DAQ_time_start", "1020");
   }
   if (errorLevel != 6){
-       shuttle->AddInputRunParameter("beamEnergy", "1400.");
+       shuttle->AddInputRunParameter("beamEnergy", "123");
   }
 
   shuttle->AddInputRunParameter("DAQ_time_end",   "1980");
-  shuttle->AddInputRunParameter("beamType",    beamType);
+  shuttle->AddInputRunParameter("beamType", beamType);
   shuttle->AddInputRunParameter("numberOfDetectors", "5");
-  shuttle->AddInputRunParameter("detectorMask", "34555");
   shuttle->AddInputRunParameter("LHCperiod",    "LHC08b");
   shuttle->AddInputRunParameter("partition",partition);
   shuttle->AddInputRunParameter("detector",detector);
@@ -161,13 +194,10 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
   // <valueList> is a TObjArray of AliDCSValue
   // An AliDCSValue consists of timestamp and a value in form of a AliSimpleValue
   
-  const Int_t fgknDCSDP = 51;
+  const Int_t fgknDCSDP = 48;
   const char* fgkDCSDataPoints[AliGRPPreprocessor::fgknDCSDP] = {
-                   "LHCState",              // missing in DCS
                    "L3Polarity",
                    "DipolePolarity",
-                   "LHCLuminosity",         // missing in DCS
-                   "BeamIntensity",         // missing in DCS
                    "L3Current",
                    "DipoleCurrent",
                   "L3_BSF17_H1",
@@ -223,15 +253,6 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
   aliasMap = new TMap;
   aliasMap->SetOwner(1);
   
-  /*
-  // LHCState
-  valueSet = new TObjArray;
-  valueSet->SetOwner(1);
-  dcsVal = new AliDCSValue( 'F', 2 );
-  valueSet->Add(dcsVal);
-  aliasMap->Add( new TObjString(fgkDCSDataPoints[0]), valueSet );
-  */
-
   // L3Polarity
   valueSet = new TObjArray;
   valueSet->SetOwner(1);
@@ -260,18 +281,6 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
   dcsVal = new AliDCSValue( kTRUE, 1990 );
   aliasMap->Add( new TObjString(fgkDCSDataPoints[2]), valueSet );
 
-  // LHCLuminosity - keeping outside look to check procedure to calculate statistics values
-  valueSet = new TObjArray;
-  valueSet->SetOwner(1);
-  dcsVal = new AliDCSValue( (Float_t)2, 1010 );
-  valueSet->Add(dcsVal);
-  dcsVal = new AliDCSValue( (Float_t)4, 1100 );
-  valueSet->Add(dcsVal);
-  dcsVal = new AliDCSValue( (Float_t)6, 1200 );
-  valueSet->Add(dcsVal);
-  dcsVal = new AliDCSValue( (Float_t)8, 1985 );
-  valueSet->Add(dcsVal);
-  aliasMap->Add( new TObjString(fgkDCSDataPoints[3]), valueSet );
 
   TRandom random;
 
@@ -283,8 +292,8 @@ TMap* CreateDCSAliasMap(Int_t errorLevel)
          maxDPindex = 3;  // simulating only a few DP in case errorLevel=5
   }
 
-  for( int nAlias=4; nAlias<maxDPindex; nAlias++)  {
-         if (nAlias>=7 && nAlias < 47) continue; 
+  for( int nAlias=2; nAlias<maxDPindex; nAlias++)  {
+         if (nAlias>=4 && nAlias < 44) continue; 
     valueSet = new TObjArray;
     valueSet->SetOwner(1);