FairRoot/PandaRoot
Functions
QAmacro_hyp_1.C File Reference
#include "TString.h"

Go to the source code of this file.

Functions

int QAmacro_hyp_1 (Int_t nEvents=500, TString SimEngine="TGeant4", Bool_t HYP_File=false, Bool_t gam=false)
 

Function Documentation

int QAmacro_hyp_1 ( Int_t  nEvents = 500,
TString  SimEngine = "TGeant4",
Bool_t  HYP_File = false,
Bool_t  gam = false 
)

Definition at line 21 of file QAmacro_hyp_1.C.

References BeamMomentum, Bool_t, boxGen, Cave, ctime, Double_t, fField, fRun, gam, gDebug, Hyp, kParameterMerged, nEvents, output, primGen, printf(), rtdb, rtime, PndHyp::SetAbsorberVol(), PndHyp::SetGeoVersion(), PndHyp::SetHypGamFEm(), PndHyp::SetHypSDtoFile(), PndHyp::SetListMat(), PndHyp::SetMatbud(), PndHyp::SetSensorVol(), PndHyp::SetTreeFName(), timer, and TString.

22 {
23 
24  //-----User Settings:-----------------------------------------------
25  TString OutputFile ="hypqasim.root";
26  TString ParOutputfile ="hypqapar.root";
27  TString MediaFile ="media_pnd.geo";
28  gDebug = 0;
29 
30  Float_t BeamMomentum =3.0; // ** change HERE if you run Box generator
31  //------------------------------------------------------------------
32  TStopwatch timer;
33  timer.Start();
34  gRandom->SetSeed();
35 
36  // Create the Simulation run manager--------------------------------
37  FairRunSim *fRun = new FairRunSim();
38  fRun->SetName(SimEngine.Data() );
39  fRun->SetOutputFile(OutputFile.Data());
40  // fRun->SetGenerateRunInfo(kFALSE);
41  fRun->SetBeamMom(BeamMomentum);
42  fRun->SetMaterials(MediaFile.Data());
43  //fRun->SetUseFairLinks(kTRUE);
44  FairRuntimeDb *rtdb=fRun->GetRuntimeDb();
45 
46 
47  //---------------------Set Parameter output ----------
49  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
50  output->open(ParOutputfile.Data());
51  rtdb->setOutput(output);
52 
53  // Create and add detectors
54 
55  //------------------------- CAVE -----------------
56 
57  FairModule *Cave= new PndCave("CAVE");
58  Cave->SetGeometryFileName("pndcave.geo");
59  fRun->AddModule(Cave);
60 
61  //------------------------- HYP -----------------
62  PndHyp *Hyp = new PndHyp("HYP",kTRUE);
63  Hyp->SetAbsorberVol("Absorber"); // absorber layer
64  Hyp->SetSensorVol("Sensor"); // silicon sensor
65  Hyp->SetGeoVersion("List");
66  Hyp->SetListMat("HYPboron");
67  Hyp->SetListMat("HYPaluminium");
68  Hyp->SetListMat("Al97Mg3");
69  Hyp->SetListMat("titanium");
70  Hyp->SetListMat("HYPcarbon");
71  Hyp->SetListMat("siliconinactive");
72  Hyp->SetGeometryFileName("TargetSystem_WindowAbsB_insideAbsB.root");
73 
74  if(HYP_File){
75 
76  Hyp->SetHypSDtoFile(true,HYP_File);
77 
78  if(gam){
79  Hyp->SetHypGamFEm(gam);
80  Hyp->SetTreeFName("hypBupV1T_Decay_gam.root");
81  }else{
82  Hyp->SetTreeFName("hypBupV1T_Decay.root");
83  }
84  }
85 
86  Hyp->SetMatbud(false); //material budget hit Collection production
87 
88  fRun->AddModule(Hyp);
89 
90  //gROOT->LoadMacro("$VMCWORKDIR/gconfig/SetFragments.C");
91  //FragConfig(fRun);
92 
93  //fRun->SetUserDecay(kTRUE);
94 
95  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
96  fRun->SetGenerator(primGen);
97 
98  FairBoxGenerator* boxGen = new FairBoxGenerator(3312, 1); // 13 = muon; 1 = multipl.
99  boxGen->SetPRange(0.1,0.5); // GeV/c
100  boxGen->SetPhiRange(0., 360.); // Azimuth angle range [degree]
101  boxGen->SetThetaRange(5., 150.); // Polar angle in lab system range [degree]
102  boxGen->SetXYZ(0., 0., -55.); // cm
103  primGen->AddGenerator(boxGen);
104 
105 
106 
107  PndMultiField *fField= new PndMultiField("FULL");
108  fRun->SetField(fField);
109 
110  // EMC Hit producer
111  //-------------------------------
112 
113  //------------------------- Initialize the RUN -----------------
114  fRun->Init();
115  //------------------------- Run the Simulation -----------------
116  fRun->Run(nEvents);
117  //------------------------- Save the parameters -----------------
118  rtdb->saveOutput();
119  //------------------------Print some info and exit----------------
120  timer.Stop();
121  Double_t rtime = timer.RealTime();
122  Double_t ctime = timer.CpuTime();
123  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
124 
125  cout << " Test passed" << endl;
126  cout << " All ok " << endl;
127  delete fRun;
128  return 0;
129 
130 };
PndMultiField * fField
Definition: sim_emc_apd.C:97
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void SetListMat(TString mat="carbon")
Definition: PndHyp.h:222
Definition: PndHyp.h:30
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
PndHyp * Hyp
Definition: runSimHF_ptr.C:73
double BeamMomentum
Definition: sim_ftof_stof.C:17
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
void SetSensorVol(TString VolSi)
Definition: PndHyp.h:195
FairRunAna * fRun
Definition: hit_dirc.C:58
void SetMatbud(bool mbud)
Definition: PndHyp.h:188
void SetHypSDtoFile(bool onf, bool val)
Definition: PndHyp.h:177
Double_t
FairModule * Cave
Definition: sim_emc_apd.C:32
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
void SetHypGamFEm(bool gam)
Definition: PndHyp.h:183
void SetAbsorberVol(TString VolAb)
Definition: PndHyp.h:199
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void SetTreeFName(const Char_t *Name)
Definition: PndHyp.h:193
gDebug
Definition: sim_emc_apd.C:6
CandList gam
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
Double_t rtime
Definition: hit_dirc.C:113
Definition: PndCave.h:8