FairRoot/PandaRoot
Functions
tutorials/analysis/simfast_dpm.C File Reference

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 5 of file tutorials/analysis/simfast_dpm.C.

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

6 {
7  TStopwatch timer;
8  timer.Start();
9  gDebug=0;
10 
11  // Load basic libraries
12  // Load basic libraries
13  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
14  rootlogon();
15 
16  // Load this libraries
17  gSystem->Load("libRho");
18  gSystem->Load("libfastsim");
19 
20  double mp=0.938272;
21  double p=0,M=0;
22 
23  // determine the pbar mom and E_cms for DPM generator
24  if (mom>0)
25  {
26  p=mom;
27  double E=sqrt(mp*mp+mom*mom)+mp;
28  M=sqrt(E*E-mom*mom);
29  }
30  else
31  {
32  M=-mom;
33  double X = (M*M-2*mp*mp)/(2*mp);
34  p = sqrt(X*X-mp*mp);
35  }
36 
37  char tmp[100];
38  sprintf(tmp,"dpm%d_%6.4f_%dk.fast.root",mode,M,nevts/1000);
39  if (outfile=="") outfile=TString(tmp);
40 
41  FairRunSim *fRun = new FairRunSim();
42  fRun->SetOutputFile(outfile.Data());
43  fRun->SetName("TGeant3");
44 
45  // Create and Set Event Generator
46  //-------------------------------
47 
48  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
49  fRun->SetGenerator(primGen);
50 
51  //PndDpmGenerator* dpmGen = new PndDpmGenerator(infile.Data());
52  /* *
53  * 0. - No elastic scattering, only inelastic
54  * 1. - Elastic and inelastic interactions
55  * 2. - Only elastic scattering, no inelastic one
56  */
58  primGen->AddGenerator(dpmGen);
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("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.1 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  fRun->Run(nevts);
97 
98  timer.Stop();
99  Double_t rtime = timer.RealTime();
100  Double_t ctime = timer.CpuTime();
101  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
102 }
Double_t p
Definition: anasim.C:58
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
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