source: trunk/source/digits_hits/detector/include/G4SDManager.hh @ 1199

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

update

File size: 4.0 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: G4SDManager.hh,v 1.4 2006/06/29 18:05:19 gunter Exp $
28// GEANT4 tag $Name: geant4-09-02-ref-02 $
29//
30
31#ifndef G4SDManager_h
32#define G4SDManager_h 1
33
34#include "globals.hh"
35#include "G4SDStructure.hh"
36#include "G4HCtable.hh"
37class G4VHitsCollection;
38class G4VSensitiveDetector;
39class G4HCofThisEvent;
40class G4SDmessenger;
41
42// class description:
43//
44//  This is a singleton class which manages the sensitive detectors.
45// The user cannot access to the constructor. The pointer of the
46// only existing object can be got via G4SDManager::GetSDMpointer()
47// static method. The first invokation of this static method makes
48// the singleton object.
49//
50
51class G4SDManager 
52{
53  public: // with description
54      static G4SDManager* GetSDMpointer();
55      // Returns the pointer to the singleton object.
56  public:
57      static G4SDManager* GetSDMpointerIfExist();
58
59  protected:
60      G4SDManager();
61
62  public:
63      ~G4SDManager();
64
65  public: // with description
66      void AddNewDetector(G4VSensitiveDetector*aSD); 
67      //  Registors the user's sensitive detector. This method must be invoked
68      // when the user construct his/her sensitive detector.
69      void Activate(G4String dName, G4bool activeFlag);
70      //  Activate/inactivate the registered sensitive detector. For the inactivated
71      // detectors, hits collections will not be stored to the G4HCofThisEvent object.
72      G4int GetCollectionID(G4String colName);
73      G4int GetCollectionID(G4VHitsCollection * aHC);
74      //  These two methods return the ID number of the sensitive detector.
75
76  public:
77      G4VSensitiveDetector* FindSensitiveDetector(G4String dName, G4bool warning = true);
78      G4HCofThisEvent* PrepareNewEvent();
79      void TerminateCurrentEvent(G4HCofThisEvent* HCE);
80      void AddNewCollection(G4String SDname,G4String DCname);
81
82
83  private: 
84      static G4SDManager * fSDManager;
85      G4SDStructure * treeTop;
86      G4int verboseLevel;
87      G4HCtable* HCtable;
88      G4SDmessenger* theMessenger;
89
90  public:
91      inline void SetVerboseLevel(G4int vl) 
92      { 
93        verboseLevel = vl; 
94        treeTop->SetVerboseLevel(vl);
95      }
96      inline G4SDStructure* GetTreeTop() const
97      { return treeTop; }
98      inline void ListTree() const
99      { treeTop->ListTree(); }
100      inline G4int GetCollectionCapacity() const
101      { return HCtable->entries(); }
102      inline G4HCtable* GetHCtable() const
103      { return HCtable; }
104
105};
106
107
108
109
110#endif
111
Note: See TracBrowser for help on using the repository browser.