Skip to content
Snippets Groups Projects
Commit 6b2d3b71 authored by Chad Lantz's avatar Chad Lantz
Browse files

Started changing StackingAction to EventAction

parent 4742b8d4
No related branches found
No related tags found
No related merge requests found
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 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. *
// ********************************************************************
// @Author Chad Lantz
#ifndef OpNoviceEventAction_H
#define OpNoviceEventAction_H 1
#include "globals.hh"
#include "G4UserEventAction.hh"
class OpNoviceEventAction : public G4UserEventAction{
public:
OpNoviceEventAction();
virtual ~OpNoviceEventAction();
virtual void BeginOfEventAction( const G4Event* event );
virtual void EndOfEventAction( const G4Event* event );
private:
G4THitsMap<G4double>* GetHitsCollection ( G4int hcID, const G4Event* event ) const;
G4double GetSum ( G4THitsMap<G4double>* hitsMap ) const;
void PrintEventStatistics( G4double absoEdep, G4double absoTrackLength, G4double gapEdep, G4double gapTrackLength ) const;
G4int hitsCollID;
};
#endif
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 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. *
// ********************************************************************
//
// @Author Chad Lantz
#include "OpNoviceEventAction.hh"
#include "G4VProcess.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4Track.hh"
#include "G4ios.hh"
OpNoviceEventgAction::OpNoviceStackingAction()
: G4UserEventAction(),
hitsCollID(0){
}
OpNoviceEventAction::~OpNoviceStackingAction(){
}
void OpNoviceEventAction::BeginOfEventAction(const G4Event* event){
fEventNo = evt->GetEventID();
// G4SDManager * SDman = G4SDManager::GetSDMpointer();
hitsCollID = 0;
}
void OpNoviceEventAction::EndOfEventAction(const G4Event* event){
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// fill ntuple //
analysisManager->FillNtupleDColumn(0, absoEdep);
analysisManager->FillNtupleDColumn(1, gapEdep);
analysisManager->FillNtupleDColumn(2, absoTrackLength);
analysisManager->FillNtupleDColumn(3, gapTrackLength);
analysisManager->AddNtupleRow();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment