Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/electromagnetic/TestEm9/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/electromagnetic/TestEm9/src/Histo.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm9/src/Histo.cc (Version 10.0.p1)


  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 electromagnetic/TestEm9/src/Histo.cc     26 /// \file electromagnetic/TestEm9/src/Histo.cc
 27 /// \brief Implementation of the Histo class       27 /// \brief Implementation of the Histo class
 28 //                                                 28 //
                                                   >>  29 // $Id: Histo.cc 67268 2013-02-13 11:38:40Z ihrivnac $
 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() : fManager(0), fMessenger(0)    <<  51 Histo::Histo()
                                                   >>  52  : fManager(0),
                                                   >>  53    fMessenger(0)
 53 {                                                  54 {
 54   fMessenger = new HistoMessenger(this);           55   fMessenger = new HistoMessenger(this);
 55                                                <<  56  
 56   fHistName = "test";                          <<  57   fHistName   = "test";
 57   fHistType = "root";                          <<  58   fHistType   = "root";
 58   fTupleName = "tuple";                        <<  59   fTupleName  = "tuple";
 59   fTupleTitle = "test";                            60   fTupleTitle = "test";
 60   fNHisto = 0;                                 <<  61   fNHisto     = 0;
 61   fVerbose = 0;                                <<  62   fVerbose    = 0;
 62   fDefaultAct = true;                              63   fDefaultAct = true;
 63   fHistoActive = false;                        <<  64   fHistoActive= false;
 64   fNtupleActive = false;                       <<  65   fNtupleActive= false;
 65 }                                                  66 }
 66                                                    67 
 67 //....oooOO0OOooo........oooOO0OOooo........oo <<  68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 68                                                    69 
 69 Histo::~Histo()                                    70 Histo::~Histo()
 70 {                                                  71 {
 71   delete fMessenger;                               72   delete fMessenger;
                                                   >>  73   delete fManager;
 72 }                                                  74 }
 73                                                    75 
 74 //....oooOO0OOooo........oooOO0OOooo........oo <<  76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 75                                                    77 
 76 void Histo::Book()                                 78 void Histo::Book()
 77 {                                                  79 {
 78   if (!(fHistoActive || fNtupleActive)) {      <<  80   if(!(fHistoActive || fNtupleActive)) { return; }
 79     return;                                    << 
 80   }                                            << 
 81                                                    81 
 82   // Always creating analysis manager              82   // Always creating analysis manager
 83   fManager = G4RootAnalysisManager::Instance() <<  83   fManager = G4RootAnalysisManager::Instance(); 
 84                                                    84 
 85   // Creating a tree mapped to a new hbook fil     85   // Creating a tree mapped to a new hbook file.
 86   G4String nam = fHistName + "." + fHistType;      86   G4String nam = fHistName + "." + fHistType;
 87                                                    87 
 88   // Open file histogram file                      88   // Open file histogram file
 89   if (!fManager->OpenFile(nam)) {              <<  89   if(!fManager->OpenFile(nam)) {
 90     G4cout << "Histo::Book: ERROR open file <"     90     G4cout << "Histo::Book: ERROR open file <" << nam << ">" << G4endl;
 91     fHistoActive = false;                          91     fHistoActive = false;
 92     fNtupleActive = false;                         92     fNtupleActive = false;
 93     return;                                    <<  93     return; 
 94   }                                                94   }
 95   G4cout << "### Histo::Save: Opended file <"  <<  95   G4cout << "### Histo::Save: Opended file <" << nam << ">  for " 
 96          << G4endl;                            <<  96          << fNHisto << " histograms " << G4endl;
 97                                                    97 
 98   // Creating an 1-dimensional histograms in t     98   // Creating an 1-dimensional histograms in the root directory of the tree
 99   for (G4int i = 0; i < fNHisto; ++i) {        <<  99   for(G4int i=0; i<fNHisto; ++i) {
100     if (fActive[i]) {                          << 100     if(fActive[i]) {
101       G4String ss = "h" + fIds[i];                101       G4String ss = "h" + fIds[i];
102       fHisto[i] = fManager->CreateH1(ss, fTitl    102       fHisto[i] = fManager->CreateH1(ss, fTitles[i], fBins[i], fXmin[i], fXmax[i]);
103       if (fVerbose > 0) {                      << 103       if(fVerbose > 0) {
104         G4cout << "Created histogram #" << i < << 104         G4cout << "Created histogram #" << i << "  id= " << fHisto[i]
105                << fTitles[i] << G4endl;        << 105                << "  "  << ss << "  " << fTitles[i] << G4endl;
106       }                                           106       }
107     }                                             107     }
108   }                                               108   }
109   // Creating a tuple factory, whose tuples wi    109   // Creating a tuple factory, whose tuples will be handled by the tree
110   if (fNtupleActive) {                         << 110   if(fNtupleActive) {
111     fManager->CreateNtuple(fTupleName, fTupleT << 111     fManager->CreateNtuple(fTupleName,fTupleTitle); 
112     G4int i;                                      112     G4int i;
113     G4int n = fNtupleI.size();                    113     G4int n = fNtupleI.size();
114     for (i = 0; i < n; ++i) {                  << 114     for(i=0; i<n; ++i) { 
115       if (fTupleI[i] == -1) {                  << 115       if(fTupleI[i] == -1) {  fTupleI[i] = fManager->CreateNtupleIColumn(fNtupleI[i]); }
116         fTupleI[i] = fManager->CreateNtupleICo << 
117       }                                        << 
118     }                                             116     }
119     n = fNtupleF.size();                          117     n = fNtupleF.size();
120     for (i = 0; i < n; ++i) {                  << 118     for(i=0; i<n; ++i) { 
121       if (fTupleF[i] == -1) {                  << 119       if(fTupleF[i] == -1) {  fTupleF[i] = fManager->CreateNtupleFColumn(fNtupleF[i]); }
122         fTupleF[i] = fManager->CreateNtupleFCo << 
123       }                                        << 
124     }                                             120     }
125     n = fNtupleD.size();                          121     n = fNtupleD.size();
126     for (i = 0; i < n; ++i) {                  << 122     for(i=0; i<n; ++i) { 
127       if (fTupleD[i] == -1) {                  << 123       if(fTupleD[i] == -1) {  fTupleD[i] = fManager->CreateNtupleDColumn(fNtupleD[i]); }
128         fTupleD[i] = fManager->CreateNtupleDCo << 
129       }                                        << 
130     }                                             124     }
131   }                                               125   }
132 }                                              << 126 } 
133                                                   127 
134 //....oooOO0OOooo........oooOO0OOooo........oo << 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
135                                                   129 
136 void Histo::Save()                                130 void Histo::Save()
137 {                                                 131 {
138   if (!(fHistoActive || fNtupleActive)) {      << 132   if(!(fHistoActive || fNtupleActive)) { return; }
139     return;                                    << 
140   }                                            << 
141                                                   133 
142   // Creating a tree mapped to a new hbook fil    134   // Creating a tree mapped to a new hbook file.
143   G4String nam = fHistName + "." + fHistType;     135   G4String nam = fHistName + "." + fHistType;
144                                                   136 
145   // Write histogram file                         137   // Write histogram file
146   if (!fManager->Write()) {                    << 138   if(!fManager->Write()) {
147     G4Exception("Histo::Save()", "hist01", Fat << 139     G4cout   << "Histo::Save: FATAL ERROR writing ROOT file" << G4endl;
                                                   >> 140     exit(1);
148   }                                               141   }
149   if (fVerbose > 0) {                          << 142   if(fVerbose > 0) {
150     G4cout << "### Histo::Save: Histograms and    143     G4cout << "### Histo::Save: Histograms and Ntuples are saved" << G4endl;
151   }                                               144   }
152   if (fManager->CloseFile() && fVerbose > 0) { << 145   if(fManager->CloseFile() && fVerbose > 0) {
153     G4cout << "                 File is closed    146     G4cout << "                 File is closed" << G4endl;
154   }                                               147   }
155   fManager->Clear();                           << 148   delete G4RootAnalysisManager::Instance();
156 }                                              << 149   fManager = 0;
157                                                << 150 } 
158 //....oooOO0OOooo........oooOO0OOooo........oo << 151 
159                                                << 152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
160 void Histo::Add1D(const G4String& id, const G4 << 153 
161                   G4double u)                  << 154 void Histo::Add1D(const G4String& id, const G4String& name, G4int nb, 
162 {                                              << 155                   G4double x1, G4double x2, G4double u)
163   if (fVerbose > 0) {                          << 156 {
164     G4cout << "Histo::Add1D: New histogram wil << 157   if(fVerbose > 0) {
165            << "  " << x1 << "  " << x2 << "  " << 158     G4cout << "Histo::Add1D: New histogram will be booked: #" << id << "  <" << name 
                                                   >> 159            << "  " << nb << "  " << x1 << "  " << x2 << "  " << u 
                                                   >> 160            << G4endl;
166   }                                               161   }
167   ++fNHisto;                                      162   ++fNHisto;
168   x1 /= u;                                        163   x1 /= u;
169   x2 /= u;                                        164   x2 /= u;
170   fActive.push_back(fDefaultAct);                 165   fActive.push_back(fDefaultAct);
171   fBins.push_back(nb);                            166   fBins.push_back(nb);
172   fXmin.push_back(x1);                            167   fXmin.push_back(x1);
173   fXmax.push_back(x2);                            168   fXmax.push_back(x2);
174   fUnit.push_back(u);                             169   fUnit.push_back(u);
175   fIds.push_back(id);                             170   fIds.push_back(id);
176   fTitles.push_back(name);                        171   fTitles.push_back(name);
177   fHisto.push_back(-1);                           172   fHisto.push_back(-1);
178 }                                                 173 }
179                                                   174 
180 //....oooOO0OOooo........oooOO0OOooo........oo << 175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
181                                                   176 
182 void Histo::SetHisto1D(G4int i, G4int nb, G4do    177 void Histo::SetHisto1D(G4int i, G4int nb, G4double x1, G4double x2, G4double u)
183 {                                                 178 {
184   if (i >= 0 && i < fNHisto) {                 << 179   if(i>=0 && i<fNHisto) {
185     if (fVerbose > 0) {                        << 180     if(fVerbose > 0) {
186       G4cout << "Histo::SetHisto1D: #" << i << << 181       G4cout << "Histo::SetHisto1D: #" << i  
                                                   >> 182              << "  " << nb << "  " << x1 << "  " << x2 << "  " << u 
187              << G4endl;                           183              << G4endl;
188     }                                             184     }
189     fBins[i] = nb;                                185     fBins[i] = nb;
190     fXmin[i] = x1;                                186     fXmin[i] = x1;
191     fXmax[i] = x2;                                187     fXmax[i] = x2;
192     fUnit[i] = u;                                 188     fUnit[i] = u;
193     fActive[i] = true;                            189     fActive[i] = true;
194     fHistoActive = true;                          190     fHistoActive = true;
195   }                                            << 191   } else {
196   else {                                       << 
197     G4cout << "Histo::SetHisto1D: WARNING! wro    192     G4cout << "Histo::SetHisto1D: WARNING! wrong histogram index " << i << G4endl;
198   }                                               193   }
199 }                                                 194 }
200                                                   195 
201 //....oooOO0OOooo........oooOO0OOooo........oo << 196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
202                                                   197 
203 void Histo::Activate(G4int i, G4bool val)         198 void Histo::Activate(G4int i, G4bool val)
204 {                                                 199 {
205   if (fVerbose > 1) {                          << 200   if(fVerbose > 1) {
206     G4cout << "Histo::Activate: Histogram: #"  << 201     G4cout << "Histo::Activate: Histogram: #" << i << "   "  
                                                   >> 202            << val << G4endl;   
207   }                                               203   }
208   if (i >= 0 && i < fNHisto) {                 << 204   if(i>=0 && i<fNHisto) { 
209     fActive[i] = val;                          << 205     fActive[i] = val; 
210     if (val) {                                 << 206     if(val) { fHistoActive = true; }
211       fHistoActive = true;                     << 
212     }                                          << 
213   }                                               207   }
214 }                                                 208 }
215                                                   209 
216 //....oooOO0OOooo........oooOO0OOooo........oo << 210 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
217                                                   211 
218 void Histo::Fill(G4int i, G4double x, G4double    212 void Histo::Fill(G4int i, G4double x, G4double w)
219 {                                                 213 {
220   if (!fHistoActive) {                         << 214   if(!fHistoActive) { return; }
221     return;                                    << 215   if(fVerbose > 1) {
222   }                                            << 216     G4cout << "Histo::Fill: Histogram: #" << i << " at x= " << x 
223   if (fVerbose > 1) {                          << 217            << "  weight= " << w
224     G4cout << "Histo::Fill: Histogram: #" << i << 218            << G4endl;   
225   }                                            << 219   }
226   if (i >= 0 && i < fNHisto) {                 << 220   if(i>=0 && i<fNHisto) {
227     if (fActive[i]) {                          << 221     if(fActive[i]) { fManager->FillH1(fHisto[i], x/fUnit[i], w); }
228       fManager->FillH1(fHisto[i], x / fUnit[i] << 222   } else {
229     }                                          << 
230   }                                            << 
231   else {                                       << 
232     G4cout << "Histo::Fill: WARNING! wrong his    223     G4cout << "Histo::Fill: WARNING! wrong histogram index " << i << G4endl;
233   }                                               224   }
234 }                                                 225 }
235                                                   226 
236 //....oooOO0OOooo........oooOO0OOooo........oo << 227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
237                                                   228 
238 void Histo::ScaleH1(G4int i, G4double x)          229 void Histo::ScaleH1(G4int i, G4double x)
239 {                                                 230 {
240   if (!fHistoActive) {                         << 231   if(!fHistoActive) { return; }
241     return;                                    << 232   if(fVerbose > 0) {
242   }                                            << 233     G4cout << "Histo::Scale: Histogram: #" << i << " by factor " << x << G4endl;   
243   if (fVerbose > 0) {                          << 234   }
244     G4cout << "Histo::Scale: Histogram: #" <<  << 235   if(i>=0 && i<fNHisto) {
245   }                                            << 236     if(fActive[i]) { fManager->GetH1(fHisto[i])->scale(x); }
246   if (i >= 0 && i < fNHisto) {                 << 237   } else {
247     if (fActive[i]) {                          << 
248       fManager->GetH1(fHisto[i])->scale(x);    << 
249     }                                          << 
250   }                                            << 
251   else {                                       << 
252     G4cout << "Histo::Scale: WARNING! wrong hi    238     G4cout << "Histo::Scale: WARNING! wrong histogram index " << i << G4endl;
253   }                                               239   }
254 }                                                 240 }
255                                                   241 
256 //....oooOO0OOooo........oooOO0OOooo........oo << 242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
257                                                   243 
258 void Histo::AddTuple(const G4String& w1)          244 void Histo::AddTuple(const G4String& w1)
259 {                                                 245 {
260   fTupleTitle = w1;                               246   fTupleTitle = w1;
261 }                                                 247 }
262                                                   248 
263 //....oooOO0OOooo........oooOO0OOooo........oo << 249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
264                                                   250 
265 void Histo::AddTupleI(const G4String& w1)         251 void Histo::AddTupleI(const G4String& w1)
266 {                                                 252 {
267   fNtupleActive = true;                           253   fNtupleActive = true;
268   fNtupleI.push_back(w1);                         254   fNtupleI.push_back(w1);
269   fTupleI.push_back(-1);                          255   fTupleI.push_back(-1);
270 }                                                 256 }
271                                                   257 
272 //....oooOO0OOooo........oooOO0OOooo........oo << 258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
273                                                   259 
274 void Histo::AddTupleF(const G4String& w1)         260 void Histo::AddTupleF(const G4String& w1)
275 {                                                 261 {
276   fNtupleActive = true;                           262   fNtupleActive = true;
277   fNtupleF.push_back(w1);                         263   fNtupleF.push_back(w1);
278   fTupleF.push_back(-1);                          264   fTupleF.push_back(-1);
279 }                                                 265 }
280                                                   266 
281 //....oooOO0OOooo........oooOO0OOooo........oo << 267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
282                                                   268 
283 void Histo::AddTupleD(const G4String& w1)         269 void Histo::AddTupleD(const G4String& w1)
284 {                                                 270 {
285   fNtupleActive = true;                           271   fNtupleActive = true;
286   fNtupleD.push_back(w1);                         272   fNtupleD.push_back(w1);
287   fTupleD.push_back(-1);                          273   fTupleD.push_back(-1);
288 }                                                 274 }
289                                                   275 
290 //....oooOO0OOooo........oooOO0OOooo........oo << 276 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
291                                                   277 
292 void Histo::FillTupleI(G4int i, G4int x)          278 void Histo::FillTupleI(G4int i, G4int x)
293 {                                                 279 {
294   if (!fNtupleActive) {                        << 280   if(!fNtupleActive) { return; }
295     return;                                    << 
296   }                                            << 
297   G4int n = fNtupleI.size();                      281   G4int n = fNtupleI.size();
298   if (i >= 0 && i < n) {                       << 282   if(i >= 0 && i < n) {
299     if (fVerbose > 1) {                        << 283     if(fVerbose > 1) {
300       G4cout << "Histo::FillTupleI: i= " << i  << 284       G4cout << "Histo::FillTupleI: i= " << i << "  id= " << fTupleI[i]
301              << "> = " << x << G4endl;         << 285              << "   <" << fNtupleI[i] << "> = " << x << G4endl; 
302     }                                             286     }
303     fManager->FillNtupleIColumn(fTupleI[i], x) << 287     fManager->FillNtupleIColumn(fTupleI[i], x); 
304   }                                            << 288   } else {
305   else {                                       << 
306     G4cout << "Histo::FillTupleI: WARNING! wro    289     G4cout << "Histo::FillTupleI: WARNING! wrong ntuple index " << i << G4endl;
307   }                                               290   }
308 }                                                 291 }
309                                                   292 
310 //....oooOO0OOooo........oooOO0OOooo........oo << 293 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
311                                                   294 
312 void Histo::FillTupleF(G4int i, G4float x)        295 void Histo::FillTupleF(G4int i, G4float x)
313 {                                                 296 {
314   if (!fNtupleActive) {                        << 297   if(!fNtupleActive) { return; }
315     return;                                    << 
316   }                                            << 
317   G4int n = fNtupleF.size();                      298   G4int n = fNtupleF.size();
318   if (i >= 0 && i < n) {                       << 299   if(i >= 0 && i < n) {
319     if (fVerbose > 1) {                        << 300     if(fVerbose > 1) {
320       G4cout << "Histo::FillTupleF: i= " << i  << 301       G4cout << "Histo::FillTupleF: i= " << i << "  id= " << fTupleF[i]
321              << "> = " << x << G4endl;         << 302              << "   <" << fNtupleF[i] << "> = " << x << G4endl; 
322     }                                             303     }
323     fManager->FillNtupleFColumn(fTupleF[i], x) << 304     fManager->FillNtupleFColumn(fTupleF[i], x); 
324   }                                            << 305   } else {
325   else {                                       << 
326     G4cout << "Histo::FillTupleF: WARNING! wro    306     G4cout << "Histo::FillTupleF: WARNING! wrong ntuple index " << i << G4endl;
327   }                                               307   }
328 }                                                 308 }
329                                                   309 
330 //....oooOO0OOooo........oooOO0OOooo........oo << 310 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
331                                                   311 
332 void Histo::FillTupleD(G4int i, G4double x)       312 void Histo::FillTupleD(G4int i, G4double x)
333 {                                                 313 {
334   if (!fNtupleActive) {                        << 314   if(!fNtupleActive) { return; }
335     return;                                    << 
336   }                                            << 
337   G4int n = fNtupleD.size();                      315   G4int n = fNtupleD.size();
338   if (i >= 0 && i < n) {                       << 316   if(i >= 0 && i < n) {
339     if (fVerbose > 1) {                        << 317     if(fVerbose > 1) {
340       G4cout << "Histo::FillTupleD: i= " << i  << 318       G4cout << "Histo::FillTupleD: i= " << i << "  id= " << fTupleD[i]
341              << "> = " << x << G4endl;         << 319              << "   <" << fNtupleD[i] << "> = " << x << G4endl; 
342     }                                             320     }
343     fManager->FillNtupleDColumn(fTupleD[i], x) << 321     fManager->FillNtupleDColumn(fTupleD[i], x); 
344   }                                            << 322   } else {
345   else {                                       << 
346     G4cout << "Histo::FillTupleD: WARNING! wro    323     G4cout << "Histo::FillTupleD: WARNING! wrong ntuple index " << i << G4endl;
347   }                                               324   }
348 }                                                 325 }
349                                                   326 
350 //....oooOO0OOooo........oooOO0OOooo........oo << 327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
351                                                   328 
352 void Histo::AddRow()                              329 void Histo::AddRow()
353 {                                                 330 {
354   if (!fNtupleActive) {                        << 331   if(!fNtupleActive) { return; }
355     return;                                    << 
356   }                                            << 
357   fManager->AddNtupleRow();                       332   fManager->AddNtupleRow();
358 }                                              << 333 } 
359                                                   334 
360 //....oooOO0OOooo........oooOO0OOooo........oo << 335 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
361                                                   336 
362 void Histo::SetFileName(const G4String& nam)   << 337 void Histo::SetFileName(const G4String& nam) 
363 {                                                 338 {
364   fHistName = nam;                                339   fHistName = nam;
365   fHistoActive = true;                            340   fHistoActive = true;
366 }                                                 341 }
367                                                   342 
368 //....oooOO0OOooo........oooOO0OOooo........oo << 343 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
369                                                   344 
370 void Histo::SetFileType(const G4String& nam)   << 345 void Histo::SetFileType(const G4String& nam) 
371 {                                                 346 {
372   // format other than ROOT is not tested      << 347   if(nam == "root" || nam == "ROOT" )   { fHistType = "root"; }
373   if (nam == "root" || nam == "ROOT") {        << 348   else if(nam == "xml" || nam == "XML") { fHistType = "xml"; }
374     fHistType = "root";                        << 349   else if(nam == "ascii" || nam == "ASCII" || 
375   }                                            << 350           nam == "Csv" || nam == "csv" || nam == "CSV") { fHistType = "ascii"; }
376   else if (nam == "xml" || nam == "XML") {     << 
377     fHistType = "xml";                         << 
378   }                                            << 
379   else if (nam == "ascii" || nam == "ASCII" || << 
380     fHistType = "ascii";                       << 
381   }                                            << 
382 }                                                 351 }
383                                                   352 
384 //....oooOO0OOooo........oooOO0OOooo........oo << 353 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 354 
385                                                   355