]>
Commit | Line | Data |
---|---|---|
0422a446 | 1 | #include <TPDGCode.h> |
2 | ||
9e26f77a | 3 | class RichConfig : public TGMainFrame |
473cb33a | 4 | { |
5 | RQ_OBJECT() | |
6 | public: | |
473cb33a | 7 | RichConfig(const char*sFileName); |
9e26f77a | 8 | ~RichConfig() {Info("ctor","");Cleanup();} |
f47d03bc | 9 | |
10 | enum EVersOpts {kNo=101,kVer0,kVer1,kVer2,kTest, kDeclust=301,kSagita,kFeedback,kSecRad,kQe0=400,kQeNorm,kOptics}; | |
11 | enum EGenTypes {kGunZ=1,kGun1,kGun7,kBox1,kBox7,kHijing,kHijingPara,kPythia,kRichLib,kNotUsed=999}; | |
473cb33a | 12 | |
f47d03bc | 13 | enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kCRT,kHALL,kPHOS,kSTART,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD}; |
473cb33a | 14 | enum EProcesses {kDCAY=1,kPAIR,kCOMP,kPHOT,kPFIS,kDRAY,kANNI,kBREM,kMUNU,kCKOV,kHADR,kLOSS,kMULS,kRAYL,kALL}; |
f47d03bc | 15 | enum EBatchFlags{kPrim=555,kTransport,kAll,kOnly,kRawDdl,kRawDate,kRawRoot,kVertex,kTrack,kEsd}; |
473cb33a | 16 | |
f47d03bc | 17 | Float_t Eta2Theta (Float_t arg) const{return (180./TMath::Pi())*2.*TMath::ATan(TMath::Exp(-arg));} |
473cb33a | 18 | |
f47d03bc | 19 | void GuiRich (TGHorizontalFrame *pMainF); void WriteRich (FILE *pF); void RichSlot (Int_t ver); |
20 | void GuiPhys (TGHorizontalFrame *pMainF); void WritePhys (FILE *pF); void PhysAddSlot(Int_t id); void PhysRemSlot(Int_t id); | |
21 | void GuiGen (TGCompositeFrame *pMainF); void WriteGen (FILE *pF); void GenAddSlot (Int_t id); void GenRemSlot (Int_t id); | |
22 | void GuiDet (TGHorizontalFrame *pMainF); void WriteDet (FILE *pF); void DetAddSlot (Int_t id); void DetRemSlot (Int_t id); | |
23 | void GuiBatch(TGHorizontalFrame *pMainF); void WriteBatch( ); | |
24 | ||
25 | void WriteConfig(); | |
26 | void ExitSlot(); | |
473cb33a | 27 | |
f47d03bc | 28 | TGButtonGroup *fVerBG,*fOptBG,*fQeBG; //Rich widgets |
29 | TGButton *fMagB; //magnet field widgets | |
30 | ||
31 | TGComboBox *fGenPidCO,*fGenPminCO,*fGenPmaxCO,*fGenChamCO,*fGenNprimCO; //generator widgets combos | |
32 | TGCompositeFrame *fGenF; //generator widgets frames | |
33 | TGButtonGroup *fGenBG; //generator widgets | |
34 | ||
35 | TGButtonGroup *fDetBG,*fProcBG; //detectors and processes widgets | |
36 | TGButtonGroup *fSimBG,*fSDigBG,*fDigBG,*fRawBG,*fClusBG,*fRecoBG; //batch control widgets | |
37 | ||
38 | char *fFileName; | |
473cb33a | 39 | };//class RichConfig |
40 | //__________________________________________________________________________________________________ | |
8493d0aa | 41 | RichConfig::RichConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),700,400) |
f47d03bc | 42 | { |
473cb33a | 43 | fFileName=sFileName; |
9e26f77a | 44 | |
f47d03bc | 45 | AddFrame(pMainF=new TGHorizontalFrame(this,100,200)); //main horizontal frame |
8493d0aa | 46 | |
8493d0aa | 47 | // Magnetic Field |
f47d03bc | 48 | pMainF->AddFrame(fMagB=new TGCheckButton(pMainF,"Mag field On/Off")); fMagB->SetState(kButtonDown); |
8493d0aa | 49 | |
f47d03bc | 50 | GuiRich (pMainF); |
51 | GuiGen (pMainF); | |
52 | GuiDet (pMainF); | |
53 | GuiPhys (pMainF); | |
54 | GuiBatch(pMainF); | |
473cb33a | 55 | |
f47d03bc | 56 | //File |
57 | AddFrame(pFileHF=new TGHorizontalFrame(this,100,200)); | |
58 | pFileHF->AddFrame(pCrtTB=new TGTextButton(pFileHF,"Create")); | |
59 | pCrtTB->Connect("Clicked()","RichConfig",this,"ExitSlot()"); | |
60 | pFileHF->AddFrame(new TGLabel(pFileHF,Form(" config file as %s",fFileName))); | |
473cb33a | 61 | |
f47d03bc | 62 | MapSubwindows(); |
63 | Resize(GetDefaultSize()); | |
64 | SetWindowName("Create AliROOT scripts"); | |
65 | MapWindow(); | |
66 | }//KirCondig::ctor | |
67 | //__________________________________________________________________________________________________ | |
68 | void RichConfig::GuiRich(TGHorizontalFrame *pMainHF) | |
69 | { | |
70 | pMainHF->AddFrame(pLeftVF=new TGVerticalFrame(pMainHF,100,200)); | |
71 | pLeftVF->AddFrame(pRichGF=new TGGroupFrame(pLeftVF,"RICH")); | |
72 | pRichGF->AddFrame(fVerBG=new TGButtonGroup(pRichGF,"")); fVerBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"RichVerSlot(Int_t)"); | |
73 | new TGRadioButton(fVerBG, "No" ,kNo )); | |
74 | new TGRadioButton(fVerBG, "ver0" ,kVer0 )); | |
75 | new TGRadioButton(fVerBG, "ver1" ,kVer1 )); fVerBG->SetButton(kVer1); | |
76 | new TGRadioButton(fVerBG, "ver2" ,kVer2 )); | |
77 | pRichGF->AddFrame(fOptBG=new TGButtonGroup(pRichGF,"")); fOptBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"RichVerSlot(Int_t)"); | |
78 | new TGCheckButton(fOptBG,"Test beam position?" ,kTest); | |
79 | new TGCheckButton(fOptBG,"Second radiator?" ,kSecRad); | |
80 | new TGCheckButton(fOptBG,"Decluster?" ,kDeclust); fOptBG->SetButton(kDeclust); | |
81 | new TGCheckButton(fOptBG,"Wire sagita?" ,kSagita); fOptBG->SetButton(kSagita); | |
82 | new TGCheckButton(fOptBG,"Feedbacks?" ,kFeedback); fOptBG->SetButton(kFeedback); | |
83 | new TGCheckButton(fOptBG,"Plot optics?" ,kOptics); | |
84 | pRichGF->AddFrame(fQeBG=new TGButtonGroup(pRichGF,"")); | |
85 | new TGRadioButton(fQeBG,"QE=0" ,kQe0); | |
86 | new TGRadioButton(fQeBG,"QE normal" ,kQeNorm); fQeBG->SetButton(kQeNorm); | |
87 | }//Rich() | |
88 | //__________________________________________________________________________________________________ | |
89 | void RichConfig::RichVerSlot(Int_t ver) | |
90 | { | |
91 | if(ver==kTest) {fMagB->SetState(kButtonUp); fGenBG->SetButton(kGunZ); } | |
92 | } | |
93 | //__________________________________________________________________________________________________ | |
94 | void RichConfig::WriteRich(FILE *pF) | |
95 | { | |
96 | if(!fVerBG->GetButton(kNo)->GetState()){ | |
97 | if( fOptBG->GetButton(kSecRad)->GetState()) fprintf(pF," AliRICHParam::fgIsSecondRadiator=kTRUE;\n"); | |
98 | if(!fOptBG->GetButton(kSagita)->GetState()) fprintf(pF," AliRICHParam::fgIsWireSagita=kFALSE;\n"); | |
99 | if( fOptBG->GetButton(kTest) ->GetState()) fprintf(pF," AliRICHParam::fgIsTestBeam=kTRUE;\n"); | |
100 | if( fOptBG->GetButton(kTest) ->GetState()) fprintf(pF," AliRICHParam::fgIsOptDisp=kTRUE;\n"); | |
101 | ||
102 | if (fVerBG->GetButton(kVer0)->GetState()) fprintf(pF," AliRICH *pRICH=new AliRICHv0(\"Debug\");\n\n"); | |
103 | else if(fVerBG->GetButton(kVer1)->GetState()) fprintf(pF," AliRICH *pRICH=new AliRICHv1(\"RICH\",\"Normal RICH\");\n\n"); | |
104 | else if(fVerBG->GetButton(kVer2)->GetState()) fprintf(pF," AliRICH *pRICH=new AliRICHv2(\"New Rich\");\n\n"); | |
105 | } | |
106 | } | |
107 | //__________________________________________________________________________________________________ | |
108 | void RichConfig::GuiPhys(TGHorizontalFrame *pMainHF) | |
109 | { | |
8493d0aa | 110 | pMainHF->AddFrame(fProcBG=new TGButtonGroup(pMainHF,"Processes")); |
f47d03bc | 111 | fProcBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"PhysAddSlot(Int_t)"); |
112 | fProcBG->Connect("Released(Int_t)","RichConfig",this,"PhysRemSlot(Int_t)"); | |
473cb33a | 113 | new TGCheckButton(fProcBG,"ALL ON/OFF" ,kALL)) ; |
114 | new TGCheckButton(fProcBG,"DCAY Decay" ,kDCAY)); fProcBG->SetButton(kDCAY); | |
115 | new TGCheckButton(fProcBG,"PAIR Pair production" ,kPAIR)); fProcBG->SetButton(kPAIR); | |
116 | new TGCheckButton(fProcBG,"COMP Compton" ,kCOMP)); fProcBG->SetButton(kCOMP); | |
117 | new TGCheckButton(fProcBG,"PHOT" ,kPHOT)); fProcBG->SetButton(kPHOT); | |
118 | new TGCheckButton(fProcBG,"PFIS Photofission" ,kPFIS)); | |
119 | new TGCheckButton(fProcBG,"DRAY Delta electrons" ,kDRAY)); | |
120 | new TGCheckButton(fProcBG,"ANNI Annihilation" ,kANNI)); fProcBG->SetButton(kANNI); | |
121 | new TGCheckButton(fProcBG,"BREM Bremstraslung" ,kBREM)); fProcBG->SetButton(kBREM); | |
122 | new TGCheckButton(fProcBG,"MUNU Muon-Nuclear" ,kMUNU)); fProcBG->SetButton(kMUNU); | |
123 | new TGCheckButton(fProcBG,"CKOV Cerenkovs" ,kCKOV)); fProcBG->SetButton(kCKOV); | |
124 | new TGCheckButton(fProcBG,"HADR Hadronic interactions " ,kHADR)); fProcBG->SetButton(kHADR); | |
125 | new TGCheckButton(fProcBG,"LOSS Energy losses" ,kLOSS)); fProcBG->SetButton(kLOSS); | |
126 | new TGCheckButton(fProcBG,"MULS Multiple scattering" ,kMULS)); fProcBG->SetButton(kMULS); | |
f47d03bc | 127 | new TGCheckButton(fProcBG,"RAYL Rayleigh scattering" ,kRAYL)); fProcBG->SetButton(kRAYL); |
128 | } | |
8493d0aa | 129 | //__________________________________________________________________________________________________ |
f47d03bc | 130 | void RichConfig::PhysAddSlot(Int_t id) |
131 | {//slot is invoked when any of physics check button is pressed | |
132 | if(id==kALL) //if the pressed check button is kALL then switch on all the buttons | |
133 | for(int i=1;i<=fProcBG->GetCount();i++) | |
134 | fProcBG->SetButton(i,kButtonDown); | |
135 | } | |
136 | //__________________________________________________________________________________________________ | |
137 | void RichConfig::PhysRemSlot(Int_t id) | |
138 | {//slot is invoked when any of physics check button is released | |
139 | if(id==kALL) //if the released check button is kALL then switch off all the buttons | |
140 | for(int i=1;i<=fProcBG->GetCount();i++) | |
141 | fProcBG->SetButton(i,kButtonUp); | |
142 | } | |
143 | //__________________________________________________________________________________________________ | |
144 | void RichConfig::WritePhys(FILE *pF) | |
145 | { | |
146 | if(fProcBG->GetButton(kDCAY)->GetState()) fprintf(pF," gMC->SetProcess(\"DCAY\",1); ");else fprintf(pF," gMC->SetProcess(\"DCAY\",0); "); | |
147 | if(fProcBG->GetButton(kPAIR)->GetState()) fprintf(pF," gMC->SetProcess(\"PAIR\",1); ");else fprintf(pF," gMC->SetProcess(\"PAIR\",0); "); | |
148 | if(fProcBG->GetButton(kCOMP)->GetState()) fprintf(pF," gMC->SetProcess(\"COMP\",1);\n");else fprintf(pF," gMC->SetProcess(\"COMP\",0);\n"); | |
149 | if(fProcBG->GetButton(kPHOT)->GetState()) fprintf(pF," gMC->SetProcess(\"PHOT\",1); ");else fprintf(pF," gMC->SetProcess(\"PHOT\",0); "); | |
150 | if(fProcBG->GetButton(kPFIS)->GetState()) fprintf(pF," gMC->SetProcess(\"PFIS\",1); ");else fprintf(pF," gMC->SetProcess(\"PFIS\",0); "); | |
151 | if(fProcBG->GetButton(kDRAY)->GetState()) fprintf(pF," gMC->SetProcess(\"DRAY\",1);\n");else fprintf(pF," gMC->SetProcess(\"DRAY\",0);\n"); | |
152 | if(fProcBG->GetButton(kANNI)->GetState()) fprintf(pF," gMC->SetProcess(\"ANNI\",1); ");else fprintf(pF," gMC->SetProcess(\"ANNI\",0); "); | |
153 | if(fProcBG->GetButton(kBREM)->GetState()) fprintf(pF," gMC->SetProcess(\"BREM\",1); ");else fprintf(pF," gMC->SetProcess(\"BREM\",0); "); | |
154 | if(fProcBG->GetButton(kMUNU)->GetState()) fprintf(pF," gMC->SetProcess(\"MUNU\",1);\n");else fprintf(pF," gMC->SetProcess(\"MUNU\",0);\n"); | |
155 | if(fProcBG->GetButton(kCKOV)->GetState()) fprintf(pF," gMC->SetProcess(\"CKOV\",1); ");else fprintf(pF," gMC->SetProcess(\"CKOV\",0); "); | |
156 | if(fProcBG->GetButton(kHADR)->GetState()) fprintf(pF," gMC->SetProcess(\"HADR\",1); ");else fprintf(pF," gMC->SetProcess(\"HADR\",0); "); | |
157 | if(fProcBG->GetButton(kLOSS)->GetState()) fprintf(pF," gMC->SetProcess(\"LOSS\",2);\n");else fprintf(pF," gMC->SetProcess(\"LOSS\",0);\n"); | |
158 | if(fProcBG->GetButton(kMULS)->GetState()) fprintf(pF," gMC->SetProcess(\"MULS\",1); ");else fprintf(pF," gMC->SetProcess(\"MULS\",0); "); | |
159 | if(fProcBG->GetButton(kRAYL)->GetState()) fprintf(pF," gMC->SetProcess(\"RAYL\",1);\n");else fprintf(pF," gMC->SetProcess(\"RAYL\",0);\n"); | |
8493d0aa | 160 | |
f47d03bc | 161 | fprintf(pF,"\n"); |
162 | fprintf(pF," gMC->SetCut(\"CUTGAM\",0.001); "); fprintf(pF," gMC->SetCut(\"CUTELE\",0.001); "); fprintf(pF," gMC->SetCut(\"CUTNEU\",0.001);\n"); | |
163 | fprintf(pF," gMC->SetCut(\"CUTHAD\",0.001); "); fprintf(pF," gMC->SetCut(\"CUTMUO\",0.001); "); fprintf(pF," gMC->SetCut(\"BCUTE\" ,0.001);\n"); | |
164 | fprintf(pF," gMC->SetCut(\"BCUTM\" ,0.001); "); fprintf(pF," gMC->SetCut(\"DCUTE\" ,0.001); "); fprintf(pF," gMC->SetCut(\"DCUTM\" ,0.001);\n"); | |
165 | fprintf(pF," gMC->SetCut(\"PPCUTM\",0.001); "); fprintf(pF," gMC->SetCut(\"TOFMAX\",1e10);\n\n"); | |
166 | }//WritePhys() | |
167 | //__________________________________________________________________________________________________ | |
168 | void RichConfig::GuiGen(TGCompositeFrame *pMainF) | |
169 | {//generator configurator implemented as group of radio buttons | |
170 | pMainF->AddFrame(fGenF=new TGVerticalFrame(pMainF));//add generator vertical frame to horizontal main frame | |
171 | fGenF->AddFrame(fGenBG=new TGButtonGroup(fGenF,"Generator"));//add type button group to vertical generator frame | |
172 | fGenBG->Connect("Pressed(Int_t)","RichConfig",this,"GenAddSlot(Int_t)"); fGenBG->Connect("Released(Int_t)","RichConfig",this,"GenRemSlot(Int_t)"); | |
173 | new TGCheckButton(fGenBG,"gun along z" ,kGunZ); | |
174 | new TGCheckButton(fGenBG,"gun to 1 chamber" ,kGun1); | |
175 | new TGCheckButton(fGenBG,"gun to 7 chambers" ,kGun7); | |
176 | new TGCheckButton(fGenBG,"box to 1 chamber" ,kBox1); | |
177 | new TGCheckButton(fGenBG,"box to 7 chambers" ,kBox7); | |
178 | new TGCheckButton(fGenBG,"HIJING" ,kHijing); | |
179 | new TGCheckButton(fGenBG,"HIJING para" ,kHijingPara); | |
180 | new TGCheckButton(fGenBG,"Pythia" ,kPythia); | |
181 | new TGCheckButton(fGenBG,"RICH lib" ,kRichLib); | |
182 | //N prims for box and Hijing para | |
183 | fGenF->AddFrame(fGenNprimCO=new TGComboBox(fGenF,100)); //add N prims combo to generator vertical frame | |
184 | fGenNprimCO->AddEntry("not used" ,kNotUsed); | |
185 | fGenNprimCO->AddEntry("N prim=1" ,1); | |
186 | fGenNprimCO->AddEntry("N prim=2" ,2); | |
187 | fGenNprimCO->AddEntry("N prim=5" ,5); | |
188 | fGenNprimCO->AddEntry("N prim=500" ,5); | |
189 | fGenNprimCO->AddEntry("N prim=80000",80000); fGenNprimCO->Resize(160,20); fGenNprimCO->Select(kNotUsed); | |
190 | //PID | |
191 | fGenF->AddFrame(fGenPidCO=new TGComboBox(fGenF,100)); //add pid combo to generator vertical frame | |
192 | fGenPidCO->AddEntry("not used" ,kNotUsed); | |
193 | fGenPidCO->AddEntry("electron" ,kElectron); | |
194 | fGenPidCO->AddEntry("positron" ,kPositron); | |
195 | fGenPidCO->AddEntry("pion +" ,kPiPlus); | |
196 | fGenPidCO->AddEntry("pion -" ,kPiMinus); | |
197 | fGenPidCO->AddEntry("kaon +" ,kKPlus); | |
198 | fGenPidCO->AddEntry("kaon -" ,kKMinus); | |
199 | fGenPidCO->AddEntry("kaon 0" ,kK0Short); | |
200 | fGenPidCO->AddEntry("proton" ,kProton); | |
201 | fGenPidCO->AddEntry("antiproton" ,kProtonBar); | |
202 | fGenPidCO->AddEntry("lambda" ,kLambda0); | |
203 | fGenPidCO->AddEntry("antilambda" ,kLambda0Bar); fGenPidCO->Resize(160,20); fGenPidCO->Select(kNotUsed); | |
204 | //Pmin | |
205 | fGenF->AddFrame(fGenPminCO=new TGComboBox(fGenF,100)); //add Pmin combo to generator vertical frame | |
206 | fGenPminCO->AddEntry("not used",kNotUsed); | |
207 | for(Int_t i=5;i<=295;i+=5) fGenPminCO->AddEntry(Form("Pmin=%3.1f GeV",0.1*i), i); fGenPminCO->Resize(160,20); fGenPminCO->Select(kNotUsed); | |
208 | //Pmax | |
209 | fGenF->AddFrame(fGenPmaxCO=new TGComboBox(fGenF,100)); //add Pmax combo to generator vertical frame | |
210 | fGenPmaxCO->AddEntry("not used",kNotUsed); | |
211 | for(Int_t i=10;i<=295;i+=5) fGenPmaxCO->AddEntry(Form("Pmax=%3.1f GeV",0.1*i), i); fGenPmaxCO->Resize(160,20); fGenPmaxCO->Select(kNotUsed); | |
212 | //Chamber number | |
213 | fGenF->AddFrame(fGenChamCO=new TGComboBox(fGenF,100)); //add chamber number combo to generator vertical frame | |
214 | fGenChamCO->AddEntry("not used",kNotUsed); | |
215 | for(int i=1;i<=7;i++) fGenChamCO->AddEntry(Form("Chamber %i",i),i); fGenChamCO->Resize(160,20); fGenChamCO->Select(kNotUsed); | |
216 | }//GuiGen() | |
217 | //__________________________________________________________________________________________________ | |
218 | void RichConfig::GenAddSlot(Int_t id) | |
219 | {//is invoked when any of generator check button is pressed | |
220 | if(id==kGunZ){ | |
221 | fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenF->HideFrame(fGenNprimCO); | |
222 | fGenBG->GetButton(kGun7)->SetEnabled(kFALSE); fGenPidCO->Select(kProton); | |
223 | fGenBG->GetButton(kBox1)->SetEnabled(kFALSE); fGenF->HideFrame(fGenPmaxCO); fGenPminCO->Select(25); | |
224 | fGenBG->GetButton(kBox7)->SetEnabled(kFALSE); fGenF->HideFrame(fGenChamCO); | |
225 | } | |
226 | if(id==kGun1){ | |
227 | fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenF->HideFrame(fGenNprimCO); | |
228 | fGenBG->GetButton(kGun7)->SetEnabled(kFALSE); fGenF->HideFrame(fGenPmaxCO); | |
229 | fGenBG->GetButton(kBox1)->SetEnabled(kFALSE); | |
230 | fGenBG->GetButton(kBox7)->SetEnabled(kFALSE); fGenPidCO->Select(kProton); fGenPminCO->Select(25); fGenChamCO->Select(4); | |
8493d0aa | 231 | } |
f47d03bc | 232 | if(id==kGun7){ |
233 | fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenF->HideFrame(fGenNprimCO); | |
234 | fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenPidCO->Select(kProton); | |
235 | fGenBG->GetButton(kBox1)->SetEnabled(kFALSE); fGenF->HideFrame(fGenPmaxCO); fGenPminCO->Select(25); | |
236 | fGenBG->GetButton(kBox7)->SetEnabled(kFALSE); fGenF->HideFrame(fGenChamCO); | |
237 | } | |
238 | if(id==kBox1){ | |
239 | fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenNprimCO->Select(1); | |
240 | fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenPidCO ->Select(kProton); | |
241 | fGenBG->GetButton(kGun7)->SetEnabled(kFALSE); fGenPminCO ->Select(5); fGenPmaxCO->Select(25); | |
242 | fGenBG->GetButton(kBox7)->SetEnabled(kFALSE); fGenChamCO ->Select(4); | |
8493d0aa | 243 | } |
f47d03bc | 244 | if(id==kBox7){ |
245 | fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenNprimCO->Select(1); | |
246 | fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenPidCO ->Select(kProton); | |
247 | fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenPminCO ->Select(5); fGenPmaxCO->Select(25); | |
248 | fGenBG->GetButton(kBox1)->SetEnabled(kFALSE); fGenF->HideFrame(fGenChamCO); | |
249 | } | |
250 | if(id==kHijing){ | |
251 | fGenBG->GetButton(kHijing)->ChangeBackground(0xff0000); | |
252 | fGenBG->GetButton(kHijingPara)->SetEnabled(kFALSE); | |
253 | fGenBG->GetButton(kPythia)->SetEnabled(kFALSE); | |
254 | } | |
255 | if(id==kHijingPara){ | |
256 | fGenBG->GetButton(kHijing)->SetEnabled(kFALSE); | |
257 | fGenBG->GetButton(kPythia)->SetEnabled(kFALSE); | |
258 | } | |
259 | if(id==kPythia){ | |
260 | fGenBG->GetButton(kHijing)->SetEnabled(kFALSE); | |
261 | fGenBG->GetButton(kHijingPara)->SetEnabled(kFALSE); | |
262 | } | |
263 | }//GenAddSlot() | |
264 | //__________________________________________________________________________________________________ | |
265 | void RichConfig::GenRemSlot(Int_t id) | |
266 | {//is invoked when any of generator check button is released | |
267 | if(id==kGunZ){ | |
268 | fGenBG->GetButton(kGun1)->SetEnabled(); fGenF->ShowFrame(fGenNprimCO); | |
269 | fGenBG->GetButton(kGun7)->SetEnabled(); fGenPidCO ->Select(kNotUsed); | |
270 | fGenBG->GetButton(kBox1)->SetEnabled(); fGenF->ShowFrame(fGenPmaxCO); fGenPminCO ->Select(kNotUsed); | |
271 | fGenBG->GetButton(kBox7)->SetEnabled(); fGenF->ShowFrame(fGenChamCO); | |
272 | } | |
273 | if(id==kGun1){ | |
274 | fGenBG->GetButton(kGunZ)->SetEnabled(); fGenF->ShowFrame(fGenNprimCO); | |
275 | fGenBG->GetButton(kGun7)->SetEnabled(); fGenPidCO ->Select(kNotUsed); | |
276 | fGenBG->GetButton(kBox1)->SetEnabled(); fGenF->ShowFrame(fGenPmaxCO); fGenPminCO ->Select(kNotUsed); | |
277 | fGenBG->GetButton(kBox7)->SetEnabled(); fGenChamCO ->Select(kNotUsed); | |
278 | } | |
279 | if(id==kGun7){ | |
280 | fGenBG->GetButton(kGunZ)->SetEnabled(); fGenF->ShowFrame(fGenNprimCO); | |
281 | fGenBG->GetButton(kGun1)->SetEnabled(); fGenPidCO ->Select(kNotUsed); | |
282 | fGenBG->GetButton(kBox1)->SetEnabled(); fGenF->ShowFrame(fGenPmaxCO); fGenPminCO ->Select(kNotUsed); | |
283 | fGenBG->GetButton(kBox7)->SetEnabled(); fGenF->ShowFrame(fGenChamCO); | |
284 | } | |
285 | if(id==kBox1){ | |
286 | fGenBG->GetButton(kGunZ)->SetEnabled(); fGenNprimCO->Select(kNotUsed); | |
287 | fGenBG->GetButton(kGun1)->SetEnabled(); fGenPidCO ->Select(kNotUsed); | |
288 | fGenBG->GetButton(kGun7)->SetEnabled(); fGenPminCO ->Select(kNotUsed); fGenPmaxCO->Select(kNotUsed); | |
289 | fGenBG->GetButton(kBox7)->SetEnabled(); fGenChamCO ->Select(kNotUsed); | |
290 | } | |
291 | if(id==kBox7){ | |
292 | fGenBG->GetButton(kGunZ)->SetEnabled(); fGenNprimCO->Select(kNotUsed); | |
293 | fGenBG->GetButton(kGun1)->SetEnabled(); fGenPidCO ->Select(kNotUsed); | |
294 | fGenBG->GetButton(kGun1)->SetEnabled(); fGenPminCO ->Select(kNotUsed); fGenPmaxCO->Select(kNotUsed); | |
295 | fGenBG->GetButton(kBox1)->SetEnabled(); fGenF->ShowFrame(fGenChamCO); | |
296 | } | |
297 | if(id==kHijing){ | |
298 | fGenBG->GetButton(kHijing)->ChangeBackground(0xbebebe); | |
299 | fGenBG->GetButton(kHijingPara)->SetEnabled(); | |
300 | fGenBG->GetButton(kPythia)->SetEnabled(); | |
301 | } | |
302 | if(id==kHijingPara){ | |
303 | fGenBG->GetButton(kHijing)->SetEnabled(); | |
304 | fGenBG->GetButton(kPythia)->SetEnabled(); | |
305 | } | |
306 | if(id==kPythia){ | |
307 | fGenBG->GetButton(kHijing)->SetEnabled(); | |
308 | fGenBG->GetButton(kHijingPara)->SetEnabled(); | |
309 | } | |
310 | }//GenRemSlot() | |
311 | //__________________________________________________________________________________________________ | |
312 | void RichConfig::WriteGen(FILE *pF) | |
313 | { | |
314 | fprintf(pF," AliGenCocktail *pCocktail=new AliGenCocktail();\n\n"); | |
315 | if(fGenBG->GetButton(kGunZ)->GetState()==kButtonDown){//1 particle along Z axis | |
316 | fprintf(pF," AliGenFixed *pGunZ=new AliGenFixed(1);\n"); | |
317 | fprintf(pF," pGunZ->SetPart(%i); pGunZ->SetMomentum(%.1f); pGunZ->SetOrigin(0,0,-200);\n",fGenPidCO->GetSelected(),float(fGenPminCO->GetSelected())/10); | |
318 | fprintf(pF," pCocktail->AddGenerator(pGunZ,\"gunZ\",1);\n\n"); | |
319 | } | |
320 | if(fGenBG->GetButton(kGun1)->GetState()==kButtonDown){//1 gun towards 1 RICH chamber | |
321 | fprintf(pF," AliGenFixed *pGun1=new AliGenFixed(1);\n"); | |
322 | fprintf(pF," pGun1->SetPart(%i); pGun1->SetMomentum(%.1f);\n",fGenPidCO->GetSelected(),float(fGenPminCO->GetSelected())/10); | |
323 | fprintf(pF," pGun1->SetTheta(pRICH->C(%i)->ThetaD()-2); pGun1->SetPhi(pRICH->C(%i)->PhiD()-2); \n",fGenChamCO->GetSelected(),fGenChamCO->GetSelected()); | |
324 | fprintf(pF," pCocktail->AddGenerator(pGun1,\"gun1\",1);\n\n"); | |
325 | } | |
326 | if(fGenBG->GetButton(kGun7)->GetState()==kButtonDown){//7 guns towards 7 RICH chambers | |
327 | fprintf(pF," for(int i=1;i<=7;i++){\n"); | |
328 | fprintf(pF," AliGenFixed *pGun7=new AliGenFixed(1);\n"); | |
329 | fprintf(pF," pGun7->SetPart(%i); pGun7->SetMomentum(1.0+i*0.5);\n",fGenPidCO->GetSelected()); | |
330 | fprintf(pF," pGun7->SetTheta(pRICH->C(i)->ThetaD()-2); pGun7->SetPhi(pRICH->C(i)->PhiD()); \n"); | |
331 | fprintf(pF," pCocktail->AddGenerator(pGun7,Form(\"gun7-%%i\",i),1);\n }\n\n"); | |
332 | } | |
333 | if(fGenBG->GetButton(kBox1)->GetState()==kButtonDown){//1 box towards 1 RICH chamber | |
334 | fprintf(pF," AliGenBox *pBox1=new AliGenBox(1);\n"); | |
335 | fprintf(pF," pBox1->SetPart(%i); pBox1->SetMomentumRange(%.1f,%.1f);\n",fGenPidCO->GetSelected(),float(fGenPminCO->GetSelected())/10,float(fGenPmaxCO->GetSelected())/10); | |
336 | fprintf(pF," pBox1->SetThetaRange(pRICH->C(%i)->ThetaD()-3,pRICH->C(%i)->ThetaD()-1); \n",fGenChamCO->GetSelected(),fGenChamCO->GetSelected()); | |
337 | fprintf(pF," pBox1->SetPhiRange(pRICH->C(%i)->PhiD()-1,pRICH->C(%i)->PhiD()+1); \n",fGenChamCO->GetSelected(),fGenChamCO->GetSelected()); | |
338 | fprintf(pF," pCocktail->AddGenerator(pBox1,\"box1\",1);\n\n"); | |
339 | } | |
340 | if(fGenBG->GetButton(kBox7)->GetState()==kButtonDown){//7 boxes towards 7 RICH chambers | |
341 | fprintf(pF," AliGenCocktail *pCocktail=new AliGenCocktail();\n"); | |
342 | fprintf(pF," for(int i=1;i<=7;i++){\n"); | |
343 | fprintf(pF," AliGenBox *pGen=new AliGenBox(1);\n"); | |
344 | fprintf(pF," pGen->SetPart(%i); pGen->SetMomentumRange(%.1f,%.1f); \n",fGenPidCO->GetSelected(),float(fGenPminCO->GetSelected())/10,float(fGenPmaxCO->GetSelected())/10); | |
345 | fprintf(pF," pGen->SetThetaRange(pRICH->C(i)->ThetaD()-3,pRICH->C(i)->ThetaD()-1); pGen->SetPhiRange(pRICH->C(i)->PhiD()-1,pRICH->C(i)->PhiD()+1); \n"); | |
346 | fprintf(pF," pCocktail->AddGenerator(pGen,Form(\"Box %i\",i),1);\n }\n\n"); | |
347 | } | |
348 | if(fGenBG->GetButton(kHijing)->GetState()==kButtonDown){//normal HIJING | |
349 | fprintf(pF," AliGenHijing *pHij=new AliGenHijing(-1); pHij->SetEnergyCMS(5500); pHij->SetReferenceFrame(\"CMS\");\n"); | |
350 | fprintf(pF," pHij->SetProjectile(\"A\", 208, 82); pHij->SetTarget(\"A\", 208, 82);\n"); | |
351 | fprintf(pF," pHij->SetJetQuenching(0); pHij->SetShadowing(0);\n"); | |
352 | fprintf(pF," pHij->KeepFullEvent(); pHij->SetSelectAll(0); \n"); | |
353 | fprintf(pF," pHij->SetImpactParameterRange(0, 5); //fermi\n"); | |
354 | fprintf(pF," pCocktail->AddGenerator(pHij,\"hijing\",1);\n\n"); | |
355 | } | |
356 | if(fGenBG->GetButton(kHijingPara)->GetState()==kButtonDown){//parametrized HIJING | |
357 | fprintf(pF," AliGenHIJINGpara *pGen=new AliGenHIJINGpara(%i);\n",(int)fGenNprimCO->GetSelected()); | |
358 | fprintf(pF," pHijPara->SetMomentumRange(0,999); pHijPara->SetThetaRange(%f,%f); pHijPara->SetPhiRange(0,360);\n",Eta2Theta(8),Eta2Theta(-8)); | |
359 | fprintf(pF," pCocktail->AddGenerator(pHijPara,\"hijing para\",1);\n\n"); | |
360 | } | |
361 | if(fGenBG->GetButton(kPythia)->GetState()==kButtonDown){//Pythia + 7 guns towards 7 RICH chambers | |
362 | fprintf(pF," AliGenPythia *pPythia = new AliGenPythia(-1);\n"); | |
363 | fprintf(pF," pPythia->SetMomentumRange(0,999); pPythia->SetPhiRange(20,80); pPythia->SetThetaRange(75,115);\n"); | |
364 | fprintf(pF," pPythia->SetYRange(-12,12); pPythia->SetPtRange(0,1000); pPythia->SetStrucFunc(kCTEQ4L);\n"); | |
365 | fprintf(pF," pPythia->SetProcess(kPyMb); pPythia->SetEnergyCMS(14000);\n"); | |
366 | fprintf(pF," pCocktail->AddGenerator(pPythia,\"Pythia\",1);\n\n"); | |
367 | } | |
368 | fprintf(pF," pCocktail->Init();\n"); | |
369 | }//WriteGenerator() | |
370 | //__________________________________________________________________________________________________ | |
371 | void RichConfig::GuiDet(TGHorizontalFrame *pMainHF) | |
372 | { | |
373 | pMainHF->AddFrame(fDetBG=new TGButtonGroup(pMainHF,"Detectors")); | |
374 | fDetBG->Connect("Pressed(Int_t)" ,"RichConfig",this,"DetAddSlot(Int_t)"); | |
375 | fDetBG->Connect("Released(Int_t)","RichConfig",this,"DetRemSlot(Int_t)"); | |
376 | new TGCheckButton(fDetBG,"PIPE" ,kPIPE)); new TGCheckButton(fDetBG,"ITS" ,kITS)); new TGCheckButton(fDetBG,"TPC" ,kTPC)); | |
377 | new TGCheckButton(fDetBG,"TRD" ,kTRD)); new TGCheckButton(fDetBG,"TOF" ,kTOF)); new TGCheckButton(fDetBG,"FRAME" ,kFRAME)); | |
378 | new TGCheckButton(fDetBG,"MAG" ,kMAG)); new TGCheckButton(fDetBG,"CRT" ,kCRT)); new TGCheckButton(fDetBG,"HALL" ,kHALL)); | |
379 | new TGCheckButton(fDetBG,"PHOS" ,kPHOS)); new TGCheckButton(fDetBG,"START" ,kSTART)); new TGCheckButton(fDetBG,"FMD" ,kFMD)); | |
380 | new TGCheckButton(fDetBG,"ABSO" ,kABSO)); new TGCheckButton(fDetBG,"PMD" ,kPMD)); new TGCheckButton(fDetBG,"DIPO" ,kDIPO)); | |
381 | new TGCheckButton(fDetBG,"EMCAL" ,kEMCAL)); new TGCheckButton(fDetBG,"VZERO" ,kVZERO)); new TGCheckButton(fDetBG,"MUON" ,kMUON)); | |
382 | new TGCheckButton(fDetBG,"ZDC" ,kZDC)); new TGCheckButton(fDetBG,"SHILD" ,kSHILD)); | |
383 | } | |
384 | //__________________________________________________________________________________________________ | |
385 | void RichConfig::DetAddSlot(Int_t id) | |
386 | {//slot is invoked when any detector check button is pressed | |
387 | if(id==kTRD || id==kTOF) //TRD and TOF geometries depend on FRAME | |
388 | fDetBG->SetButton(kFRAME); | |
389 | } | |
390 | //__________________________________________________________________________________________________ | |
391 | void RichConfig::DetRemSlot(Int_t id) | |
392 | {//slot is invoked when any detector check button is released | |
393 | if(id==kFRAME){ | |
394 | fDetBG->SetButton(kTRD,kFALSE); //switch off TRD and TOF when FRAME is switched off by user hence TRD&TOF depend on FRAME | |
395 | fDetBG->SetButton(kTOF,kFALSE); | |
396 | } | |
397 | } | |
398 | //__________________________________________________________________________________________________ | |
399 | void RichConfig::WriteDet(FILE *pF) | |
400 | { | |
401 | //central detectors | |
402 | if(fDetBG->GetButton(kPIPE )->GetState()) fprintf(pF,"\n new AliPIPEv0(\"PIPE\",\"Beam Pipe\");\n"); | |
403 | if(fDetBG->GetButton(kSHILD)->GetState()) fprintf(pF,"\n new AliSHILv2(\"SHIL\",\"Shielding Version 2\");\n"); | |
0422a446 | 404 | if(fDetBG->GetButton(kITS )->GetState()){ |
f47d03bc | 405 | fprintf(pF,"\n AliITSvPPRasymmFMD *pIts =new AliITSvPPRasymmFMD(\"ITS\",\"ITS PPR detailed version\");\n"); |
406 | fprintf(pF," pIts->SetMinorVersion(2); pIts->SetReadDet(kTRUE);\n"); | |
407 | fprintf(pF," pIts->SetThicknessDet1(200.); pIts->SetThicknessDet2(200.);\n"); | |
408 | fprintf(pF," pIts->SetThicknessChip1(200.); pIts->SetThicknessChip2(200.);\n"); | |
409 | fprintf(pF," pIts->SetRails(0); pIts->SetCoolingFluid(1);\n"); | |
410 | fprintf(pF," pIts->SetEUCLID(0);\n"); | |
0422a446 | 411 | } |
f47d03bc | 412 | if(fDetBG->GetButton(kTPC )->GetState()) {fprintf(pF,"\n AliTPC *pTpc=new AliTPCv2(\"TPC\",\"Default\"); pTpc->SetSecAU(-1);pTpc->SetSecAL(-1);\n");} |
413 | if(fDetBG->GetButton(kFRAME)->GetState()) fprintf(pF,"\n AliFRAMEv2 *pFrame=new AliFRAMEv2(\"FRAME\",\"Space Frame\"); pFrame->SetHoles(1);\n"); | |
0422a446 | 414 | if(fDetBG->GetButton(kTRD )->GetState()) { |
f47d03bc | 415 | fprintf(pF,"\n AliTRD *pTrd=new AliTRDv1(\"TRD\",\"TRD slow simulator\");\n"); |
416 | fprintf(pF," pTrd->SetGasMix(1); pTrd->SetPHOShole(); pTrd->SetRICHhole();pTrd->CreateTR();\n"); | |
0422a446 | 417 | } |
f47d03bc | 418 | if(fDetBG->GetButton(kTOF )->GetState()) fprintf(pF,"\n new AliTOFv4T0(\"TOF\", \"normal TOF\");\n"); |
419 | //central detectors | |
420 | if(fDetBG->GetButton(kMAG )->GetState()) fprintf(pF,"\n new AliMAG(\"MAG\",\"Magnet\");\n"); | |
421 | if(fDetBG->GetButton(kHALL )->GetState()) fprintf(pF,"\n new AliHALL(\"HALL\",\"Alice Hall\");\n"); | |
0422a446 | 422 | //forward detectors |
f47d03bc | 423 | if(fDetBG->GetButton(kFMD )->GetState()) fprintf(pF,"\n new AliFMDv1(\"FMD\",\"normal FMD\");\n"); |
424 | if(fDetBG->GetButton(kABSO )->GetState()) fprintf(pF,"\n new AliABSOv0(\"ABSO\",\"Muon absorber\");\n"); | |
425 | if(fDetBG->GetButton(kDIPO )->GetState()) fprintf(pF,"\n new AliDIPOv2(\"DIPO\",\"Dipole version 2\");\n"); | |
426 | if(fDetBG->GetButton(kMUON )->GetState()) fprintf(pF,"\n new AliMUONv1(\"MUON\",\"default\");\n"); | |
427 | if(fDetBG->GetButton(kPMD )->GetState()) fprintf(pF,"\n new AliPMDv1(\"PMD\",\"normal PMD\");\n"); | |
428 | if(fDetBG->GetButton(kSTART)->GetState()) fprintf(pF,"\n new AliSTARTv1(\"START\",\"START Detector\");\n"); | |
429 | if(fDetBG->GetButton(kVZERO)->GetState()) fprintf(pF,"\n new AliVZEROv2(\"VZERO\",\"normal VZERO\");\n"); | |
430 | if(fDetBG->GetButton(kZDC )->GetState()) fprintf(pF,"\n new AliZDCv2(\"ZDC\",\"normal ZDC\");\n"); | |
0422a446 | 431 | //different phase space detectors |
f47d03bc | 432 | if(fDetBG->GetButton(kPHOS )->GetState()) fprintf(pF,"\n new AliPHOSv1(\"PHOS\",\"IHEP\");\n"); |
433 | if(fDetBG->GetButton(kEMCAL)->GetState()) fprintf(pF,"\n new AliEMCALv1(\"EMCAL\",\"G56_2_55_19_104_14\");\n"); | |
434 | if(fDetBG->GetButton(kCRT )->GetState()) fprintf(pF,"\n new AliCRTv0(\"CRT\",\"normal ACORDE\");\n"); | |
435 | } | |
0422a446 | 436 | //__________________________________________________________________________________________________ |
f47d03bc | 437 | void RichConfig::GuiBatch(TGHorizontalFrame *pMainF) |
0422a446 | 438 | { |
f47d03bc | 439 | TGGroupFrame *pSimF=new TGGroupFrame(pMainF,"Simu"); pMainF->AddFrame(pSimF); |
440 | pSimF->AddFrame(fSimBG=new TGButtonGroup(pSimF,"" )); | |
441 | new TGCheckButton(fSimBG, "Primary" ,kPrim )); fSimBG->SetButton(kPrim); | |
442 | new TGCheckButton(fSimBG, "Transport" ,kTransport)); fSimBG->SetButton(kTransport); | |
443 | pSimF->AddFrame (fSDigBG=new TGButtonGroup(pSimF,"" )); | |
444 | new TGRadioButton(fSDigBG, "No SDigits" ,kNo )); | |
445 | new TGRadioButton(fSDigBG, "SDigits ALL" ,kAll )); | |
446 | new TGRadioButton(fSDigBG, "SDigits RICH" ,kOnly )); fSDigBG->SetButton(kOnly); | |
447 | pSimF->AddFrame (fDigBG=new TGButtonGroup(pSimF,"" )); | |
448 | new TGRadioButton(fDigBG, "No Digits" ,kNo )); | |
449 | new TGRadioButton(fDigBG, "Digits ALL" ,kAll )); | |
450 | new TGRadioButton(fDigBG, "Digits RICH" ,kOnly )); fDigBG->SetButton(kOnly); | |
451 | pSimF->AddFrame(fRawBG=new TGButtonGroup(pSimF,"" )); | |
452 | new TGRadioButton(fRawBG, "No RAW files" ,kNo )); fRawBG->SetButton(kNo); | |
453 | new TGRadioButton(fRawBG, "RAW DDL" ,kRawDdl )); | |
454 | new TGRadioButton(fRawBG, "RAW DATE" ,kRawDate )); | |
455 | new TGRadioButton(fRawBG, "RAW ROOT" ,kRawRoot )); | |
456 | ||
457 | TGCompositeFrame *pRecF=new TGGroupFrame(pMainF,"Reco"); pMainF->AddFrame(pRecF); | |
458 | pRecF->AddFrame(fClusBG=new TGButtonGroup(pRecF,"" )); | |
459 | new TGRadioButton(fClusBG, "No Clusters" ,kNo )); | |
460 | new TGRadioButton(fClusBG, "Clusters ALL" ,kAll )); | |
461 | new TGRadioButton(fClusBG, "Clusters RICH" ,kOnly )); fClusBG->SetButton(kOnly); | |
462 | pRecF->AddFrame(fRecoBG=new TGButtonGroup(pRecF,"" )); | |
463 | new TGCheckButton(fRecoBG, "Find vertex" ,kVertex )); | |
464 | new TGCheckButton(fRecoBG, "Find ESD tracks" ,kTrack )); | |
465 | new TGCheckButton(fRecoBG, "Add info ESD" ,kEsd )); | |
466 | } | |
473cb33a | 467 | //__________________________________________________________________________________________________ |
f47d03bc | 468 | void RichConfig::WriteBatch() |
469 | {//creates Batch.C file | |
470 | char *sBatchName="RichBatch"; | |
471 | FILE *fp=fopen(Form("%s.C",sBatchName),"w"); if(!fp){Info("CreateBatch","Cannot open output file: %s.C",sBatchName);return;} | |
9e26f77a | 472 | //header and debug |
f47d03bc | 473 | fprintf(fp,"void %s(const Int_t iNevents,const Bool_t isDebug,const char *sConfigFileName)\n{\n",sBatchName); |
474 | fprintf(fp," gSystem->Exec(\"rm -rf *.root hlt hough fort* raw* ZZZ*\");\n"); | |
475 | fprintf(fp," if(isDebug) AliLog::SetGlobalDebugLevel(AliLog::kDebug);\n"); | |
476 | fprintf(fp," gBenchmark->Start(\"ALICE\");\n TDatime time;\n\n"); | |
9e26f77a | 477 | //simulation section |
f47d03bc | 478 | fprintf(fp," AliSimulation *pSim=new AliSimulation(sConfigFileName);\n"); |
479 | //generate initial kinematics | |
480 | if(fSimBG->GetButton(kPrim)->GetState()) | |
481 | fprintf(fp," pSim->SetRunGeneration(kTRUE); //initial kinematics generated\n"); | |
482 | else | |
483 | fprintf(fp," pSim->SetRunGeneration(kFALSE); //no initial kinematics generated\n"); | |
484 | //transport and hit creations | |
485 | if(fSimBG->GetButton(kTransport)->GetState()) | |
486 | fprintf(fp," pSim->SetRunSimulation(kTRUE); //transport and hits creation\n"); | |
487 | else | |
488 | fprintf(fp," pSim->SetRunSimulation(kFALSE); //no transport and hits creation\n"); | |
489 | //sdigits | |
490 | if (fSDigBG->GetButton(kNo) ->GetState()) fprintf(fp," pSim->SetMakeSDigits(\"\"); //no sdigits created\n"); | |
491 | else if(fSDigBG->GetButton(kAll) ->GetState()) fprintf(fp," pSim->SetMakeSDigits(\"ALL\"); //sdigits created for ALL\n"); | |
492 | else if(fSDigBG->GetButton(kOnly) ->GetState()) fprintf(fp," pSim->SetMakeSDigits(\"RICH\"); //sdigits created for RICH\n"); | |
493 | //digits | |
494 | if (fDigBG->GetButton(kNo) ->GetState()) fprintf(fp," pSim->SetMakeDigits(\"\"); //no digits created\n"); | |
495 | else if(fDigBG->GetButton(kAll) ->GetState()) fprintf(fp," pSim->SetMakeDigits(\"ALL\"); //digits created for all detectors\n"); | |
496 | else if(fDigBG->GetButton(kOnly) ->GetState()) fprintf(fp," pSim->SetMakeDigits(\"RICH\"); //digits created for RICH\n"); | |
497 | //raw data generation | |
498 | if (fRawBG->GetButton(kRawDdl)->GetState()) fprintf(fp," pSim->SetWriteRawData(\"ALL\"); //raw data in DDL format for ALL\n"); | |
499 | else if(fRawBG->GetButton(kRawDate)->GetState()) fprintf(fp," pSim->SetWriteRawData(\"ALL\",\".date\");//raw data in DATE format for ALL\n"); | |
500 | else if(fRawBG->GetButton(kRawRoot)->GetState()) fprintf(fp," pSim->SetWriteRawData(\"ALL\",\".root\");//raw data in ROOT format for ALL\n"); | |
9e26f77a | 501 | |
f47d03bc | 502 | fprintf(fp," pSim->Run(iNevents);\n delete pSim;\n\n"); |
9e26f77a | 503 | //reconstraction section |
f47d03bc | 504 | if(!fClusBG->GetButton(kNo)->GetState()){ |
505 | fprintf(fp," AliReconstruction *pRec=new AliReconstruction;\n"); | |
506 | if (fClusBG->GetButton(kAll) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"ALL\"); //run cluster creation for ALL\n"); | |
507 | else if(fClusBG->GetButton(kOnly) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"RICH\"); //run cluster creation for RICH\n"); | |
508 | ||
509 | if(fRecoBG->GetButton(kVertex)->GetState()) | |
510 | fprintf(fp," pRec->SetRunVertexFinder(kTRUE); //run ESD vertex task\n"); | |
511 | else | |
512 | fprintf(fp," pRec->SetRunVertexFinder(kFALSE); //not run ESD vertex task\n"); | |
513 | ||
514 | if(fRecoBG->GetButton(kTrack)->GetState()) | |
515 | fprintf(fp," pRec->SetRunTracking(\"ITS TPC TRD TOF RICH\"); //run ESD track task\n"); | |
516 | else | |
517 | fprintf(fp," pRec->SetRunTracking(\"\"); //not run ESD track task\n"); | |
518 | ||
519 | if(fRecoBG->GetButton(kEsd)->GetState()) | |
520 | fprintf(fp," pRec->SetFillESD(\"ITS TPC TRD TOF RICH\"); //run ESD add info task\n"); | |
521 | else | |
522 | fprintf(fp," pRec->SetFillESD(\"\"); //not run ESD add info task\n"); | |
523 | ||
524 | ||
525 | fprintf(fp," pRec->Run();delete pRec;\n\n"); | |
473cb33a | 526 | } |
9e26f77a | 527 | //benchmarks |
f47d03bc | 528 | fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <my/Batch.C>: Start time: \";time.Print();\n"); |
529 | fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <my/Batch.C>: Stop time: \";time.Set(); time.Print();\n"); | |
530 | fprintf(fp," gBenchmark->Show(\"ALICE\");\n"); | |
473cb33a | 531 | |
f47d03bc | 532 | fprintf(fp," gSystem->Exec(\"play -c 2 ~/.kde/my/end.wav\");\n"); |
533 | fprintf(fp," gSystem->Exec(\"touch ZZZ______finished_______ZZZ\");\n}\n"); | |
473cb33a | 534 | fclose(fp); |
f47d03bc | 535 | }//WriteBatch() |
473cb33a | 536 | //__________________________________________________________________________________________________ |
f47d03bc | 537 | void RichConfig::ExitSlot() |
473cb33a | 538 | { |
539 | //slot to be invoked by clik on the Create button | |
f47d03bc | 540 | WriteConfig(); |
541 | WriteBatch(); | |
8493d0aa | 542 | SendCloseMessage(); |
f47d03bc | 543 | gApplication->Terminate(0); |
473cb33a | 544 | } |
545 | //__________________________________________________________________________________________________ | |
f47d03bc | 546 | void RichConfig::WriteConfig() |
547 | { | |
548 | FILE *pF=fopen(fFileName,"w"); if(!pF){Info("CreateConfigFile","Cannot open output file:%sn",fFileName);return;} | |
549 | ||
550 | fprintf(pF,"void Config()\n"); | |
551 | fprintf(pF,"{\n"); | |
552 | fprintf(pF,"\n ::Info(\"\\n\\n\\n----------> RICH private config\",\"Start\");\n"); | |
553 | //Random | |
554 | fprintf(pF," gRandom->SetSeed(123456);//put 0 to use system time\n\n"); | |
555 | //Geant | |
556 | fprintf(pF," gSystem->Load(\"libgeant321\");\n"); | |
557 | fprintf(pF," new TGeant3TGeo(\"C++ Interface to Geant3\");\n\n"); | |
558 | //File | |
559 | fprintf(pF," AliRunLoader *pAL=AliRunLoader::Open(\"galice.root\",AliConfig::GetDefaultEventFolderName(),\"recreate\");\n"); | |
560 | fprintf(pF," pAL->SetCompressionLevel(2);\n"); | |
561 | fprintf(pF," pAL->SetNumberOfEventsPerFile(1000);\n"); | |
562 | fprintf(pF," gAlice->SetRunLoader(pAL);\n\n"); | |
563 | //Decayer | |
564 | fprintf(pF," TVirtualMCDecayer *pDecayer=new AliDecayerPythia();\n"); | |
565 | fprintf(pF," pDecayer->SetForceDecay(kAll);\n"); | |
566 | fprintf(pF," pDecayer->Init();\n"); | |
567 | fprintf(pF," gMC->SetExternalDecayer(pDecayer);\n\n"); | |
568 | ||
569 | WritePhys(pF); //physics processes | |
570 | ||
571 | //Field | |
572 | if(fMagB->GetState()==kButtonDown) | |
573 | fprintf(pF," gAlice->SetField();\n\n"); | |
574 | else | |
575 | fprintf(pF," gAlice->SetField(0);\n\n"); | |
576 | fprintf(pF," pAL->CdGAFile();\n\n"); //???? | |
577 | //BODY-ALIC | |
578 | fprintf(pF," new AliBODY(\"BODY\",\"Alice envelop\");\n\n"); | |
579 | ||
580 | WriteRich(pF); //private RICH part | |
581 | WriteGen(pF);//generator | |
582 | WriteDet(pF); //other detectors | |
583 | //end of Config.C file: | |
584 | fprintf(pF,"\n ::Info(\"----------> RICH private config\",\"Stop\\n\\n\\n\");\n"); | |
585 | fprintf(pF,"}\n"); | |
586 | fclose(pF); | |
587 | }//WriteConfig() | |
588 | ||
589 | ||
590 | RichConfig *kir=0; | |
591 | //__________________________________________________________________________________________________ | |
473cb33a | 592 | void RichConfig() |
593 | { | |
f47d03bc | 594 | kir=new RichConfig("Config.C"); |
473cb33a | 595 | } |