T2KEvGenMetaData.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2020, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
7  University of Liverpool & STFC Rutherford Appleton Laboratory
8 */
9 //____________________________________________________________________________
10 
11 #include "T2KEvGenMetaData.h"
12 
13 using std::endl;
14 
16 
17 //____________________________________________________________________________
18 namespace genie
19 {
20  namespace utils
21  {
22  ostream & operator << (ostream & stream, const T2KEvGenMetaData & md)
23  {
24  md.Print(stream);
25  return stream;
26  }
27  }
28 }
29 //____________________________________________________________________________
31 {
32  stream << endl;
33 
34  if(this->jnubeam_version.size() > 0) {
35  stream << "jnubeam version = " << this->jnubeam_version << endl;
36  }
37  if(this->jnubeam_file.size() > 0) {
38  stream << "flux ntuple filename = " << this->jnubeam_file << endl;
39  }
40  if(this->detector_location.size() > 0) {
41  stream << "detector location = " << this->detector_location << endl;
42  }
43  if(this->geom_file.size() > 0) {
44  stream << "detector geometry file = " << this->geom_file << endl;
45  }
46 
47  map<int, TH1D*> fluxhists = this->flux_hists;
48  if(fluxhists.size()>0) {
49  stream << "found flux histograms:" << endl;
50  }
51  map<int, TH1D*>::const_iterator hist_iter = fluxhists.begin();
52  while(hist_iter != fluxhists.end()){
53  TH1D * curr_hist = (TH1D*) hist_iter->second;
54  if(curr_hist){
55  stream << " - name = " << curr_hist->GetName()
56  << " (entries: " << curr_hist->GetEntries()
57  << ", mean: " << curr_hist->GetMean()
58  << ") --> neutrino pdg = " << hist_iter->first << endl;
59  ++hist_iter;
60  }//curr_hist
61  }//hist_iter
62 
63  map<int, double> targetmix = this->target_mix;
64  if(targetmix.size()>0) {
65  stream << "found target mix:" << endl;
66  }
67  map<int, double>::const_iterator target_iter = targetmix.begin();
68  while(target_iter != targetmix.end()){
69  stream << " - target pdg = " << target_iter->first
70  << ", weight fraction = " << target_iter->second << endl;
71  ++target_iter;
72  }
73 }
74 //____________________________________________________________________________
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
intermediate_table::const_iterator const_iterator
ostream & operator<<(ostream &stream, const T2KEvGenMetaData &md)
void Print(ostream &stream) const
Definition: utils.py:1
ClassImp(genie::utils::T2KEvGenMetaData)
Utility class to store MC job meta-data.
QTextStream & endl(QTextStream &s)