]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/muondep/AccEffTemplates/simrun.C
end-of-line normalization
[u/mrichter/AliRoot.git] / PWG / muondep / AccEffTemplates / simrun.C
index c04a82569030a3699a599e4f7247b365b36560a9..430209c5ff70b3af1b92e4f574079ca18081b107 100644 (file)
-// #define VERBOSEARGS\r
-// simrun.C\r
-{\r
-// set job and simulation variables as :\r
-// root.exe -b -q simrun.C  --run <x> --chunk <y> --event <n> \r
-\r
-  int nrun = 0;\r
-  int nchunk = 0;\r
-  int nevent = 0;\r
-  int seed = 0;\r
-  Bool_t snapshot(kFALSE);\r
-  \r
-  char sseed[1024];\r
-  char srun[1024];\r
-  char schunk[1024];\r
-\r
-  sprintf(srun,"");\r
-  sprintf(schunk,"");\r
-\r
-  for (int i=0; i< gApplication->Argc();i++){\r
-#ifdef VERBOSEARGS\r
-    printf("Arg  %d:  %s\n",i,gApplication->Argv(i));\r
-#endif\r
-    if (!(strcmp(gApplication->Argv(i),"--run")))\r
-      nrun = atoi(gApplication->Argv(i+1));\r
-    sprintf(srun,"%d",nrun);\r
-\r
-    if (!(strcmp(gApplication->Argv(i),"--chunk")))\r
-      nchunk = atoi(gApplication->Argv(i+1));\r
-    sprintf(schunk,"%d",nchunk);\r
-\r
-    if (!(strcmp(gApplication->Argv(i),"--event")))\r
-      nevent = atoi(gApplication->Argv(i+1));\r
-\r
-    if (!(strcmp(gApplication->Argv(i),"--snapshot")))\r
-      snapshot = kTRUE;\r
-  }\r
-\r
-  seed = nrun * 10000 + nchunk;\r
-  sprintf(sseed,"%d",seed);\r
-\r
-  if (seed==0) {\r
-    fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
-    fprintf(stderr,"!!!!  WARNING! Seeding variable for MC is 0          !!!!\n");\r
-    fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
-  } else {\r
-    fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
-    fprintf(stdout,"!!!  MC Seed is %d \n",seed);\r
-    fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
-  }\r
-  \r
-// set the seed environment variable\r
-  gSystem->Setenv("CONFIG_SEED",sseed);\r
-  gSystem->Setenv("DC_RUN",srun); // used in AliSimulation.cxx\r
-  gSystem->Setenv("DC_EVENT",schunk); // Not used in Config.C (used for setting seed)\r
-  \r
-// Needed to produce simulated RAW data\r
-  gSystem->Setenv("ALIMDC_RAWDB1","./mdc1");\r
-  gSystem->Setenv("ALIMDC_RAWDB2","./mdc2");\r
-  gSystem->Setenv("ALIMDC_TAGDB","./mdc1/tag");\r
-  gSystem->Setenv("ALIMDC_RUNDB","./mdc1/meta");\r
-  cout<< "SIMRUN:: Run " << gSystem->Getenv("DC_RUN")\r
-          << " Chunk " << gSystem->Getenv("DC_EVENT")\r
-         << endl;\r
-\r
-  cout<<">>>>> SIMULATION <<<<<"<<endl;\r
-  if ( snapshot )\r
-  {\r
-    gSystem->Setenv("OCDB_SNAPSHOT_CREATE","kTRUE");\r
-    gSystem->Setenv("OCDB_SNAPSHOT_FILENAME","OCDB_sim.root");\r
-  }\r
-  \r
-  gSystem->Exec(Form("aliroot -b -q sim.C\\(%d\\) > sim.log 2>&1",nevent));\r
-  gSystem->Exec("mv syswatch.log simwatch.log");\r
-\r
-  if ( snapshot )\r
-  {\r
-    gSystem->Setenv("OCDB_SNAPSHOT_FILENAME","OCDB_rec.root");\r
-  }\r
-  \r
-  cout<<">>>>> RECONSTRUCTION <<<<<"<<endl;\r
-  \r
-  if ( snapshot )\r
-  {\r
-    // for some reason must include ITS objects in the snapshot\r
-    // (to be able to instantiante the vertexer later on ?)\r
-    gSystem->Exec("aliroot -b -q rec.C\\(1\\) > rec.log 2>&1");\r
-  }\r
-  else\r
-  {\r
-    gSystem->Exec("aliroot -b -q rec.C > rec.log 2>&1");\r
-  }\r
-  \r
-  gSystem->Exec("mv syswatch.log recwatch.log");\r
-\r
-  if ( snapshot )\r
-  {\r
-    gSystem->Exec(Form("mkdir -p OCDB/%s",srun));\r
-    gSystem->Exec(Form("mv OCDB_*.root OCDB/%s/",srun));\r
-  }\r
-  else\r
-  {\r
-    //  cout<<">>>>> TAG <<<<<"<<endl;\r
-    //  gSystem->Exec("aliroot -b -q tag.C > tag.log 2>&1");\r
-  \r
-    cout<<">>>>> CHECK ESD <<<<<"<<endl;\r
-    gSystem->Exec("aliroot -b -q CheckESD.C > checkesd.log 2>&1");\r
-    cout<<">>>>> MAKE AOD <<<<<"<<endl;\r
-    gSystem->Exec("aliroot -b -q AODtrain.C > aod.log 2>&1");\r
-    cout<<">>>>> CHECK AOD <<<<<"<<endl;\r
-    gSystem->Exec("aliroot -b -q CheckAOD.C > checkaod.log 2>&1");\r
-  }\r
-  \r
-  return 0;\r
-}\r
+// #define VERBOSEARGS
+// simrun.C
+{
+// set job and simulation variables as :
+// root.exe -b -q simrun.C  --run <x> --chunk <y> --event <n> 
+
+  int nrun = 0;
+  int nchunk = 0;
+  int nevent = 0;
+  int seed = 0;
+  Bool_t snapshot(kFALSE);
+  
+  char sseed[1024];
+  char srun[1024];
+  char schunk[1024];
+
+  sprintf(srun,"");
+  sprintf(schunk,"");
+
+  for (int i=0; i< gApplication->Argc();i++){
+#ifdef VERBOSEARGS
+    printf("Arg  %d:  %s\n",i,gApplication->Argv(i));
+#endif
+    if (!(strcmp(gApplication->Argv(i),"--run")))
+      nrun = atoi(gApplication->Argv(i+1));
+    sprintf(srun,"%d",nrun);
+
+    if (!(strcmp(gApplication->Argv(i),"--chunk")))
+      nchunk = atoi(gApplication->Argv(i+1));
+    sprintf(schunk,"%d",nchunk);
+
+    if (!(strcmp(gApplication->Argv(i),"--event")))
+      nevent = atoi(gApplication->Argv(i+1));
+
+    if (!(strcmp(gApplication->Argv(i),"--snapshot")))
+      snapshot = kTRUE;
+  }
+
+  seed = nrun * 10000 + nchunk;
+  sprintf(sseed,"%d",seed);
+
+  if (seed==0) {
+    fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+    fprintf(stderr,"!!!!  WARNING! Seeding variable for MC is 0          !!!!\n");
+    fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+  } else {
+    fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+    fprintf(stdout,"!!!  MC Seed is %d \n",seed);
+    fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+  }
+  
+// set the seed environment variable
+  gSystem->Setenv("CONFIG_SEED",sseed);
+  gSystem->Setenv("DC_RUN",srun); // used in AliSimulation.cxx
+  gSystem->Setenv("DC_EVENT",schunk); // Not used in Config.C (used for setting seed)
+  
+// Needed to produce simulated RAW data
+  gSystem->Setenv("ALIMDC_RAWDB1","./mdc1");
+  gSystem->Setenv("ALIMDC_RAWDB2","./mdc2");
+  gSystem->Setenv("ALIMDC_TAGDB","./mdc1/tag");
+  gSystem->Setenv("ALIMDC_RUNDB","./mdc1/meta");
+  cout<< "SIMRUN:: Run " << gSystem->Getenv("DC_RUN")
+          << " Chunk " << gSystem->Getenv("DC_EVENT")
+         << endl;
+
+  cout<<">>>>> SIMULATION <<<<<"<<endl;
+  if ( snapshot )
+  {
+    gSystem->Setenv("OCDB_SNAPSHOT_CREATE","kTRUE");
+    gSystem->Setenv("OCDB_SNAPSHOT_FILENAME","OCDB_sim.root");
+  }
+  
+  gSystem->Exec(Form("aliroot -b -q sim.C\\(%d\\) > sim.log 2>&1",nevent));
+  gSystem->Exec("mv syswatch.log simwatch.log");
+
+  if ( snapshot )
+  {
+    gSystem->Setenv("OCDB_SNAPSHOT_FILENAME","OCDB_rec.root");
+  }
+  
+  cout<<">>>>> RECONSTRUCTION <<<<<"<<endl;
+  
+  if ( snapshot )
+  {
+    // for some reason must include ITS objects in the snapshot
+    // (to be able to instantiante the vertexer later on ?)
+    gSystem->Exec("aliroot -b -q rec.C\\(1\\) > rec.log 2>&1");
+  }
+  else
+  {
+    gSystem->Exec("aliroot -b -q rec.C > rec.log 2>&1");
+  }
+  
+  gSystem->Exec("mv syswatch.log recwatch.log");
+
+  if ( snapshot )
+  {
+    gSystem->Exec(Form("mkdir -p OCDB/%s",srun));
+    gSystem->Exec(Form("mv OCDB_*.root OCDB/%s/",srun));
+  }
+  else
+  {
+    //  cout<<">>>>> TAG <<<<<"<<endl;
+    //  gSystem->Exec("aliroot -b -q tag.C > tag.log 2>&1");
+  
+    cout<<">>>>> CHECK ESD <<<<<"<<endl;
+    gSystem->Exec("aliroot -b -q CheckESD.C > checkesd.log 2>&1");
+    cout<<">>>>> MAKE AOD <<<<<"<<endl;
+    gSystem->Exec("aliroot -b -q AODtrain.C > aod.log 2>&1");
+    cout<<">>>>> CHECK AOD <<<<<"<<endl;
+    gSystem->Exec("aliroot -b -q CheckAOD.C > checkaod.log 2>&1");
+  }
+  
+  return 0;
+}