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