source: trunk/source/processes/parameterisation/test/test.cc @ 1201

Last change on this file since 1201 was 1199, checked in by garnier, 15 years ago

nvx fichiers dans CVS

File size: 3.3 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: test.cc,v 1.2 2006/06/29 21:09:42 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31// ------------------------------------------------------------
32
33#include <iostream.h>
34
35#include "G4GlobalFastSimulationManager.hh"
36#include "G4FastSimulationManager.hh"
37#include "DummyModel.hh"
38#include "G4LogicalVolume.hh"
39#include "G4Box.hh"
40
41int main()
42{
43  G4Box box("box",10,10,10);
44  G4LogicalVolume vol1(&box,0,"vol1");
45  G4LogicalVolume vol2(&box,0,"vol2");
46  G4LogicalVolume vol3(&box,0,"vol3");
47
48  DummyModel dummy11 ("dummy11", &vol1);
49  DummyModel dummy12 ("dummy12", &vol1);
50  DummyModel to_find1("to_find", &vol1);
51  DummyModel dummy13 ("dummy13", &vol1);
52 
53  DummyModel to_find2("to_find", &vol2);
54  DummyModel dummy21 ("dummy21", &vol2);
55  DummyModel dummy22 ("dummy22", &vol2);
56  DummyModel dummy23 ("dummy23", &vol2);
57 
58  DummyModel dummy31 ("dummy31", &vol3);
59  DummyModel to_find3("to_find", &vol3);
60  DummyModel to_find4("to_find", &vol3);
61  DummyModel to_find5("to_find", &vol3);
62  DummyModel dummy32 ("dummy32", &vol3);
63
64  G4GlobalFastSimulationManager* gbl = G4GlobalFastSimulationManager::GetGlobalFastSimulationManager();
65
66  cout << "model addresses to retrieve:" << endl;
67  cout << &to_find1 << endl;
68  cout << &to_find2 << endl;
69  cout << &to_find3 << endl;
70  cout << &to_find4 << endl;
71  cout << &to_find5 << endl;
72
73  cout << "-- individual : " << endl;
74  cout << gbl->GetFastSimulationModel("to_find") << endl;
75  cout << gbl->GetFastSimulationModel("to_find") << endl;
76 
77  cout << "-- loop: " << endl;
78  G4VFastSimulationModel *model, *previousModel(0);
79  while ((model = gbl->GetFastSimulationModel("to_find", previousModel)))
80    {
81      cout << "->" << model << endl;
82      previousModel = model;
83    }
84 
85
86}
Note: See TracBrowser for help on using the repository browser.