digits_hits/detector/include/G4SDStructure.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4SDStructure.hh,v 1.3 2006/06/29 18:05:22 gunter Exp $
00028 // GEANT4 tag $Name: geant4-09-01-patch-01 $
00029 //
00030 
00031 #ifndef G4SDStructure_h
00032 #define G4SDStructure_h 1
00033 
00034 // Globals
00035 #include "globals.hh"
00036 // G4VSensitiveDetector
00037 #include "G4VSensitiveDetector.hh"
00038 #include <vector>
00039 
00040 class G4HCofThisEvent;
00041 
00042 // class description:
00043 //
00044 //  This class is exclusively used by G4SDManager for handling the tree
00045 // structure of the user's sensitive detector names.
00046 //
00047 
00048 class G4SDStructure 
00049 {
00050   public:
00051       G4SDStructure(G4String aPath);
00052       ~G4SDStructure();
00053 
00054       G4int operator==(const G4SDStructure &right) const;
00055 
00056       void AddNewDetector(G4VSensitiveDetector*aSD, G4String treeStructure);
00057       void Activate(G4String aName, G4bool sensitiveFlag);
00058       void Initialize(G4HCofThisEvent*HCE);
00059       void Terminate(G4HCofThisEvent*HCE);
00060       G4VSensitiveDetector* FindSensitiveDetector(G4String aName, G4bool warning = true);
00061       G4VSensitiveDetector* GetSD(G4String aName);
00062       void ListTree();
00063 
00064   private:
00065       G4SDStructure* FindSubDirectory(G4String subD);
00066       G4String ExtractDirName(G4String aPath);
00067 
00068   private:
00069       std::vector<G4SDStructure*> structure;
00070       std::vector<G4VSensitiveDetector*> detector;
00071       G4String pathName;
00072       G4String dirName;
00073       G4int verboseLevel;
00074 
00075   public:
00076       inline void SetVerboseLevel(G4int vl) 
00077       {
00078         verboseLevel = vl;
00079         for(size_t i=0; i<structure.size(); i++)
00080         { structure[i]->SetVerboseLevel(vl); }
00081         for(size_t j=0; j<detector.size(); j++)
00082         { detector[j]->SetVerboseLevel(vl); }
00083       };
00084 
00085 };
00086 
00087 
00088 
00089 
00090 #endif
00091 

Generated on Fri Apr 11 17:09:45 2008 for Geant4 by  doxygen 1.4.7