FairRoot/PandaRoot
Functions
hyp/Alicia/run.C File Reference

Go to the source code of this file.

Functions

int run (TString prefix="", Int_t nEvents=420, TString Decfile="hypbup", TString vers="current", Bool_t HYP_File=false, Bool_t gam=false)
 

Function Documentation

int run ( TString  prefix = "",
Int_t  nEvents = 420,
TString  Decfile = "hypbup",
TString  vers = "current",
Bool_t  HYP_File = false,
Bool_t  gam = false 
)

data/work/kpha4/lorente/sim_panda/Sim_hypFSG41TXm_GB.root");

data/work/kpha4/lorente/sim_panda/Sim_hypFS1TG4Xm_GBparams.root");

rtdb->print();

Definition at line 18 of file hyp/Alicia/run.C.

References AsciiGen, Bool_t, boxGen, Cave, ctime, Double_t, fieldPar, fMagField, fRun, gam, PndHypBupGenerator::GammaEmissPar(), gDebug, Hyp, inFile, kParameterMerged, nEvents, output, partGen, primGen, printf(), rtdb, rtime, PndHyp::SetAbsorberVol(), PndConstField::SetField(), PndConstField::SetFieldRegion(), PndHyp::SetGeoVersion(), PndHyp::SetHypGamFEm(), PndHyp::SetHypSDtoFile(), PndHyp::SetListMat(), PndHyp::SetMatbud(), PndCorrDistGenerator::SetParam(), PndConstPar::SetParameters(), PndBoxGenerator::SetPhiRange(), PndHypBupGenerator::SetPhiRange(), PndBoxGenerator::SetPRange(), PndHypBupGenerator::SetPRange(), PndHyp::SetSensorVol(), PndCorrDistGenerator::SetThetaRange(), PndHypBupGenerator::SetThetaRange(), PndBoxGenerator::SetThetaRange(), PndHyp::SetTreeFName(), PndBoxGenerator::SetXYZ(), timer, and TString.

