]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- fixes to simulation macros
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 May 2010 12:49:05 +0000 (12:49 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 May 2010 12:49:05 +0000 (12:49 +0000)
HLT/CALO/macros/ConfigSingle.C
HLT/CALO/macros/run_tests.py
HLT/CALO/macros/sim.C

index 7b8bdcf0eb001cf971736baf8388d1a71d54bddb..baf06124cb840e4d5ae5b6841671fb8caac5e7ad 100644 (file)
@@ -196,17 +196,17 @@ void Config()
     Int_t   iITS   =  0;
     Int_t   iMAG   =  0;
     Int_t   iMUON  =  0;
-    Int_t   iPHOS  =  1;
+    Int_t   iPHOS  =  0;
     Int_t   iPIPE  =  0;
     Int_t   iPMD   =  0;
     Int_t   iHMPID  =  0;
     Int_t   iSHIL  =  0;
     Int_t   iT0 =  0;
     Int_t   iTOF   =  0;
-    Int_t   iTPC   =  1;
+    Int_t   iTPC   =  0;
     Int_t   iTRD   =  0;
     Int_t   iZDC   =  0;
-    Int_t   iEMCAL =  1;
+    Int_t   iEMCAL =  0;
     Int_t   iACORDE   =  0;
     Int_t   iVZERO =  0;
     rl->CdGAFile();
index 44b9086e853fb343b6fb50a58318fe2634f55f54..8bbe768c7c92c402868a1225ba3aac4bc013a62b 100755 (executable)
@@ -22,13 +22,27 @@ class Simulator():
    def cleanFiles(self):
         os.system("rm simulations/single/ -rf")
         os.system("rm simulations/pi0/ -rf")
-   
+
+   def editConfigFiles(self, dophos, doemcal, dotm):
+
+      if dophos == True:
+         command = "sed -i \'s/Int_t   iPHOS  =  0/Int_t   iPHOS  =  1/g\' simulations/single/Config.C"
+         os.system(command)
+      if doemcal == True:
+         command = "sed -i \'s/Int_t   iEMCAL =  0/Int_t   iEMCAL =  1/g\' simulations/single/Config.C"
+         os.system(command)
+
+      if dotm == True:
+         command = "sed -i \'s/Int_t   iTPC   =  0/Int_t   iTPC   =  1/g\' simulations/single/Config.C"
+         os.system(command)
+
    def initSimulation(self):
       self.cleanFiles()
       self.mkDirStructure()
       self.copyFiles()
 
    def runSimulation(self, nevents, dophos, doemcal, dotm):
+      self.editConfigFiles(dophos, doemcal, dotm)
       simargs = str(nevents) + ", " + str(int(dophos)) + ", " + str(int(doemcal)) + ", " + str(int(dotm))
       command = "cd simulations/single/ && aliroot -b -q sim.C\'(" + simargs + ")\'"
       os.system(command)
@@ -83,4 +97,4 @@ else:
    tester.run(options.runphos, options.runemcal, options.runtm)
    exit(0)
     
-   
\ No newline at end of file
+   
index dee4d88b6adc0f03a7a4cd437070d656eccfb2dc..dc05b0166af57b15822440b5e86ab3aa88403c78 100644 (file)
@@ -1,15 +1,53 @@
 void sim(Int_t nev=1, bool dophos = true, bool doemcal = true, bool dotm = true) {
   
+  if(!dophos && !doemcal && !dotm)
+    {
+      cout << "No detectors selected for simulation, exiting..." << endl;
+      return;
+    }
+
   AliSimulation simulator;
-  TString sdigits; 
-  if(dophos) sdigits += " PHOS";
-  if(doemcal) sdigits += " EMCAL";
-  simulator.SetMakeSDigits(sdigits);
-  
-  if(dotm) simulator.SetMakeDigitsFromHits("TPC");
-  //  simulator.SetWriteRawData("ALL","raw.root",kTRUE);
+  simulator.SetMakeDigitsFromHits(":");
+  simulator.SetMakeSDigits(":");
+
+  TString sdigits = ""; 
+  TString rawdata = "";
+  if(dophos) 
+    {
+      sdigits += "PHOS";
+      rawdata += "PHOS";
+    }
+  if(doemcal) 
+    {
+      if(sdigits != "")
+       {
+         sdigits += " ";
+         rawdata += " ";
+       }
+      sdigits += "EMCAL";
+      rawdata += "EMCAL";
+    }
+  if(dotm) 
+    {
+      if(rawdata != "")
+       {
+         rawdata += " ";
+       }
+
+      simulator.SetMakeDigitsFromHits("TPC");
+      rawdata += "TPC";
+    }
+
+  if(sdigits != "") 
+    {
+      cout << "SetMakeSDigits("<< sdigits << ")" << endl;
+      simulator.SetMakeSDigits(sdigits);
+    }
   
-  simulator.SetWriteRawData("ALL");
+  cout << "sdigits: " << sdigits <<endl;
+  cout << "rawdata: " << rawdata <<endl;
+  simulator.SetWriteRawData(rawdata);
+  //simulator.SetWriteRawData("ALL");
   simulator.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   simulator.SetSpecificStorage("GRP/GRP/Data",
                               Form("local://%s",gSystem->pwd()));