Adding the new Qmax and Qtot histograms
[u/mrichter/AliRoot.git] / HMPID / Hconfig.C
CommitLineData
e4290ede 1//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
e4290ede 2
3
6453cfc6 4#include <TPDGCode.h>
5
ad09b4ea 6Bool_t gGun1 =kFALSE;
7Bool_t gGun7 =kFALSE;
8Bool_t gGunZ =kFALSE;
9Bool_t gBox =kFALSE;
10Bool_t gHijing =kFALSE;
11Bool_t gHijingPara=kFALSE;
12Bool_t gPythia =kFALSE;
13
6453cfc6 14class HmpConfig : public TGMainFrame
15{
16RQ_OBJECT()
17public:
18 HmpConfig(const char*sFileName);
19 ~HmpConfig() {Info("ctor","");Cleanup();}
20
65201c45 21 enum EVersOpts {kNo=101,kVer0,kVer1,kVer2,kVer3,kTest, kDeclust=301,kSagita,kFeedback,kElNoise,kQe0=400,kQeNorm,kFlatIdx,kOptics};
6453cfc6 22 enum EGenTypes {kGunZ=1,kGun1,kGun7,kBox,kHijing,kHijingPara,kPythia,kHmpLib,kNotUsed=999};
23
24 enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kACORDE,kHALL,kPHOS,kT0,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD};
25 enum EProcesses {kDCAY=1,kPAIR,kCOMP,kPHOT,kPFIS,kDRAY,kANNI,kBREM,kMUNU,kCKOV,kHADR,kLOSS,kMULS,kRAYL,kALL};
55a829a5 26 enum EBatchFlags{kAll=55,kHmp,kDdl,kDat,kRoo,kVtx,kTrk,kHlt,kPid,kAln,kRecoPar};
6453cfc6 27 enum EMagField {kFld0,kFld2,kFld4,kFld5,kFld_2,kFld_4,kFld_5};
28
29 Float_t Eta2Theta (Float_t arg) const{return (180./TMath::Pi())*2.*TMath::ATan(TMath::Exp(-arg));}
30
31 void GuiHmp (TGHorizontalFrame *pMainF); void WriteHmp (FILE *pF); void HmpSlot (Int_t ver);
32 void GuiPhys (TGHorizontalFrame *pMainF); void WritePhys (FILE *pF); void PhysAddSlot(Int_t); void PhysRemSlot(Int_t);
33 void GuiGen (TGCompositeFrame *pMainF); void WriteGen (FILE *pF); void GenAddSlot (Int_t); void GenRemSlot (Int_t);
34 void GuiDet (TGHorizontalFrame *pMainF); void WriteDet (FILE *pF); void DetAddSlot (Int_t); void DetRemSlot (Int_t);
35 void GuiBatch(TGHorizontalFrame *pMainF); void WriteBatch( ); void SlotBatch (Int_t); void SlotRec (Bool_t);
36
37 void WriteConfig();
38 void ExitSlot();
39
40 TGButtonGroup *fVerBG,*fOptBG,*fQeBG; //Hmp widgets
41 TGButtonGroup *fMagBG; //mag field widgets
42 TGButton *fDecayerB; //external decayer widgets
43
44 TGComboBox *fGenPidCO,*fGenPminCO,*fGenPmaxCO,*fGenChamCO,*fGenNprimCO; //generator widgets combos
45 TGCompositeFrame *fGenF; //generator widgets frames
46 TGButtonGroup *fGenBG; //generator widgets
47
48 TGButtonGroup *fDetBG,*fProcBG; //detectors and processes sections
49 TGCheckButton *fSimB,*fTraB; TGButtonGroup *fSdiBG,*fDigBG,*fRawBG; //sim section
50 TGCheckButton *fRecB; TGButtonGroup *fInpBG,*fCluBG,*fTrkBG; //rec section
51 //batch control widgets
52
53 char *fFileName;
54};//class HmpConfig
55//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56HmpConfig::HmpConfig(const char *sFileName):TGMainFrame(gClient->GetRoot(),700,400)
57{
58 fFileName=sFileName;
59
60 AddFrame(pMainF=new TGHorizontalFrame(this,100,200)); //main horizontal frame
61
62 GuiHmp (pMainF);
63 GuiGen (pMainF);
64 GuiDet (pMainF);
65 GuiPhys (pMainF);
66 GuiBatch(pMainF);
67
68//File
69 AddFrame(pFileHF=new TGHorizontalFrame(this,100,200));
70 pFileHF->AddFrame(pCrtTB=new TGTextButton(pFileHF,"Create"));
71 pCrtTB->Connect("Clicked()","HmpConfig",this,"ExitSlot()");
72 pFileHF->AddFrame(new TGLabel(pFileHF,Form(" config file as %s",fFileName)));
73
74 MapSubwindows();
75 Resize(GetDefaultSize());
76 SetWindowName("Create AliROOT scripts");
77 MapWindow();
78}//ctor
79//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
80void HmpConfig::GuiHmp(TGHorizontalFrame *pMainHF)
81{
82 pMainHF->AddFrame(pLeftVF=new TGVerticalFrame(pMainHF,100,200));
83 pLeftVF->AddFrame(pHmpGF=new TGGroupFrame(pLeftVF,"HMPID"));
84 pHmpGF->AddFrame(fVerBG=new TGButtonGroup(pHmpGF,"")); fVerBG->Connect("Pressed(Int_t)" ,"HmpConfig",this,"HmpVerSlot(Int_t)");
85 new TGRadioButton(fVerBG, "No" ,kNo );
86 new TGRadioButton(fVerBG, "ver0" ,kVer0 );
12419ec4 87 new TGRadioButton(fVerBG, "ver1" ,kVer1 );
65201c45 88 new TGRadioButton(fVerBG, "ver2" ,kVer2 );
89 new TGRadioButton(fVerBG, "ver3" ,kVer3 ); fVerBG->SetButton(kVer3);
6453cfc6 90 pHmpGF->AddFrame(fOptBG=new TGButtonGroup(pHmpGF,"")); fOptBG->Connect("Pressed(Int_t)" ,"HmpConfig",this,"HmpVerSlot(Int_t)");
27311693 91 new TGCheckButton(fOptBG,"Test run position" ,kTest);
92 new TGCheckButton(fOptBG,"Unfold cluster " ,kDeclust); fOptBG->SetButton(kDeclust);
93 new TGCheckButton(fOptBG,"Wire sagitta " ,kSagita); fOptBG->SetButton(kSagita);
94 new TGCheckButton(fOptBG,"Photon feedback " ,kFeedback); fOptBG->SetButton(kFeedback);
95 new TGCheckButton(fOptBG,"Electronic noise " ,kElNoise); // fOptBG->SetButton(kElNoise);
59d9d4b3 96 new TGCheckButton(fOptBG,"C6F14 N=1.292 " ,kFlatIdx);
27311693 97 new TGCheckButton(fOptBG,"Plot optics " ,kOptics);
6453cfc6 98 pHmpGF->AddFrame(fQeBG=new TGButtonGroup(pHmpGF,""));
99 new TGRadioButton(fQeBG,"QE=0" ,kQe0);
100 new TGRadioButton(fQeBG,"QE normal" ,kQeNorm); fQeBG->SetButton(kQeNorm);
101 pLeftVF->AddFrame(fDecayerB=new TGCheckButton(pLeftVF,"Puthia decayer On/Off")); fDecayerB->SetState(kButtonDown);
102 pLeftVF->AddFrame(fMagBG=new TGButtonGroup(pLeftVF,"Mag field"));
103 new TGRadioButton(fMagBG, "0.5 T" ,kFld5 );
104 new TGRadioButton(fMagBG, "0.4 T" ,kFld4 );
105 new TGRadioButton(fMagBG, "0.2 T" ,kFld2 ); fMagBG->SetButton(kFld2);
106 new TGRadioButton(fMagBG, "0 T" ,kFld0 );
107 new TGRadioButton(fMagBG, "-0.2 T" ,kFld_2 );
108 new TGRadioButton(fMagBG, "-0.4 T" ,kFld_4 );
109 new TGRadioButton(fMagBG, "-0.5 T" ,kFld_5 );
110}//Hmp()
111//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
112void HmpConfig::HmpVerSlot(Int_t ver)
113{
114 if(ver==kTest) {fMagBG->SetButton(kFld0); fGenBG->SetButton(kGunZ); }
115}
116//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
117void HmpConfig::WriteHmp(FILE *pF)
118{
119 if(!fVerBG->GetButton(kNo)->GetState()){
120 TString title;
27311693 121 if(!fOptBG->GetButton(kSagita) ->GetState()) fprintf(pF," AliHMPIDParam::fgIsWireSagita=kFALSE;\n");
59d9d4b3 122 if(!fOptBG->GetButton(kFeedback)->GetState()) title+=" NoFeedBack ";
27311693 123 if( fOptBG->GetButton(kElNoise) ->GetState()) fprintf(pF," AliHMPIDDigitizer::DoNoise(kTRUE);\n");
124 if( fOptBG->GetButton(kTest) ->GetState()) title+=" TestBeam ";
125 if( fOptBG->GetButton(kOptics) ->GetState()) title+=" ShowOptics ";
59d9d4b3 126 if( fOptBG->GetButton(kFlatIdx) ->GetState()) title+=" FlatIdx ";
6453cfc6 127 if(title.Length()==0) title="Default";
128
129 if (fVerBG->GetButton(kVer0)->GetState()) fprintf(pF," new AliHMPIDv0(\"Gel %s\");\n\n",title.Data());
130 else if(fVerBG->GetButton(kVer1)->GetState()) fprintf(pF," new AliHMPIDv1(\"HMPID\",\"%s\");\n\n",title.Data());
2451b455 131 else if(fVerBG->GetButton(kVer2)->GetState()) fprintf(pF," new AliHMPIDv2(\"HMPID\",\"%s\");\n\n",title.Data());
65201c45 132 else if(fVerBG->GetButton(kVer3)->GetState()) fprintf(pF," new AliHMPIDv3(\"HMPID\",\"%s\");\n\n",title.Data());
6453cfc6 133 }
134}
135//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
136void HmpConfig::GuiPhys(TGHorizontalFrame *pMainHF)
137{
138 pMainHF->AddFrame(fProcBG=new TGButtonGroup(pMainHF,"Procs"));
139 fProcBG->Connect("Pressed(Int_t)" ,"HmpConfig",this,"PhysAddSlot(Int_t)");
140 fProcBG->Connect("Released(Int_t)","HmpConfig",this,"PhysRemSlot(Int_t)");
141 new TGCheckButton(fProcBG,"ALL ON/OFF" ,kALL)) ;
142 new TGCheckButton(fProcBG,"DCAY Decay" ,kDCAY)); fProcBG->SetButton(kDCAY);
143 new TGCheckButton(fProcBG,"PAIR Pair production" ,kPAIR)); fProcBG->SetButton(kPAIR);
144 new TGCheckButton(fProcBG,"COMP Compton" ,kCOMP)); fProcBG->SetButton(kCOMP);
145 new TGCheckButton(fProcBG,"PHOT" ,kPHOT)); fProcBG->SetButton(kPHOT);
146 new TGCheckButton(fProcBG,"PFIS Photofission" ,kPFIS));
147 new TGCheckButton(fProcBG,"DRAY Delta electrons" ,kDRAY));
148 new TGCheckButton(fProcBG,"ANNI Annihilation" ,kANNI)); fProcBG->SetButton(kANNI);
149 new TGCheckButton(fProcBG,"BREM Bremstraslung" ,kBREM)); fProcBG->SetButton(kBREM);
150 new TGCheckButton(fProcBG,"MUNU Muon-Nuclear" ,kMUNU)); fProcBG->SetButton(kMUNU);
151 new TGCheckButton(fProcBG,"CKOV Cerenkovs" ,kCKOV)); fProcBG->SetButton(kCKOV);
152 new TGCheckButton(fProcBG,"HADR Hadronic interactions " ,kHADR)); fProcBG->SetButton(kHADR);
153 new TGCheckButton(fProcBG,"LOSS Energy losses" ,kLOSS)); fProcBG->SetButton(kLOSS);
154 new TGCheckButton(fProcBG,"MULS Multiple scattering" ,kMULS)); fProcBG->SetButton(kMULS);
155 new TGCheckButton(fProcBG,"RAYL Rayleigh scattering" ,kRAYL)); fProcBG->SetButton(kRAYL);
156}
157//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
158void HmpConfig::PhysAddSlot(Int_t id)
159{//slot is invoked when any of physics check button is pressed
160 if(id==kALL) //if the pressed check button is kALL then switch on all the buttons
161 for(int i=1;i<=fProcBG->GetCount();i++)
162 fProcBG->SetButton(i,kButtonDown);
163}
164//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
165void HmpConfig::PhysRemSlot(Int_t id)
166{//slot is invoked when any of physics check button is released
167 if(id==kALL) //if the released check button is kALL then switch off all the buttons
168 for(int i=1;i<=fProcBG->GetCount();i++)
169 fProcBG->SetButton(i,kButtonUp);
170}
171//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
172void HmpConfig::WritePhys(FILE *pF)
173{
174 if(fProcBG->GetButton(kDCAY)->GetState()) fprintf(pF," gMC->SetProcess(\"DCAY\",1); ");else fprintf(pF," gMC->SetProcess(\"DCAY\",0); ");
175 if(fProcBG->GetButton(kPAIR)->GetState()) fprintf(pF," gMC->SetProcess(\"PAIR\",1); ");else fprintf(pF," gMC->SetProcess(\"PAIR\",0); ");
176 if(fProcBG->GetButton(kCOMP)->GetState()) fprintf(pF," gMC->SetProcess(\"COMP\",1);\n");else fprintf(pF," gMC->SetProcess(\"COMP\",0);\n");
177 if(fProcBG->GetButton(kPHOT)->GetState()) fprintf(pF," gMC->SetProcess(\"PHOT\",1); ");else fprintf(pF," gMC->SetProcess(\"PHOT\",0); ");
178 if(fProcBG->GetButton(kPFIS)->GetState()) fprintf(pF," gMC->SetProcess(\"PFIS\",1); ");else fprintf(pF," gMC->SetProcess(\"PFIS\",0); ");
179 if(fProcBG->GetButton(kDRAY)->GetState()) fprintf(pF," gMC->SetProcess(\"DRAY\",1);\n");else fprintf(pF," gMC->SetProcess(\"DRAY\",0);\n");
180 if(fProcBG->GetButton(kANNI)->GetState()) fprintf(pF," gMC->SetProcess(\"ANNI\",1); ");else fprintf(pF," gMC->SetProcess(\"ANNI\",0); ");
181 if(fProcBG->GetButton(kBREM)->GetState()) fprintf(pF," gMC->SetProcess(\"BREM\",1); ");else fprintf(pF," gMC->SetProcess(\"BREM\",0); ");
182 if(fProcBG->GetButton(kMUNU)->GetState()) fprintf(pF," gMC->SetProcess(\"MUNU\",1);\n");else fprintf(pF," gMC->SetProcess(\"MUNU\",0);\n");
183 if(fProcBG->GetButton(kCKOV)->GetState()) fprintf(pF," gMC->SetProcess(\"CKOV\",1); ");else fprintf(pF," gMC->SetProcess(\"CKOV\",0); ");
184 if(fProcBG->GetButton(kHADR)->GetState()) fprintf(pF," gMC->SetProcess(\"HADR\",1); ");else fprintf(pF," gMC->SetProcess(\"HADR\",0); ");
185 if(fProcBG->GetButton(kLOSS)->GetState()) fprintf(pF," gMC->SetProcess(\"LOSS\",2);\n");else fprintf(pF," gMC->SetProcess(\"LOSS\",0);\n");
186 if(fProcBG->GetButton(kMULS)->GetState()) fprintf(pF," gMC->SetProcess(\"MULS\",1); ");else fprintf(pF," gMC->SetProcess(\"MULS\",0); ");
187 if(fProcBG->GetButton(kRAYL)->GetState()) fprintf(pF," gMC->SetProcess(\"RAYL\",1);\n");else fprintf(pF," gMC->SetProcess(\"RAYL\",0);\n");
188
189 fprintf(pF,"\n");
190 fprintf(pF," gMC->SetCut(\"CUTGAM\",0.001); "); fprintf(pF," gMC->SetCut(\"CUTELE\",0.001); "); fprintf(pF," gMC->SetCut(\"CUTNEU\",0.001);\n");
191 fprintf(pF," gMC->SetCut(\"CUTHAD\",0.001); "); fprintf(pF," gMC->SetCut(\"CUTMUO\",0.001); "); fprintf(pF," gMC->SetCut(\"BCUTE\" ,0.001);\n");
192 fprintf(pF," gMC->SetCut(\"BCUTM\" ,0.001); "); fprintf(pF," gMC->SetCut(\"DCUTE\" ,0.001); "); fprintf(pF," gMC->SetCut(\"DCUTM\" ,0.001);\n");
193 fprintf(pF," gMC->SetCut(\"PPCUTM\",0.001); "); fprintf(pF," gMC->SetCut(\"TOFMAX\",1e10);\n\n");
194}//WritePhys()
195//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
196void HmpConfig::GuiGen(TGCompositeFrame *pMainF)
197{//generator configurator implemented as group of radio buttons
198 pMainF->AddFrame(fGenF=new TGVerticalFrame(pMainF));//add generator vertical frame to horizontal main frame
199 fGenF->AddFrame(fGenBG=new TGButtonGroup(fGenF,"Gene"));//add type button group to vertical generator frame
200 fGenBG->Connect("Pressed(Int_t)","HmpConfig",this,"GenAddSlot(Int_t)"); fGenBG->Connect("Released(Int_t)","HmpConfig",this,"GenRemSlot(Int_t)");
201 new TGCheckButton(fGenBG,"gun along z" ,kGunZ);
202 new TGCheckButton(fGenBG,"gun to 1 chamber" ,kGun1);
203 new TGCheckButton(fGenBG,"gun to 7 chambers" ,kGun7);
204 new TGCheckButton(fGenBG,"box HMPID phase space" ,kBox );
205 new TGCheckButton(fGenBG,"HIJING" ,kHijing);
206 new TGCheckButton(fGenBG,"HIJING para" ,kHijingPara);
207 new TGCheckButton(fGenBG,"Pythia" ,kPythia);
208 new TGCheckButton(fGenBG,"HMPID lib" ,kHmpLib);
209//N prims for box and Hijing para
210 fGenF->AddFrame(fGenNprimCO=new TGComboBox(fGenF,100)); //add N prims combo to generator vertical frame
211 fGenNprimCO->AddEntry("not used" ,kNotUsed);
212 fGenNprimCO->AddEntry("N prim=1" ,1);
213 fGenNprimCO->AddEntry("N prim=2" ,2);
214 fGenNprimCO->AddEntry("N prim=5" ,5);
c770ceb9 215 fGenNprimCO->AddEntry("N prim=10" ,10);
216 fGenNprimCO->AddEntry("N prim=20" ,20);
217 fGenNprimCO->AddEntry("N prim=50" ,50);
6453cfc6 218 fGenNprimCO->AddEntry("N prim=100" ,100);
219 fGenNprimCO->AddEntry("N prim=500" ,500);
220 fGenNprimCO->AddEntry("N prim=1000" ,1000);
221 fGenNprimCO->AddEntry("N prim=10000",10000);
222 fGenNprimCO->AddEntry("N prim=80000",80000); fGenNprimCO->Resize(160,20); fGenNprimCO->Select(kNotUsed);
223//PID
224 fGenF->AddFrame(fGenPidCO=new TGComboBox(fGenF,100)); //add pid combo to generator vertical frame
225 fGenPidCO->AddEntry("not used" ,kNotUsed);
226 fGenPidCO->AddEntry("electron" ,kElectron);
227 fGenPidCO->AddEntry("positron" ,kPositron);
228 fGenPidCO->AddEntry("pion +" ,kPiPlus);
229 fGenPidCO->AddEntry("pion -" ,kPiMinus);
230 fGenPidCO->AddEntry("kaon +" ,kKPlus);
231 fGenPidCO->AddEntry("kaon -" ,kKMinus);
232 fGenPidCO->AddEntry("kaon 0" ,kK0Short);
233 fGenPidCO->AddEntry("proton" ,kProton);
234 fGenPidCO->AddEntry("antiproton" ,kProtonBar);
235 fGenPidCO->AddEntry("lambda" ,kLambda0);
236 fGenPidCO->AddEntry("antilambda" ,kLambda0Bar); fGenPidCO->Resize(160,20); fGenPidCO->Select(kNotUsed);
237//Pmin
238 fGenF->AddFrame(fGenPminCO=new TGComboBox(fGenF,100)); //add Pmin combo to generator vertical frame
239 fGenPminCO->AddEntry("not used",kNotUsed);
240 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);
241//Pmax
242 fGenF->AddFrame(fGenPmaxCO=new TGComboBox(fGenF,100)); //add Pmax combo to generator vertical frame
243 fGenPmaxCO->AddEntry("not used",kNotUsed);
244 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);
245//Chamber number
246 fGenF->AddFrame(fGenChamCO=new TGComboBox(fGenF,100)); //add chamber number combo to generator vertical frame
247 fGenChamCO->AddEntry("not used",kNotUsed);
ef3a1bac 248 for(int i=1;i<=7;i++) fGenChamCO->AddEntry(Form("Chamber %i",i-1),i); fGenChamCO->Resize(160,20); fGenChamCO->Select(kNotUsed);
6453cfc6 249}//GuiGen()
250//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
251void HmpConfig::GenAddSlot(Int_t id)
252{//is invoked when any of generator check button is pressed
253 if(id==kGunZ){
254 fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenF->HideFrame(fGenNprimCO); fGenF->HideFrame(fGenPmaxCO);
255 fGenBG->GetButton(kGun7)->SetEnabled(kFALSE);
256 fGenBG->GetButton(kBox )->SetEnabled(kFALSE); fGenPidCO->Select(kProton); fGenPminCO->Select(25);
ad09b4ea 257 fGenF->HideFrame(fGenChamCO);
258 gGunZ=!gGunZ;
6453cfc6 259 }
260 if(id==kGun1){
261 fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenF->HideFrame(fGenNprimCO); fGenF->HideFrame(fGenPmaxCO);
262 fGenBG->GetButton(kGun7)->SetEnabled(kFALSE); fGenPidCO->Select(kProton); fGenPminCO->Select(25); fGenChamCO->Select(4);
263 fGenBG->GetButton(kBox )->SetEnabled(kFALSE);
ad09b4ea 264 gGun1=!gGun1;
6453cfc6 265 }
266 if(id==kGun7){
267 fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenF->HideFrame(fGenNprimCO);
268 fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenPidCO->Select(kProton);
269 fGenBG->GetButton(kBox )->SetEnabled(kFALSE); fGenF->HideFrame(fGenPmaxCO); fGenPminCO->Select(25);
270 fGenF->HideFrame(fGenChamCO);
ad09b4ea 271 gGun7=!gGun7;
6453cfc6 272 }
273 if(id==kBox){
274 fGenBG->GetButton(kGunZ)->SetEnabled(kFALSE); fGenNprimCO->Select(500);
275 fGenBG->GetButton(kGun1)->SetEnabled(kFALSE); fGenPidCO ->Select(kProton);
276 fGenBG->GetButton(kGun7)->SetEnabled(kFALSE); fGenPminCO ->Select(15); fGenPmaxCO->Select(15);
ad09b4ea 277 fGenF->HideFrame(fGenChamCO);
278 gBox=!gBox;
6453cfc6 279 }
280 if(id==kHijing){
ad09b4ea 281// fGenBG->GetButton(kHijing)->ChangeBackground(0xff0000);
6453cfc6 282 fGenBG->GetButton(kHijingPara)->SetEnabled(kFALSE);
283 fGenBG->GetButton(kPythia)->SetEnabled(kFALSE);
ad09b4ea 284 gHijing=!gHijing;
6453cfc6 285 }
286 if(id==kHijingPara){
287 fGenBG->GetButton(kHijing)->SetEnabled(kFALSE); fGenNprimCO->Select(500);
288 fGenBG->GetButton(kPythia)->SetEnabled(kFALSE);
ad09b4ea 289 gHijingPara=!gHijingPara;
6453cfc6 290 }
291 if(id==kPythia){
292 fGenBG->GetButton(kHijing)->SetEnabled(kFALSE);
293 fGenBG->GetButton(kHijingPara)->SetEnabled(kFALSE);
ad09b4ea 294 gPythia=!gPythia;
6453cfc6 295 }
296}//GenAddSlot()
297//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
298void HmpConfig::GenRemSlot(Int_t id)
299{//is invoked when any of generator check button is released
ad09b4ea 300 if(id==kGunZ&&!gGunZ){
6453cfc6 301 fGenBG->GetButton(kGun1)->SetEnabled(); fGenF->ShowFrame(fGenNprimCO);
302 fGenBG->GetButton(kGun7)->SetEnabled(); fGenPidCO ->Select(kNotUsed);
303 fGenBG->GetButton(kBox )->SetEnabled(); fGenF->ShowFrame(fGenPmaxCO); fGenPminCO ->Select(kNotUsed);
304 }
ad09b4ea 305 if(id==kGun1&&!gGun1){
6453cfc6 306 fGenBG->GetButton(kGunZ)->SetEnabled(); fGenF->ShowFrame(fGenNprimCO);
307 fGenBG->GetButton(kGun7)->SetEnabled(); fGenPidCO ->Select(kNotUsed);
308 fGenBG->GetButton(kBox )->SetEnabled(); fGenF->ShowFrame(fGenPmaxCO); fGenPminCO ->Select(kNotUsed);
ad09b4ea 309 fGenChamCO ->Select(kNotUsed);
6453cfc6 310 }
ad09b4ea 311 if(id==kGun7&&!gGun7){
6453cfc6 312 fGenBG->GetButton(kGunZ)->SetEnabled(); fGenF->ShowFrame(fGenNprimCO);
313 fGenBG->GetButton(kGun1)->SetEnabled(); fGenPidCO ->Select(kNotUsed);
314 fGenBG->GetButton(kBox )->SetEnabled(); fGenF->ShowFrame(fGenPmaxCO); fGenPminCO ->Select(kNotUsed);
315 fGenF->ShowFrame(fGenChamCO);
316 }
ad09b4ea 317 if(id==kBox&&!gBox){
6453cfc6 318 fGenBG->GetButton(kGunZ)->SetEnabled(); fGenNprimCO->Select(kNotUsed);
319 fGenBG->GetButton(kGun1)->SetEnabled(); fGenPidCO ->Select(kNotUsed);
320 fGenBG->GetButton(kGun7)->SetEnabled(); fGenPminCO ->Select(kNotUsed); fGenPmaxCO->Select(kNotUsed);
321 fGenChamCO ->Select(kNotUsed);
322 }
ad09b4ea 323 if(id==kHijing&&!gHijing){
324// fGenBG->GetButton(kHijing)->ChangeBackground(0xbebebe);
6453cfc6 325 fGenBG->GetButton(kHijingPara)->SetEnabled();
326 fGenBG->GetButton(kPythia)->SetEnabled();
327 }
ad09b4ea 328 if(id==kHijingPara&&!gHijingPara){
329 fGenBG->GetButton(kHijing)->SetEnabled(); fGenNprimCO->Select(kNotUsed);
6453cfc6 330 fGenBG->GetButton(kPythia)->SetEnabled();
331 }
ad09b4ea 332 if(id==kPythia&&!gPythia){
6453cfc6 333 fGenBG->GetButton(kHijing)->SetEnabled();
334 fGenBG->GetButton(kHijingPara)->SetEnabled();
335 }
336}//GenRemSlot()
337//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
338void HmpConfig::WriteGen(FILE *pF)
339{
340 Int_t pid=fGenPidCO->GetSelected();
341 Float_t pmin=0.1*fGenPminCO->GetSelected(); //particle momentum, GeV
342 Float_t pmax=0.1*fGenPmaxCO->GetSelected(); //particle momentum, GeV
343
7a4ef05a 344 if(fGenBG->GetButton(kHijing)->GetState()==kButtonDown ||
345 fGenBG->GetButton(kHijingPara)->GetState()==kButtonDown ||
346 fGenBG->GetButton(kPythia)->GetState()==kButtonDown) {;}
347 else {fprintf(pF," AliGenCocktail *pG=new AliGenCocktail();\n\n");}
6453cfc6 348
349 if(fGenBG->GetButton(kGunZ)->GetState()==kButtonDown)//1 particle along Z axis
072d445a 350 fprintf(pF," AliGenFixed *pGz=new AliGenFixed(1); pGz->SetPart(%i); pGz->SetMomentum(%.1f); pGz->SetOrigin(0,0,-200); pG->AddGenerator(pGz,\"Gz\",1);\n",pid,pmin);
6453cfc6 351
352 if(fGenBG->GetButton(kGun1)->GetState()==kButtonDown){//1 gun towards 1 HMPID chamber
353 switch(fGenChamCO->GetSelected()){
354 case 1: fprintf(pF," AliGenFixed *pG1=new AliGenFixed(1); pG1->SetPart(%i); pG1->SetMomentum(%.1f);\n",pid,pmin);
355 fprintf(pF," pG1->SetTheta(109.5); pG1->SetPhi(10); pG->AddGenerator(pG1,\"g1\",1);\n"); break;
356 case 2: fprintf(pF," AliGenFixed *pG2=new AliGenFixed(1); pG2->SetPart(%i); pG2->SetMomentum(%.1f);\n",pid,pmin);
357 fprintf(pF," pG2->SetTheta( 90.0); pG2->SetPhi(10); pG->AddGenerator(pG2,\"g2\",1);\n"); break;
358 case 3: fprintf(pF," AliGenFixed *pG3=new AliGenFixed(1); pG3->SetPart(%i); pG3->SetMomentum(%.1f);\n",pid,pmin);
359 fprintf(pF," pG3->SetTheta(109.5); pG3->SetPhi(30); pG->AddGenerator(pG3,\"g3\",1);\n"); break;
360 case 4: fprintf(pF," AliGenFixed *pG4=new AliGenFixed(1); pG4->SetPart(%i); pG4->SetMomentum(%.1f);\n",pid,pmin);
94b1fbfa 361 fprintf(pF," pG4->SetTheta( 87.0); pG4->SetPhi(30); pG->AddGenerator(pG4,\"g4\",1);\n"); break;
6453cfc6 362 case 5: fprintf(pF," AliGenFixed *pG5=new AliGenFixed(1); pG5->SetPart(%i); pG5->SetMomentum(%.1f);\n",pid,pmin);
363 fprintf(pF," pG5->SetTheta( 70.5); pG5->SetPhi(30); pG->AddGenerator(pG5,\"g5\",1);\n"); break;
364 case 6: fprintf(pF," AliGenFixed *pG6=new AliGenFixed(1); pG6->SetPart(%i); pG6->SetMomentum(%.1f);\n",pid,pmin);
365 fprintf(pF," pG6->SetTheta( 90.0); pG6->SetPhi(50); pG->AddGenerator(pG6,\"g6\",1);\n"); break;
366 case 7: fprintf(pF," AliGenFixed *pG7=new AliGenFixed(1); pG7->SetPart(%i); pG7->SetMomentum(%.1f);\n",pid,pmin);
367 fprintf(pF," pG7->SetTheta( 70.5); pG7->SetPhi(50); pG->AddGenerator(pG7,\"g7\",1);\n"); break;
368 }
369 }
370
371 if(fGenBG->GetButton(kGun7)->GetState()==kButtonDown){//7 guns towards 7 HMPID chambers
372 fprintf(pF," AliGenFixed *pG1=new AliGenFixed(1); pG1->SetPart(%i); pG1->SetMomentum(%.1f);pG1->SetTheta(109.5-3); pG1->SetPhi(10);\n",pid,pmin);
373 fprintf(pF," pG->AddGenerator(pG1,\"g1\",1);\n");
374 fprintf(pF," AliGenFixed *pG2=new AliGenFixed(1); pG2->SetPart(%i); pG2->SetMomentum(%.1f);pG2->SetTheta( 90.0-3); pG2->SetPhi(10);\n",pid,pmin);
375 fprintf(pF," pG->AddGenerator(pG2,\"g2\",1);\n");
376 fprintf(pF," AliGenFixed *pG3=new AliGenFixed(1); pG3->SetPart(%i); pG3->SetMomentum(%.1f);pG3->SetTheta(109.5-3); pG3->SetPhi(30);\n",pid,pmin);
377 fprintf(pF," pG->AddGenerator(pG3,\"g3\",1);\n");
378 fprintf(pF," AliGenFixed *pG4=new AliGenFixed(1); pG4->SetPart(%i); pG4->SetMomentum(%.1f);pG4->SetTheta( 90.0-3); pG4->SetPhi(30);\n",pid,pmin);
379 fprintf(pF," pG->AddGenerator(pG4,\"g4\",1);\n");
380 fprintf(pF," AliGenFixed *pG5=new AliGenFixed(1); pG5->SetPart(%i); pG5->SetMomentum(%.1f);pG5->SetTheta( 70.0-3); pG5->SetPhi(30);\n",pid,pmin);
381 fprintf(pF," pG->AddGenerator(pG5,\"g5\",1);\n");
382 fprintf(pF," AliGenFixed *pG6=new AliGenFixed(1); pG6->SetPart(%i); pG6->SetMomentum(%.1f);pG6->SetTheta( 90.0-3); pG6->SetPhi(50);\n",pid,pmin);
383 fprintf(pF," pG->AddGenerator(pG6,\"g6\",1);\n");
384 fprintf(pF," AliGenFixed *pG7=new AliGenFixed(1); pG7->SetPart(%i); pG7->SetMomentum(%.1f);pG7->SetTheta( 70.0-3); pG7->SetPhi(50);\n",pid,pmin);
385 fprintf(pF," pG->AddGenerator(pG7,\"g7\",1);\n");
386 }
387
388 if(fGenBG->GetButton(kBox)->GetState()==kButtonDown){// box towards HMPID phase space
389 fprintf(pF," AliGenBox *pB=new AliGenBox(%i); pB->SetPart(%i); pB->SetMomentumRange(%.1f,%.1f);\n",(int)fGenNprimCO->GetSelected(),pid,pmin,pmax);
390 fprintf(pF," pB->SetThetaRange(65,115); pB->SetPhiRange(5,55); pG->AddGenerator(pB,\"b\",1);\n");
391 }
392
393 if(fGenBG->GetButton(kHijing)->GetState()==kButtonDown){//normal HIJING
7a4ef05a 394 fprintf(pF," AliGenHijing *pH=new AliGenHijing(-1); pH->SetEnergyCMS(5500); pH->SetReferenceFrame(\"CMS\");\n");
395 fprintf(pF," pH->SetProjectile(\"A\", 208, 82); pH->SetTarget(\"A\", 208, 82); pH->SetJetQuenching(0);\n");
6453cfc6 396 fprintf(pF," pH->SetShadowing(0); pH->KeepFullEvent(); pH->SetSelectAll(0);\n");
397 fprintf(pF," pH->SetImpactParameterRange(0, 5); //fermi\n");
7a4ef05a 398 fprintf(pF," AliGenerator *gener = (AliGenerator*)pH; \n");
399 fprintf(pF," gener->SetOrigin(0, 0, 0); // vertex position \n");
400 fprintf(pF," gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position \n");
401 fprintf(pF," gener->SetCutVertexZ(1.); // Truncate at 1 sigma \n");
402 fprintf(pF," gener->SetVertexSmear(kPerEvent); \n");
403 fprintf(pF," gener->SetTrackingFlag(1); \n");
404 fprintf(pF," gener->Init(); \n\n");
6453cfc6 405 }
406
407 if(fGenBG->GetButton(kHijingPara)->GetState()==kButtonDown){//parametrized HIJING
408 fprintf(pF," AliGenHIJINGpara *pHP=new AliGenHIJINGpara(%i);\n",(int)fGenNprimCO->GetSelected());
409 fprintf(pF," pHP->SetMomentumRange(0,999); pHP->SetThetaRange(%f,%f); pHP->SetPhiRange(0,360);\n",Eta2Theta(8),Eta2Theta(-8));
7a4ef05a 410 fprintf(pF," AliGenerator *gener = (AliGenerator*)pHP; \n");
411 fprintf(pF," gener->SetOrigin(0, 0, 0); // vertex position \n");
412 fprintf(pF," gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position \n");
413 fprintf(pF," gener->SetCutVertexZ(1.); // Truncate at 1 sigma \n");
414 fprintf(pF," gener->SetVertexSmear(kPerEvent); \n");
415 fprintf(pF," gener->SetTrackingFlag(1); \n");
416 fprintf(pF," gener->Init(); \n\n");
6453cfc6 417 }
418
419 if(fGenBG->GetButton(kPythia)->GetState()==kButtonDown){//Pythia
420 fprintf(pF," AliGenPythia *pP=new AliGenPythia(-1);\n");
3be98c75 421 fprintf(pF," pP->SetMomentumRange(0,999);\n");
6453cfc6 422 fprintf(pF," pP->SetYRange(-12,12); pP->SetPtRange(0,1000); pP->SetStrucFunc(kCTEQ4L);\n");
423 fprintf(pF," pP->SetProcess(kPyMb); pP->SetEnergyCMS(14000);\n");
7a4ef05a 424 fprintf(pF," AliGenerator *gener = (AliGenerator*)pP; \n");
425 fprintf(pF," gener->SetOrigin(0, 0, 0); // vertex position \n");
426 fprintf(pF," gener->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position \n");
427 fprintf(pF," gener->SetCutVertexZ(1.); // Truncate at 1 sigma \n");
428 fprintf(pF," gener->SetVertexSmear(kPerEvent); \n");
429 fprintf(pF," gener->SetTrackingFlag(1); \n");
430 fprintf(pF," gener->Init(); \n\n");
6453cfc6 431 }
7a4ef05a 432 if(fGenBG->GetButton(kHijing)->GetState()==kButtonDown ||
433 fGenBG->GetButton(kHijingPara)->GetState()==kButtonDown ||
434 fGenBG->GetButton(kPythia)->GetState()==kButtonDown) continue;
435 else fprintf(pF," pG->Init();\n\n");
6453cfc6 436}//WriteGenerator()
437//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
438void HmpConfig::GuiDet(TGHorizontalFrame *pMainHF)
439{
440 pMainHF->AddFrame(fDetBG=new TGButtonGroup(pMainHF,"Dets"));
441 fDetBG->Connect("Pressed(Int_t)" ,"HmpConfig",this,"DetAddSlot(Int_t)");
442 fDetBG->Connect("Released(Int_t)","HmpConfig",this,"DetRemSlot(Int_t)");
443 new TGCheckButton(fDetBG,"PIPE" ,kPIPE)); new TGCheckButton(fDetBG,"ITS" ,kITS)); new TGCheckButton(fDetBG,"TPC" ,kTPC));
444 new TGCheckButton(fDetBG,"TRD" ,kTRD)); new TGCheckButton(fDetBG,"TOF" ,kTOF)); new TGCheckButton(fDetBG,"FRAME" ,kFRAME));
445 new TGCheckButton(fDetBG,"MAG" ,kMAG)); new TGCheckButton(fDetBG,"ACORDE",kACORDE));new TGCheckButton(fDetBG,"HALL" ,kHALL));
446 new TGCheckButton(fDetBG,"PHOS" ,kPHOS)); new TGCheckButton(fDetBG,"T0" ,kT0)); new TGCheckButton(fDetBG,"FMD" ,kFMD));
447 new TGCheckButton(fDetBG,"ABSO" ,kABSO)); new TGCheckButton(fDetBG,"PMD" ,kPMD)); new TGCheckButton(fDetBG,"DIPO" ,kDIPO));
448 new TGCheckButton(fDetBG,"EMCAL" ,kEMCAL)); new TGCheckButton(fDetBG,"VZERO" ,kVZERO)); new TGCheckButton(fDetBG,"MUON" ,kMUON));
449 new TGCheckButton(fDetBG,"ZDC" ,kZDC)); new TGCheckButton(fDetBG,"SHILD" ,kSHILD));
450}
451//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
452void HmpConfig::DetAddSlot(Int_t id)
453{//slot is invoked when any detector check button is pressed
454 if(id==kTRD || id==kTOF) //TRD and TOF geometries depend on FRAME
455 fDetBG->SetButton(kFRAME);
456}
457//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
458void HmpConfig::DetRemSlot(Int_t id)
459{//slot is invoked when any detector check button is released
460 if(id==kFRAME){
461 fDetBG->SetButton(kTRD,kFALSE); //switch off TRD and TOF when FRAME is switched off by user hence TRD&TOF depend on FRAME
462 fDetBG->SetButton(kTOF,kFALSE);
463 }
464}
465//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
466void HmpConfig::WriteDet(FILE *pF)
467{
468//CORE detectors
e4290ede 469 if(fDetBG->GetButton(kPIPE )->GetState()) fprintf(pF,"\n new AliPIPEv3(\"PIPE\",\"Beam Pipe\");\n");
470 if(fDetBG->GetButton(kSHILD)->GetState()) fprintf(pF,"\n new AliSHILv3(\"SHIL\",\"Shielding Version 2\");\n");
008322e6 471 if(fDetBG->GetButton(kITS )->GetState()) fprintf(pF,"\n new AliITSv11Hybrid(\"ITS\",\"ITS v11Hybrid\");\n");
e4290ede 472
6453cfc6 473 if(fDetBG->GetButton(kTPC )->GetState()) fprintf(pF,"\n new AliTPCv2(\"TPC\",\"Default\");\n");
474 if(fDetBG->GetButton(kFRAME)->GetState()) fprintf(pF,"\n AliFRAMEv2 *pFrame=new AliFRAMEv2(\"FRAME\",\"Space Frame\"); pFrame->SetHoles(1);\n");
475 if(fDetBG->GetButton(kTRD )->GetState()) fprintf(pF,"\n AliTRD *pTrd=new AliTRDv1(\"TRD\",\"TRD slow simulator\");\n");
e4290ede 476 if(fDetBG->GetButton(kTOF )->GetState()) {
477 fprintf(pF,"\n AliTOF *TOF = new AliTOFv6T0(\"TOF\", \"normal TOF\");\n");
478 fprintf(pF,"\n Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};\n");
479 fprintf(pF,"\n TOF->SetTOFSectors(TOFSectors);\n");
480 }
6453cfc6 481//central detectors behind HMPID
482 if(fDetBG->GetButton(kMAG )->GetState()) fprintf(pF,"\n new AliMAG(\"MAG\",\"Magnet\");\n");
483 if(fDetBG->GetButton(kHALL )->GetState()) fprintf(pF,"\n new AliHALL(\"HALL\",\"Alice Hall\");\n");
484//forward detectors
e4290ede 485 if(fDetBG->GetButton(kFMD )->GetState()) fprintf(pF,"\n AliFMD *FMD = new AliFMDv1(\"FMD\",\"normal FMD\");\n");
486 if(fDetBG->GetButton(kABSO )->GetState()) fprintf(pF,"\n AliABSO *ABSO = new AliABSOv3(\"ABSO\",\"Muon absorber\");\n");
487 if(fDetBG->GetButton(kDIPO )->GetState()) fprintf(pF,"\n AliDIPO *DIPO = new AliDIPOv3(\"DIPO\",\"Dipole version 3\");\n");
488 if(fDetBG->GetButton(kMUON )->GetState()) fprintf(pF,"\n AliMUON *MUON = new AliMUONv1(\"MUON\",\"default\");\n");
489 if(fDetBG->GetButton(kPMD )->GetState()) fprintf(pF,"\n AliPMD *PMD = new AliPMDv1(\"PMD\",\"normal PMD\");\n");
490 if(fDetBG->GetButton(kT0)->GetState()) fprintf(pF,"\n AliT0 *T0 = new AliT0v1(\"T0\",\"T0 Detector\");\n");
491 if(fDetBG->GetButton(kVZERO)->GetState()) fprintf(pF,"\n AliVZERO *VZERO = new AliVZEROv7(\"VZERO\",\"normal VZERO\");\n");
492 if(fDetBG->GetButton(kZDC )->GetState()) fprintf(pF,"\n AliZDC *ZDC = new AliZDCv2(\"ZDC\",\"normal ZDC\");\n");
6453cfc6 493//different phase space detectors
e4290ede 494 if(fDetBG->GetButton(kPHOS )->GetState()) fprintf(pF,"\n AliPHOS *PHOS = new AliPHOSv1(\"PHOS\",\"IHEP\");\n");
495 if(fDetBG->GetButton(kEMCAL)->GetState()) fprintf(pF,"\n AliEMCAL *EMCAL = new AliEMCALv2(\"EMCAL\",\"SHISH_77_TRD1_2X2_FINAL_110DEG\");\n");
f7882672 496 if(fDetBG->GetButton(kACORDE )->GetState()) fprintf(pF,"\n AliACORDE *ACORDE = new AliACORDEv1(\"ACORDE\",\"normal ACORDE\");\n");
6453cfc6 497}
498//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
499void HmpConfig::GuiBatch(TGHorizontalFrame *pMainF)
500{
501 TGGroupFrame *pSimF=new TGGroupFrame(pMainF,"Simu"); pMainF->AddFrame(pSimF);
502 pSimF->AddFrame(fSimB =new TGCheckButton(pSimF,"Enable")); fSimB->Connect("Toggled(Bool_t)","HmpConfig",this,"SlotSim(Bool_t)");
503 pSimF->AddFrame(fTraB =new TGCheckButton(pSimF,"Transport"));
504 pSimF->AddFrame(fSdiBG=new TGButtonGroup(pSimF,""));
505 pSimF->AddFrame(fDigBG=new TGButtonGroup(pSimF,""));
506 pSimF->AddFrame(fRawBG=new TGButtonGroup(pSimF,""));
507 new TGRadioButton(fSdiBG, "No SDigits" ,kNo );
508 new TGRadioButton(fSdiBG, "SDigits CORE" ,kAll );
509 new TGRadioButton(fSdiBG, "SDigits HMPID" ,kHmp );
510 new TGRadioButton(fDigBG, "No Digits" ,kNo );
511 new TGRadioButton(fDigBG, "Digits CORE" ,kAll );
512 new TGRadioButton(fDigBG, "Digits HMPID" ,kHmp );
513 new TGRadioButton(fRawBG, "No RAW files" ,kNo );
514 new TGRadioButton(fRawBG, "RAW DDL" ,kDdl );
515 new TGRadioButton(fRawBG, "RAW DATE" ,kDat );
516 new TGRadioButton(fRawBG, "RAW ROOT" ,kRoo );
517
518
519 TGCompositeFrame *pRecF=new TGGroupFrame(pMainF,"Reco"); pMainF->AddFrame(pRecF);
520 pRecF->AddFrame(fRecB =new TGCheckButton(pRecF,"Enable")); fRecB->Connect("Toggled(Bool_t)","HmpConfig",this,"SlotRec(Bool_t)");
521 pRecF->AddFrame(fInpBG=new TGButtonGroup(pRecF,"" ));
522 pRecF->AddFrame(fCluBG=new TGButtonGroup(pRecF,"" ));
523 pRecF->AddFrame(fTrkBG=new TGButtonGroup(pRecF,"" )); fTrkBG->Connect("Pressed(Int_t)","HmpConfig",this,"SlotBatch(Int_t)");
524 new TGRadioButton(fInpBG, "From sim" ,kNo );
525 new TGRadioButton(fInpBG, "From DDL" ,kDdl );
526 new TGRadioButton(fInpBG, "From DATE" ,kDat );
527 new TGRadioButton(fInpBG, "From ROOT" ,kRoo );
528 new TGRadioButton(fCluBG, "No Clusters" ,kNo );
529 new TGRadioButton(fCluBG, "Clusters CORE" ,kAll );
530 new TGRadioButton(fCluBG, "Clusters HMPID" ,kHmp );
55a829a5 531
532 new TGCheckButton(fTrkBG, "Apply RecoParam" ,kRecoPar);
533
6453cfc6 534 new TGCheckButton(fTrkBG, "Load Align data" ,kAln );
535 new TGCheckButton(fTrkBG, "Prim vertex" ,kVtx );
536 new TGCheckButton(fTrkBG, "ESD tracks" ,kTrk );
537 new TGCheckButton(fTrkBG, "Assign PID" ,kPid );
538
539 fSimB->SetState(kButtonDown); fTraB->SetState(kButtonDown); fSdiBG->SetButton(kHmp); fDigBG->SetButton(kHmp); fRawBG->SetButton(kNo);
540 fRecB->SetState(kButtonDown); fInpBG->SetButton(kNo); fCluBG->SetButton(kHmp);
541}
542//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
543void HmpConfig::SlotSim(Bool_t isChk)
544{
545 if(isChk){
546 fTraB ->SetState(kButtonDown);
547
548 fSdiBG->GetButton(kNo )->SetState(kButtonEngaged);
549 fSdiBG->GetButton(kAll)->SetState(kButtonEngaged);
550 fSdiBG->GetButton(kHmp)->SetState(kButtonDown);
551
552 fDigBG->GetButton(kNo )->SetState(kButtonEngaged);
553 fDigBG->GetButton(kAll)->SetState(kButtonEngaged);
554 fDigBG->GetButton(kHmp)->SetState(kButtonDown);
555
556 fRawBG->GetButton(kNo )->SetState(kButtonDown);
557 fRawBG->GetButton(kDdl)->SetState(kButtonEngaged);
558 fRawBG->GetButton(kDat)->SetState(kButtonEngaged);
559 fRawBG->GetButton(kRoo)->SetState(kButtonEngaged);
560 }else{
561 fTraB ->SetState(kButtonDisabled);
562
563 fSdiBG->GetButton(kNo )->SetState(kButtonDisabled);
564 fSdiBG->GetButton(kAll)->SetState(kButtonDisabled);
565 fSdiBG->GetButton(kHmp)->SetState(kButtonDisabled);
566
567 fDigBG->GetButton(kNo )->SetState(kButtonDisabled);
568 fDigBG->GetButton(kAll)->SetState(kButtonDisabled);
569 fDigBG->GetButton(kHmp)->SetState(kButtonDisabled);
570
571 fRawBG->GetButton(kNo )->SetState(kButtonDisabled);
572 fRawBG->GetButton(kDdl)->SetState(kButtonDisabled);
573 fRawBG->GetButton(kDat)->SetState(kButtonDisabled);
574 fRawBG->GetButton(kRoo)->SetState(kButtonDisabled);
575 }
576}
577//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
578void HmpConfig::SlotRec(Bool_t isChk)
579{
580 if(isChk){
581 fInpBG->GetButton(kNo) ->SetState(kButtonDown);
582 fInpBG->GetButton(kDdl)->SetState(kButtonEngaged);
583 fInpBG->GetButton(kDat)->SetState(kButtonEngaged);
584 fInpBG->GetButton(kRoo)->SetState(kButtonEngaged);
585
586 fCluBG->GetButton(kNo) ->SetState(kButtonEngaged);
587 fCluBG->GetButton(kAll)->SetState(kButtonEngaged);
588 fCluBG->GetButton(kHmp)->SetState(kButtonDown);
589
55a829a5 590 fTrkBG->GetButton(kRecoPar)->SetState(kButtonEngaged);
6453cfc6 591 fTrkBG->GetButton(kAln)->SetState(kButtonEngaged);
592 fTrkBG->GetButton(kVtx)->SetState(kButtonEngaged);
593 fTrkBG->GetButton(kTrk)->SetState(kButtonEngaged);
594 fTrkBG->GetButton(kPid)->SetState(kButtonEngaged);
595 }else{
596 fInpBG->GetButton(kNo) ->SetState(kButtonDisabled);
597 fInpBG->GetButton(kDdl)->SetState(kButtonDisabled);
598 fInpBG->GetButton(kDat)->SetState(kButtonDisabled);
599 fInpBG->GetButton(kRoo)->SetState(kButtonDisabled);
600
601 fCluBG->GetButton(kNo) ->SetState(kButtonDisabled);
602 fCluBG->GetButton(kAll)->SetState(kButtonDisabled);
603 fCluBG->GetButton(kHmp)->SetState(kButtonDisabled);
604
55a829a5 605 fTrkBG->GetButton(kRecoPar)->SetState(kButtonDisabled);
6453cfc6 606 fTrkBG->GetButton(kAln)->SetState(kButtonDisabled);
607 fTrkBG->GetButton(kVtx)->SetState(kButtonDisabled);
608 fTrkBG->GetButton(kTrk)->SetState(kButtonDisabled);
609 fTrkBG->GetButton(kPid)->SetState(kButtonDisabled);
610 }
611}
612//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
613void HmpConfig::SlotBatch(Int_t id)
614{//slot is invoked when any button in fTrkBG is pressed
615 if(id==kTrk){
616 fSdiBG->SetButton(kAll);
617 fDigBG->SetButton(kAll);
618 fCluBG->SetButton(kAll);
619 fDetBG->SetButton(kITS);
620 fDetBG->SetButton(kTPC);
621 fDetBG->SetButton(kTRD);
622 }
623}
624//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
625void HmpConfig::WriteBatch()
626{//creates Batch.C file
b08ebbb0 627 TString det;
628 if(fDetBG->GetButton(kITS )->GetState()) det+="ITS ";
629 if(fDetBG->GetButton(kTPC )->GetState()) det+="TPC ";
630 if(fDetBG->GetButton(kTRD )->GetState()) det+="TRD ";
631 if(fDetBG->GetButton(kTOF )->GetState()) det+="TOF ";
632 if(!fVerBG->GetButton(kNo)->GetState()) det+="HMPID ";
39cd22e6 633 char *sBatchName="sim";
634 FILE *fp=fopen(Form("%s.C",sBatchName),"w"); if(!fp){Info("CreateSim","Cannot open output file: %s.C",sBatchName);return;}
6453cfc6 635
39cd22e6 636 fprintf(fp,"void %s(Int_t iNevt=1,Bool_t isDbg=kFALSE,char *sCfg=\"Config.C\")\n{\n",sBatchName);
21f61e25 637 fprintf(fp," gSystem->Exec(\"rm -rf hlt hough gphysi* fort* ZZZ* raw*\"); //remove garbage\n");
6453cfc6 638 fprintf(fp," gBenchmark->Start(\"ALICE\"); TDatime time; //start benchmarking\n\n");
639
640 fprintf(fp," if(isDbg) AliLog::SetGlobalDebugLevel(AliLog::kDebug);\n");
641//simulation section
21f61e25 642 if(fSimB->GetState()){ fprintf(fp," gSystem->Exec(\"rm -rf *.root \"); //remove previous simulation\n");
643 fprintf(fp," gSystem->Exec(\"rm -rf *.date \"); //remove previous simulation\n");
6453cfc6 644 fprintf(fp," AliSimulation *pSim=new AliSimulation(sCfg); //init simulation\n");
645
646 if(fTraB->GetState()) fprintf(fp," pSim->SetRunSimulation(kTRUE); //transport and hits creation\n");
647 else fprintf(fp," pSim->SetRunSimulation(kFALSE); //no transport and hits creation\n");
648
649 if (fSdiBG->GetButton(kNo )->GetState()) fprintf(fp," pSim->SetMakeSDigits(\"\"); //no sdigits\n");
b08ebbb0 650 else if(fSdiBG->GetButton(kAll)->GetState()) fprintf(fp," pSim->SetMakeSDigits(\"%s\"); //sdigits for all\n",det.Data());
6453cfc6 651 else if(fSdiBG->GetButton(kHmp)->GetState()) fprintf(fp," pSim->SetMakeSDigits(\"HMPID\"); //sdigits for HMPID\n");
652
653 if (fDigBG->GetButton(kNo )->GetState()) fprintf(fp," pSim->SetMakeDigits(\"\"); //no digits\n");
b08ebbb0 654 else if(fDigBG->GetButton(kAll)->GetState()) fprintf(fp," pSim->SetMakeDigits(\"%s\"); //digits for all\n",det.Data());
6453cfc6 655 else if(fDigBG->GetButton(kHmp)->GetState()) fprintf(fp," pSim->SetMakeDigits(\"HMPID\"); //digits for HMPID\n");
656
b08ebbb0 657 if (fRawBG->GetButton(kDdl)->GetState()) fprintf(fp," pSim->SetWriteRawData(\"%s\"); //raw data as DDL\n",det.Data());
658 else if(fRawBG->GetButton(kDat)->GetState()) fprintf(fp," pSim->SetWriteRawData(\"%s\",\"raw.date\"); //raw data as DATE\n",det.Data());
659 else if(fRawBG->GetButton(kRoo)->GetState()) fprintf(fp," pSim->SetWriteRawData(\"%s\",\"raw.root\"); //raw data as ROOT\n",det.Data());
abefd847 660
661 fprintf(fp," pSim->SetRunHLT(\"\"); //no HLT stuff\n");
d8b161c4 662 fprintf(fp," pSim->SetRunQA(\":\"); //no QA\n");
39cd22e6 663 fprintf(fp," pSim->Run(iNevt); //run iNevt events\n delete pSim;\n\n");
6453cfc6 664 }//sim section
39cd22e6 665 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <sim.C>: Start time: \";time.Print();\n");
666 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <sim.C>: Stop time: \";time.Set(); time.Print();\n");
667 fprintf(fp," gBenchmark->Show(\"ALICE\");\n");
668
8b8e7c9e 669 fprintf(fp," gSystem->Exec(\"touch ZZZ______finished_______SSS\");\n");
fef4ce04 670 fprintf(fp," gSystem->Exec(\"aliroot -q rec.C &\");\n}\n");
39cd22e6 671 fclose(fp);
54104a7c 672// rec section
39cd22e6 673 char *sBatchName="rec";
674 FILE *fp=fopen(Form("%s.C",sBatchName),"w"); if(!fp){Info("CreateRec","Cannot open output file: %s.C",sBatchName);return;}
675
676 fprintf(fp,"void %s()\n{\n",sBatchName);
54104a7c 677 fprintf(fp," gSystem->Exec(\"rm -rf *RRR \"); //remove garbage\n");
6453cfc6 678 if(fRecB->GetState()){
efc29373 679/*
680 if(fMagBG->GetButton(kFld0)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 0,1,10.,2));//no field\n");
681 else if(fMagBG->GetButton(kFld2)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 1,1,10,AliMagF::k2kG));//0.2 Tesla field\n");
682 else if(fMagBG->GetButton(kFld4)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 1,1,10,AliMagF::k4kG));//0.4 Tesla field\n");
683 else if(fMagBG->GetButton(kFld5)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 1,1,10,AliMagF::k5kG));//0.5 Tesla field\n");
684 else if(fMagBG->GetButton(kFld_2)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,AliMagF::k2kG));//-0.2 Tesla field\n");
685 else if(fMagBG->GetButton(kFld_4)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,AliMagF::k4kG));//-0.4 Tesla field\n");
686 else if(fMagBG->GetButton(kFld_5)->GetState()) fprintf(fp," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,AliMagF::k5kG));//-0.5 Tesla field\n");
687*/
6453cfc6 688 fprintf(fp," AliReconstruction *pRec=new AliReconstruction;\n");
39cd22e6 689 fprintf(fp," gBenchmark->Start(\"ALICE\"); TDatime time; //start benchmarking\n\n");
6453cfc6 690
55a829a5 691 //---------------------------------------------
692 if (fTrkBG->GetButton(kRecoPar)->GetState())
693 {
694 fprintf(fp," AliHMPIDRecoParam * hmpidRecoParam = AliHMPIDRecoParam::GetUserModeParam(); //Get the HMPID reco param\n");
65201c45 695 fprintf(fp," hmpidRecoParam->SetUserCutMode(kTRUE); //Switch to RecoParam\n");
696 fprintf(fp," hmpidRecoParam->SetUserCut(0,4); //eg cut for UserCutSigma (Values: ch0)\n");
697 fprintf(fp," hmpidRecoParam->SetUserCut(1,4); //eg cut for UserCutSigma (Values: ch1)\n");
698 fprintf(fp," hmpidRecoParam->SetUserCut(2,4); //eg cut for UserCutSigma (Values: ch2)\n");
699 fprintf(fp," hmpidRecoParam->SetUserCut(3,4); //eg cut for UserCutSigma (Values: ch3)\n");
700 fprintf(fp," hmpidRecoParam->SetUserCut(4,4); //eg cut for UserCutSigma (Values: ch4)\n");
701 fprintf(fp," hmpidRecoParam->SetUserCut(5,4); //eg cut for UserCutSigma (Values: ch5)\n");
702 fprintf(fp," hmpidRecoParam->SetUserCut(6,4); //eg cut for UserCutSigma (Values: ch6)\n");
55a829a5 703 fprintf(fp," AliHMPIDReconstructor::SetRecoParam(hmpidRecoParam); //Pass the RecoPar to the Reconstructor\n");
704 }
705 //---------------------------------------------
706
6453cfc6 707 if (fInpBG->GetButton(kNo )->GetState()) fprintf(fp," pRec->SetInput(\"\"); //from digits\n");
708 else if(fInpBG->GetButton(kDdl)->GetState()) fprintf(fp," pRec->SetInput(\"./\"); //from raw data in DDL format\n");
21f61e25 709 else if(fInpBG->GetButton(kDat)->GetState()) fprintf(fp," pRec->SetInput(\"raw.date\"); //from raw data in DATE format\n");
6453cfc6 710 else if(fInpBG->GetButton(kRoo)->GetState()) fprintf(fp," pRec->SetInput(\"raw.root\"); //from raw data in ROOT format\n");
711
b08ebbb0 712 if (fCluBG->GetButton(kAll) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"%s\"); //clusters for all detectors\n",det.Data());
6453cfc6 713 else if(fCluBG->GetButton(kHmp) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"HMPID\"); //clusters for HMPID only\n");
714 else if(fCluBG->GetButton(kNo) ->GetState()) fprintf(fp," pRec->SetRunLocalReconstruction(\"\"); //no clusters\n");
715
55a829a5 716
717
b08ebbb0 718 if (fTrkBG->GetButton(kAln)->GetState()) fprintf(fp," pRec->SetLoadAlignData(\"%s\"); //with misalignment\n",det.Data());
6453cfc6 719 else fprintf(fp," pRec->SetLoadAlignData(\"\"); //no misalignment\n");
720
721 if (fTrkBG->GetButton(kVtx)->GetState()) fprintf(fp," pRec->SetRunVertexFinder(kTRUE); //primary vertex\n");
722 else fprintf(fp," pRec->SetRunVertexFinder(kFALSE); //no primary vertex\n");
723
b08ebbb0 724 if (fTrkBG->GetButton(kTrk) ->GetState()) fprintf(fp," pRec->SetRunTracking(\"%s\"); //tracking\n",det.Data());
6453cfc6 725 else fprintf(fp," pRec->SetRunTracking(\"\"); //no tracking\n");
726
b08ebbb0 727 if (fTrkBG->GetButton(kPid) ->GetState()) fprintf(fp," pRec->SetFillESD(\"%s\"); //prob vect\n",det.Data());
6453cfc6 728 else fprintf(fp," pRec->SetFillESD(\"\"); //no prob vect\n");
729
730 fprintf(fp," pRec->Run();delete pRec;\n\n");
731 }//rec part
732//benchmarks
39cd22e6 733 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <rec.C>: Start time: \";time.Print();\n");
734 fprintf(fp," cout<<\"!!!!!!!!!!!!Info in <rec.C>: Stop time: \";time.Set(); time.Print();\n");
6453cfc6 735 fprintf(fp," gBenchmark->Show(\"ALICE\");\n");
736
39cd22e6 737 fprintf(fp," gSystem->Exec(\"touch ZZZ______finished_______RRR\");\n}\n");
6453cfc6 738 fclose(fp);
739}//WriteBatch()
740//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
741void HmpConfig::ExitSlot()
742{
743//slot to be invoked by clik on the Create button
744 if(fSimB->GetState()) WriteConfig();
745 WriteBatch();
746 SendCloseMessage();
747 gApplication->Terminate(0);
748}
749//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
750void HmpConfig::WriteConfig()
751{
752 FILE *pF=fopen(fFileName,"w"); if(!pF){Info("CreateConfigFile","Cannot open output file:%sn",fFileName);return;}
753
754 fprintf(pF,"void Config()\n");
755 fprintf(pF,"{\n");
756 fprintf(pF,"\n ::Info(\"\\n\\n\\n----------> HMPID private config\",\"Start\");\n");
757//Random
758 fprintf(pF," gRandom->SetSeed(123456);//put 0 to use system time\n\n");
6453cfc6 759//File
760 fprintf(pF," AliRunLoader *pAL=AliRunLoader::Open(\"galice.root\",AliConfig::GetDefaultEventFolderName(),\"recreate\");\n");
761 fprintf(pF," pAL->SetCompressionLevel(2);\n");
762 fprintf(pF," pAL->SetNumberOfEventsPerFile(1000);\n");
763 fprintf(pF," gAlice->SetRunLoader(pAL);\n\n");
764//Decayer
cbb81c06 765 if(fDecayerB->GetState()==kButtonDown){
766 fprintf(pF," gSystem->Load(\"liblhapdf.so\"); // Parton density functions \n");
767 fprintf(pF," gSystem->Load(\"libEGPythia6.so\"); // TGenerator interface \n");
768 fprintf(pF," gSystem->Load(\"libpythia6.so\"); // Pythia \n");
769 fprintf(pF," gSystem->Load(\"libAliPythia6.so\"); // ALICE specifics implementations \n\n");
e1422617 770//Geant
771 fprintf(pF," gSystem->Load(\"libgeant321\");\n");
772 fprintf(pF," new TGeant3TGeo(\"C++ Interface to Geant3\");\n\n");
773
7a4ef05a 774 fprintf(pF," AliDecayer *pDecayer=new AliDecayerPythia();\n");
6453cfc6 775 fprintf(pF," pDecayer->SetForceDecay(kAll);\n");
776 fprintf(pF," pDecayer->Init();\n");
777 fprintf(pF," gMC->SetExternalDecayer(pDecayer);\n\n");
778 }
779 WritePhys(pF); //physics processes
780
781//Field
efc29373 782 if(fMagBG->GetButton(kFld0)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 0,1,10,AliMagF::k2kG));// NO field\n");
783 else if(fMagBG->GetButton(kFld2)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 1,1,10,AliMagF::k2kG));//0.2 Tesla field\n");
784 else if(fMagBG->GetButton(kFld4)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 1,1,10,AliMagF::k4kG));//0.4 Tesla field\n");
785 else if(fMagBG->GetButton(kFld5)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2, 1,1,10,AliMagF::k5kG));//0.5 Tesla field\n");
786 else if(fMagBG->GetButton(kFld_2)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,AliMagF::k2kG));//-0.2 Tesla field\n");
787 else if(fMagBG->GetButton(kFld_4)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,AliMagF::k4kG));//-0.4 Tesla field\n");
788 else if(fMagBG->GetButton(kFld_5)->GetState()) fprintf(pF," TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\",2,-1,1,10,AliMagF::k5kG));//-0.5 Tesla field\n");
6453cfc6 789
790 fprintf(pF," pAL->CdGAFile();\n\n"); //????
791//Generator
792 WriteGen(pF);//generator
793//BODY-ALIC
794 fprintf(pF," new AliBODY(\"BODY\",\"Alice envelop\");\n\n");
795//HMPID
796 WriteHmp(pF); //private HMPID part
797 WriteDet(pF); //other detectors
798//end of Config.C file:
49881df7 799 fprintf(pF,"\n ::Info(\"----------> HMPID private config\",\"Stop\\n\\n\\n\");\n");
800//
6453cfc6 801 fprintf(pF,"}\n");
802 fclose(pF);
803}//WriteConfig()
804//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
805void Hconfig()
806{
807 new HmpConfig("Config.C");
808}