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 // >> 23 #ifdef G4ANALYSIS_USE 26 // 24 // >> 25 // $Id: GammaRayTelAnalysis.hh,v 1.17 2004/06/01 06:59:38 guatelli Exp $ >> 26 // GEANT4 tag $Name: geant4-07-01 $ 27 // ------------------------------------------- 27 // ------------------------------------------------------------ 28 // GEANT 4 class header file 28 // GEANT 4 class header file 29 // CERN Geneva Switzerland 29 // CERN Geneva Switzerland 30 // 30 // 31 // 31 // 32 // ------------ GammaRayTelAnalysis ---- 32 // ------------ GammaRayTelAnalysis ------ 33 // by R.Giannitrapani, F. Longo & G. 33 // by R.Giannitrapani, F. Longo & G.Santin (30 nov 2000) 34 // 34 // 35 // 03.04.2013 F.Longo and L.Pandola << 36 // - migrated to G4AnalysisManager << 37 // << 38 // 07.12.2001 A.Pfeiffer 35 // 07.12.2001 A.Pfeiffer 39 // - integrated Guy's addition of the ntuple 36 // - integrated Guy's addition of the ntuple 40 // 37 // 41 // 06.12.2001 A.Pfeiffer 38 // 06.12.2001 A.Pfeiffer 42 // - updating to new design (singleton) 39 // - updating to new design (singleton) 43 // 40 // 44 // 22.11.2001 G.Barrand 41 // 22.11.2001 G.Barrand 45 // - Adaptation to AIDA 42 // - Adaptation to AIDA 46 // ------------------------------------------- << 47 // Class description: << 48 // Example of analysis in a simulation applica << 49 // This class follows the singleton design pat << 50 // it is responsible for the analysis manageme << 51 // 43 // 52 // ------------------------------------------- << 44 // ************************************************************ 53 45 54 #ifndef GammaRayTelAnalysis_h 46 #ifndef GammaRayTelAnalysis_h 55 #define GammaRayTelAnalysis_h 1 47 #define GammaRayTelAnalysis_h 1 56 48 57 #include "globals.hh" 49 #include "globals.hh" 58 #include <vector> 50 #include <vector> 59 #include "G4ThreeVector.hh" 51 #include "G4ThreeVector.hh" 60 #include "G4AnalysisManager.hh" << 52 >> 53 #include <AIDA/AIDA.h> >> 54 >> 55 using namespace AIDA; 61 56 62 class GammaRayTelAnalysisMessenger; 57 class GammaRayTelAnalysisMessenger; 63 class GammaRayTelDetectorConstruction; 58 class GammaRayTelDetectorConstruction; 64 59 >> 60 class AIDA::IAnalysisFactory; >> 61 class AIDA::ITree; >> 62 class AIDA::IHistogramFactory; >> 63 class AIDA::ITupleFactory; >> 64 //class AIDA::IPlotter; >> 65 class AIDA::IHistogram1D; >> 66 class AIDA::IHistogram2D; >> 67 65 class GammaRayTelAnalysis { 68 class GammaRayTelAnalysis { 66 public: 69 public: 67 ~GammaRayTelAnalysis(); << 70 virtual ~GammaRayTelAnalysis(); 68 << 71 69 void BeginOfRun(); << 72 public: 70 73 71 void EndOfRun(); << 72 74 73 void EndOfEvent(G4int flag); << 75 // void BeginOfRun(G4int n); 74 76 75 void Init(); << 77 void BeginOfRun(); >> 78 void EndOfRun(G4int n); >> 79 void EndOfEvent(G4int flag); 76 80 77 void Finish(); << 81 void Init(); >> 82 void Finish(); 78 83 79 void SetHisto2DMode(G4String value) { << 84 void SetHisto1DDraw(G4String str) {histo1DDraw = str;}; 80 histo2DMode = value; << 85 void SetHisto1DSave(G4String str) {histo1DSave = str;}; 81 } << 86 void SetHisto2DDraw(G4String str) {histo2DDraw = str;}; >> 87 void SetHisto2DSave(G4String str) {histo2DSave = str;}; >> 88 void SetHisto2DMode(G4String str) {histo2DMode = str;}; 82 89 83 auto GetHisto2DMode() -> G4String { << 90 G4String GetHisto2DMode() {return histo2DMode;}; 84 return histo2DMode; << 85 } << 86 91 87 void InsertPositionXZ(G4double x, G4double z << 92 void InsertPositionXZ(double x, double z); >> 93 void InsertPositionYZ(double y, double z); >> 94 void InsertEnergy(double en); >> 95 void InsertHits(int nplane); 88 96 89 void InsertPositionYZ(G4double y, G4double z << 97 void setNtuple(float E, float p, float x, float y, float z); 90 98 91 void InsertEnergy(G4double energy); << 99 static GammaRayTelAnalysis* getInstance(); 92 100 93 void InsertHits(G4int planeNumber); << 101 private: 94 102 95 void setNtuple(G4double energy, G4int planeN << 103 GammaRayTelAnalysis(); 96 104 97 static auto getInstance() -> GammaRayTelAnal << 105 void plot1D(IHistogram1D* histo); >> 106 void plot2D(IHistogram2D* histo); >> 107 void Plot(); 98 108 99 private: 109 private: 100 GammaRayTelAnalysis(); << 110 static GammaRayTelAnalysis* instance; 101 << 102 void Plot(); << 103 111 104 static GammaRayTelAnalysis *instance; << 112 GammaRayTelDetectorConstruction* GammaRayTelDetector; 105 113 106 const GammaRayTelDetectorConstruction *detec << 114 IAnalysisFactory* analysisFactory; >> 115 ITree* tree; >> 116 //IPlotter* plotter; >> 117 ITuple* tuple; >> 118 >> 119 IHistogram1D* energy; >> 120 IHistogram1D* hits; >> 121 IHistogram2D* posXZ; >> 122 IHistogram2D* posYZ; >> 123 >> 124 G4String histo1DDraw; >> 125 G4String histo1DSave; >> 126 G4String histo2DDraw; >> 127 G4String histo2DSave; >> 128 G4String histo2DMode; 107 129 108 G4String histo2DMode; << 130 GammaRayTelAnalysisMessenger* analysisMessenger; >> 131 }; 109 132 110 G4String histogramFileName; << 111 133 112 GammaRayTelAnalysisMessenger *analysisMessen << 134 #endif 113 }; << 114 #endif 135 #endif 115 136