FairRoot/PandaRoot
Functions
macro/examples/fastsim/simfast_dpm.C File Reference

Go to the source code of this file.

Functions

int simfast_dpm (double mom, int mode=0, int soff=0, int nevts=100, TString outfile="")
 

Function Documentation

int simfast_dpm ( double  mom,
int  mode = 0,
int  soff = 0,
int  nevts = 100,
TString  outfile = "" 
)

Definition at line 5 of file macro/examples/fastsim/simfast_dpm.C.

References PndFastSim::AddDetector(), basiclibs(), ctime, Double_t, dpmGen, PndFastSim::EnableSplitoffs(), fRun, gDebug, mode, mom, mp, outfile, p, primGen, printf(), rtime, PndFastSim::SetVerbosity(), sqrt(), timer, TString, and X.

6 {
7  TStopwatch timer;
8  timer.Start();
9  gDebug=0;
10 
11  // Load basic libraries
12  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
13  basiclibs();
14 
15  // Load this example libraries
16  gSystem->Load("libGeoBase");
17  gSystem->Load("libParBase");
18  gSystem->Load("libBase");
19  gSystem->Load("libPndData");
20  gSystem->Load("libDpmEvtGen");
21  gSystem->Load("libPGen");
22  //gSystem->Load("libGen");
23  gSystem->Load("libRho");
24  gSystem->Load("libfsim");
25 
26  double mp=0.938272;
27  double p=0,M=0;
28 
29  // determine the pbar mom and E_cms for DPM generator
30  if (mom>0)
31  {
32  p=mom;
33  double E=sqrt(mp*mp+mom*mom)+mp;
34  M=sqrt(E*E-mom*mom);
35  }
36  else
37  {
38  M=-mom;
39  double X = (M*M-2*mp*mp)/(2*mp);
40  p = sqrt(X*X-mp*mp);
41  }
42 
43  char tmp[100];
44  sprintf(tmp,"dpm%d_%6.4f_%dk.fast.root",mode,M,nevts/1000);
45  if (outfile=="") outfile=TString(tmp);
46 
47  FairRunSim *fRun = new FairRunSim();
48  fRun->SetOutputFile(outfile.Data());
49 
50  // Create and Set Event Generator
51  //-------------------------------
52 
53  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
54  fRun->SetGenerator(primGen);
55 
56  //PndDpmGenerator* dpmGen = new PndDpmGenerator(infile.Data());
57  /* *
58  * 0. - No elastic scattering, only inelastic
59  * 1. - Elastic and inelastic interactions
60  * 2. - Only elastic scattering, no inelastic one
61  */
63  primGen->AddGenerator(dpmGen);
64 
65  primGen->DoTracking(kFALSE);
66 
67 
68  //Setup the Fast Simulation Task
69  //-----------------------------
70  PndFastSim* fastSim = new PndFastSim();
71 
72  //increasing verbosity increases the amount of console output (mainly for debugging)
73  fastSim->SetVerbosity(0);
74 
75  //enable the producting of parametrized neutral (hadronic) split offs
76  if (soff)
77  fastSim->EnableSplitoffs("splitpars.dat");
78 
79  //EM Calorimeters w/ default parameters (don't have to be set, just to list the available parameters
80  fastSim->AddDetector("EmcBarrel","thtMin=22.0 thtMax=140.0 Emin=0.01 barrelRadius=0.5");
81  fastSim->AddDetector("EmcFwCap", "thtMin=5.0 thtMax=22.0 Emin=0.01 dist=2.5");
82  fastSim->AddDetector("EmcBwCap", "thtMin=140.0 thtMax=170.0 Emin=0.01 dist=0.7");
83  fastSim->AddDetector("EmcFS", "thtMin=0.05 thtMax=5.0 aPar=0.02 bPar=0.0274 Emin=0.01 dist=8.0");
84 
85  //Tracking, Vertexing, dE/dx
86  fastSim->AddDetector("Mvd", "thtMin=0.0 thtMax=180.0 vtxRes=0.0001 pRes=0.1 phiRes=0.01 thetaRes=0.01 dEdxRes=0.25");
87  fastSim->AddDetector("Stt", "thtMin=7.765 thtMax=159.44 dEdxRes=0.2");
88  fastSim->AddDetector("MdcTS","thtMin=0.5 thtMax=22.0");
89  fastSim->AddDetector("MdcFS","thtMin=0.5 angleXMax=10.0 angleYMax=5.0");
90  //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");
91 
92  //PID detectors
93  fastSim->AddDetector("DrcBarrel","thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
94  fastSim->AddDetector("DrcDisc","thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
95  fastSim->AddDetector("Rich","angleXMax=5.0 angleYMax=10.0 efdthtc=0.01 nPhotMin=5 effNPhotons=0.075");
96  fastSim->AddDetector("Tof","thtMin=22.0 thtMax=140.0 dp=0.01");
97 
98  fRun->AddTask(fastSim);
99 
100  fRun->Init();
101  fRun->Run(nevts);
102 
103  timer.Stop();
104  Double_t rtime = timer.RealTime();
105  Double_t ctime = timer.CpuTime();
106  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
107  return 0;
108 }
Double_t p
Definition: anasim.C:58
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
basiclibs()
PndDpmGenerator * dpmGen
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
bool AddDetector(std::string name, std::string params="")
Definition: PndFastSim.cxx:313
Double_t mom
Definition: plot_dirc.C:14
static const double mp
Definition: mzparameters.h:11
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
FairRunAna * fRun
Definition: hit_dirc.C:58
Int_t mode
Definition: autocutx.C:47
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
double X
Definition: anaLmdDigi.C:68
void SetVerbosity(int vb)
Definition: PndFastSim.h:59
Double_t rtime
Definition: hit_dirc.C:113
TString outfile