4 // set job and simulation variables as :
5 // root run.C --run <x> --event <y> --process <proc> --minhard <min> --maxhard <max> --minpt <minpt> ...
16 char sminpthard[1024];
17 char smaxpthard[1024];
18 char sminptgammapi0[1024];
19 char spi0gammafrag[1024];
22 char smedlength[1024];
30 sprintf(sminpthard,"");
31 sprintf(smaxpthard,"");
32 sprintf(sminptgammapi0,"");
33 sprintf(spi0gammafrag,"");
36 //sprintf(smedlength,"");
40 for (int i=0; i< gApplication->Argc();i++){
42 printf("Arg %d: %s\n",i,gApplication->Argv(i));
44 if (!(strcmp(gApplication->Argv(i),"--run")))
45 nrun = atoi(gApplication->Argv(i+1));
46 sprintf(srun,"%d",nrun);
48 if (!(strcmp(gApplication->Argv(i),"--event")))
49 nevent = atoi(gApplication->Argv(i+1));
50 sprintf(sevent,"%d",nevent);
52 if (!(strcmp(gApplication->Argv(i),"--process")))
53 sprintf(sprocess, gApplication->Argv(i+1));
55 if (!(strcmp(gApplication->Argv(i),"--year")))
56 sprintf(syear, gApplication->Argv(i+1));
58 if (!(strcmp(gApplication->Argv(i),"--ecms")))
59 sprintf(secms,gApplication->Argv(i+1));
61 if (!(strcmp(gApplication->Argv(i),"--minhard")))
62 sprintf(sminpthard,gApplication->Argv(i+1));
64 if (!(strcmp(gApplication->Argv(i),"--maxhard")))
65 sprintf(smaxpthard,gApplication->Argv(i+1));
67 if (!(strcmp(gApplication->Argv(i),"--pi0gammafrag")))
68 sprintf(spi0gammafrag,gApplication->Argv(i+1));
70 if (!(strcmp(gApplication->Argv(i),"--minpt")))
71 sprintf(sminptgammapi0,gApplication->Argv(i+1));
73 if (!(strcmp(gApplication->Argv(i),"--quench")))
74 sprintf(squench,gApplication->Argv(i+1));
76 if (!(strcmp(gApplication->Argv(i),"--qhat")))
77 sprintf(sqhat,gApplication->Argv(i+1));
79 //if (!(strcmp(gApplication->Argv(i),"--medlength")))
80 // sprintf(smedlength,gApplication->Argv(i+1));
82 if (!(strcmp(gApplication->Argv(i),"--trigger")))
83 sprintf(strig,gApplication->Argv(i+1));
87 //rec params for reconstruction
88 //only for release < 16
90 //sprintf(cmd, ".! tar zxvf DBpp.tgz") ;
91 //gROOT->ProcessLine(cmd) ;
93 seed = nrun * 100000 + nevent;
94 sprintf(sseed,"%d",seed);
97 fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
98 fprintf(stderr,"!!!! WARNING! Seeding variable for MC is 0 !!!!\n");
99 fprintf(stderr,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
101 fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
102 fprintf(stdout,"!!! MC Seed is %d \n",seed);
103 fprintf(stdout,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
106 // set the seed environment variable
107 gSystem->Setenv("CONFIG_SEED",sseed);
108 gSystem->Setenv("RUN",srun);
109 gSystem->Setenv("EVENT",sevent);
110 gSystem->Setenv("DC_RUN_TYPE",sprocess);//"kPyGammaJetPHOS");
111 gSystem->Setenv("YEAR",syear);//"14000");
112 gSystem->Setenv("ECMS",secms);//"14000");
113 gSystem->Setenv("PTHARDMIN",sminpthard);//"20");
114 gSystem->Setenv("PTHARDMAX",smaxpthard);//"30");
115 gSystem->Setenv("PI0GAMMAINDET",spi0gammafrag);//"1");
116 gSystem->Setenv("PTGAMMAPI0MIN",sminptgammapi0);//"1");
117 gSystem->Setenv("QUENCHING",squench);
118 gSystem->Setenv("QHAT",sqhat);
119 //gSystem->Setenv("MEDLENGTH",smedlength);
120 gSystem->Setenv("TRIGGER",strig);
122 cout<< "SIMRUN:: Run = " << gSystem->Getenv("RUN") << "; Event = " << gSystem->Getenv("EVENT")
123 << "; Process = " << gSystem->Getenv("DC_RUN_TYPE")
124 << "; E cms = " << gSystem->Getenv("ECMS")
125 << "; Trigger configuration = "<< gSystem->Getenv("TRIGGER")
126 << "; Year = "<<gSystem->Getenv("YEAR") << endl;
128 cout<< " minpthard = " << gSystem->Getenv("PTHARDMIN")
129 << "; maxpthard =" << gSystem->Getenv("PTHARDMAX")
130 << "; force pi0/gamma frag in detector = " << gSystem->Getenv("PI0GAMMAINDET")
131 << "; minpt = " << gSystem->Getenv("PTGAMMAPI0MIN")
132 << "; quenching option ="<<gSystem->Getenv("QUENCHING")
133 << "; qhat = "<<gSystem->Getenv("QHAT")
134 //<< "; medium length = "<<gSystem->Getenv("MEDIUMLENGTH")
137 cout<<">>>>> SIMULATION <<<<<"<<endl;
138 gSystem->Exec("aliroot -b -q sim.C > sim.log 2>&1");
139 cout<<">>>>> RECONSTRUCTION <<<<<"<<endl;
140 gSystem->Exec("aliroot -b -q rec.C > rec.log 2>&1");
141 cout<<">>>>> TAG <<<<<"<<endl;
142 gSystem->Exec("aliroot -b -q tag.C > tag.log 2>&1");
143 cout<<">>>>> CHECK ESD <<<<<"<<endl;
144 gSystem->Exec("aliroot -b -q CheckESD.C > check.log 2>&1");