]> git.uio.no Git - u/mrichter/AliRoot.git/blame - prod/LHC09d5/simrun.C
QA for pp data
[u/mrichter/AliRoot.git] / prod / LHC09d5 / simrun.C
CommitLineData
b0e91ec7 1// #define VERBOSEARGS\r
2// simrun.C\r
3{\r
4// set job and simulation variables as :\r
5// root.exe -b -q simrun.C --run <x> --event <y> --process <kPythia6/kPhojet> --field <kNoField/k5kG> --energy <900/10000>\r
6\r
7 int nrun = 0;\r
8 int nevent = 0;\0\r
9 int seed = 0;\r
10\r
11 char sseed[1024];\r
12 char srun[1024];\r
13 char sevent[1024];\r
14 char sprocess[1024];\r
15 char sfield[1024];\r
16 char senergy[1024];\r
17\r
18 sprintf(srun,"");\r
19 sprintf(sevent,"");\r
20 sprintf(sprocess,"");\r
21 sprintf(sfield,"");\r
22 sprintf(senergy,"");\r
23\r
24 for (int i=0; i< gApplication->Argc();i++){\r
25#ifdef VERBOSEARGS\r
26 printf("Arg %d: %s\n",i,gApplication->Argv(i));\r
27#endif\r
28 if (!(strcmp(gApplication->Argv(i),"--run")))\r
29 nrun = atoi(gApplication->Argv(i+1));\r
30 sprintf(srun,"%d",nrun);\r
31\r
32 if (!(strcmp(gApplication->Argv(i),"--event")))\r
33 nevent = atoi(gApplication->Argv(i+1));\r
34 sprintf(sevent,"%d",nevent);\r
35\r
36 if (!(strcmp(gApplication->Argv(i),"--process")))\r
37 sprintf(sprocess, gApplication->Argv(i+1));\r
38\r
39 if (!(strcmp(gApplication->Argv(i),"--field")))\r
40 sprintf(sfield,gApplication->Argv(i+1));\r
41\r
42 if (!(strcmp(gApplication->Argv(i),"--energy")))\r
43 sprintf(senergy,gApplication->Argv(i+1));\r
44\r
45 }\r
46\r
47 seed = nrun * 100000 + nevent;\r
48 sprintf(sseed,"%d",seed);\r
49\r
50 if (seed==0) {\r
51 fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
52 fprintf(stderr,"!!!! WARNING! Seeding variable for MC is 0 !!!!\n");\r
53 fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
54 } else {\r
55 fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
56 fprintf(stdout,"!!! MC Seed is %d \n",seed);\r
57 fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");\r
58 }\r
59 \r
60// set the seed environment variable\r
61 gSystem->Setenv("CONFIG_SEED",sseed);\r
62 gSystem->Setenv("CONFIG_RUN_TYPE",sprocess); // kPythia6 or kPhojet\r
63 gSystem->Setenv("CONFIG_FIELD",sfield); // kNoField or k5kG\r
64 gSystem->Setenv("CONFIG_ENERGY",senergy); // 900 or 10000 (GeV)\r
65 gSystem->Setenv("DC_RUN",srun); // Not used in Config.C\r
66 gSystem->Setenv("DC_EVENT",sevent); // Not used in Config.C\r
67 \r
68// Needed to produce simulated RAW data\r
69 gSystem->Setenv("ALIMDC_RAWDB1","./mdc1");\r
70 gSystem->Setenv("ALIMDC_RAWDB2","./mdc2");\r
71 gSystem->Setenv("ALIMDC_TAGDB","./mdc1/tag");\r
72 gSystem->Setenv("ALIMDC_RUNDB","./mdc1/meta");\r
73 cout<< "SIMRUN:: Run " << gSystem->Getenv("DC_RUN") << " Event " << gSystem->Getenv("DC_EVENT")\r
74 << " Generator " << gSystem->Getenv("CONFIG_RUN_TYPE")\r
75 << " Field " << gSystem->Getenv("CONFIG_FIELD")\r
76 << " Energy " << gSystem->Getenv("CONFIG_ENERGY")\r
77 << endl;\r
78\r
79 cout<<">>>>> SIMULATION <<<<<"<<endl;\r
80 gSystem->Exec("aliroot -b -q sim.C > sim.log 2>&1");\r
81 cout<<">>>>> RECONSTRUCTION <<<<<"<<endl;\r
82 gSystem->Exec("aliroot -b -q rec.C > rec.log 2>&1");\r
83 cout<<">>>>> TAG <<<<<"<<endl;\r
84 gSystem->Exec("aliroot -b -q tag.C > tag.log 2>&1");\r
85 cout<<">>>>> CHECK ESD <<<<<"<<endl;\r
86 gSystem->Exec("aliroot -b -q CheckESD.C > check.log 2>&1");\r
87 cout<<">>>>> AOD <<<<<"<<endl;\r
88 gSystem->Exec("aliroot -b -q CreateAODfromESD.C > aod.log 2>&1");\r
89\r
90}\r