19 if (!
getenv(
"WIMPSIM_DIR")) {
30 unsigned int ann_chan;
31 double cm_energy,
mwimp;
33 bool wimpann_outp, use_earth_ann, wimpann_sum;
34 std::string file_s, file_e, file_info, file_sum_s, file_sum_e;
36 use_earth_ann, file_s, file_e, file_info,
37 wimpann_sum, file_sum_s, file_sum_e);
38 mwimp = cm_energy / 2.0;
46 for (
size_t i=0;
i<ss.str().length() &&
i<20;
i++) {
47 cseed[
i] = ss.str().c_str()[
i];
49 for (
size_t i=ss.str().length();
i<20;
i++) {
80 TFile*
file = TFile::Open(fnameout.c_str(),
"RECREATE");
81 TTree* fluxntp =
new TTree(
"flux",
"a simple flux n-tuple");
82 TTree* metantp =
new TTree(
"meta",
"metadata for flux n-tuple");
87 fluxntp->Branch(
"entry",&fentry);
88 fluxntp->Branch(
"numi",&fnumi);
89 fluxntp->Branch(
"aux",&faux);
90 metantp->Branch(
"meta",&fmeta);
94 std::set<int> pdglist;
96 double minwgt = +1.0e10;
97 double maxwgt = -1.0e10;
99 UInt_t metakey =
TString::Hash(fnameout.c_str(),strlen(fnameout.c_str()));
102 metakey &= 0x7FFFFFFF;
105 TRandom3 *myRand =
new TRandom3(0);
113 long int nann_sofar = 0;
115 unsigned nok = 0, nwrite = 0;
117 for (
unsigned int i=0;
i<=nann/100000;
i++) {
118 unsigned int todo = (nann-
i*100000<100000) ? nann-
i*100000 : 100000;
124 for (
unsigned int j=0;
j<
nus_.nnus;
j++) {
132 if (enu <
enumin)
continue;
140 double a_e, a_mu, a_tau, phi_e, phi_mu, phi_tau;
148 phi_mu = phi_mu-phi_e;
149 phi_tau = phi_tau-phi_e;
180 double r = myRand->Rndm();
183 else if (r < (pe+pmu)) fam = 2;
198 double wgt,
x,
y,
z, px, py, pz;
234 px = enu *
cos(part_el) *
sin(phi);
235 py = - enu *
sin(part_el);
236 pz = - enu *
cos(part_el) *
cos(phi);
281 faux->
auxdbl.push_back(wgt);
282 faux->
auxint.push_back(nann);
287 pdglist.insert(fentry->
pdg);
288 minwgt = TMath::Min(minwgt, fentry->
wgt);
289 maxwgt = TMath::Max(maxwgt, fentry->
wgt);
290 maxe = TMath::Max(maxe, fentry->
E);
297 std::set<int>::const_iterator setitr = pdglist.begin();
298 for ( ; setitr != pdglist.end(); ++setitr) fmeta->
pdglist.push_back(*setitr);
309 std::cout <<
"Generated " << nwrite <<
" (" << nok <<
" w/ E >" 312 << nann_sofar <<
" nAnn " <<
" ( request " << nann <<
" )" 319 std::cout <<
"Last GSimpleNtpEntry: " << std::endl
322 <<
"Last GSimpleNtpMeta: " << std::endl
400 char time_text[27] =
"D0V 2013 ";
Double_t E
energy in lab frame
void RandGen(long int seed)
const unsigned int WE_INT
int main(int argc, char *argv[])
const std::string FILE_SUM_E
Double_t pdpx
nu parent momentum at time of decay
Double_t px
x momentum in lab frame
Double_t vtxy
y position in lab frame
Float_t x1[n_points_granero]
Double_t vx
vertex position of hadron/muon decay
const unsigned int WE_MED
const unsigned int ANN_CHAN
Int_t tptype
parent particle type at target exit
std::vector< Double_t > auxdbl
additional doubles associated w/ entry
::xsd::cxx::tree::time< char, simple_type > time
std::vector< Int_t > auxint
additional ints associated w/ entry
double astxt2mjd_(char *)
const double NOVA_AZIMUTH
void get_wimpann_info(unsigned int &, double &, unsigned int &, bool &, bool &, std::string &, std::string &, std::string &, bool &, std::string &, std::string &)
unsigned int nutype(unsigned int u)
Double_t pppx
nu parent momentum at production point
void pygive_(char *, size_t)
std::string getenv(std::string const &name)
Double_t vtxz
z position in lab frame
const unsigned nFluxEntries
void genevt_(unsigned int *channel, unsigned int *nev)
Int_t ppmedium
tracking medium where parent was produced
Double_t tpx
parent particle px at target exit
const std::string FILE_SUM_S
std::size_t Hash(const std::vector< std::size_t > &vals)
Generate a unique hash from a sequence of integers.
int get_pdg(unsigned wimpevent_nui)
Double_t vtxx
x position in lab frame
Double_t pz
z momentum in lab frame
Double_t dist
distance from hadron decay
void get_wimpevent_info()
UInt_t metakey
key to meta data
Double_t py
y momentum in lab frame
const std::string FILE_INFO
Int_t ptype
parent type (PDG)