Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4SDStructure << 27 // 23 // 28 // Class description: << 24 // $Id: G4SDStructure.hh,v 1.2 2004/05/03 08:14:01 gcosmo Exp $ >> 25 // GEANT4 tag $Name: geant4-07-01 $ 29 // 26 // 30 // This class is exclusively used by G4SDManag << 27 31 // structure of the user's sensitive detector << 32 // << 33 // Author: Makoto Asai << 34 // ------------------------------------------- << 35 #ifndef G4SDStructure_h 28 #ifndef G4SDStructure_h 36 #define G4SDStructure_h 1 29 #define G4SDStructure_h 1 37 30 38 // Globals 31 // Globals 39 #include "G4VSensitiveDetector.hh" << 40 #include "globals.hh" 32 #include "globals.hh" 41 << 33 // G4VSensitiveDetector >> 34 #include "G4VSensitiveDetector.hh" 42 #include <vector> 35 #include <vector> 43 36 44 class G4HCofThisEvent; 37 class G4HCofThisEvent; 45 38 46 class G4SDStructure << 39 // class description: >> 40 // >> 41 // This class is exclusively used by G4SDManager for handling the tree >> 42 // structure of the user's sensitive detector names. >> 43 // >> 44 >> 45 class G4SDStructure 47 { 46 { 48 public: << 47 public: 49 G4SDStructure(const G4String& aPath); << 48 G4SDStructure(G4String aPath); 50 ~G4SDStructure(); << 49 ~G4SDStructure(); 51 << 50 52 G4bool operator==(const G4SDStructure& right << 51 G4int operator==(const G4SDStructure &right) const; 53 << 52 54 void AddNewDetector(G4VSensitiveDetector* aS << 53 void AddNewDetector(G4VSensitiveDetector*aSD, G4String treeStructure); 55 void Activate(const G4String& aName, G4bool << 54 void Activate(G4String aName, G4bool sensitiveFlag); 56 void Initialize(G4HCofThisEvent* HCE); << 55 void Initialize(G4HCofThisEvent*HCE); 57 void Terminate(G4HCofThisEvent* HCE); << 56 void Terminate(G4HCofThisEvent*HCE); 58 G4VSensitiveDetector* FindSensitiveDetector( << 57 G4VSensitiveDetector* FindSensitiveDetector(G4String aName, G4bool warning = true); 59 G4VSensitiveDetector* GetSD(const G4String& << 58 G4VSensitiveDetector* GetSD(G4String aName); 60 void ListTree(); << 59 void ListTree(); 61 << 60 62 inline void SetVerboseLevel(G4int vl) << 61 private: 63 { << 62 G4SDStructure* FindSubDirectory(G4String subD); 64 verboseLevel = vl; << 63 G4String ExtractDirName(G4String aPath); 65 for (auto& i : structure) { << 64 66 i->SetVerboseLevel(vl); << 65 private: 67 } << 66 std::vector<G4SDStructure*> structure; 68 for (auto& j : detector) { << 67 std::vector<G4VSensitiveDetector*> detector; 69 j->SetVerboseLevel(vl); << 68 G4String pathName; 70 } << 69 G4String dirName; 71 }; << 70 G4int verboseLevel; 72 << 71 73 private: << 72 public: 74 G4SDStructure* FindSubDirectory(const G4Stri << 73 inline void SetVerboseLevel(G4int vl) 75 G4String ExtractDirName(const G4String& aPat << 74 { 76 void RemoveSD(G4VSensitiveDetector*); << 75 verboseLevel = vl; 77 << 76 for(size_t i=0; i<structure.size(); i++) 78 private: << 77 { structure[i]->SetVerboseLevel(vl); } 79 std::vector<G4SDStructure*> structure; << 78 for(size_t j=0; j<detector.size(); j++) 80 std::vector<G4VSensitiveDetector*> detector; << 79 { detector[j]->SetVerboseLevel(vl); } 81 G4String pathName; << 80 }; 82 G4String dirName; << 81 83 G4int verboseLevel{0}; << 84 }; 82 }; 85 83 >> 84 >> 85 >> 86 86 #endif 87 #endif >> 88 87 89