SDD Run types updated. New macro to test the SDD preprocessor
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Feb 2008 19:16:15 +0000 (19:16 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Feb 2008 19:16:15 +0000 (19:16 +0000)
ITS/AliITSPreprocessorSDD.cxx
ITS/TestPreprocessorSDD.C [new file with mode: 0644]

index ae290ce..0177cd6 100644 (file)
@@ -68,7 +68,7 @@ UInt_t AliITSPreprocessorSDD::Process(TMap* dcsAliasMap){
   md1->SetAliRootVersion("head 30 November 2007"); //root version
   md1->SetComment("This is a test");
 
-  if (runType == "PULSER_RUN"){
+  if (runType == "PULSER"){
     TObjArray calSDD(kNumberOfSDD);
     calSDD.SetOwner(kFALSE);
     Float_t baseline,rawnoise,cmn,corn,gain;
@@ -138,7 +138,7 @@ UInt_t AliITSPreprocessorSDD::Process(TMap* dcsAliasMap){
     }
     md1->SetObjectClassName("AliITSCalibration");
     retcode = Store("Calib","CalibSDD",&calSDD,md1, 0, kTRUE);
-  }else if(runType == "PHYSICS"){
+  }else if(runType == "PHYSICS" || runType== "INJECTOR"){
 
     TObjArray vdrift(2*kNumberOfSDD);
     vdrift.SetOwner(kFALSE);
diff --git a/ITS/TestPreprocessorSDD.C b/ITS/TestPreprocessorSDD.C
new file mode 100644 (file)
index 0000000..fb40eea
--- /dev/null
@@ -0,0 +1,81 @@
+
+void TestPreprocessorSDD(Char_t *optRunType="PULSER"){
+  // macro to Test SDD preprocessor
+  // needs:
+  // - 4 tar files with simulated output of PULSER DA
+  // - 4 tar files with simulated output of INJECTOR DA
+  // - 1 root file with simulated output of DCS
+  // all these files can be found on 
+  gSystem->Load("libTestShuttle.so");
+
+  // The parameters are run, startTime, endTime
+  AliTestShuttle* shuttle = new AliTestShuttle(7, 0, 1);
+
+
+  AliTestShuttle::SetMainCDB("local:///home/prino/alice/SDD/Calibration/preprocessor/OCDB");
+  AliTestShuttle::SetMainRefStorage("local:///home/prino/alice/SDD/Calibration/preprocessor/OCDB");
+
+  printf("Test OCDB storage Uri: %s\n", AliShuttleInterface::GetMainCDB().Data());
+  printf("Test Reference storage Uri: %s\n", AliShuttleInterface::GetMainRefStorage().Data());
+
+  // DCS input file
+  TFile *fil=new TFile("DCSAliasMap_3h_SIM.root");
+  TMap* dcsAliasMap =(TMap*)fil->Get("DCSAliasMap");
+  shuttle->SetDCSInput(dcsAliasMap);
+
+  // DA input files
+  if(optRunType=="PULSER"){
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Calib","LDC1","SDDbase_LDC1.tar");
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Calib","LDC2","SDDbase_LDC2.tar");
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Calib","LDC3","SDDbase_LDC3.tar");
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Calib","LDC4","SDDbase_LDC4.tar");
+  }else if(optRunType=="PHYSICS" || optRunType=="INJECTOR"){ 
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Injec","LDC1","SDDinj_LDC1.tar");
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Injec","LDC2","SDDinj_LDC2.tar");
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Injec","LDC3","SDDinj_LDC3.tar");
+    shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SDD","SDD_Injec","LDC4","SDDinj_LDC4.tar");
+  }
+
+  shuttle->SetInputRunType(optRunType);
+
+  shuttle->AddInputRunParameter("totalEvents", "30000");
+  shuttle->AddInputRunParameter("NumberOfGDCs", "15");
+  cout<<"Input run parameters added"<<endl;
+
+
+  Bool_t hltStatus=kFALSE;
+  //  shuttle->SetInputHLTStatus(hltStatus);
+
+
+  // Call preprocessor
+  AliPreprocessor* test = new AliITSPreprocessorSDD(shuttle);
+  printf("Call SDD Preprocessor\n");
+  shuttle->Process();
+  printf("Preprocessor OK\n");
+
+  // Check the file which should have been created
+  Char_t theDir[100];
+  Bool_t doCheck=kFALSE;
+  if(optRunType=="PULSER"){
+    sprintf(theDir,"ITS/Calib/CalibSDD");
+    doCheck=kTRUE;
+  }else if(optRunType=="PHYSICS" || optRunType=="INJECTOR"){ 
+    sprintf(theDir,"ITS/Calib/DriftSpeedSDD");
+    doCheck=kTRUE;
+  }
+  if(doCheck){
+    AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get(theDir, 7);
+    if (!chkEntry){
+      printf("The file is not there. Something went wrong.\n");
+      return;
+    }
+  }
+
+  AliTestDataDCS* output = dynamic_cast<AliTestDataDCS*> (chkEntry->GetObject());
+  // If everything went fine, draw the result
+  if (output)
+    output->Inspect();
+}
+
+