#ifndef IRESAMPLER_HXX #define IRESAMPLER_HXX /// G4 #include "G4String.hh" /// ICEDUST #include "ICOMETEvent.hxx" #include "IRooTrackerFile.hxx" /// IResampler: backward sampling functionalities using the GOUPIL/PUMAS backend /// /// This class uses Geant4 to calculate step sizes in the geometry and EM field and /// passes the information down to GOUPIL to compute the rate of each input event. class G4RunManager; class PrimaryGenerator; class StackingAction; class IResampler { public: /// Constructor arguments: /// geometryMacro: name of the master geometry macro, e.g. Phase-I-CyDet.macro, /// Phase-II.macro /// fieldmapDirectory: directory of the fieldmap. If empty, the directory pointed /// to by the ICEDUST_FIELDMAPS environment variable will be used /// nResamplings: number of backward MC propagations to perform to estimate the /// flux of each primary particle. /// outputDebugData: whether to output backward stepping information to a csv /// file as we perform the backward propagation. IResampler(const std::string& geometryMacro, const std::string& fieldmapDirectory, int nResamplings, bool detailedTransport, bool outputDebugData); ~IResampler(); /// Computes the flux of a primary event by backward Monte Carlo /// propagation to an atmospheric flux distribution. void ComputeFlux(COMET::ICOMETEvent& event, COMET::IHandle output); private: G4RunManager* fRunManager; PrimaryGenerator* fPrimaryGenerator; StackingAction* fStackingAction; /// Number of backward samplings to perform per primary event to evaluate the /// average flux. int fNResamplings; /// Vector of flux values stored over resamplings for each primary event. std::vector fFluxVector; }; #endif