4 // set job and simulation variables as :
5 // root.exe -b -q simrun.C --run <x> --event <y> --process <kPythia6/kPhojet> --field <kNoField/k5kG> --energy <900/10000>
24 for (int i=0; i< gApplication->Argc();i++){
26 printf("Arg %d: %s\n",i,gApplication->Argv(i));
28 if (!(strcmp(gApplication->Argv(i),"--run")))
29 nrun = atoi(gApplication->Argv(i+1));
30 sprintf(srun,"%d",nrun);
32 if (!(strcmp(gApplication->Argv(i),"--event")))
33 nevent = atoi(gApplication->Argv(i+1));
34 sprintf(sevent,"%d",nevent);
36 if (!(strcmp(gApplication->Argv(i),"--process")))
37 sprintf(sprocess, gApplication->Argv(i+1));
39 if (!(strcmp(gApplication->Argv(i),"--field")))
40 sprintf(sfield,gApplication->Argv(i+1));
42 if (!(strcmp(gApplication->Argv(i),"--energy")))
43 sprintf(senergy,gApplication->Argv(i+1));
47 seed = nrun * 100000 + nevent;
48 sprintf(sseed,"%d",seed);
51 fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
52 fprintf(stderr,"!!!! WARNING! Seeding variable for MC is 0 !!!!\n");
53 fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
55 fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
56 fprintf(stdout,"!!! MC Seed is %d \n",seed);
57 fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
60 // set the seed environment variable
61 gSystem->Setenv("CONFIG_SEED",sseed);
62 gSystem->Setenv("CONFIG_RUN_TYPE",sprocess); // kPythia6 or kPhojet
63 gSystem->Setenv("CONFIG_FIELD",sfield); // kNoField or k5kG
64 gSystem->Setenv("CONFIG_ENERGY",senergy); // 900 or 10000 (GeV)
65 gSystem->Setenv("DC_RUN",srun); // Not used in Config.C
66 gSystem->Setenv("DC_EVENT",sevent); // Not used in Config.C
68 // Needed to produce simulated RAW data
69 gSystem->Setenv("ALIMDC_RAWDB1","./mdc1");
70 gSystem->Setenv("ALIMDC_RAWDB2","./mdc2");
71 gSystem->Setenv("ALIMDC_TAGDB","./mdc1/tag");
72 gSystem->Setenv("ALIMDC_RUNDB","./mdc1/meta");
73 cout << "SIMRUN:: Run " << gSystem->Getenv("DC_RUN") << " Event " << gSystem->Getenv("DC_EVENT")
77 // Background simulation
78 gSystem->Setenv("CONFIG_EMBEDDING","kBackground");
80 cout<<">>>>> BACKGROUND SIMULATION <<<<<"<<endl;
81 gSystem->Exec("mkdir BackgroundFull");
82 gSystem->Exec("cp Config.C BackgroundFull/");
83 gSystem->Exec("cp sim.C BackgroundFull/");
84 gSystem->Exec("cp rec.C BackgroundFull/");
85 gSystem->ChangeDirectory("BackgroundFull/");
86 gSystem->Exec("aliroot -b -q 'sim.C(0)' > sim.log 2>&1");
87 cout<<">>>>> BACKGROUND RECONSTRUCTION <<<<<"<<endl;
88 gSystem->Exec("aliroot -b -q 'rec.C(0)' > rec.log 2>&1");
89 gSystem->ChangeDirectory("../");
91 // Convert Raw to SDigits
92 cout << ">>>>> CONVERTING RAW 2 SDIGITS <<<<<" << endl;
93 gSystem->Exec("mkdir Background");
94 gSystem->Exec("cp BackgroundFull/raw.root Background/");
95 gSystem->Exec("cp BackgroundFull/AliESDs.root Background/");
96 gSystem->Exec("cp -a BackgroundFull/GRP Background/");
97 gSystem->Exec("cp sim.C Background/");
98 gSystem->Exec("cp Config.C Background/");
99 gSystem->ChangeDirectory("Background/");
100 gSystem->Exec("aliroot -b -q 'sim.C(4)' > sim.log 2>&1");
101 gSystem->ChangeDirectory("../");
102 gSystem->Exec("mkdir BackgroundSDigits");
103 gSystem->Exec("cp Background/*SDigits.root BackgroundSDigits");
104 gSystem->Exec("cp BackgroundFull/galice.root BackgroundSDigits/");
105 gSystem->Exec("cp BackgroundFull/AliESDs.root BackgroundSDigits/");
108 gSystem->Setenv("CONFIG_EMBEDDING","kMerged");
110 cout<<">>>>> MERGED SIMULATION <<<<<<"<< endl;
111 gSystem->Exec("mkdir Merged");
112 gSystem->Exec("cp Config.C Merged/");
113 gSystem->Exec("cp sim.C Merged/");
114 gSystem->Exec("cp rec.C Merged/");
115 gSystem->ChangeDirectory("Merged/");
116 gSystem->Exec("aliroot -b -q 'sim.C(1)' > sim.log 2>&1");
117 cout<<">>>>> MERGED RECONSTRUCTION <<<<<"<<endl;
118 gSystem->Exec("aliroot -b -q 'rec.C(1)' > rec.log 2>&1");
119 gSystem->ChangeDirectory("../");
121 // Pure signal re-reconstruction
122 gSystem->Setenv("CONFIG_EMBEDDING","kSignal");
124 cout<<">>>>> SIGNAL SIMULATION <<<<<<"<< endl;
125 gSystem->Exec("mkdir Signal");
126 gSystem->Exec("cp Config.C Signal/");
127 gSystem->Exec("cp sim.C Signal/");
128 gSystem->Exec("cp rec.C Signal/");
129 gSystem->Exec("cp Merged/*SDigits*.root Signal/");
130 gSystem->Exec("cp Merged/galice.root Signal/");
131 gSystem->Exec("cp Merged/Kinematics.root Signal/");
132 gSystem->Exec("cp -a Merged/GRP Signal/");
133 gSystem->ChangeDirectory("Signal/");
134 gSystem->Exec("aliroot -b -q 'sim.C(2)' > sim.log 2>&1");
135 cout<<">>>>> SIGNAL RECONSTRUCTION <<<<<"<<endl;
136 gSystem->Exec("aliroot -b -q 'rec.C(2)' > rec.log 2>&1");
137 gSystem->ChangeDirectory("../");
139 // cout<<">>>>> TAG <<<<<"<<endl;
140 // gSystem->Exec("aliroot -b -q tag.C > tag.log 2>&1");
141 // cout<<">>>>> CHECK ESD <<<<<"<<endl;
142 // gSystem->Exec("aliroot -b -q CheckESD.C > check.log 2>&1");
143 // cout<<">>>>> AOD <<<<<"<<endl;
144 // gSystem->Exec("aliroot -b -q CreateAODfromESD.C > aod.log 2>&1");