FairRoot/PandaRoot
Functions
simfast_single_allpid.C File Reference

Go to the source code of this file.

Functions

int simfast_single_allpid (int mult=5, int soff=0, int nevts=0, TString outfile="")
 

Function Documentation

int simfast_single_allpid ( int  mult = 5,
int  soff = 0,
int  nevts = 0,
TString  outfile = "" 
)

Macro for running fast simulation it will only fill the PndData without any transport(M. Al-Turany)

Definition at line 6 of file simfast_single_allpid.C.

References PndFastSim::AddDetector(), basiclibs(), boxGen, ctime, Double_t, PndFastSim::EnableSplitoffs(), fRun, gDebug, i, mult, outfile, primGen, printf(), rtime, PndFastSim::SetVerbosity(), and timer.

7 {
8  TStopwatch timer;
9  timer.Start();
10  gDebug=0;
11  // Load basic libraries
12  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
13  basiclibs();
14  // Load this example libraries
15  gSystem->Load("libGeoBase");
16  gSystem->Load("libParBase");
17  gSystem->Load("libBase");
18  gSystem->Load("libPndData");
19  gSystem->Load("libGen");
20  gSystem->Load("libRho");
21  gSystem->Load("libfsim");
22 
23  if (outfile=="") outfile="fastout.root";
24 
25 
26  FairRunSim *fRun = new FairRunSim();
27  fRun->SetOutputFile(outfile.Data());
28 
29  // Create and Set Event Generator
30  //-------------------------------
31 
32  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
33  fRun->SetGenerator(primGen);
34 
35  double pmin = 0.05;
36  double pmax = 8.0;
37  double thtmin = 0.;
38  double thtmax = 180.;
39 
40  int pdgcode[10]={11,-11,13,-13,211,-211,321,-321,2212,-2212};
41 
42  int i;
43 
44  FairBoxGenerator *boxGen[10];
45 
46  for (i=0;i<10;i++){
47  boxGen[i] =new FairBoxGenerator();
48  boxGen[i]->SetMultiplicity(mult);
49  boxGen[i]->SetPDGType(pdgcode[i]);
50  boxGen[i]->SetThetaRange(thtmin,thtmax);
51  boxGen[i]->SetPRange(pmin,pmax);
52  //boxGen[i]->SetCosTheta();
53  primGen->AddGenerator(boxGen[i]);
54  }
55 
56 
57  // FairEvtGenGenerator* evtGen = new FairEvtGenGenerator(infile.Data());
58  // primGen->AddGenerator(evtGen);
59 
60  primGen->DoTracking(kFALSE);
61 
62 
63  //Setup the Fast Simulation Task
64  //-----------------------------
65  PndFastSim* fastSim = new PndFastSim();
66 
67  //increasing verbosity increases the amount of console output (mainly for debugging)
68  fastSim->SetVerbosity(0);
69 
70  //enable the producting of parametrized neutral (hadronic) split offs
71  if (soff)
72  fastSim->EnableSplitoffs("../../fsim/splitpars.dat");
73 
74  //EM Calorimeters w/ default parameters (don't have to be set, just to list the available parameters)
75  fastSim->AddDetector("EmcBarrel","thtMin=22.0 thtMax=140.0 Emin=0.01 barrelRadius=0.5");
76  fastSim->AddDetector("EmcFwCap", "thtMin=5.0 thtMax=22.0 Emin=0.01 dist=2.5");
77  fastSim->AddDetector("EmcBwCap", "thtMin=140.0 thtMax=170.0 Emin=0.01 dist=0.7");
78  fastSim->AddDetector("EmcFS", "thtMin=0.05 thtMax=5.0 aPar=0.02 bPar=0.0274 Emin=0.01 dist=8.0");
79 
80  //Tracking, Vertexing, dE/dx
81  fastSim->AddDetector("Mvd", "thtMin=0.0 thtMax=180.0 vtxRes=0.0001 pRes=0.05 phiRes=0.01 thetaRes=0.01 dEdxRes=0.25");
82  fastSim->AddDetector("Stt", "thtMin=7.765 thtMax=159.44 dEdxRes=0.2");
83  fastSim->AddDetector("MdcTS","thtMin=0.5 thtMax=22.0");
84  fastSim->AddDetector("MdcFS","thtMin=0.5 angleXMax=10.0 angleYMax=5.0");
85  //fastSim->AddDetector("Tpc", "thtMin=7.765 thtMax=159.44 efficiency=1.0 pmin=0.0 pRes=0.005 phiRes=0.1 thetaRes=0.1 dEdxRes=0.07");
86 
87  //PID detectors
88  fastSim->AddDetector("DrcBarrel","thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
89  fastSim->AddDetector("DrcDisc","thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
90  fastSim->AddDetector("Rich","angleXMax=5.0 angleYMax=10.0 efdthtc=0.01 nPhotMin=5 effNPhotons=0.075");
91  fastSim->AddDetector("Tof","thtMin=22.0 thtMax=140.0 dp=0.01");
92 
93  fRun->AddTask(fastSim);
94 
95  fRun->Init();
96  if (nevts==0) nevts=10;
97  fRun->Run(nevts);
98 
99  timer.Stop();
100  Double_t rtime = timer.RealTime();
101  Double_t ctime = timer.CpuTime();
102  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
103  return 0;
104 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
basiclibs()
Int_t i
Definition: run_full.C:25
bool AddDetector(std::string name, std::string params="")
Definition: PndFastSim.cxx:313
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
FairRunAna * fRun
Definition: hit_dirc.C:58
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
gDebug
Definition: sim_emc_apd.C:6
bool EnableSplitoffs(std::string fname="splitpars.dat")
Definition: PndFastSim.cxx:224
Double_t ctime
Definition: hit_dirc.C:114
FairBoxGenerator * boxGen
Definition: sim_emc_apd.C:85
void SetVerbosity(int vb)
Definition: PndFastSim.h:59
Double_t rtime
Definition: hit_dirc.C:113
Double_t mult
TString outfile