Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:10

0001 #include <iostream>
0002 #include <ostream>
0003 #include <fstream>
0004 #include <cctype>
0005 #include <string>
0006 #include <math.h>
0007 #include <cstdlib>
0008 
0009 #include "TROOT.h"
0010 #include "TF1.h"
0011 #include "TH1.h"
0012 #include "TH2.h"
0013 #include "TH3.h"
0014 #include "TNtuple.h"
0015 #include "TFile.h"
0016 #include "TRandom.h"
0017 #include "TMath.h"
0018 #include "TCanvas.h"
0019  
0020 
0021 char title[100];
0022 char cfile[100];
0023 //char *cflag"";
0024 
0025 // length, width of the rectangular towers is now in "arbitrary units",
0026 // essentially something about a Moliere-radius
0027 
0028 const double dlength = 20.0; // tower length, arb units
0029 const double ddedx = 0.0025;  // deposit in one step of mip
0030 const double ddzmip = 0.2; // that is constant as opposed to had stepsize
0031 
0032 // The following parameters are the most crucial to play with
0033 // for instance dmipstop=0.994 with 100 steps gives 55% probability that the particle
0034 // will never start a shower, survives as MIP
0035 const double dmipstop = 0.994; // if uniform ends up above this, stop MIP
0036 const double dresol = 0.18;  // resolution
0037 //const double ddeem = 0.05;  // deposit in one step of em part
0038 //const double ddehad = 0.1;  // deposit in one step of hadronic
0039 // Width terms of the em and hadronic showers, 
0040 // irrelevant for total deposit (modulo edge effects), crucial for shape
0041 const double dwidthem = 0.11;
0042 const double dwidthhad = 0.3;
0043 
0044 const double dtothade = 12.0;    // May want to make a runtime param
0045 
0046 
0047 const int ntry=3000;  // generate that many particles
0048 const int ndefmipstep = 100;  // max step of MIP
0049 const int ndefshstep = 1000;  // default number of steps for hadron showers
0050 const int nlive = 100;  // 1/frequency of live display
0051 
0052 
0053 const int nbin=40;
0054 const double xlo=-20.0;
0055 const double xhi=20.0;
0056 const double ylo=-20.0;
0057 const double yhi=20.0;
0058 const double zlo=0.0;
0059 const double zhi=20.0;