Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/hadronic/Hadr01/src/Histo.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/hadronic/Hadr01/src/Histo.cc (Version 11.3.0) and /examples/extended/hadronic/Hadr01/src/Histo.cc (Version 9.6.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file hadronic/Hadr01/src/Histo.cc             26 /// \file hadronic/Hadr01/src/Histo.cc
 27 /// \brief Implementation of the Histo class       27 /// \brief Implementation of the Histo class
 28 //                                                 28 //
                                                   >>  29 // $Id$
 29 //                                                 30 //
 30 //--------------------------------------------     31 //---------------------------------------------------------------------------
 31 //                                                 32 //
 32 // ClassName:   Histo - Generic histogram/ntup     33 // ClassName:   Histo - Generic histogram/ntuple manager class
 33 //                                                 34 //
 34 //                                                 35 //
 35 // Author:      V.Ivanchenko 30.10.03              36 // Author:      V.Ivanchenko 30.10.03
 36 //                                                 37 //
 37 //--------------------------------------------     38 //----------------------------------------------------------------------------
 38 //                                                 39 //
 39                                                    40 
 40 //....oooOO0OOooo........oooOO0OOooo........oo <<  41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 41 //....oooOO0OOooo........oooOO0OOooo........oo <<  42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 42                                                    43 
 43 #include "Histo.hh"                                44 #include "Histo.hh"
 44                                                << 
 45 #include "HistoMessenger.hh"                       45 #include "HistoMessenger.hh"
 46                                                << 
 47 #include "G4RootAnalysisManager.hh"                46 #include "G4RootAnalysisManager.hh"
 48                                                    47 
 49 //....oooOO0OOooo........oooOO0OOooo........oo <<  48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 50 //....oooOO0OOooo........oooOO0OOooo........oo <<  49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 51                                                    50 
 52 Histo::Histo()                                     51 Histo::Histo()
 53   : fManager(nullptr),                         << 
 54     fHistName("test"),                         << 
 55     fTupleName("tuple"),                       << 
 56     fTupleTitle("test"),                       << 
 57     fNHisto(0),                                << 
 58     fVerbose(0),                               << 
 59     fDefaultAct(true),                         << 
 60     fHistoActive(false),                       << 
 61     fNtupleActive(false)                       << 
 62 {                                                  52 {
                                                   >>  53   fManager   = 0;
 63   fMessenger = new HistoMessenger(this);           54   fMessenger = new HistoMessenger(this);
                                                   >>  55  
                                                   >>  56   fHistName   = "test";
                                                   >>  57   fHistType   = "root";
                                                   >>  58   fTupleName  = "tuple";
                                                   >>  59   fTupleTitle = "test";
                                                   >>  60   fNHisto     = 0;
                                                   >>  61   fVerbose    = 0;
                                                   >>  62   fDefaultAct = true;
                                                   >>  63   fHistoActive= false;
                                                   >>  64   fNtupleActive= false;
 64 }                                                  65 }
 65                                                    66 
 66 //....oooOO0OOooo........oooOO0OOooo........oo <<  67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 67                                                    68 
 68 Histo::~Histo()                                    69 Histo::~Histo()
 69 {                                                  70 {
 70   delete fMessenger;                               71   delete fMessenger;
                                                   >>  72   delete fManager;
 71 }                                                  73 }
 72                                                    74 
 73 //....oooOO0OOooo........oooOO0OOooo........oo <<  75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 74                                                    76 
 75 void Histo::Book()                                 77 void Histo::Book()
 76 {                                                  78 {
 77   if (!(fHistoActive || fNtupleActive)) {      <<  79   if(!(fHistoActive || fNtupleActive)) { return; }
 78     return;                                    << 
 79   }                                            << 
 80                                                    80 
 81   // Always creating analysis manager              81   // Always creating analysis manager
 82   fManager = G4RootAnalysisManager::Instance() <<  82   fManager = G4RootAnalysisManager::Instance(); 
 83                                                    83 
 84   // Creating a tree mapped to a new hbook fil     84   // Creating a tree mapped to a new hbook file.
 85   G4String nam = fHistName + ".root";          <<  85   G4String nam = fHistName + "." + fHistType;
 86                                                    86 
 87   // Open file histogram file                      87   // Open file histogram file
 88   if (!fManager->OpenFile(nam)) {              <<  88   if(!fManager->OpenFile(nam)) {
 89     G4cout << "Histo::Book: ERROR open file <"     89     G4cout << "Histo::Book: ERROR open file <" << nam << ">" << G4endl;
 90     fHistoActive = false;                          90     fHistoActive = false;
 91     fNtupleActive = false;                         91     fNtupleActive = false;
 92     return;                                    <<  92     return; 
 93   }                                                93   }
 94   G4cout << "### Histo::Save: Opended file <"  <<  94   G4cout << "### Histo::Save: Opended file <" << nam << ">  for " 
 95          << G4endl;                            <<  95          << fNHisto << " histograms " << G4endl;
 96                                                    96 
 97   // Creating an 1-dimensional histograms in t     97   // Creating an 1-dimensional histograms in the root directory of the tree
 98   for (G4int i = 0; i < fNHisto; ++i) {        <<  98   for(G4int i=0; i<fNHisto; ++i) {
 99     if (fActive[i]) {                          <<  99     if(fActive[i]) {
100       G4String ss = "h" + fIds[i];                100       G4String ss = "h" + fIds[i];
101       fHisto[i] = fManager->CreateH1(ss, fTitl    101       fHisto[i] = fManager->CreateH1(ss, fTitles[i], fBins[i], fXmin[i], fXmax[i]);
102       if (fVerbose > 0) {                      << 102       if(fVerbose > 0) {
103         G4cout << "Created histogram #" << i < << 103         G4cout << "Created histogram #" << i << "  id= " << fHisto[i]
104                << fTitles[i] << G4endl;        << 104                << "  "  << ss << "  " << fTitles[i] << G4endl;
105       }                                           105       }
106     }                                             106     }
107   }                                               107   }
108   // Creating a tuple factory, whose tuples wi    108   // Creating a tuple factory, whose tuples will be handled by the tree
109   if (fNtupleActive) {                         << 109   if(fNtupleActive) {
110     fManager->CreateNtuple(fTupleName, fTupleT << 110     fManager->CreateNtuple(fTupleName,fTupleTitle); 
111     G4int i;                                      111     G4int i;
112     G4int n = fNtupleI.size();                    112     G4int n = fNtupleI.size();
113     for (i = 0; i < n; ++i) {                  << 113     for(i=0; i<n; ++i) { 
114       if (fTupleI[i] == -1) {                  << 114       if(fTupleI[i] == -1) {  fTupleI[i] = fManager->CreateNtupleIColumn(fNtupleI[i]); }
115         fTupleI[i] = fManager->CreateNtupleICo << 
116       }                                        << 
117     }                                             115     }
118     n = fNtupleF.size();                          116     n = fNtupleF.size();
119     for (i = 0; i < n; ++i) {                  << 117     for(i=0; i<n; ++i) { 
120       if (fTupleF[i] == -1) {                  << 118       if(fTupleF[i] == -1) {  fTupleF[i] = fManager->CreateNtupleFColumn(fNtupleF[i]); }
121         fTupleF[i] = fManager->CreateNtupleFCo << 
122       }                                        << 
123     }                                             119     }
124     n = fNtupleD.size();                          120     n = fNtupleD.size();
125     for (i = 0; i < n; ++i) {                  << 121     for(i=0; i<n; ++i) { 
126       if (fTupleD[i] == -1) {                  << 122       if(fTupleD[i] == -1) {  fTupleD[i] = fManager->CreateNtupleDColumn(fNtupleD[i]); }
127         fTupleD[i] = fManager->CreateNtupleDCo << 
128       }                                        << 
129     }                                             123     }
130   }                                               124   }
131 }                                              << 125 } 
132                                                   126 
133 //....oooOO0OOooo........oooOO0OOooo........oo << 127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
134                                                   128 
135 void Histo::Save()                                129 void Histo::Save()
136 {                                                 130 {
137   if (!(fHistoActive || fNtupleActive)) {      << 131   if(!(fHistoActive || fNtupleActive)) { return; }
138     return;                                    << 132 
139   }                                            << 133   // Creating a tree mapped to a new hbook file.
                                                   >> 134   G4String nam = fHistName + "." + fHistType;
140                                                   135 
141   // Write histogram file                         136   // Write histogram file
142   if (!fManager->Write()) {                    << 137   if(!fManager->Write()) {
143     G4cout << "Histo::Save: FATAL ERROR writin << 138     G4cout   << "Histo::Save: FATAL ERROR writing ROOT file" << G4endl;
144     exit(1);                                      139     exit(1);
145   }                                               140   }
146   if (fVerbose > 0) {                          << 141   if(fVerbose > 0) {
147     G4cout << "### Histo::Save: Histograms and    142     G4cout << "### Histo::Save: Histograms and Ntuples are saved" << G4endl;
148   }                                               143   }
149   if (fManager->CloseFile() && fVerbose > 0) { << 144   if(fManager->CloseFile() && fVerbose > 0) {
150     G4cout << "Histo::Save: File is closed" << << 145     G4cout << "                 File is closed" << G4endl;
151   }                                               146   }
152   fManager->Clear();                           << 147   delete G4RootAnalysisManager::Instance();
153 }                                              << 148   fManager = 0;
154                                                << 149 } 
155 //....oooOO0OOooo........oooOO0OOooo........oo << 150 
156                                                << 151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
157 void Histo::Add1D(const G4String& id, const G4 << 152 
158                   G4double u)                  << 153 void Histo::Add1D(const G4String& id, const G4String& name, G4int nb, 
159 {                                              << 154                   G4double x1, G4double x2, G4double u)
160   if (fVerbose > 0) {                          << 155 {
161     G4cout << "Histo::Add1D: New histogram wil << 156   if(fVerbose > 0) {
162            << "  " << x1 << "  " << x2 << "  " << 157     G4cout << "Histo::Add1D: New histogram will be booked: #" << id << "  <" << name 
                                                   >> 158            << "  " << nb << "  " << x1 << "  " << x2 << "  " << u 
                                                   >> 159            << G4endl;
163   }                                               160   }
164   ++fNHisto;                                      161   ++fNHisto;
165   x1 /= u;                                        162   x1 /= u;
166   x2 /= u;                                        163   x2 /= u;
167   fActive.push_back(fDefaultAct);                 164   fActive.push_back(fDefaultAct);
168   fBins.push_back(nb);                            165   fBins.push_back(nb);
169   fXmin.push_back(x1);                            166   fXmin.push_back(x1);
170   fXmax.push_back(x2);                            167   fXmax.push_back(x2);
171   fUnit.push_back(u);                             168   fUnit.push_back(u);
172   fIds.push_back(id);                             169   fIds.push_back(id);
173   fTitles.push_back(name);                        170   fTitles.push_back(name);
174   fHisto.push_back(-1);                           171   fHisto.push_back(-1);
175 }                                                 172 }
176                                                   173 
177 //....oooOO0OOooo........oooOO0OOooo........oo << 174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
178                                                   175 
179 void Histo::SetHisto1D(G4int i, G4int nb, G4do    176 void Histo::SetHisto1D(G4int i, G4int nb, G4double x1, G4double x2, G4double u)
180 {                                                 177 {
181   if (i >= 0 && i < fNHisto) {                 << 178   if(i>=0 && i<fNHisto) {
182     if (fVerbose > 0) {                        << 179     if(fVerbose > 0) {
183       G4cout << "Histo::SetHisto1D: #" << i << << 180       G4cout << "Histo::SetHisto1D: #" << i  
                                                   >> 181              << "  " << nb << "  " << x1 << "  " << x2 << "  " << u 
184              << G4endl;                           182              << G4endl;
185     }                                             183     }
186     fBins[i] = nb;                                184     fBins[i] = nb;
187     fXmin[i] = x1;                                185     fXmin[i] = x1;
188     fXmax[i] = x2;                                186     fXmax[i] = x2;
189     fUnit[i] = u;                                 187     fUnit[i] = u;
190     fActive[i] = true;                            188     fActive[i] = true;
191     fHistoActive = true;                          189     fHistoActive = true;
192   }                                            << 190   } else {
193   else {                                       << 
194     G4cout << "Histo::SetHisto1D: WARNING! wro    191     G4cout << "Histo::SetHisto1D: WARNING! wrong histogram index " << i << G4endl;
195   }                                               192   }
196 }                                                 193 }
197                                                   194 
198 //....oooOO0OOooo........oooOO0OOooo........oo << 195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
199                                                   196 
200 void Histo::Activate(G4int i, G4bool val)         197 void Histo::Activate(G4int i, G4bool val)
201 {                                                 198 {
202   if (fVerbose > 1) {                          << 199   if(fVerbose > 1) {
203     G4cout << "Histo::Activate: Histogram: #"  << 200     G4cout << "Histo::Activate: Histogram: #" << i << "   "  
                                                   >> 201            << val << G4endl;   
204   }                                               202   }
205   if (i >= 0 && i < fNHisto) {                 << 203   if(i>=0 && i<fNHisto) { 
206     fActive[i] = val;                          << 204     fActive[i] = val; 
207     if (val) {                                 << 205     if(val) { fHistoActive = true; }
208       fHistoActive = true;                     << 
209     }                                          << 
210   }                                               206   }
211 }                                                 207 }
212                                                   208 
213 //....oooOO0OOooo........oooOO0OOooo........oo << 209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
214                                                   210 
215 void Histo::Fill(G4int i, G4double x, G4double    211 void Histo::Fill(G4int i, G4double x, G4double w)
216 {                                                 212 {
217   if (!fHistoActive) {                         << 213   if(!fHistoActive) { return; }
218     return;                                    << 214   if(fVerbose > 1) {
219   }                                            << 215     G4cout << "Histo::Fill: Histogram: #" << i << " at x= " << x 
220   if (fVerbose > 1) {                          << 216            << "  weight= " << w
221     G4cout << "Histo::Fill: Histogram: #" << i << 217            << G4endl;   
222   }                                            << 218   }
223   if (i >= 0 && i < fNHisto) {                 << 219   if(i>=0 && i<fNHisto) {
224     if (fActive[i]) {                          << 220     if(fActive[i]) { fManager->FillH1(fHisto[i], x/fUnit[i], w); }
225       fManager->FillH1(fHisto[i], x / fUnit[i] << 221   } else {
226     }                                          << 
227   }                                            << 
228   else {                                       << 
229     G4cout << "Histo::Fill: WARNING! wrong his    222     G4cout << "Histo::Fill: WARNING! wrong histogram index " << i << G4endl;
230   }                                               223   }
231 }                                                 224 }
232                                                   225 
233 //....oooOO0OOooo........oooOO0OOooo........oo << 226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
234                                                   227 
235 void Histo::ScaleH1(G4int i, G4double x)          228 void Histo::ScaleH1(G4int i, G4double x)
236 {                                                 229 {
237   if (!fHistoActive) {                         << 230   if(!fHistoActive) { return; }
238     return;                                    << 231   if(fVerbose > 0) {
239   }                                            << 232     G4cout << "Histo::Scale: Histogram: #" << i << " by factor " << x << G4endl;   
240   if (fVerbose > 0) {                          << 233   }
241     G4cout << "Histo::Scale: Histogram: #" <<  << 234   if(i>=0 && i<fNHisto) {
242   }                                            << 235     if(fActive[i]) { fManager->GetH1(fHisto[i])->scale(x); }
243   if (i >= 0 && i < fNHisto) {                 << 236   } else {
244     if (fActive[i]) {                          << 
245       fManager->GetH1(fHisto[i])->scale(x);    << 
246     }                                          << 
247   }                                            << 
248   else {                                       << 
249     G4cout << "Histo::Scale: WARNING! wrong hi    237     G4cout << "Histo::Scale: WARNING! wrong histogram index " << i << G4endl;
250   }                                               238   }
251 }                                                 239 }
252                                                   240 
253 //....oooOO0OOooo........oooOO0OOooo........oo << 241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
254                                                   242 
255 void Histo::AddTuple(const G4String& w1)          243 void Histo::AddTuple(const G4String& w1)
256 {                                                 244 {
257   fTupleTitle = w1;                               245   fTupleTitle = w1;
258 }                                                 246 }
259                                                   247 
260 //....oooOO0OOooo........oooOO0OOooo........oo << 248 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
261                                                   249 
262 void Histo::AddTupleI(const G4String& w1)         250 void Histo::AddTupleI(const G4String& w1)
263 {                                                 251 {
264   fNtupleActive = true;                           252   fNtupleActive = true;
265   fNtupleI.push_back(w1);                         253   fNtupleI.push_back(w1);
266   fTupleI.push_back(-1);                          254   fTupleI.push_back(-1);
267 }                                                 255 }
268                                                   256 
269 //....oooOO0OOooo........oooOO0OOooo........oo << 257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
270                                                   258 
271 void Histo::AddTupleF(const G4String& w1)         259 void Histo::AddTupleF(const G4String& w1)
272 {                                                 260 {
273   fNtupleActive = true;                           261   fNtupleActive = true;
274   fNtupleF.push_back(w1);                         262   fNtupleF.push_back(w1);
275   fTupleF.push_back(-1);                          263   fTupleF.push_back(-1);
276 }                                                 264 }
277                                                   265 
278 //....oooOO0OOooo........oooOO0OOooo........oo << 266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
279                                                   267 
280 void Histo::AddTupleD(const G4String& w1)         268 void Histo::AddTupleD(const G4String& w1)
281 {                                                 269 {
282   fNtupleActive = true;                           270   fNtupleActive = true;
283   fNtupleD.push_back(w1);                         271   fNtupleD.push_back(w1);
284   fTupleD.push_back(-1);                          272   fTupleD.push_back(-1);
285 }                                                 273 }
286                                                   274 
287 //....oooOO0OOooo........oooOO0OOooo........oo << 275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
288                                                   276 
289 void Histo::FillTupleI(G4int i, G4int x)          277 void Histo::FillTupleI(G4int i, G4int x)
290 {                                                 278 {
291   if (!fNtupleActive) {                        << 279   if(!fNtupleActive) { return; }
292     return;                                    << 
293   }                                            << 
294   G4int n = fNtupleI.size();                      280   G4int n = fNtupleI.size();
295   if (i >= 0 && i < n) {                       << 281   if(i >= 0 && i < n) {
296     if (fVerbose > 1) {                        << 282     if(fVerbose > 1) {
297       G4cout << "Histo::FillTupleI: i= " << i  << 283       G4cout << "Histo::FillTupleI: i= " << i << "  id= " << fTupleI[i]
298              << "> = " << x << G4endl;         << 284              << "   <" << fNtupleI[i] << "> = " << x << G4endl; 
299     }                                             285     }
300     fManager->FillNtupleIColumn(fTupleI[i], x) << 286     fManager->FillNtupleIColumn(fTupleI[i], x); 
301   }                                            << 287   } else {
302   else {                                       << 
303     G4cout << "Histo::FillTupleI: WARNING! wro    288     G4cout << "Histo::FillTupleI: WARNING! wrong ntuple index " << i << G4endl;
304   }                                               289   }
305 }                                                 290 }
306                                                   291 
307 //....oooOO0OOooo........oooOO0OOooo........oo << 292 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
308                                                   293 
309 void Histo::FillTupleF(G4int i, G4float x)        294 void Histo::FillTupleF(G4int i, G4float x)
310 {                                                 295 {
311   if (!fNtupleActive) {                        << 296   if(!fNtupleActive) { return; }
312     return;                                    << 
313   }                                            << 
314   G4int n = fNtupleF.size();                      297   G4int n = fNtupleF.size();
315   if (i >= 0 && i < n) {                       << 298   if(i >= 0 && i < n) {
316     if (fVerbose > 1) {                        << 299     if(fVerbose > 1) {
317       G4cout << "Histo::FillTupleF: i= " << i  << 300       G4cout << "Histo::FillTupleF: i= " << i << "  id= " << fTupleF[i]
318              << "> = " << x << G4endl;         << 301              << "   <" << fNtupleF[i] << "> = " << x << G4endl; 
319     }                                             302     }
320     fManager->FillNtupleFColumn(fTupleF[i], x) << 303     fManager->FillNtupleFColumn(fTupleF[i], x); 
321   }                                            << 304   } else {
322   else {                                       << 
323     G4cout << "Histo::FillTupleF: WARNING! wro    305     G4cout << "Histo::FillTupleF: WARNING! wrong ntuple index " << i << G4endl;
324   }                                               306   }
325 }                                                 307 }
326                                                   308 
327 //....oooOO0OOooo........oooOO0OOooo........oo << 309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
328                                                   310 
329 void Histo::FillTupleD(G4int i, G4double x)       311 void Histo::FillTupleD(G4int i, G4double x)
330 {                                                 312 {
331   if (!fNtupleActive) {                        << 313   if(!fNtupleActive) { return; }
332     return;                                    << 
333   }                                            << 
334   G4int n = fNtupleD.size();                      314   G4int n = fNtupleD.size();
335   if (i >= 0 && i < n) {                       << 315   if(i >= 0 && i < n) {
336     if (fVerbose > 1) {                        << 316     if(fVerbose > 1) {
337       G4cout << "Histo::FillTupleD: i= " << i  << 317       G4cout << "Histo::FillTupleD: i= " << i << "  id= " << fTupleD[i]
338              << "> = " << x << G4endl;         << 318              << "   <" << fNtupleD[i] << "> = " << x << G4endl; 
339     }                                             319     }
340     fManager->FillNtupleDColumn(fTupleD[i], x) << 320     fManager->FillNtupleDColumn(fTupleD[i], x); 
341   }                                            << 321   } else {
342   else {                                       << 
343     G4cout << "Histo::FillTupleD: WARNING! wro    322     G4cout << "Histo::FillTupleD: WARNING! wrong ntuple index " << i << G4endl;
344   }                                               323   }
345 }                                                 324 }
346                                                   325 
347 //....oooOO0OOooo........oooOO0OOooo........oo << 326 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
348                                                   327 
349 void Histo::AddRow()                              328 void Histo::AddRow()
350 {                                                 329 {
351   if (!fNtupleActive) {                        << 330   if(!fNtupleActive) { return; }
352     return;                                    << 
353   }                                            << 
354   fManager->AddNtupleRow();                       331   fManager->AddNtupleRow();
355 }                                              << 332 } 
356                                                   333 
357 //....oooOO0OOooo........oooOO0OOooo........oo << 334 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
358                                                   335 
359 void Histo::SetFileName(const G4String& nam)   << 336 void Histo::SetFileName(const G4String& nam) 
360 {                                                 337 {
361   fHistName = nam;                                338   fHistName = nam;
362   fHistoActive = true;                            339   fHistoActive = true;
363 }                                                 340 }
364                                                   341 
365 //....oooOO0OOooo........oooOO0OOooo........oo << 342 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 343 
                                                   >> 344 void Histo::SetFileType(const G4String& nam) 
                                                   >> 345 {
                                                   >> 346   if(nam == "root" || nam == "ROOT" )   { fHistType = "root"; }
                                                   >> 347   else if(nam == "xml" || nam == "XML") { fHistType = "xml"; }
                                                   >> 348   else if(nam == "ascii" || nam == "ASCII" || 
                                                   >> 349           nam == "Csv" || nam == "csv" || nam == "CSV") { fHistType = "ascii"; }
                                                   >> 350 }
                                                   >> 351 
                                                   >> 352 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 353 
366                                                   354