]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/TOFPreprocessor.C
Fix needed in case several AliESDEvent instances want to connect to the same tree.
[u/mrichter/AliRoot.git] / TOF / TOFPreprocessor.C
index 905c9b8bb6f033eac984211b7396628cd5d328b4..6836946811c6fef015949dc6babfdfbb557d5aa1 100644 (file)
@@ -10,21 +10,23 @@ $Id$
 //   ReadDCSAliasMap() reads from a file
 //   CreateInputFilesMap() creates a list of local files, that can be accessed by the shuttle
 
+extern TBenchmark *gBenchmark;
 void TOFPreprocessor()
 {
   gSystem->Load("$ALICE/SHUTTLE/TestShuttle/libTestShuttle.so");
 
   // initialize location of CDB
-  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+  AliTestShuttle::SetMainCDB("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
+  AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference");
 
   // create AliTestShuttle instance
   AliTestShuttle* shuttle = new AliTestShuttle(0, 0, 1000);
 
   // Generation of "fake" input DCS data
-  TMap* dcsAliasMap = CreateDCSAliasMap();
+  TMap* dcsAliasMap = CreateDCSAliasMap();  
 
   // now give the alias map to the shuttle
-  shuttle->SetDCSInput(dcsAliasMap);
+  shuttle->SetDCSInput(dcsAliasMap);   
 
   // processing files. for the time being, the files are local.
   shuttle->AddInputFile(AliTestShuttle::kDAQ, "TOF", "DELAYS", "MON", "$ALICE_ROOT/TOF/ShuttleInput/Total.root");
@@ -34,20 +36,25 @@ void TOFPreprocessor()
   AliPreprocessor* pp = new AliTOFPreprocessor(shuttle);
 
   // preprocessing
+  gBenchmark->Start("process");
   shuttle->Process();
+  gBenchmark->Stop("process");
+  gBenchmark->Print("process");
 
   // checking the file which should have been created  
-  AliCDBEntry* entry = AliCDBManager::Instance()->Get("TOF/Calib/OnlineDelay", 0);
-  if (!entry)
+  AliCDBEntry* chkEntry = AliCDBManager::Instance()->GetStorage(AliShuttleInterface::GetMainCDB())
+                       ->Get("TOF/Calib/OnlineDelay", 0);
+  if (!chkEntry)
   {
     printf("The file is not there. Something went wrong.\n");
     return;
   }
 
-  AliTOFDataDCS* output = dynamic_cast<AliTOFDataDCS*> (entry->GetObject());
+  AliTOFDataDCS* output = dynamic_cast<AliTOFDataDCS*> (chkEntry->GetObject());
   // If everything went fine, draw the result
   if (output)
-    output->Draw();
+    printf("Output found.\n");
+  //    output->Draw();
   
 }
 
@@ -55,11 +62,14 @@ TMap* CreateDCSAliasMap()
 {
   // Creates a DCS structure
   // The structure is the following:
-  // TMap (key --> value)
-  // <DCSAlias> --> <valueList>
-  // <DCSAlias> is a string
-  // <valueList> is a TObjArray of AliDCSValue
+  //   TMap (key --> value)
+  //     <DCSAlias> --> <valueList>
+  //     <DCSAlias> is a string
+  //     <valueList> is a TObjArray of AliDCSValue
+  //     An AliDCSValue consists of timestamp and a value in form of a AliSimpleValue
 
+  // In this example 6 aliases exists: DCSAlias1 ... DCSAlias6
+  // Each contains 1000 values randomly generated by TRandom::Gaus + 5*nAlias
 
   TMap* aliasMap = new TMap;
   aliasMap->SetOwner(1);
@@ -72,16 +82,22 @@ TMap* CreateDCSAliasMap()
   delete datime;
   Int_t iseed = TMath::Abs(10000 * pid + time - date); 
 
+  //Float_t thrHVv=7.75, thrHVc=3, thrLVv=2.75, thrLVc=2.5,
+  //thrFEEthr=1.5, thrFEEt=10, thrTemp=35, thrPress=1000;
+  //Float_t tentHVv=6.75, tentHVc=2, tentLVv=1.75, tentLVc=1.5,
+  //  tentFEEthr=0.5, te    result=0;
+  //ntFEEt=20, tentTemp=25, tentPress=900;
+  //Float_t sigmaHVv=1, sigmaHVc=0.25, sigmaLVv=0.25, sigmaLVc=0.25,
+  //  sigmaFEEthr=0.05, sigmaFEEt=5, sigmaTemp=1, sigmaPress=10;
+
   Float_t tentHVv=6500, tentHVi=80, tentLVv=2.7, tentLVi=4.5,
     tentLVv33=3.3, tentLVv50=5.0, tentLVv48=48,
     tentLVi33=100, tentLVi50=3.0, tentLVi48=10,
-    tentFEEthr=1.0, tentFEEtfeac=25, tentFEEttrm=45, 
-    tentTemp=25, tentPress=900;
+    tentFEEthr=1.0, tentFEEtfeac=25, tentFEEttrm=45;
   Float_t sigmaHVv=10, sigmaHVi=10, sigmaLVv=0.2, sigmaLVi=1.0,
     sigmaLVv33=0.1, sigmaLVv50=0.1, sigmaLVv48=1,
     sigmaLVi33=10, sigmaLVi50=0.5, sigmaLVi48=2,
-    sigmaFEEthr=0.1, sigmaFEEtfeac=10, sigmaFEEttrm=4, 
-    sigmaTemp=1, sigmaPress=10;
+    sigmaFEEthr=0.1, sigmaFEEtfeac=10, sigmaFEEttrm=4;
 
   Float_t tent=0, sigma=0, thr=0;
   Int_t NAliases=10514, NHV=90, NLV=576, NLV33=72, NLV50=72, NLV48=72, NFEEthr=1152, NFEEtfeac=576, NFEEttrm=6840, NT=1, NP=1;
@@ -246,21 +262,6 @@ TMap* CreateDCSAliasMap()
       sigma=sigmaFEEttrm;
       //thr=thrFEEthr;
     }
-    else if (nAlias<NHV*4+2*NLV+2*NLV33+2*NLV50+2*NLV48+NFEEthr+NFEEtfeac+NFEEttrm+1){
-      cout << " putting temperature" << endl;
-      aliasName = "temperature";
-      tent=tentTemp;
-      sigma=sigmaTemp;
-      //thr=thrTemp;
-    }
-    else if (nAlias<NHV*4+2*NLV+2*NLV33+2*NLV50+2*NLV48+NFEEthr+NFEEtfeac+NFEEttrm+2){
-      cout << " putting pressure" << endl;
-      aliasName = "pressure";
-      tent=tentPress;
-      sigma=sigmaPress;
-      //thr=thrPress;
-    }
-
 
     // gauss generation of values 
     for (int timeStamp=0;timeStamp<1000;timeStamp+=10){