Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/dna/dsbandrepair/include/Analysis.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 /// \file Analysis.hh
0028 /// \brief Definition of the Analysis class
0029 /// \file Analysis.hh
0030 /// \brief Definition of the Analysis class
0031 
0032 #ifndef ANALYSIS_h
0033 #define ANALYSIS_h 1
0034 
0035 #include "G4ThreeVector.hh"
0036 #include <map>
0037 #include "G4AnalysisManager.hh"
0038 #include "G4GenericMessenger.hh"
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 
0042 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
0043     TypeName(const TypeName&);               \
0044     void operator=(const TypeName&)
0045 
0046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0047 
0048 struct InfoForChemGeo // store info for creating input files for chem stage
0049 {
0050     G4int fType{0}; // water: 1; solvated electron=2
0051     G4int fState{-99}; // no state for solvated electron
0052     G4int fElectronicLevel{-99}; // no electronic level for solvated electron
0053     G4double fX{0.}; // position of the incoming track
0054     G4double fY{0.}; // position of the incoming track
0055     G4double fZ{0.}; // position of the incoming track
0056     G4int fParentTrackID{-1};
0057     G4int fEventNumber{-1};
0058     G4int fVolume{-1};
0059     G4int fVolumeCopyNumber{-1};
0060     G4int fMotherVolume{-1};
0061     G4int fMotherVolumeCopyNumber{-1};
0062     G4double fRelX{-1.};
0063     G4double fRelY{-1.};
0064     G4double fRelZ{-1.};
0065 };
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 struct InfoInPhysStage // store info created in Physical stage
0070 {
0071     G4int fFlagParticle{-1};
0072     G4int fFlagParentID{-1};
0073     G4int fFlagProcess{-1};
0074     G4double fX{-1.};
0075     G4double fY{-1.};
0076     G4double fZ{-1.};
0077     G4double fEdep{-1.};
0078     G4int fEventNumber{-1};
0079     G4int fVolumeName{-1};
0080     G4int fCopyNumber{-1};
0081     G4int fLastMetVoxelCopyNum{-1};
0082 };
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0085 
0086 class Analysis
0087 {
0088 public:
0089     ~Analysis() = default;
0090     static Analysis* GetAnalysis();
0091 
0092     void OpenFile(const G4String outFolder="");
0093     void Save();
0094     void Close(G4bool reset = true);
0095     void SetFileName(const G4String& name) {fFileName = name;};
0096     void Book();
0097     G4AnalysisManager* GetAnalysisManager();
0098     void ClearVector() ; // being called in Beginofeventaction
0099     void AddInfoForChemGeo(InfoForChemGeo);
0100     void AddInfoInPhysStage(InfoInPhysStage);
0101     void UpdateChemInputDataAndFillNtuple(); // being called in Endofeventaction
0102     void RecordCellDefFiliePath(const G4String &pth) {fCellDefFilePath = pth;};
0103     void RecordVoxelDefFilesList(std::set<G4String> list) {fVoxelDefFilesList = list;};
0104     void RecordChemInputFolderName(const G4String &pth) {fChemInputFolderName = pth;};
0105     void WritePhysGeo();
0106     G4String GetChemInputFolderName() {return fChemInputFolderName;}
0107     G4String GetPhysOutFolderName() {return fPhysOutFolderName;}
0108     G4String GetChemOutFolderName() {return fChemOutFolderName;}
0109     void SetTotalNbBpPlacedInGeo(unsigned long long val) {fTotalNbBpPlacedInGeo = val;}
0110     void SetTotalNbHistonePlacedInGeo(unsigned long long val) {fTotalNbHistonePlacedInGeo = val;}
0111     void SetNucleusVolume(G4double vl) {fNucleusVolume = vl;};
0112     void SetNucleusMassDensity(G4double md) {fNucleusMassDensity = md;};
0113     void CheckAndCreateNewFolderInChemStage();
0114     void CheckAndCreateNewFolderInPhysStage();
0115 private:
0116     Analysis() {DefineCommands();};
0117     G4String CreateChemInputFile(G4int eventNum,G4int volumeCopyNumber,const G4String &voxelName);
0118     void UpdatingChemInputFile(InfoForChemGeo);
0119     void UpdatingChemInputFile(InfoInPhysStage);
0120     std::vector<InfoForChemGeo> fInfoForChemGeoVector;
0121     std::vector<InfoInPhysStage> fInfoInPhysStageVector;
0122     std::map<G4double, std::map<G4double, G4String> > fOutputFiles;
0123     G4String fCellDefFilePath;
0124     std::set<G4String> fVoxelDefFilesList;
0125     G4String fChemInputFolderName{"chem_input"};
0126     G4String fPhysOutFolderName{"phys_output"};
0127     G4String fChemOutFolderName{"chem_output"};
0128     unsigned long long fTotalNbBpPlacedInGeo{0};
0129     unsigned long long fTotalNbHistonePlacedInGeo{0};
0130     G4double fNucleusVolume{0.};
0131     G4double fNucleusMassDensity{0.};
0132     G4String fFileName="Output";// output
0133     std::unique_ptr<G4GenericMessenger> fMessenger;
0134     void DefineCommands();
0135     DISALLOW_COPY_AND_ASSIGN(Analysis);
0136 };
0137 
0138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0139 
0140 #endif