Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ link_directories("$ENV{hep_hpc_path}/lib")
set(HEP_HPC_LIBRARIES "$ENV{hep_hpc_path}/lib/libhep_hpc_hdf5.so;$ENV{hep_hpc_path}/lib/libhep_hpc_Utilities.so;$ENV{hep_hpc_path}/lib/libhep_hpc_concat_hdf5.so")
message(STATUS "HEP_HPC lib: ${HEP_HPC_LIBRARIES}")


# Locate sources and headers for this project
# We presume the existence of three directories

Expand Down Expand Up @@ -88,21 +87,6 @@ foreach(_file ${macros} ${genie} ${analysis} ${gridutils} ${setup})
#message(STATUS "Copying ${_file} in ${PROJECT_BINARY_DIR}/${_file}")
endforeach()

#----------------------------------------------------------------------------
# generate dictionaries for the custom classes in the ROOT tree
ROOT_GENERATE_DICTIONARY(FPFClassesDict ${PROJECT_SOURCE_DIR}/include/FPFNeutrino.hh
${PROJECT_SOURCE_DIR}/include/FPFParticle.hh
LINKDEF ${PROJECT_SOURCE_DIR}/include/LinkDef.h
MODULE FPFClasses)

# create a shared library that includes the dictionary
add_library(FPFClasses SHARED ${PROJECT_SOURCE_DIR}/src/FPFNeutrino.cc
${PROJECT_SOURCE_DIR}/src/FPFParticle.cc
FPFClassesDict.cxx)

# include directories for headers
target_include_directories(FPFClasses PUBLIC ${PROJECT_SOURCE_DIR}/include)

#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
Expand All @@ -114,12 +98,9 @@ target_link_libraries(FPFSim
${HDF5_LIBRARIES}
${HEP_HPC_LIBRARIES}
${HEPMC3_LIBRARIES} ${HEPMC3_FIO_LIBRARIES} ${HEPMC3_LIB}
FPFClasses
)

#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS FPFSim DESTINATION ${PROJECT_SOURCE_DIR}/bin)
install(TARGETS FPFClasses DESTINATION ${PROJECT_SOURCE_DIR}/lib)
install(FILES ${PROJECT_SOURCE_DIR}/build/libFPFClasses_rdict.pcm DESTINATION ${PROJECT_SOURCE_DIR}/lib)
install(TARGETS FPFSim DESTINATION ${PROJECT_SOURCE_DIR}/bin)
31 changes: 23 additions & 8 deletions include/AnalysisManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "AnalysisManagerMessenger.hh"
#include "PixelMap3D.hh"
#include "FPFParticle.hh"
#include "FPFNeutrino.hh"

#include "hep_hpc/hdf5/File.hpp"

Expand Down Expand Up @@ -62,6 +61,7 @@ class AnalysisManager {
void bookFLArETrees();
void bookFASER2Trees();

void FillEventTree(const G4Event* event);
void FillPrimariesTree(const G4Event* event);
void FillTrajectoriesTree(const G4Event* event);

Expand Down Expand Up @@ -120,13 +120,29 @@ class AnalysisManager {

//---------------------------------------------------
// OUTPUT VARIABLES FOR COMMON TREES
// TODO: review carefully
// TODO: need to make evt tree less FLARE-centric
// TODO: remove pseudo-reco or add it as FLARE-only tree
// TODO: turn arrays in std::vector!

G4int evtID;
FPFNeutrino neutrino; //TODO: remove??
G4int evtID;
G4int vertexID;
double weight;
std::string genType;
std::string processName;
int initPDG;
double initX, initY, initZ, initT;
double initPx, initPy, initPz, initE;
double initM;
double initQ;
int intType;
int scatteringType;
int fslPDG;
int tgtPDG;
int tgtA;
int tgtZ;
int hitnucPDG;
double xs;
double Q2;
double xBj;
double y;
double W;

//---------------------------------------------------
// Output variables for TRAJECTORIES tree
Expand Down Expand Up @@ -164,7 +180,6 @@ class AnalysisManager {
//---------------------------------------------------
// OUTPUT VARIABLES FOR FLArE TREES
// TODO: merge hit variables? no need to use different names?
// TODO: somehow need to add back here info from evt tree

PixelMap3D* pm3D;

Expand Down
32 changes: 32 additions & 0 deletions include/EventInformation.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef EventInformation_HH
#define EventInformation_HH

#include "G4VUserEventInformation.hh"
#include "generators/GeneratorVertexMetadata.hh"
#include "globals.hh"
#include <vector>

// Event information
class EventInformation : public G4VUserEventInformation
{
public:

EventInformation();
EventInformation(std::vector<GeneratorVertexMetadata> genMetadata);
virtual ~EventInformation();

/// Gets vertex metadata full vector
inline std::vector<GeneratorVertexMetadata> GetEventMetadata() const { return fGenMetadata; }

/// Gets metadata per vertex
inline GeneratorVertexMetadata GetMetadataPerVertex(int i) const { return fGenMetadata.at(i); }

/// Prints the information about the event.
virtual void Print() const;

private:
/// Set of vertex metadata
std::vector<GeneratorVertexMetadata> fGenMetadata;
};

#endif
73 changes: 0 additions & 73 deletions include/FPFNeutrino.hh

This file was deleted.

5 changes: 0 additions & 5 deletions include/LinkDef.h

This file was deleted.

4 changes: 1 addition & 3 deletions include/PixelMap3D.hh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#include "G4ThreeVector.hh"

#include "FPFNeutrino.hh"

#include "hep_hpc/hdf5/File.hpp"
//#include "hep_hpc/hdf5/Ntuple.hpp"

Expand All @@ -27,7 +25,7 @@ class PixelMap3D {
void FillEntryWithToyElectronTransportation(const Double_t* pos_xyz, const Double_t* vtx_xyz, Double_t edep, const Int_t idxPrim);
void FillEntryWithToySingleElectronTransportation(const Double_t* pos_xyz, const Double_t* vtx_xyz, Double_t edep, const Int_t idxPrim);
void Write2DPMToFile(TFile* thefile, TDirectory *thedir);
void Process3DPM(hep_hpc::hdf5::File &h5file, FPFNeutrino neutrino, G4bool save3D);
void Process3DPM(hep_hpc::hdf5::File &h5file, G4int initPDG, G4int fslPDG, G4int intType, G4int scatType, G4double initE, G4bool save3D);

// this should go to a Geometry Service class
G4double DistanceToAnode(G4double x);
Expand Down
121 changes: 0 additions & 121 deletions include/PrimaryParticleInformation.hh

This file was deleted.

5 changes: 3 additions & 2 deletions include/generators/BackgroundGenerator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

#include "generators/GeneratorBase.hh"

#include "G4LorentzVector.hh"

#include "TFile.h"
#include "TH3D.h"
#include "TLorentzVector.h"
#include "globals.hh"

class G4Event;
Expand Down Expand Up @@ -45,7 +46,7 @@ class BackgroundGenerator : public GeneratorBase
G4double TPC_driftTime_s = 187.5e-6; // 187.5 us for 30cm drift

// specific internal functions
void ShootParticle(G4Event* anEvent, G4int pdg, TLorentzVector x4, TLorentzVector p4) const;
void ShootParticle(G4Event* anEvent, G4int pdg, G4LorentzVector x4, G4LorentzVector p4);
void SampleDirectionCosines(double& xdircos, double& ydircos, double E) const;
int ExtractBackgroundParticles() const;

Expand Down
Loading