Commit 26d4524d authored by Chad Lantz's avatar Chad Lantz
Browse files

Modified function to work with new AnalysisManager class

parent af461ba6
......@@ -31,6 +31,8 @@
#ifndef EventAction_h
#define EventAction_h 1
#include "AnalysisManager.hh"
#include "G4UserEventAction.hh"
#include "FiberHit.hh"
#include "globals.hh"
......@@ -50,23 +52,15 @@ class EventAction : public G4UserEventAction
virtual void EndOfEventAction ( const G4Event* event );
virtual void ProcessHitCollection ( FiberHitsCollection* HC );
virtual void ProcessOpticalHitCollection ( FiberHitsCollection* HC );
virtual void SetnZDCs ( G4int nZDCs );
virtual void SetnRPDs ( G4int nRPDs );
inline void SetClusterFlag ( G4bool arg ){CLUSTER = arg;}
inline std::vector< std::vector< std::vector<double> > >* GetRPDdoubleVectors( ){return fRPDdblVec;}
inline std::vector< std::vector< std::vector< int > > >* GetRPDintVectors ( ){return fRPDintVec;}
inline std::vector< std::vector< std::vector<double> > >* GetZDCdoubleVectors( ){return fZDCdblVec;}
inline std::vector< std::vector< std::vector< int > > >* GetZDCintVectors ( ){return fZDCintVec;}
private:
// Indecies are [mod#][dataSet][dataValue]
// data set order will need to be coordinated betweeen here and Run Action
std::vector< std::vector< std::vector<double> > > *fRPDdblVec, *fZDCdblVec;
std::vector< std::vector< std::vector< int > > > *fRPDintVec, *fZDCintVec;
std::vector< std::vector< std::vector<double> > > *m_RPDdblVec, *m_ZDCdblVec;
std::vector< std::vector< std::vector< int > > > *m_RPDintVec, *m_ZDCintVec;
AnalysisManager* m_analysisManager;
G4int hitsCollID, fEventNo, fnZDCs, fnRPDs;
G4double gunPosX, gunPosY, gunPosZ;
G4bool CLUSTER;
......
......@@ -31,22 +31,14 @@
#ifndef RunAction_h
#define RunAction_h 1
#include "Analysis.hh"
#include "AnalysisManager.hh"
#include "G4UserRunAction.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
#include <vector>
class G4Run;
/// Run action class
///
/// In EndOfRunAction(), it calculates the dose in the selected volume
/// from the energy deposit accumulated via stepping and event actions.
/// The computed dose is then printed on the screen.
class RunAction : public G4UserRunAction
{
public:
......@@ -57,19 +49,11 @@ class RunAction : public G4UserRunAction
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
virtual void MakeZDCTree ( G4int nTupleNo, G4int zdcNo );
virtual void MakeZDCOpticalTree( G4int nTupleNo, G4int zdcNo );
virtual void MakeRPDTree ( G4int nTupleNo, G4int rpdNo );
virtual void MakeRPDOpticalTree( G4int nTupleNo, G4int rpdNo );
private:
G4String m_fileName;
G4bool CLUSTER;
G4AnalysisManager* m_analysisManager;
std::vector< std::vector< std::vector<double> > > *m_ZDCdblVec, *m_RPDdblVec;
std::vector< std::vector< std::vector< int > > > *m_ZDCintVec, *m_RPDintVec;
AnalysisManager* m_analysisManager;
};
......
......@@ -31,7 +31,7 @@
#include "EventAction.hh"
#include "FiberHit.hh"
#include "FiberSD.hh"
#include "Analysis.hh"
#include "AnalysisManager.hh"
#include "G4UnitsTable.hh"
......@@ -49,6 +49,7 @@
EventAction::EventAction( )
: G4UserEventAction(){
hitsCollID = -1;
m_analysisManager = AnalysisManager::getInstance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -56,35 +57,6 @@ EventAction::EventAction( )
EventAction::~EventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::SetnZDCs(G4int nZDCs){
//Make a new vector of vectors of pointers to vectors of doubles
fZDCdblVec = new std::vector< std::vector< std::vector<double> > >(nZDCs);
fZDCintVec = new std::vector< std::vector< std::vector< int > > >(nZDCs);
// Resize to the largest number of branches we will fill from vectors
for(G4int i = 0; i < nZDCs; i++){
fZDCdblVec->at(i).resize(10);
fZDCintVec->at(i).resize(8);
}//end ZDC loop
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::SetnRPDs(G4int nRPDs){
//Make a new vector of vectors of pointers to vectors of doubles
fRPDdblVec = new std::vector< std::vector< std::vector<double> > >(nRPDs);
fRPDintVec = new std::vector< std::vector< std::vector< int > > >(nRPDs);
for(G4int i = 0; i < nRPDs; i++){
fRPDdblVec->at(i).resize(10);
fRPDintVec->at(i).resize(8);
}//end RPD loop
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -98,10 +70,11 @@ void EventAction::BeginOfEventAction(const G4Event* evt)
void EventAction::EndOfEventAction(const G4Event* evt){
G4PrimaryVertex* pVert = evt->GetPrimaryVertex();
// Last step in volume?
G4double LastStepInVolume = pVert->GetPosition().z();
m_RPDdblVec = m_analysisManager->GetRPDdoubleVectors( );
m_RPDintVec = m_analysisManager->GetRPDintVectors ( );
m_ZDCdblVec = m_analysisManager->GetZDCdoubleVectors( );
m_ZDCintVec = m_analysisManager->GetZDCintVectors ( );
CLUSTER = m_analysisManager->GetClusterFlag();
G4cout << ">>> Event " << evt->GetEventID() << G4endl;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
......@@ -119,30 +92,22 @@ void EventAction::EndOfEventAction(const G4Event* evt){
}// end while < nCollections
// fill ntuples //
//Use the base class to fill individual data points
//There's probably a better way to do this, but I just want it
//to work right now
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// fill ntuples //
for(int i = 0; i < analysisManager->GetNofNtuples(); i++){
analysisManager->FillNtupleDColumn(i,1,LastStepInVolume);
analysisManager->FillNtupleDColumn(i,2, pVert->GetX0() );
analysisManager->FillNtupleDColumn(i,3, pVert->GetY0() );
analysisManager->FillNtupleDColumn(i,4, pVert->GetZ0() );
analysisManager->FillNtupleIColumn(i,0, fEventNo );
analysisManager->AddNtupleRow(i);
}
// Clear ZDC vectors //
for(uint i = 0; i < fZDCdblVec->size(); i++){
fZDCdblVec->at(i).clear();
fZDCintVec->at(i).clear();
}
// Clear RPD vectors //
for(uint i = 0; i < fRPDdblVec->size(); i++){
fRPDdblVec->at(i).clear();
fRPDintVec->at(i).clear();
}
}// end if HCE
//Use our custom class to finish the job
m_analysisManager->FillNtuples();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -189,71 +154,72 @@ void EventAction::ProcessHitCollection( FiberHitsCollection* HC ){
int rpdNo = atoi( name.substr(3,1).c_str() );
if(!CLUSTER){
//doubles
fRPDdblVec->at(rpdNo).at(0). push_back( position.x() );
fRPDdblVec->at(rpdNo).at(1). push_back( position.y() );
fRPDdblVec->at(rpdNo).at(2). push_back( position.z() );
fRPDdblVec->at(rpdNo).at(3). push_back( momentum.x() );
fRPDdblVec->at(rpdNo).at(4). push_back( momentum.y() );
fRPDdblVec->at(rpdNo).at(5). push_back( momentum.z() );
fRPDdblVec->at(rpdNo).at(6). push_back( energy );
fRPDdblVec->at(rpdNo).at(7). push_back( velocity );
fRPDdblVec->at(rpdNo).at(8). push_back( beta );
fRPDdblVec->at(rpdNo).at(9). push_back( eDepSum );
fRPDdblVec->at(rpdNo).at(10).push_back( charge );
m_RPDdblVec->at(rpdNo).at(0). push_back( position.x() );
m_RPDdblVec->at(rpdNo).at(1). push_back( position.y() );
m_RPDdblVec->at(rpdNo).at(2). push_back( position.z() );
m_RPDdblVec->at(rpdNo).at(3). push_back( momentum.x() );
m_RPDdblVec->at(rpdNo).at(4). push_back( momentum.y() );
m_RPDdblVec->at(rpdNo).at(5). push_back( momentum.z() );
m_RPDdblVec->at(rpdNo).at(6). push_back( energy );
m_RPDdblVec->at(rpdNo).at(7). push_back( velocity );
m_RPDdblVec->at(rpdNo).at(8). push_back( beta );
m_RPDdblVec->at(rpdNo).at(9). push_back( eDepSum );
m_RPDdblVec->at(rpdNo).at(10).push_back( charge );
//ints
fRPDintVec->at(rpdNo).at(0).push_back( modNb );
fRPDintVec->at(rpdNo).at(1).push_back( radiatorNo );
fRPDintVec->at(rpdNo).at(2).push_back( rodNo );
fRPDintVec->at(rpdNo).at(3).push_back( nCherenkovsSum );
fRPDintVec->at(rpdNo).at(4).push_back( trackID );
fRPDintVec->at(rpdNo).at(5).push_back( pid );
m_RPDintVec->at(rpdNo).at(0).push_back( modNb );
m_RPDintVec->at(rpdNo).at(1).push_back( radiatorNo );
m_RPDintVec->at(rpdNo).at(2).push_back( rodNo );
m_RPDintVec->at(rpdNo).at(3).push_back( nCherenkovsSum );
m_RPDintVec->at(rpdNo).at(4).push_back( trackID );
m_RPDintVec->at(rpdNo).at(5).push_back( pid );
} else{
//doubles
fRPDdblVec->at(rpdNo).at(0).push_back( position.x() );
fRPDdblVec->at(rpdNo).at(1).push_back( position.y() );
fRPDdblVec->at(rpdNo).at(2).push_back( position.z() );
m_RPDdblVec->at(rpdNo).at(0).push_back( position.x() );
m_RPDdblVec->at(rpdNo).at(1).push_back( position.y() );
m_RPDdblVec->at(rpdNo).at(2).push_back( position.z() );
//ints
fRPDintVec->at(rpdNo).at(0).push_back( nCherenkovsSum );
fRPDintVec->at(rpdNo).at(1).push_back( rodNo );
m_RPDintVec->at(rpdNo).at(0).push_back( nCherenkovsSum );
m_RPDintVec->at(rpdNo).at(1).push_back( rodNo );
}// end if !CLUSTER
// end if RPD
} else{
if( name.compare(0,3,"ZDC") ){//ZDC hitsCollID, check to be sure/symmetric
int zdcNo = atoi( name.substr(3,1).c_str() );
G4cout << "Processing ZDC" << zdcNo << " hits" << G4endl;
if(!CLUSTER){
//doubles
fZDCdblVec->at(zdcNo).at(0). push_back( position.x() );
fZDCdblVec->at(zdcNo).at(1). push_back( position.y() );
fZDCdblVec->at(zdcNo).at(2). push_back( position.z() );
fZDCdblVec->at(zdcNo).at(3). push_back( momentum.x() );
fZDCdblVec->at(zdcNo).at(4). push_back( momentum.y() );
fZDCdblVec->at(zdcNo).at(5). push_back( momentum.z() );
fZDCdblVec->at(zdcNo).at(6). push_back( energy );
fZDCdblVec->at(zdcNo).at(7). push_back( velocity );
fZDCdblVec->at(zdcNo).at(8). push_back( beta );
fZDCdblVec->at(zdcNo).at(9). push_back( eDepSum );
fZDCdblVec->at(zdcNo).at(10).push_back( charge );
m_ZDCdblVec->at(zdcNo).at(0). push_back( position.x() );
m_ZDCdblVec->at(zdcNo).at(1). push_back( position.y() );
m_ZDCdblVec->at(zdcNo).at(2). push_back( position.z() );
m_ZDCdblVec->at(zdcNo).at(3). push_back( momentum.x() );
m_ZDCdblVec->at(zdcNo).at(4). push_back( momentum.y() );
m_ZDCdblVec->at(zdcNo).at(5). push_back( momentum.z() );
m_ZDCdblVec->at(zdcNo).at(6). push_back( energy );
m_ZDCdblVec->at(zdcNo).at(7). push_back( velocity );
m_ZDCdblVec->at(zdcNo).at(8). push_back( beta );
m_ZDCdblVec->at(zdcNo).at(9). push_back( eDepSum );
m_ZDCdblVec->at(zdcNo).at(10).push_back( charge );
//ints
fZDCintVec->at(zdcNo).at(0).push_back( modNb );
fZDCintVec->at(zdcNo).at(1).push_back( radiatorNo );
fZDCintVec->at(zdcNo).at(2).push_back( rodNo );
fZDCintVec->at(zdcNo).at(3).push_back( nCherenkovsSum );
fZDCintVec->at(zdcNo).at(4).push_back( trackID );
fZDCintVec->at(zdcNo).at(5).push_back( pid );
m_ZDCintVec->at(zdcNo).at(0).push_back( modNb );
m_ZDCintVec->at(zdcNo).at(1).push_back( radiatorNo );
m_ZDCintVec->at(zdcNo).at(2).push_back( rodNo );
m_ZDCintVec->at(zdcNo).at(3).push_back( nCherenkovsSum );
m_ZDCintVec->at(zdcNo).at(4).push_back( trackID );
m_ZDCintVec->at(zdcNo).at(5).push_back( pid );
} else{
//doubles
fZDCdblVec->at(zdcNo).at(0). push_back( position.x() );
fZDCdblVec->at(zdcNo).at(1). push_back( position.y() );
fZDCdblVec->at(zdcNo).at(2). push_back( position.z() );
m_ZDCdblVec->at(zdcNo).at(0). push_back( position.x() );
m_ZDCdblVec->at(zdcNo).at(1). push_back( position.y() );
m_ZDCdblVec->at(zdcNo).at(2). push_back( position.z() );
//ints
fZDCintVec->at(zdcNo).at(0).push_back( nCherenkovsSum );
fZDCintVec->at(zdcNo).at(1).push_back( radiatorNo );
m_ZDCintVec->at(zdcNo).at(0).push_back( nCherenkovsSum );
m_ZDCintVec->at(zdcNo).at(1).push_back( radiatorNo );
}// end if !CLUSTER
}// end if ZDC
}// end else (!RPD)
......@@ -272,7 +238,7 @@ void EventAction::ProcessOpticalHitCollection ( FiberHitsCollection* HC ){
G4double topOfVolume = sd->GetTopOfVolume();
int n_hit = HC->entries();
G4cout << name << " nHits = " << n_hit << G4endl;
G4cout << name << " nOpticalHits = " << n_hit << G4endl;
for ( G4int i = 0 ; i < n_hit; i++){
......@@ -300,27 +266,27 @@ void EventAction::ProcessOpticalHitCollection ( FiberHitsCollection* HC ){
if( trackID != prevTrackId ){
if( name.compare(0,3,"ZDC") ){//ZDC hitsCollID, check to be sure/symmetric
int zdcNo = atoi( name.substr(3,1).c_str() );
fZDCdblVec->at(zdcNo).at(0). push_back( origin.x() );
fZDCdblVec->at(zdcNo).at(1). push_back( origin.y() );
fZDCdblVec->at(zdcNo).at(2). push_back( origin.z() );
fZDCdblVec->at(zdcNo).at(3). push_back( momentum.x() );
fZDCdblVec->at(zdcNo).at(4). push_back( momentum.y() );
fZDCdblVec->at(zdcNo).at(5). push_back( momentum.z() );
m_ZDCdblVec->at(zdcNo).at(0). push_back( origin.x() );
m_ZDCdblVec->at(zdcNo).at(1). push_back( origin.y() );
m_ZDCdblVec->at(zdcNo).at(2). push_back( origin.z() );
m_ZDCdblVec->at(zdcNo).at(3). push_back( momentum.x() );
m_ZDCdblVec->at(zdcNo).at(4). push_back( momentum.y() );
m_ZDCdblVec->at(zdcNo).at(5). push_back( momentum.z() );
analysisManager->FillNtupleIColumn( zdcNo, 1, nCherenkovsSum );
fZDCintVec->at(zdcNo).at(0).push_back( rodNo );
m_ZDCintVec->at(zdcNo).at(0).push_back( rodNo );
}//end fill ZDC vectors
if( name.compare(0,3,"RPD") ){//RPD hitsCollID, check to be sure/symmetric
int rpdNo = atoi( name.substr(3,1).c_str() );
fRPDdblVec->at(rpdNo).at(0). push_back( origin.x() );
fRPDdblVec->at(rpdNo).at(1). push_back( origin.y() );
fRPDdblVec->at(rpdNo).at(2). push_back( origin.z() );
fRPDdblVec->at(rpdNo).at(3). push_back( momentum.x() );
fRPDdblVec->at(rpdNo).at(4). push_back( momentum.y() );
fRPDdblVec->at(rpdNo).at(5). push_back( momentum.z() );
analysisManager->FillNtupleIColumn( rpdNo + fZDCdblVec->size(), 1, nCherenkovsSum );
fRPDintVec->at(rpdNo).at(0). push_back( rodNo );
m_RPDdblVec->at(rpdNo).at(0). push_back( origin.x() );
m_RPDdblVec->at(rpdNo).at(1). push_back( origin.y() );
m_RPDdblVec->at(rpdNo).at(2). push_back( origin.z() );
m_RPDdblVec->at(rpdNo).at(3). push_back( momentum.x() );
m_RPDdblVec->at(rpdNo).at(4). push_back( momentum.y() );
m_RPDdblVec->at(rpdNo).at(5). push_back( momentum.z() );
analysisManager->FillNtupleIColumn( rpdNo + m_ZDCdblVec->size(), 1, nCherenkovsSum );
m_RPDintVec->at(rpdNo).at(0). push_back( rodNo );
}//end fill RPD vectors
}// end if trackID
}// end hit loop
......
......@@ -29,13 +29,7 @@
/// \brief Implementation of the RunAction class
#include "RunAction.hh"
#include "EventAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "Analysis.hh"
#include "FiberSD.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
#include "G4LogicalVolumeStore.hh"
......@@ -50,214 +44,7 @@
RunAction::RunAction()
: G4UserRunAction()
{
//Create the analysis manager
m_analysisManager = G4AnalysisManager::Instance();
G4cout << "Using " << m_analysisManager->GetType() << " type Analysis Manager" << G4endl;
char name[20];
// Get number of ZDCs and RPDs from DetectorConstruction
const DetectorConstruction* constDetectorConstruction
= static_cast<const DetectorConstruction*>(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
DetectorConstruction* detectorConstruction
= const_cast<DetectorConstruction*>(constDetectorConstruction);
int nZDCs = detectorConstruction->GetnZDCs();
int nRPDs = detectorConstruction->GetnRPDs();
CLUSTER = detectorConstruction->GetClusterFlag();
// Get event action
const EventAction* constEventAction
= static_cast<const EventAction*>(G4RunManager::GetRunManager()->GetUserEventAction());
EventAction* eventAction
= const_cast<EventAction*>(constEventAction);
eventAction->SetClusterFlag(CLUSTER);
eventAction->SetnZDCs(nZDCs);
eventAction->SetnRPDs(nRPDs);
// The sizes of these vectors will tell us how many of each detector we have
// and what branches we want on the trees. We also need the addresses so we can
// write the contents to the trees.
m_ZDCdblVec = eventAction->GetZDCdoubleVectors( );
m_ZDCintVec = eventAction->GetZDCintVectors( );
m_RPDdblVec = eventAction->GetRPDdoubleVectors( );
m_RPDintVec = eventAction->GetRPDintVectors( );
FiberSD* sd;
//Create ZDC trees and branches
for(int zdcNo = 0; zdcNo < nZDCs; zdcNo++){
sprintf(name,"ZDC%d_SD",zdcNo);
//Find out from the SD if optical is on for this detector
sd = (FiberSD*)G4SDManager::GetSDMpointer()->FindSensitiveDetector( name );
if( sd->OpticalIsOn() ) MakeZDCOpticalTree( zdcNo, zdcNo );
else MakeZDCTree( zdcNo, zdcNo );
m_analysisManager->FinishNtuple();
}//end ZDC loop
//Create RPD trees and branches
for(int rpdNo = 0; rpdNo < nRPDs; rpdNo++){
sprintf(name,"RPD%d_SD",rpdNo);
int nTuple = nZDCs + rpdNo;
//Find out from the SD if optical is on for this detector
sd = (FiberSD*)G4SDManager::GetSDMpointer()->FindSensitiveDetector( name );
if( sd->OpticalIsOn() ) MakeRPDOpticalTree( nTuple, rpdNo );
else MakeRPDTree( nTuple, rpdNo );
m_analysisManager->FinishNtuple();
}//end RPD loop
}//end constructor
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::MakeZDCTree( G4int nTupleNo, G4int zdcNo ){
char name[20];
sprintf(name,"ZDC%dtree",zdcNo);
m_analysisManager->CreateNtuple( name, "ZDC data");
if(!CLUSTER){
//Make double branches
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStep" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastSteptest" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosX" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosY" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosZ" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "x", m_ZDCdblVec->at(zdcNo).at(0) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "y", m_ZDCdblVec->at(zdcNo).at(1) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "z", m_ZDCdblVec->at(zdcNo).at(2) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Px", m_ZDCdblVec->at(zdcNo).at(3) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Py", m_ZDCdblVec->at(zdcNo).at(4) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Pz", m_ZDCdblVec->at(zdcNo).at(5) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "energy", m_ZDCdblVec->at(zdcNo).at(6) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "velocity", m_ZDCdblVec->at(zdcNo).at(7) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "beta", m_ZDCdblVec->at(zdcNo).at(8) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "eDep", m_ZDCdblVec->at(zdcNo).at(9) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "charge", m_ZDCdblVec->at(zdcNo).at(10) );
//Make int branches
m_analysisManager->CreateNtupleIColumn( nTupleNo, "EventNo" );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "modNo", m_ZDCintVec->at(zdcNo).at(0) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "radNo", m_ZDCintVec->at(zdcNo).at(1) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "rodNo", m_ZDCintVec->at(zdcNo).at(2) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "nCherenkovs", m_ZDCintVec->at(zdcNo).at(3) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "trackID", m_ZDCintVec->at(zdcNo).at(4) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "pid", m_ZDCintVec->at(zdcNo).at(5) );
} else { //Fewer vector branches to save storage space
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStep" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStepTest" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosX" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosY" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosZ" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "x", m_ZDCdblVec->at(zdcNo).at(0) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "y", m_ZDCdblVec->at(zdcNo).at(1) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "z", m_ZDCdblVec->at(zdcNo).at(2) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "EventNo" );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "nCherenkovs", m_ZDCintVec->at(zdcNo).at(1) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "radNo", m_ZDCintVec->at(zdcNo).at(0) );
}//end if !CLUSTER
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::MakeZDCOpticalTree( G4int nTupleNo, G4int zdcNo ){
char name[20];
sprintf(name,"ZDC%dtree",zdcNo);
m_analysisManager->CreateNtuple( name, "ZDC data");
//Make double branches
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStep" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStepTest" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosX" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosY" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosZ" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "x", m_ZDCdblVec->at(zdcNo).at(0) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "y", m_ZDCdblVec->at(zdcNo).at(1) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "z", m_ZDCdblVec->at(zdcNo).at(2) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Px", m_ZDCdblVec->at(zdcNo).at(6) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Py", m_ZDCdblVec->at(zdcNo).at(7) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Pz", m_ZDCdblVec->at(zdcNo).at(8) );
//Make int branches
m_analysisManager->CreateNtupleIColumn( nTupleNo, "EventNo" );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "nCherenkovs" );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "rodNo", m_RPDintVec->at(zdcNo).at(0) );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::MakeRPDTree ( G4int nTupleNo, G4int rpdNo ){
char name[20];
sprintf(name,"RPD%dtree",rpdNo);
m_analysisManager->CreateNtuple( name, "RPD data");
if(!CLUSTER){
//Make double branches
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStep" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStepTest" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosX" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosY" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosZ" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "x", m_RPDdblVec->at(rpdNo).at(0) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "y", m_RPDdblVec->at(rpdNo).at(1) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "z", m_RPDdblVec->at(rpdNo).at(2) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Px", m_RPDdblVec->at(rpdNo).at(3) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Py", m_RPDdblVec->at(rpdNo).at(4) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "Pz", m_RPDdblVec->at(rpdNo).at(5) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "energy", m_RPDdblVec->at(rpdNo).at(6) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "velocity", m_RPDdblVec->at(rpdNo).at(7) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "beta", m_RPDdblVec->at(rpdNo).at(8) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "eDep", m_RPDdblVec->at(rpdNo).at(9) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "charge", m_RPDdblVec->at(rpdNo).at(10));
//Make int branches
m_analysisManager->CreateNtupleIColumn( nTupleNo, "EventNo" );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "modNo", m_RPDintVec->at(rpdNo).at(0) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "radNo", m_RPDintVec->at(rpdNo).at(1) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "rodNo", m_RPDintVec->at(rpdNo).at(2) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "nCherenkovs", m_RPDintVec->at(rpdNo).at(3) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "trackID", m_RPDintVec->at(rpdNo).at(4) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "pid", m_RPDintVec->at(rpdNo).at(5) );
} else { //Fewer vector branches to save storage space
//Make double branches
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStep" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStepTest" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosX" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosY" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosZ" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "x", m_RPDdblVec->at(rpdNo).at(0) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "y", m_RPDdblVec->at(rpdNo).at(1) );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "z", m_RPDdblVec->at(rpdNo).at(2) );
//Make int branches
m_analysisManager->CreateNtupleIColumn( nTupleNo, "EventNo" );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "nCherenkovs", m_RPDintVec->at(rpdNo).at(1) );
m_analysisManager->CreateNtupleIColumn( nTupleNo, "rodNo", m_RPDintVec->at(rpdNo).at(0) );
}//end if !CLUSTER
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::MakeRPDOpticalTree( G4int nTupleNo, G4int rpdNo ){
char name[20];
sprintf(name,"RPD%dtree",rpdNo);
m_analysisManager->CreateNtuple( name, "RPD data");
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStep" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "lastStepTest" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosX" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosY" );
m_analysisManager->CreateNtupleDColumn( nTupleNo, "gunPosZ" );
m_analysisManager