Skip to content
Snippets Groups Projects
Commit e1e3759e authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* Adding registration of Process in output tree

parent 14f624d4
No related branches found
No related tags found
No related merge requests found
Pipeline #168434 passed
......@@ -19,27 +19,28 @@
* The scorer hold the processes name *
*****************************************************************************/
#include "ProcessScorers.hh"
#include "G4UnitsTable.hh"
#include "G4SteppingManager.hh"
using namespace ProcessScorers ;
#include "G4UnitsTable.hh"
#include "RootOutput.h"
using namespace ProcessScorers;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Process::PS_Process(G4String name,G4int depth)
:G4VPrimitiveScorer(name, depth){
//m_NestingLevel = NestingLevel;
}
PS_Process::PS_Process(G4String name, G4int depth) : G4VPrimitiveScorer(name, depth) {
// m_NestingLevel = NestingLevel;
auto tree = RootOutput::getInstance()->GetTree();
tree->Branch("Process", &t_processname);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PS_Process::~PS_Process(){
}
PS_Process::~PS_Process() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool PS_Process::ProcessHits(G4Step* aStep, G4TouchableHistory*){
G4bool PS_Process::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
// Contain Process Name
G4String processname;
if(aStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
if (aStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL) {
processname = aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
t_processname.push_back(processname);
t_processtime.push_back(aStep->GetPreStepPoint()->GetGlobalTime());
}
......@@ -56,14 +57,14 @@ G4bool PS_Process::ProcessHits(G4Step* aStep, G4TouchableHistory*){
particlename = aStep->GetTrack()->GetParticleDefinition()->GetParticleName();
//step_length = aStep->GetTrack()->GetStepLength();
track_kineE = aStep->GetTrack()->GetKineticEnergy();
if(volumename=="av_1_impr_1_gas_box_logic_pv_0"){
if(processname=="hadElastic")t_FC_process.push_back(1);
if(processname=="neutronInelastic")t_FC_process.push_back(2);
}
if(HasBeenTracked[trackID]==0){
if(particlename=="gamma"){
if(particlename=="gamma"){
HasBeenTracked[trackID]=1;
//cout << trackID << " " << track_kineE << endl;
t_gamma_energy.push_back(track_kineE);
......@@ -82,36 +83,29 @@ G4bool PS_Process::ProcessHits(G4Step* aStep, G4TouchableHistory*){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PS_Process::Initialize(G4HCofThisEvent*){
clear();
}
void PS_Process::Initialize(G4HCofThisEvent*) { clear(); }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PS_Process::EndOfEvent(G4HCofThisEvent*){
}
void PS_Process::EndOfEvent(G4HCofThisEvent*) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PS_Process::clear(){
void PS_Process::clear() {
t_processname.clear();
t_processtime.clear();
t_gamma_energy.clear();
t_proton_energy.clear();
t_proton_time.clear();
t_FC_process.clear();
for(unsigned int i=0; i<100; i++){
for (unsigned int i = 0; i < 100; i++) {
HasBeenTracked[i] = 0;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PS_Process::DrawAll(){
}
void PS_Process::DrawAll() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PS_Process::PrintAll(){
}
void PS_Process::PrintAll() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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