18  {
19  TStopwatch timer;
20  timer.Start();
21  gRandom->SetSeed();
22  gDebug=0;
23 
24  //gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
25 
26 
27  gSystem->Load("libtrackrep");
28 
29  gSystem->Load("librazhyp");
30  gSystem->Load("libHyp");
31 
32  FairRunSim *fRun = new FairRunSim();
33 
34  // --- first step ----
36  //Background
37 
38  if(Decfile=="giBUU+backg")inFile= "/data/work/kpha4/lorente/sim_panda/carbon2_allParticles_1_32.root";
39 
40  // -- GiBUU Parametrization TH2F Corr. Dist P(theta)
41 
42  if(Decfile=="hist"||Decfile=="param")inFile= "XiGengiBUUSamp.root";
43 
44  //--Second xi minus momentum solution.
45 
46  //TString inFile= "data/xibximin2AStpRate.dat";//data/ximinAsciiStpRate.dat";
47  //TString inFile= "data/ximinAsciiStpRate.dat";
48 
49  // -- UrqmdSmm/GiBUU SIGNAL/ background events
50 
51  // Int_t nEvents =99480;
52 
53  if(Decfile=="giBUU")inFile= "../../../../../FairFeb14/pandaroot/macro/hyp/Alicia/carbon_onlyXi_2_5.root";//"/data/work/kpha4/lorente/XiProduction/UrQMDSmmXiXib/apC_potP1.root";
54 
55  //--- second step --
56  //--- HF from vertexes ----
57 
58  if(Decfile=="hypbup"){
59 
60  if(gam){
61  inFile= "/data/work/kpha4/lorente/sim_panda/hypBupV1T_Decay_gam_"+prefix+".root";
62  }else{
63  inFile= "hypBupV1T_Decay_"+prefix+".root";
64  }
65  }
66 
67 
68  // set the MC version used
69 
70 
71 
72  // ------------------------
73 
74  fRun->SetName("TGeant4");
75 
76 
77 
78  // ----------first step -------------
79 
80  // --------- background ------------
81 
82  if(Decfile=="giBUU+backg")fRun->SetOutputFile("/data/work/kpha4/lorente/sim_panda/Sim_hypFSG41TBg_SebGeo_"+prefix+".root");
83  //----------------------------------
84 
85  // ++++++ Xi minus production ++++++
86  if(Decfile=="box")fRun->SetOutputFile("sim_box.root");
87  if(Decfile=="param")fRun->SetOutputFile("/data/work/kpha4/lorente/sim_panda/Sim_hypFSG41TXm_SebGeo_"+prefix+".root");
88  if(Decfile=="giBUU") fRun->SetOutputFile("sim_gibuu.root");
89  // ----------first step XXb production -----------------------
90 
91  //fRun->SetOutputFile("Sim_hypFSG41TXXb_Geo2.root");
92 
93  // ---------- second step HF decay from secondary vertexes -------
94 
95  //fRun->SetOutputFile("Bup_hypFSG41TXXb.root");
96  if(Decfile=="hypbup")fRun->SetOutputFile("Bup_hypFSG41TXm.root");
97 
98 
99  // Set Material file Name
100  //-----------------------
101 
102  //fRun->SetMaterials("media_pnd_hyp.geo");
103  //new media for hyp
104  fRun->SetMaterials("media_pnd.geo");
105 
106  // Create and add detectors
107  //-------------------------
108 
109  FairModule *Cave= new PndCave("CAVE");
110  Cave->SetGeometryFileName("pndcave.geo");
111  fRun->AddModule(Cave);
112  /*
113  FairModule *Magnet= new FairMagnet("MAGNET");
114  Magnet->SetGeometryFileName("magnet.geo");
115  fRun->AddModule(Magnet);
116  */
117 
118 
119 
120  PndHyp *Hyp = new PndHyp("HYP",kTRUE);
121  //FairDetector *Hyp = new PndHyp("HYP",kTRUE);
122 
123  //Hyp->SetGeometryFileName("HypST_block.geo");
124  //fRun->AddModule(Hyp);
125  //--blocks
126  //---Layers (si+abs)
127  //Hyp->SetGeometryFileName("HypST_prueba2.geo");
128  //fRun->AddModule(Hyp);
129  //--layers C+Si
130  // Hyp->SetGeometryFileName("HypST_prueba23.geo");
131  //fRun->AddModule(Hyp);
132  //--layers C+si+hyppipe
133  //Hyp->SetGeometryFileName("HypST_prueba24pipe.geo");
134  //Hyp->SetGeometryFileName("HypST_newxy3C.geo");
135 
136 
137 
138  // --- root geometry ------
139  // xxxxx Alicia's detector geo xxxx
140  if(vers=="standard"){
141 
142  Hyp->SetAbsorberVol("stglAb"); // absorber layer
143  Hyp->SetSensorVol("stglSi"); // silicon sensor
144  Hyp->SetGeoVersion("List");
145  Hyp->SetListMat("HYPdiamond");
146  Hyp->SetListMat("HYPcarbon");
147  //Hyp->SetGeometryFileName("HYPST_assexy3C5Lay.root");
148  Hyp->SetGeometryFileName("HYPST_assexy3C5Lay_mvd.root");//HYPST_assexy3C5Lay_test.root");
149 
150  }
151 
152  // xxxxxxxx Sebastian asymmetric geo root xxxxxxxxxxx
153  if(vers=="current"){
154  Hyp->SetAbsorberVol("Absorber"); // absorber layer
155  Hyp->SetSensorVol("Sensor"); // silicon sensor
156  Hyp->SetGeoVersion("List");
157  Hyp->SetListMat("HYPboron");
158  Hyp->SetListMat("HYPaluminium");
159  Hyp->SetListMat("Al97Mg3");
160  Hyp->SetListMat("titanium");
161  Hyp->SetListMat("HYPcarbon");
162  Hyp->SetListMat("siliconinactive");
163  Hyp->SetGeometryFileName("TargetSystem_Ti_TcT150um_filledCorners_addSens.root");
164  //Hyp->SetGeometryFileName("TargetSystem_Ti_AbsWindow_addSens.root");//SekTarget_open_varAbs4Si5_3Q_HYPbe_1mm_MVD.root");
165  }
166 
167  // ---------------------------------
168 
169  if(HYP_File){
170 
171  Hyp->SetHypSDtoFile(true,HYP_File);
172 
173  if(gam){
174  Hyp->SetHypGamFEm(gam);
175  Hyp->SetTreeFName("/data/work/kpha4/lorente/sim_panda/hypBupV1T_Decay_gam_"+prefix+".root");
176  }else{
177  Hyp->SetTreeFName("hypBupV1T_Decay_"+prefix+".root");
178  }
179  }
180 
181  Hyp->SetMatbud(false); //material budget hit Collection production
182 
183  fRun->AddModule(Hyp);
184 
185  //gROOT->LoadMacro("$VMCWORKDIR/gconfig/SetFragments.C");
186  //FragConfig(fRun);
187 
188  //fRun->SetUserDecay(kTRUE);
189 
190  // MVD outer structure
191  //--------------------
192 
193  /* FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
194  Mvd->SetGeometryFileName("Mvd-2.2_Simplified_onlyStrip5_z-verschoben550.root"); // only sensors, update follows
195  Mvd->SetVerboseLevel(verboseLevel);
196  fRun->AddModule(Mvd);*/
197 
198  // Create and Set Event Generator
199  //-------------------------------
200 
201 
202 
203  if(Decfile=="giBUU+backg"){
205  fRun->SetGenerator(primGen);
206  }else{
207  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
208  fRun->SetGenerator(primGen);
209  }
210 
211  // Box Generator:
212  if(Decfile=="box"){
213  PndBoxGenerator* boxGen = new PndBoxGenerator(3312, 1); // 13 = muon; 1 = multipl. // 211 = pi+
214  // first number: PDG particle code: 2nd number: particle multiplicity per event
215 
216  boxGen->SetPRange(.1,.5); // GeV/c
217  // boxGen->SetPtRange(1.,1.); // GeV/c
218  boxGen->SetPhiRange(0., 360.); // Azimuth angle range [degree] 90
219  boxGen->SetThetaRange(0., 180.); // Polar angle in lab system range [degree] 70
220 
221  boxGen->SetXYZ(0., 0., -55.0); // vertex coordinates [cm]
222  primGen->AddGenerator(boxGen);
223  }
224 
225 
226  // *** Signal events GiBUU + TH2F(correlated dist in P (theta)) ***first step
227  if(Decfile=="hist"){
228  PndCorrDistGenerator* GiBGen = new PndCorrDistGenerator(inFile);
229 
230  primGen->SetTarget(-55.5,0.);
231  primGen->AddGenerator(GiBGen);
232 
233  }
234  // *** Signal events GiBUU + Param from TH2F(correlated dist in P (theta)) ***first step
235  if(Decfile=="param"){
236  PndCorrDistGenerator* GiBGen = new PndCorrDistGenerator(inFile);
237  GiBGen->SetParam(); //setting parametrization to be be done.
238  GiBGen->SetThetaRange(90.,120.); // low momentum Xi minus
239  primGen->SetTarget(-55.5,0.);
240  primGen->AddGenerator(GiBGen);
241 
242  }
243  // *** SIGNAL events UrqmdSmm ***first step
244  if(Decfile=="giBUU"){
245 
247 
248  primGen->SetTarget(-55.5,0.);
249  primGen->AddGenerator(AsciiGen);
250  }
251 
252  if(Decfile=="giBUU+backg"){
253 
254  PndUrqmdSmmGenerator* AsciiGen = new PndUrqmdSmmGenerator(inFile);
255 
256  primGen->SetTarget(-55.5,0.);
257  primGen->AddGenerator(AsciiGen);
258  FairEvtFilterOnCounts* min1Lmd_1aLmd = new FairEvtFilterOnCounts();
259  min1Lmd_1aLmd->AndMinMaxPdgCodes(1, 9999, 3312); // request at least 1 Xim
260  min1Lmd_1aLmd->AndMinMaxPdgCodes(1, 9999, -3312); // request at least 1 anti-Xi plus
261  primGen->AndNotFilter(min1Lmd_1aLmd);
262  }
263 
264  // *** with Ascii inFile ***first step
265  //FairAsciiGenerator* AsciiGen = new FairAsciiGenerator(inFile);
266  // primGen->SetTarget(-55.5,0.);
267  //primGen->AddGenerator(AsciiGen);
268 
269  // *** with root inFile ***second step
270  if(Decfile=="hypbup"){
271 
273 
274  if(gam){
275  partGen->GammaEmissPar(kTRUE);
276  partGen->SetPRange(1.,1.);
277  partGen->SetPhiRange(0,360);
278  partGen->SetThetaRange(0,180);
279  }
280  primGen->AddGenerator(partGen);
281  }
282 
283 
284 
285 
287  fMagField->SetField(0, 0 ,10. ); // values are in kG
288  // MinX=-75, MinY=-40,MinZ=-12 ,MaxX=75, MaxY=40 ,MaxZ=124 ); // values are in cm
289  fMagField->SetFieldRegion(-50, 50,-50, 50, -200, 200);
290  fRun->SetField(fMagField);
291 
292 
293  /*PndMultiField *fField= new PndMultiField();
294  PndTransMap *map= new PndTransMap("TransMap", "R");
295  PndDipoleMap *map1= new PndDipoleMap("DipoleMap", "R");
296  PndSolenoidMap *map2= new PndSolenoidMap("SolenoidMap", "R");
297  fField->AddField(map);
298  fField->AddField(map1);
299  fField->AddField(map2);
300  fRun->SetField(fField);*/
301 
302  fRun->SetStoreTraj(kTRUE); // to store particle trajectories
303 
304 
305  fRun->Init();
306 
307 
308 
309  // Fill the Parameter containers for this run
310  //-------------------------------------------
311  // cout<<" gGeoManager "<<gGeoManager<<endl;
312  FairRuntimeDb *rtdb=fRun->GetRuntimeDb();
313 
314  // PndMultiFieldPar* fieldPar = (PndMultiFieldPar*) rtdb->getContainer("PndMultiFieldPar");
315  // if ( fField ) { fieldPar->SetParameters(fField); }
316  // fieldPar->setInputVersion(fRun->GetRunId(),1);
317  // fieldPar->setChanged();
318 
319  PndConstPar* fieldPar = (PndConstPar*) rtdb->getContainer("PndConstPar");
320  if ( fMagField ) { fieldPar->SetParameters(fMagField); }
321  fieldPar->setInputVersion(fRun->GetRunId(),1);
322  fieldPar->setChanged();
323 
324  Bool_t kParameterMerged=kTRUE;
325  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
326  //output->open("simparams.root");
327  if(Decfile=="param") output->open("/data/work/kpha4/lorente/sim_panda/Sim_hypFS1TG4Xm_SebGeo3params_"+prefix+".root");
328  if(Decfile=="giBUU") output->open("sim_gibuuparams.root");
329  if(Decfile=="box") output->open("sim_boxparams.root");
330  //output->open("Bup_hypFS1TG4XXbparams.root");
331  if(Decfile=="hypbup")output->open("Bup_hypFS1TG4Xmparams.root");
332 
333  if(Decfile=="giBUU+backg")output->open("/data/work/kpha4/lorente/sim_panda/Sim_hypFS1TG4Bg_SebGeoparams_"+prefix+".root");
334 
335  rtdb->setOutput(output);
336 
338 
339  // Transport nEvents
340  // -----------------
341  // Set the number of events
342  //Int_t nEvents =1000;//1002;//50505;
343 
344  fRun->Run(nEvents);
345  rtdb->saveOutput();
346  timer.Stop();
347 
348  Double_t rtime = timer.RealTime();
349  Double_t ctime = timer.CpuTime();
350  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
351  // delete fRun;
352  //exit(0);
353  return 0;
354 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetListMat(TString mat="carbon")
Definition: PndHyp.h:222
Definition: PndHyp.h:30
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
PndHyp * Hyp
Definition: runSimHF_ptr.C:73
PndUrqmdSmmGenerator * AsciiGen
Definition: sim_ftof.C:62
TString inFile
Definition: hit_dirc.C:8
PndHypBupGenerator * partGen
Definition: runSimHF_ptr.C:144
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
void SetSensorVol(TString VolSi)
Definition: PndHyp.h:195
FairRunAna * fRun
Definition: hit_dirc.C:58
PndConstField * fMagField
Definition: runSimHF_ptr.C:154
void SetMatbud(bool mbud)
Definition: PndHyp.h:188
Primary generator with added event filtering capabilities.
void SetHypSDtoFile(bool onf, bool val)
Definition: PndHyp.h:177
Double_t
FairModule * Cave
Definition: sim_emc_apd.C:32
void SetField(Double_t bX, Double_t bY, Double_t bZ)
Int_t nEvents
Definition: hit_dirc.C:11
PndMultiFieldPar * fieldPar
Definition: sim_ftof.C:102
TStopwatch timer
Definition: hit_dirc.C:51
void SetHypGamFEm(bool gam)
Definition: PndHyp.h:183
void SetAbsorberVol(TString VolAb)
Definition: PndHyp.h:199
void SetParameters(FairField *field)
Definition: PndConstPar.cxx:54
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void SetTreeFName(const Char_t *Name)
Definition: PndHyp.h:193
gDebug
Definition: sim_emc_apd.C:6
void SetThetaRange(Double_t thetLow=0., Double_t thetHigh=0.)
CandList gam
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
Double_t ctime
Definition: hit_dirc.C:114
FairBoxGenerator * boxGen
Definition: sim_emc_apd.C:85
void SetGeoVersion(TString vers="standard")
Definition: PndHyp.h:210
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
Double_t rtime
Definition: hit_dirc.C:113
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
Definition: PndCave.h:8