// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // /// \file analysis/AnaEx02/src/HistoManager.cc /// \brief Implementation of the HistoManager class // // $Id: HistoManager.cc 98060 2016-07-01 16:24:08Z gcosmo $ // GEANT4 tag $Name: geant4-09-04 $ // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "HistoManager.hh" #include "G4UnitsTable.hh" #include "EventAction.hh" #include "RunAction.hh" #include "SteppingAction.hh" #include "DetectorConstruction.hh" #include #include #include #include "G4Run.hh" #include "G4RunManager.hh" #include "G4Event.hh" #include "G4Step.hh" #include "G4Track.hh" #include "G4ProcessManager.hh" #include //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... using namespace std; atomic H3number(0); //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... HistoManager::HistoManager(DetectorConstruction*Detector) :fFactoryOn(false) { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... HistoManager::~HistoManager() { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void HistoManager::BeginOfRunAction(const G4Run* aRun) { G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl; time_begin=time(NULL); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void HistoManager::EndOfRunAction(const G4Run* aRun) { G4cout << " H3number " <GetEventID(); if ( evtNb%100000000 == 0) { G4cout << "\n---> finish: " << evtNb << G4endl; time_curr=time(NULL); G4cout<<"cost time: "< GetTrack()->GetVolume()->GetName(); G4String particle_name = aStep->GetTrack()->GetDefinition()->GetParticleName(); //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... if(physics_volume=="Ge" ){ const G4TrackVector* secondary = aStep->GetSecondary(); for (size_t lp=0; lp<(*secondary).size(); lp++) { if ((*secondary)[lp]->GetDefinition()->GetParticleName()=="triton") { H3number=H3number+1; G4cout << " H3number " << H3number << " H3TrackID " << (*secondary)[lp]->GetTrackID() << " H3ParentID " << (*secondary)[lp]->GetParentID() << " H3Currentstep_number " << (*secondary)[lp]->GetCurrentStepNumber() << " H3physics_volume " << (*secondary)[lp]->GetVolume()->GetName(); G4cout << G4endl; } //..for..oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... } //..if..oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... } //....if oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... }