Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 #ifdef G4ANALYSIS_USE 26 // 27 // >> 28 // $Id: GammaRayTelAnalysis.hh 68794 2013-04-05 13:23:26Z gcosmo $ 27 // ------------------------------------------- 29 // ------------------------------------------------------------ 28 // GEANT 4 class header file 30 // GEANT 4 class header file 29 // CERN Geneva Switzerland 31 // CERN Geneva Switzerland 30 // 32 // 31 // 33 // 32 // ------------ GammaRayTelAnalysis ---- 34 // ------------ GammaRayTelAnalysis ------ 33 // by R.Giannitrapani, F. Longo & G. 35 // by R.Giannitrapani, F. Longo & G.Santin (30 nov 2000) 34 // 36 // 35 // 03.04.2013 F.Longo and L.Pandola 37 // 03.04.2013 F.Longo and L.Pandola 36 // - migrated to G4AnalysisManager 38 // - migrated to G4AnalysisManager 37 // 39 // 38 // 07.12.2001 A.Pfeiffer 40 // 07.12.2001 A.Pfeiffer 39 // - integrated Guy's addition of the ntuple 41 // - integrated Guy's addition of the ntuple 40 // 42 // 41 // 06.12.2001 A.Pfeiffer 43 // 06.12.2001 A.Pfeiffer 42 // - updating to new design (singleton) 44 // - updating to new design (singleton) 43 // 45 // 44 // 22.11.2001 G.Barrand 46 // 22.11.2001 G.Barrand 45 // - Adaptation to AIDA 47 // - Adaptation to AIDA 46 // ------------------------------------------- 48 // ------------------------------------------------------------------- 47 // Class description: 49 // Class description: 48 // Example of analysis in a simulation applica 50 // Example of analysis in a simulation application (histograms, ntuples etc.) 49 // This class follows the singleton design pat 51 // This class follows the singleton design pattern; 50 // it is responsible for the analysis manageme 52 // it is responsible for the analysis management and algorithms 51 // 53 // 52 // ------------------------------------------- 54 // -------------------------------------------------------------------// 53 55 54 #ifndef GammaRayTelAnalysis_h 56 #ifndef GammaRayTelAnalysis_h 55 #define GammaRayTelAnalysis_h 1 57 #define GammaRayTelAnalysis_h 1 56 58 57 #include "globals.hh" 59 #include "globals.hh" 58 #include <vector> 60 #include <vector> 59 #include "G4ThreeVector.hh" 61 #include "G4ThreeVector.hh" 60 #include "G4AnalysisManager.hh" << 62 >> 63 // uncomment g4xml.hh and comment g4root.hh for a XML-based output file >> 64 >> 65 #include "g4root.hh" >> 66 //#include "g4xml.hh" >> 67 61 68 62 class GammaRayTelAnalysisMessenger; 69 class GammaRayTelAnalysisMessenger; 63 class GammaRayTelDetectorConstruction; 70 class GammaRayTelDetectorConstruction; 64 71 65 class GammaRayTelAnalysis { 72 class GammaRayTelAnalysis { 66 public: 73 public: 67 ~GammaRayTelAnalysis(); << 74 virtual ~GammaRayTelAnalysis(); 68 << 75 69 void BeginOfRun(); << 76 public: 70 << 71 void EndOfRun(); << 72 << 73 void EndOfEvent(G4int flag); << 74 << 75 void Init(); << 76 << 77 void Finish(); << 78 77 79 void SetHisto2DMode(G4String value) { << 80 histo2DMode = value; << 81 } << 82 78 83 auto GetHisto2DMode() -> G4String { << 79 // void BeginOfRun(G4int n); 84 return histo2DMode; << 85 } << 86 80 87 void InsertPositionXZ(G4double x, G4double z << 81 void BeginOfRun(); >> 82 void EndOfRun(); >> 83 void EndOfEvent(G4int flag); >> 84 >> 85 void Init(); >> 86 void Finish(); >> 87 >> 88 void SetHisto2DMode(G4String str) {histo2DMode = str;}; >> 89 G4String GetHisto2DMode() {return histo2DMode;}; >> 90 >> 91 void InsertPositionXZ(double x, double z); >> 92 void InsertPositionYZ(double y, double z); >> 93 void InsertEnergy(double en); >> 94 void InsertHits(int nplane); 88 95 89 void InsertPositionYZ(G4double y, G4double z << 96 void setNtuple(float E, float p, float x, float y, float z); 90 97 91 void InsertEnergy(G4double energy); << 98 static GammaRayTelAnalysis* getInstance(); 92 99 93 void InsertHits(G4int planeNumber); << 100 private: 94 101 95 void setNtuple(G4double energy, G4int planeN << 102 GammaRayTelAnalysis(); 96 103 97 static auto getInstance() -> GammaRayTelAnal << 104 //void plot1D(IHistogram1D* histo); >> 105 //void plot2D(IHistogram2D* histo); >> 106 void Plot(); 98 107 99 private: 108 private: 100 GammaRayTelAnalysis(); << 109 static GammaRayTelAnalysis* instance; 101 110 102 void Plot(); << 111 GammaRayTelDetectorConstruction* GammaRayTelDetector; 103 112 104 static GammaRayTelAnalysis *instance; << 113 G4String histo2DMode; >> 114 G4String histoFileName; 105 115 106 const GammaRayTelDetectorConstruction *detec << 116 GammaRayTelAnalysisMessenger* analysisMessenger; 107 << 117 }; 108 G4String histo2DMode; << 109 118 110 G4String histogramFileName; << 111 119 112 GammaRayTelAnalysisMessenger *analysisMessen << 120 #endif 113 }; << 114 #endif 121 #endif 115 122