Forseen the possibility to have RICH reconstruction from Stack (useful for debug...
[u/mrichter/AliRoot.git] / RICH / CreateConfig.C
CommitLineData
144e7d10 1class RichConfig
cc69fb87 2{
3RQ_OBJECT()
4public:
5 enum EDetectors {kPIPE=1,kITS=2,kTPC=4,kTRD=8,kTOF=16,kFRAME=32,kMAG=64,kCRT=128,kHALL=256,kPHOS=512,kSTART=1024,kFMD=2048,kABSO=4096,
6 kPMD=8192,kDIPO=16384,kEMCAL=32768,kVZERO=65536,kMUON=131072,kZDC=262144,kSHILD=524288};
7 enum EProcesses {kDCAY=1,kPAIR=2,kCOMP=4,kPHOT=8,kPFIS=16,kDRAY=32,kANNI=64,kBREM=128,kMUNU=256,kCKOV=512,kHADR=1024,kLOSS=2048,kMULS=4096,
8 kRAYL=8192};
998b831f 9 enum EGenTypes {kGun1=100,kGun7,kPythia7,kHijing,kHijingPara};
86594bfc 10
144e7d10 11 RichConfig(const char*sFileName);
12 ~RichConfig() {Info("ctor","");fMain->Cleanup(); delete fMain;}
2bea03c3 13 void AddDetector(Int_t id) {fDetectors+=id; if(id==kTRD || id==kTOF) fDetButGrp->SetButton(kFRAME);}
14 void RemoveDetector(Int_t id) {fDetectors-=id; if(id==kFRAME) {fDetButGrp->SetButton(kTRD,kFALSE);fDetButGrp->SetButton(kTOF,kFALSE);}}
86594bfc 15 void AddProcess(Int_t id) {fProcesses+=id;}
16 void RemoveProcess(Int_t id) {fProcesses-=id;}
17 Bool_t IsDetectorOn(Int_t id) const{return fDetectors&id;}
18 Bool_t IsProcessOn(Int_t id) const{return fProcesses&id;}
19 Float_t Eta2Theta(Float_t arg) const{return (180./TMath::Pi())*2.*TMath::ATan(TMath::Exp(-arg));}
20 void CreateConfigFile();
cc69fb87 21protected:
22 TGMainFrame *fMain;//main window poiter
2bfae12e 23 TGComboBox *fRichVersionCombo; TGButton *fRichTopChkBtn,*fRichDeclusterChkBtn,*fRichSagChkBtn,*fRichRadioSrcChkBtn;//RICH
d4c94996 24 TGButton *fMagFldChkBtn; //MAG
144e7d10 25 TGComboBox *fGenTypeCombo,*fGenPartIdCombo,*fGenMinMomCombo,*fGenMaxMomCombo,*fGenChamberCombo; TGNumberEntry *fGenNprimEntry;//GEN
d4c94996 26 Int_t fDetectors; TGButtonGroup *fDetButGrp; //DETECTORS
cc69fb87 27 Int_t fProcesses;
86594bfc 28 char *fFileName;
144e7d10 29};//class RichConfig
cc69fb87 30
144e7d10 31RichConfig::RichConfig(const char *sFileName)
cc69fb87 32{
86594bfc 33 fFileName=sFileName;
d4c94996 34 fDetectors=0;
cc69fb87 35// Create main frame
36 fMain=new TGMainFrame(gClient->GetRoot(),500,400);
144e7d10 37// fMain->Connect("CloseWindow()","RichConfig",this,"CloseWindow()");
cc69fb87 38 fMain->AddFrame(pHorFrame=new TGHorizontalFrame(fMain,100,200));
39//RICH
40 pHorFrame->AddFrame(pVerFrame=new TGVerticalFrame(pHorFrame,100,200));
41 pVerFrame->AddFrame(pRichGrpFrm=new TGGroupFrame(pHorFrame,"RICH"));
42 pRichGrpFrm->AddFrame(fRichVersionCombo=new TGComboBox(pRichGrpFrm,100));
d4c94996 43 fRichVersionCombo->AddEntry("no RICH",-1);
44 fRichVersionCombo->AddEntry("version 0",0);
45 fRichVersionCombo->AddEntry("version 1",1);
46 fRichVersionCombo->Select(1); fRichVersionCombo->Resize(160,20);
cc69fb87 47 pRichGrpFrm->AddFrame(fRichTopChkBtn=new TGCheckButton(pRichGrpFrm,"Rotate to Top?"));
2bea03c3 48 pRichGrpFrm->AddFrame(fRichDeclusterChkBtn=new TGCheckButton(pRichGrpFrm,"Declustering")); fRichDeclusterChkBtn->SetState(kButtonDown);
2bfae12e 49 pRichGrpFrm->AddFrame(fRichSagChkBtn=new TGCheckButton(pRichGrpFrm,"Wire sagita?")); fRichSagChkBtn->SetState(kButtonDown);
50 pRichGrpFrm->AddFrame(fRichRadioSrcChkBtn=new TGCheckButton(pRichGrpFrm,"Radioactive source"));
cc69fb87 51//Generator
52 pVerFrame->AddFrame(pGenGrpFrm=new TGGroupFrame(pHorFrame,"Generator"));
53 pGenGrpFrm->AddFrame(fGenTypeCombo=new TGComboBox(pGenGrpFrm,100));
998b831f 54 fGenTypeCombo->AddEntry("gun to single chamber",kGun1);
55 fGenTypeCombo->AddEntry("gun to all chambers",kGun7);
86594bfc 56 fGenTypeCombo->AddEntry("7 guns on top of Pythia",kPythia7);
998b831f 57 fGenTypeCombo->AddEntry("HIJING",kHijing);
58 fGenTypeCombo->AddEntry("parametrized HIJING",kHijingPara);
59 fGenTypeCombo->AddEntry("Sr90 source",kSr90);
84365c70 60 fGenTypeCombo->Select(kHijingPara);
cc69fb87 61 fGenTypeCombo->Resize(160,20);
62
d4c94996 63 pGenGrpFrm->AddFrame(fGenPartIdCombo=new TGComboBox(pGenGrpFrm,100)); //PID for guns
84365c70 64 fGenPartIdCombo->AddEntry("Pion+",kPiPlus);
65 fGenPartIdCombo->AddEntry("Pion-",kPiMinus);
66 fGenPartIdCombo->AddEntry("Kaon+",kKPlus);
67 fGenPartIdCombo->AddEntry("Kaon-",kKMinus);
68 fGenPartIdCombo->AddEntry("Proton",kProton);
69 fGenPartIdCombo->AddEntry("AntiProton",kProtonBar);
d4c94996 70 fGenPartIdCombo->Select(kPiPlus); fGenPartIdCombo->Resize(160,20);
cc69fb87 71
144e7d10 72 pGenGrpFrm->AddFrame(fGenMinMomCombo=new TGComboBox(pGenGrpFrm,100)); //particle energy for guns
73 fGenMinMomCombo->AddEntry("1.5 GeV",15);
74 fGenMinMomCombo->AddEntry("2.0 Gev",20);
75 fGenMinMomCombo->AddEntry("2.5 GeV",25);
76 fGenMinMomCombo->AddEntry("3.0 GeV",30);
77 fGenMinMomCombo->AddEntry("3.5 GeV",35);
78 fGenMinMomCombo->AddEntry("4.0 GeV",40);
79 fGenMinMomCombo->AddEntry("4.5 GeV",45);
80 fGenMinMomCombo->Select(15); fGenMinMomCombo->Resize(160,20);
81
82 pGenGrpFrm->AddFrame(fGenMaxMomCombo=new TGComboBox(pGenGrpFrm,100)); //particle energy for guns
83 fGenMaxMomCombo->AddEntry("1.5 GeV",15);
84 fGenMaxMomCombo->AddEntry("2.0 Gev",20);
85 fGenMaxMomCombo->AddEntry("2.5 GeV",25);
86 fGenMaxMomCombo->AddEntry("3.0 GeV",30);
87 fGenMaxMomCombo->AddEntry("3.5 GeV",35);
88 fGenMaxMomCombo->AddEntry("4.0 GeV",40);
89 fGenMaxMomCombo->AddEntry("4.5 GeV",45);
90 fGenMaxMomCombo->Select(40); fGenMaxMomCombo->Resize(160,20);
84365c70 91
d4c94996 92 pGenGrpFrm->AddFrame(fGenChamberCombo=new TGComboBox(pGenGrpFrm,100)); //chamber number in case of gun1
93 for(int i=1;i<=7;i++) fGenChamberCombo->AddEntry(Form("Chamber %i",i),i);
94 fGenChamberCombo->Select(4); fGenChamberCombo->Resize(160,20);
95
2bfae12e 96 pGenGrpFrm->AddFrame(pGenNprimFrm=new TGGroupFrame(pGenGrpFrm,"Number of primaries"));//number of primiries in case of HIJING
84365c70 97 pGenNprimFrm->AddFrame(fGenNprimEntry=new TGNumberEntry(pGenNprimFrm,500));
98
6865fb8d 99// Magnetic Field
100 pVerFrame->AddFrame(pFldGrpFrm=new TGGroupFrame(pHorFrame,"Magnetic Field"));
86594bfc 101 pFldGrpFrm->AddFrame(fMagFldChkBtn=new TGCheckButton(pFldGrpFrm,"On/Off"));
998b831f 102 fMagFldChkBtn->SetState(kButtonDown);
6865fb8d 103//Detectors
d4c94996 104 pHorFrame->AddFrame(fDetButGrp=new TGButtonGroup(pHorFrame,"Detectors"));
144e7d10 105 fDetButGrp->Connect("Pressed(Int_t)","RichConfig",this,"AddDetector(Int_t)");
106 fDetButGrp->Connect("Released(Int_t)","RichConfig",this,"RemoveDetector(Int_t)");
d4c94996 107 new TGCheckButton(fDetButGrp,"PIPE" ,kPIPE));
108 new TGCheckButton(fDetButGrp,"ITS" ,kITS));
109 new TGCheckButton(fDetButGrp,"TPC" ,kTPC));
110 new TGCheckButton(fDetButGrp,"TRD" ,kTRD));
111 new TGCheckButton(fDetButGrp,"TOF" ,kTOF));
112 new TGCheckButton(fDetButGrp,"FRAME" ,kFRAME));
113 new TGCheckButton(fDetButGrp,"MAG" ,kMAG));
114 new TGCheckButton(fDetButGrp,"CRT" ,kCRT));
115 new TGCheckButton(fDetButGrp,"HALL" ,kHALL));
116 new TGCheckButton(fDetButGrp,"PHOS" ,kPHOS));
117 new TGCheckButton(fDetButGrp,"START" ,kSTART));
118 new TGCheckButton(fDetButGrp,"FMD" ,kFMD));
119 new TGCheckButton(fDetButGrp,"ABSO" ,kABSO));
120 new TGCheckButton(fDetButGrp,"PMD" ,kPMD));
121 new TGCheckButton(fDetButGrp,"DIPO" ,kDIPO));
122 new TGCheckButton(fDetButGrp,"EMCAL" ,kEMCAL));
123 new TGCheckButton(fDetButGrp,"VZERO" ,kVZERO));
124 new TGCheckButton(fDetButGrp,"MUON" ,kMUON));
125 new TGCheckButton(fDetButGrp,"ZDC" ,kZDC));
126 new TGCheckButton(fDetButGrp,"SHILD" ,kSHILD));
cc69fb87 127//Processes
128 pHorFrame->AddFrame(pProcButGrp=new TGButtonGroup(pHorFrame,"Processes"));
144e7d10 129 pProcButGrp->Connect("Pressed(Int_t)","RichConfig",this,"AddProcess(Int_t)");
130 pProcButGrp->Connect("Released(Int_t)","RichConfig",this,"RemoveProcess(Int_t)");
86594bfc 131 new TGCheckButton(pProcButGrp,"DCAY decay",kDCAY)); pProcButGrp->SetButton(kDCAY);
132 new TGCheckButton(pProcButGrp,"PAIR pair production",kPAIR)); pProcButGrp->SetButton(kPAIR);
133 new TGCheckButton(pProcButGrp,"COMP Compton",kCOMP)); pProcButGrp->SetButton(kCOMP);
cc69fb87 134 new TGCheckButton(pProcButGrp,"PHOT",kPHOT)); pProcButGrp->SetButton(kPHOT);
86594bfc 135 new TGCheckButton(pProcButGrp,"PFIS Photofission",kPFIS));
136 new TGCheckButton(pProcButGrp,"DRAY delta electrons",kDRAY));
137 new TGCheckButton(pProcButGrp,"ANNI annihilation",kANNI)); pProcButGrp->SetButton(kANNI);
138 new TGCheckButton(pProcButGrp,"BREM Bremstraslung",kBREM)); pProcButGrp->SetButton(kBREM);
cc69fb87 139 new TGCheckButton(pProcButGrp,"MUNU",kMUNU)); pProcButGrp->SetButton(kMUNU);
86594bfc 140 new TGCheckButton(pProcButGrp,"CKOV Cerenkovs",kCKOV)); pProcButGrp->SetButton(kCKOV);
141 new TGCheckButton(pProcButGrp,"HADR Hadronic interactions ",kHADR)); pProcButGrp->SetButton(kHADR);
cc69fb87 142 new TGCheckButton(pProcButGrp,"LOSS",kLOSS)); pProcButGrp->SetButton(kLOSS);
143 new TGCheckButton(pProcButGrp,"MULS",kMULS)); pProcButGrp->SetButton(kMULS);
144 new TGCheckButton(pProcButGrp,"RAYL",kRAYL)); pProcButGrp->SetButton(kRAYL);
86594bfc 145//File
cc69fb87 146 fMain->AddFrame(pFileHorFrm=new TGHorizontalFrame(fMain,100,200));
147 pFileHorFrm->AddFrame(pCreateBtn=new TGTextButton(pFileHorFrm,"Create"));
144e7d10 148 pCreateBtn->Connect("Clicked()","RichConfig",this,"CreateConfigFile()");
86594bfc 149 pFileHorFrm->AddFrame(new TGLabel(pFileHorFrm,Form(" config file as %s",fFileName)));
cc69fb87 150
151 fMain->MapSubwindows();
152 fMain->Layout();
153 fMain->SetWindowName("Create AliROOT Config script");
154 fMain->MapWindow();
155}//KirCondig::ctor
156
144e7d10 157void RichConfig::CreateConfigFile()
cc69fb87 158{
86594bfc 159 FILE *fp=fopen(fFileName,"w"); if(!fp){Info("CreateConfigFile","Cannot open output file:%sn",fFileName);return;}
cc69fb87 160
161 fprintf(fp,"void Config()\n");
162 fprintf(fp,"{\n");
163 fprintf(fp," ::Info(\"RICH private config\",\"Start\");\n\n");
164//Random
165 fprintf(fp," gRandom->SetSeed(123456);//put 0 to use system time\n\n");
166//Geant
167 fprintf(fp," gSystem->Load(\"libgeant321\");\n");
168 fprintf(fp," new TGeant3(\"C++ Interface to Geant3\");\n\n");
169//File
6ae8cba0 170 fprintf(fp," AliRunLoader *pAL=AliRunLoader::Open(\"galice.root\",AliConfig::GetDefaultEventFolderName(),\"recreate\");\n");
cc69fb87 171 fprintf(fp," pAL->SetCompressionLevel(2);\n");
2bea03c3 172 fprintf(fp," pAL->SetNumberOfEventsPerFile(1000);\n");
cc69fb87 173 fprintf(fp," gAlice->SetRunLoader(pAL);\n\n");
174//Decayer
175 fprintf(fp," TVirtualMCDecayer *pDecayer=new AliDecayerPythia();\n");
176 fprintf(fp," pDecayer->SetForceDecay(kAll);\n");
177 fprintf(fp," pDecayer->Init();\n");
178 fprintf(fp," gMC->SetExternalDecayer(pDecayer);\n\n");
179//Physics
180 if(IsProcessOn(kDCAY)) fprintf(fp," gMC->SetProcess(\"DCAY\",1);"); else fprintf(fp," gMC->SetProcess(\"DCAY\",0);");
181 if(IsProcessOn(kPAIR)) fprintf(fp," gMC->SetProcess(\"PAIR\",1);\n");else fprintf(fp," gMC->SetProcess(\"PAIR\",0);\n");
182 if(IsProcessOn(kCOMP)) fprintf(fp," gMC->SetProcess(\"COMP\",1);"); else fprintf(fp," gMC->SetProcess(\"COMP\",0);");
183 if(IsProcessOn(kPHOT)) fprintf(fp," gMC->SetProcess(\"PHOT\",1);\n");else fprintf(fp," gMC->SetProcess(\"PHOT\",0);\n");
184 if(IsProcessOn(kPFIS)) fprintf(fp," gMC->SetProcess(\"PFIS\",1);"); else fprintf(fp," gMC->SetProcess(\"PFIS\",0);");
185 if(IsProcessOn(kDRAY)) fprintf(fp," gMC->SetProcess(\"DRAY\",1);\n");else fprintf(fp," gMC->SetProcess(\"DRAY\",0);\n");
186 if(IsProcessOn(kANNI)) fprintf(fp," gMC->SetProcess(\"ANNI\",1);"); else fprintf(fp," gMC->SetProcess(\"ANNI\",0);");
187 if(IsProcessOn(kBREM)) fprintf(fp," gMC->SetProcess(\"BREM\",1);\n");else fprintf(fp," gMC->SetProcess(\"BREM\",0);\n");
188 if(IsProcessOn(kMUNU)) fprintf(fp," gMC->SetProcess(\"MUNU\",1);"); else fprintf(fp," gMC->SetProcess(\"MUNU\",0);");
189 if(IsProcessOn(kCKOV)) fprintf(fp," gMC->SetProcess(\"CKOV\",1);\n");else fprintf(fp," gMC->SetProcess(\"CKOV\",0);\n");
190 if(IsProcessOn(kHADR)) fprintf(fp," gMC->SetProcess(\"HADR\",1);"); else fprintf(fp," gMC->SetProcess(\"HADR\",0);");
191 if(IsProcessOn(kLOSS)) fprintf(fp," gMC->SetProcess(\"LOSS\",2);\n");else fprintf(fp," gMC->SetProcess(\"LOSS\",0);\n");
192 if(IsProcessOn(kMULS)) fprintf(fp," gMC->SetProcess(\"MULS\",1);"); else fprintf(fp," gMC->SetProcess(\"MULS\",0);");
193 if(IsProcessOn(kRAYL)) fprintf(fp," gMC->SetProcess(\"RAYL\",1);\n");else fprintf(fp," gMC->SetProcess(\"RAYL\",0);\n");
194
195 fprintf(fp," gMC->SetCut(\"CUTGAM\",0.001); "); fprintf(fp," gMC->SetCut(\"CUTELE\",0.001); ");
196 fprintf(fp," gMC->SetCut(\"CUTNEU\",0.001);\n"); fprintf(fp," gMC->SetCut(\"CUTHAD\",0.001); ");
197 fprintf(fp," gMC->SetCut(\"CUTMUO\",0.001); "); fprintf(fp," gMC->SetCut(\"BCUTE\" ,0.001);\n");
198 fprintf(fp," gMC->SetCut(\"BCUTM\" ,0.001); "); fprintf(fp," gMC->SetCut(\"DCUTE\" ,0.001); ");
199 fprintf(fp," gMC->SetCut(\"DCUTM\" ,0.001);\n"); fprintf(fp," gMC->SetCut(\"PPCUTM\",0.001); ");
200 fprintf(fp," gMC->SetCut(\"TOFMAX\",1e10);\n\n");
201//Field
6865fb8d 202 if(fMagFldChkBtn->GetState()==kButtonDown) fprintf(fp," gAlice->SetField();\n\n");else fprintf(fp," gAlice->SetField(0);\n\n");
cc69fb87 203 fprintf(fp," pAL->CdGAFile();\n\n"); //????
204//BODY-ALIC
205 fprintf(fp," new AliBODY(\"BODY\",\"Alice envelop\");\n\n");
d4c94996 206//RICH
207 if(fRichVersionCombo->GetSelected() != -1){
2bea03c3 208 if(fRichTopChkBtn->GetState()==kButtonDown) fprintf(fp," AliRICHParam::AngleRot(0);\n");
209 if(fRichDeclusterChkBtn->GetState()!=kButtonDown) fprintf(fp," AliRICHParam::SetDeclustering(kFALSE);\n");
2bfae12e 210 if(fRichSagChkBtn->GetState()!=kButtonDown) fprintf(fp," AliRICHParam::SetWireSag(kFALSE);\n");
211 if(fRichRadioSrcChkBtn->GetState()==kButtonDown) fprintf(fp," AliRICHParam::SetRadioSrc(kTRUE);\n");
d4c94996 212 switch(fRichVersionCombo->GetSelected()){//RICH
213 case 0: fprintf(fp," pRICH=new AliRICHv0(\"RICH\",\"RICH version 0\");\n"); break;
214 case 1: fprintf(fp," pRICH=new AliRICHv1(\"RICH\",\"RICH version 1\");\n"); break;
215 }
216 fprintf(fp," ::Info(\"RICH private config\",\"version %i\");\n\n",fRichVersionCombo->GetSelected());
cc69fb87 217 }
218//Generator
219 switch(fGenTypeCombo->GetSelected()){
86594bfc 220 case kHijingPara:
84365c70 221 fprintf(fp," AliGenHIJINGpara *pGen=new AliGenHIJINGpara(%i);\n",(int)fGenNprimEntry->GetNumber());
998b831f 222 fprintf(fp," pGen->SetMomentumRange(0,999); pGen->SetThetaRange(%f,%f); pGen->SetPhiRange(0,360);\n",Eta2Theta(8),Eta2Theta(-8));
86594bfc 223 fprintf(fp," pGen->SetOrigin(0,0,0); pGen->SetSigma(0,0,0);\n");
224 fprintf(fp," pGen->Init();\n");
225 break;
cc69fb87 226 case kGun1:
30c60010 227 fprintf(fp," AliGenBox *pGen=new AliGenBox(1);\n");
998b831f 228 fprintf(fp," pGen->SetPart(%i); pGen->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
30c60010 229 fprintf(fp," pGen->SetMomentumRange(%3.1f,%3.1f); \n",float(fGenMinMomCombo->GetSelected())/10, float(fGenMaxMomCombo->GetSelected())/10);
230 fprintf(fp," pGen->SetThetaRange(pRICH->C(%i)->ThetaD()-3,pRICH->C(%i)->ThetaD()-1); \n",fGenChamberCombo->GetSelected(),fGenChamberCombo->GetSelected());
231 fprintf(fp," pGen->SetPhiRange(pRICH->C(%i)->PhiD()-1,pRICH->C(%i)->PhiD()+1); \n",fGenChamberCombo->GetSelected(),fGenChamberCombo->GetSelected());
cc69fb87 232 fprintf(fp," pGen->Init();\n");
86594bfc 233 break;
234 case kGun7:
235 fprintf(fp," AliGenCocktail *pCocktail=new AliGenCocktail();\n");
236 fprintf(fp," for(int i=1;i<=7;i++){\n");
237 fprintf(fp," AliGenFixed *pFixed=new AliGenFixed(1);\n");
30c60010 238 fprintf(fp," pFixed->SetPart(%i); pFixed->SetMomentum(1.0+i*0.5); pFixed->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
998b831f 239 fprintf(fp," pFixed->SetPhi(pRICH->C(i)->PhiD()); pFixed->SetTheta(pRICH->C(i)->ThetaD()-2);\n");
86594bfc 240 fprintf(fp," pCocktail->AddGenerator(pFixed,Form(\"Fixed %i\",i),1);\n }\n");
241 fprintf(fp," pCocktail->Init();\n");
242 break;
243 case kPythia7:
244 fprintf(fp," AliGenCocktail *pCocktail=new AliGenCocktail();\n");
245 fprintf(fp," for(int i=1;i<=7;i++){\n");
246 fprintf(fp," AliGenFixed *pFixed=new AliGenFixed(1);\n");
84365c70 247 fprintf(fp," pFixed->SetPart(%i); pFixed->SetMomentum(2.5+i*0.4); pFixed->SetOrigin(0,0,0);\n",fGenPartIdCombo->GetSelected());
6ae8cba0 248 fprintf(fp," pFixed->SetPhiRange(pRICH->C(i)->PhiD()); pFixed->SetThetaRange(pRICH->C(i)->ThetaD()-2);\n");
86594bfc 249 fprintf(fp," pCocktail->AddGenerator(pFixed,Form(\"Fixed %i\",i),1);\n }\n");
250 fprintf(fp," AliGenPythia *pPythia = new AliGenPythia(-1);\n");
251 fprintf(fp," pPythia->SetMomentumRange(0,999999); pPythia->SetPhiRange(20,80); pPythia->SetThetaRange(75,115);\n");
252 fprintf(fp," pPythia->SetYRange(-12,12); pPythia->SetPtRange(0,1000); pPythia->SetStrucFunc(kCTEQ4L);\n");
253 fprintf(fp," pPythia->SetProcess(kPyMb); pPythia->SetEnergyCMS(14000);\n");
254 fprintf(fp," pCocktail->AddGenerator(pPythia,\"Pythia\",1);\n");
255 fprintf(fp," pCocktail->Init();\n");
998b831f 256 case kSr90:
257 fprintf(fp," AliGenRadioactive *pGen=new AliGenRadioactive(kSr90,%i);\n",(int)fGenNprimEntry->GetNumber());
258 fprintf(fp," pGen->SetOrigin(0,0,0); pGen->SetSigma(0.1,0.1,0.05);\n");
259 fprintf(fp," pGen->Init();\n");
260 break;
261 case kHijing:
262 fprintf(fp," AliGenHijing *pGen=new AliGenHijing(-1); pGen->SetEnergyCMS(5500); pGen->SetReferenceFrame(\"CMS\");\n");
263 fprintf(fp," pGen->SetProjectile(\"A\", 208, 82); pGen->SetTarget(\"A\", 208, 82);\n");
264 fprintf(fp," pGen->SetJetQuenching(0); pGen->SetShadowing(0);\n");
265 fprintf(fp," pGen->KeepFullEvent(); pGen->SetSelectAll(0); \n");
266 fprintf(fp," pGen->SetImpactParameterRange(0., 5.);\n");
267 fprintf(fp," pGen->Init();\n");
86594bfc 268 break;
cc69fb87 269 }
d4c94996 270//central before RICH detectors
cc69fb87 271 if(IsDetectorOn(kPIPE)) fprintf(fp,"\n new AliPIPEv0(\"PIPE\",\"Beam Pipe\");\n");
d4c94996 272 if(IsDetectorOn(kSHILD))fprintf(fp,"\n new AliSHILv2(\"SHIL\",\"Shielding Version 2\");\n");
cc69fb87 273 if(IsDetectorOn(kITS)){
274 fprintf(fp,"\n AliITSvPPRasymmFMD *pIts =new AliITSvPPRasymmFMD(\"ITS\",\"ITS PPR detailed version\");\n");
275 fprintf(fp," pIts->SetMinorVersion(2); pIts->SetReadDet(kTRUE);\n");
276 fprintf(fp," pIts->SetThicknessDet1(200.); pIts->SetThicknessDet2(200.);\n");
277 fprintf(fp," pIts->SetThicknessChip1(200.); pIts->SetThicknessChip2(200.);\n");
278 fprintf(fp," pIts->SetRails(0); pIts->SetCoolingFluid(1);\n");
279 fprintf(fp," pIts->SetEUCLID(0);\n");
d4c94996 280 }
281 if(IsDetectorOn(kTPC)) {fprintf(fp,"\n AliTPC *pTpc=new AliTPCv2(\"TPC\",\"Default\"); pTpc->SetSecAU(-1);pTpc->SetSecAL(-1);\n");}
282 if(IsDetectorOn(kFRAME))fprintf(fp,"\n AliFRAMEv2 *pFrame=new AliFRAMEv2(\"FRAME\",\"Space Frame\"); pFrame->SetHoles(1);\n");
cc69fb87 283 if(IsDetectorOn(kTRD)){
284 fprintf(fp,"\n AliTRD *pTrd=new AliTRDv1(\"TRD\",\"TRD slow simulator\");\n");
285 fprintf(fp," pTrd->SetGasMix(1); pTrd->SetPHOShole(); pTrd->SetRICHhole();pTrd->CreateTR();\n");
d4c94996 286 }
287 if(IsDetectorOn(kTOF)) fprintf(fp,"\n new AliTOFv4T0(\"TOF\", \"normal TOF\");\n");
288//central after RICH detectors
289 if(IsDetectorOn(kMAG)) fprintf(fp,"\n new AliMAG(\"MAG\",\"Magnet\");\n");
290 if(IsDetectorOn(kHALL)) fprintf(fp,"\n new AliHALL(\"HALL\",\"Alice Hall\");\n");
291//forward detectors
cc69fb87 292 if(IsDetectorOn(kFMD)) fprintf(fp,"\n new AliFMDv1(\"FMD\",\"normal FMD\");\n");
d4c94996 293 if(IsDetectorOn(kABSO)) fprintf(fp,"\n new AliABSOv0(\"ABSO\",\"Muon absorber\");\n");
294 if(IsDetectorOn(kDIPO)) fprintf(fp,"\n new AliDIPOv2(\"DIPO\",\"Dipole version 2\");\n");
cc69fb87 295 if(IsDetectorOn(kMUON)) fprintf(fp,"\n new AliMUONv1(\"MUON\",\"default\");\n");
cc69fb87 296 if(IsDetectorOn(kPMD)) fprintf(fp,"\n new AliPMDv1(\"PMD\",\"normal PMD\");\n");
297 if(IsDetectorOn(kSTART)) fprintf(fp,"\n new AliSTARTv1(\"START\",\"START Detector\");\n");
d4c94996 298 if(IsDetectorOn(kVZERO)) fprintf(fp,"\n new AliVZEROv2(\"VZERO\",\"normal VZERO\");\n");
299 if(IsDetectorOn(kZDC)) fprintf(fp,"\n new AliZDCv2(\"ZDC\",\"normal ZDC\");\n");
300//different phase space detectors
301 if(IsDetectorOn(kPHOS)) fprintf(fp,"\n new AliPHOSv1(\"PHOS\",\"IHEP\");\n");
cc69fb87 302 if(IsDetectorOn(kEMCAL)) fprintf(fp,"\n new AliEMCALv1(\"EMCAL\",\"G56_2_55_19_104_14\");\n");
303 if(IsDetectorOn(kCRT)) fprintf(fp,"\n new AliCRTv0(\"CRT\",\"normal ACORDE\");\n");
cc69fb87 304
305 fprintf(fp,"\n ::Info(\"RICH private config\",\"Stop\");\n");
306 fprintf(fp,"}\n");
86594bfc 307 fclose(fp);
144e7d10 308 CreateRichBatch();
86594bfc 309// fMain->CloseWindow();
cc69fb87 310}//CreateConfigFile
144e7d10 311//__________________________________________________________________________________________________
312void RichConfig::CreateRichBatch()
313{
314 FILE *fp=fopen("RichBatch.C","w"); if(!fp){Info("CreateRichBatch","Cannot open output file: RichBatch.C");return;}
315
316 fprintf(fp,"void RichBatch(const Int_t iNevents,const Bool_t isDebug,const char *sConfigFileName)\n");
317 fprintf(fp,"{\n");
318 fprintf(fp," gSystem->Exec(\"rm -rf *.root hlt hough ZZZ*\");\n");
319 fprintf(fp," if(isDebug) AliLog::SetGlobalDebugLevel(AliLog::kDebug);\n");
320 fprintf(fp," TStopwatch sw;TDatime time;\n\n");
321
322 fprintf(fp," AliSimulation *pSim=new AliSimulation;\n");
30c60010 323 if(fGenTypeCombo->GetSelected()==kGun1||fGenTypeCombo->GetSelected()==kGun7) {
324 fprintf(fp," pSim->SetRegionOfInterest(kTRUE);\n");
325 fprintf(fp," pSim->SetMakeSDigits(\"TOF RICH\");\n");
326 fprintf(fp," pSim->SetMakeDigitsFromHits(\"ITS TPC TRD\");\n");
327 }
144e7d10 328 fprintf(fp," pSim->Run(iNevents); delete pSim;\n\n");
329
330 fprintf(fp," AliReconstruction *pRec=new AliReconstruction;\n");
331 fprintf(fp," pRec->SetRunLocalReconstruction(\"ITS TPC TRD TOF RICH\");\n");
332 fprintf(fp," pRec->SetFillESD(\"ITS TPC TRD TOF RICH\");\n");
333 fprintf(fp," pRec->Run(); delete pRec;\n\n");
334
335 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <my/RichBatch.C>: Start time: \";time.Print();\n");
336 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <my/RichBatch.C>: Stop time: \";time.Set(); time.Print();\n");
337 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <my/RichBatch.C>: Time used: \";sw.Print();\n\n");
338
339 fprintf(fp," gSystem->Exec(\"touch ZZZ______finished_______ZZZ\");\n");
340 fprintf(fp," gSystem->Exec(\"playwave ~/bin/end.wav\");\n");
341 fprintf(fp,"}\n");
342
343 fclose(fp);
344}//CreateRichBatch()
345//__________________________________________________________________________________________________
346RichConfig *p;
cc69fb87 347void CreateConfig()
348{
144e7d10 349 p=new RichConfig("Config.C");
cc69fb87 350}
351