]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/runSimulation.C
- update track cuts
[u/mrichter/AliRoot.git] / MUON / runSimulation.C
index db8ecd9129fcd382abdffb1e07f775f3329c7ab1..32531d86e62116f7db63271e00b33a66dda868ae 100644 (file)
 #if !defined(__CINT__) || defined(__MAKECINT__)
 #include "AliCDBManager.h"
 #include "AliSimulation.h"
+#include "AliRun.h"
+#include "AliHeader.h"
 #include <TRandom.h>
+#include <Riostream.h>
 #endif
 
 void runSimulation(int seed, 
                    int nevents, 
                    const char* config,
-                   const char* embedwith)
+                   const char* embedwith,
+                   int runnumber)
 { 
 // Uncoment following lines to run simulation with local residual mis-alignment
 // (generated via MUONGenerateGeometryData.C macro)
@@ -53,14 +57,14 @@ void runSimulation(int seed,
     AliRunLoader* runLoader = AliRunLoader::Open(embedwith,"titi");
     if (runLoader == 0x0) 
     {
-      AliError(Form("Cannot open file %s",filename));    
+      cerr << Form("Cannot open file %s",embedwith) << endl;    
       return;
     }
     
     runLoader->LoadHeader();
     
     if ( ! runLoader->GetHeader() ) {
-      AliError("Cannot load header.");    
+      cerr << "Cannot load header." << endl;   
       return;
     }
     else {
@@ -73,10 +77,30 @@ void runSimulation(int seed,
     
     cout << "***** EMBEDDING MODE : USING RAW OCDB" << endl;
     AliCDBManager::Instance()->SetDefaultStorage("raw://");
-    AliCDBManager::Instance()->SetSpecificStorage("local://$ALICE_ROOT/OCDB","MUON/Calib/Gains");
     AliCDBManager::Instance()->SetSpecificStorage("local://$ALICE_ROOT/OCDB","MUON/Align/Data");
     
   }
+  else if ( runnumber > 0 )
+  {
+    // simulation with anchor run
+
+    cout << "***** ANCHOR RUN MODE : USING RAW OCDB AS MUCH AS POSSIBLE" << endl;
+    cout << "*****                   AND TAKING VERTEX FROM OCDB IF AVAILABLE" << endl;
+  
+    // Last parameter of Config.C indicates we're doing realistic simulations, so we NEED
+    // the ITS in the geometry
+    gAlice->SetConfigFunction("Config(\"\", \"param\", \"AliMUONDigitStoreV2S\",kFALSE,kTRUE);");
+
+    AliCDBManager::Instance()->SetDefaultStorage("raw://");
+    // use something like : "alien://folder=/alice/data/2011/OCDB?cacheFold=/Users/laurent/OCDBcache" instead of "raw://"
+    // if getting slow/problematic accesses to OCDB...
+        
+    AliCDBManager::Instance()->SetSpecificStorage("MUON/Align/Data","alien://folder=/alice/cern.ch/user/j/jcastill/LHC10hMisAlignCDB");
+    
+    MuonSim.SetRunNumber(runnumber);
+    
+    MuonSim.UseVertexFromCDB();
+  }
   else
   {
     gAlice->SetConfigFunction("Config(\"\", \"param\", \"AliMUONDigitStoreV2S\",kFALSE);");    
@@ -84,11 +108,11 @@ void runSimulation(int seed,
   
   MuonSim.SetSeed(seed);
   MuonSim.SetTriggerConfig("MUON");
-  MuonSim.SetWriteRawData("MUON HLT","raw.root",kTRUE);
+  MuonSim.SetWriteRawData("MUON ","raw.root",kTRUE);
 
-  MuonSim.SetMakeDigits("MUON");
   MuonSim.SetMakeSDigits("MUON");
-  MuonSim.SetMakeDigitsFromHits("");
+  MuonSim.SetMakeDigits("MUON ITS"); // ITS needed to propagate the simulated vertex
+  MuonSim.SetMakeDigitsFromHits("ITS"); // ITS needed to propagate the simulated vertex
 
   MuonSim.SetRunHLT("libAliHLTMUON.so chains=dHLT-sim");