source: trunk/examples/advanced/Tiara/source/tiara/tiara.cc @ 1253

Last change on this file since 1253 was 807, checked in by garnier, 16 years ago

update

File size: 3.4 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26//
27// $Id: tiara.cc,v 1.4 2006/06/29 15:43:16 gunter Exp $
28// GEANT4 tag
29//
30//
31// --------------------------------------------------------------
32//      GEANT 4 - tiara
33//
34// --------------------------------------------------------------
35// Comments
36//
37//
38// --------------------------------------------------------------
39
40#include "TiaraSim.hh"
41#include "G4RegionStore.hh"
42#include "G4ProductionCutsTable.hh"
43#include "TiaraTally.hh"
44#include "Randomize.hh"
45
46int main(int, char **)
47{ 
48
49  std::vector<G4double> binEdges;
50  binEdges.push_back(1.);
51  binEdges.push_back(3.);
52  binEdges.push_back(7.);
53  binEdges.push_back(13.);
54  binEdges.push_back(21.);
55 
56  TiaraTally t;
57  t.setBinEdges(binEdges);
58  for (G4int e=0; e<1000; e++) {   
59    for (G4int i=0; i<1000; i++) {
60      G4double r(1 + G4UniformRand()*20);
61      t.fill(r, G4UniformRand());
62    }
63    t.EndOfEventAction();
64  }
65  for (G4int i=0; i<t.size();i++) {
66    TiaraMeasure m(t.measure(i));
67    G4cout << "entries: " << m.GetEntries() << G4endl;
68    G4cout << m.GetMean() << G4endl;
69    G4cout << m.GetVariance() << G4endl;
70    G4cout << m.GetSum() << G4endl;
71    G4cout << m.GetSumSquared() << G4endl;
72  }
73
74  /*
75  Physics_MY_CASCADE_HP *phys = new Physics_MY_CASCADE_HP;
76  phys->Construct();
77  phys->SetCuts();
78  G4RegionStore::GetInstance()->UpdateMaterialList();
79  // Let G4ProductionCutsTable update couples
80  G4ProductionCutsTable::GetProductionCutsTable()->UpdateCoupleTable();
81  G4ProductionCutsTable::GetProductionCutsTable()->DumpCouples();
82
83  if(G4ProductionCutsTable::GetProductionCutsTable()->IsModified())
84  {
85    phys->BuildPhysicsTable();
86    G4ProductionCutsTable::GetProductionCutsTable()->PhysicsTableUpdated();
87  }
88  phys->DumpCutValuesTableIfRequested();
89  TiaraSim &tSim = TiaraSim::GetTiaraSim();
90  */
91}
92
Note: See TracBrowser for help on using the repository browser.