//____________________________________________________________________________ /*! \class GGenerateEventExternal.cxx \brief ...... \author ...... ...... \created May 2, 2022 */ //____________________________________________________________________________ #ifdef _KM3NET_ENABLED__ // presently compiled only for km3net users #include #include #include #include "SeaNuDrivers/GGenerateEventExternal.h" //___________________________________________________________________________ GGenerateEventExternal::GGenerateEventExternal(GenParam * GenPar):GGenerateEvent(GenPar) { fGenPar = GenPar; cout<<"Neutrino interactions read from file: "<FluxFiles[0].NuType<<" "<FluxFiles[0].FileNames[0]<Initialize(); this->CalcXSecWater(); fGenPar->XSecTotSW=this->CalcXsecTot(fGenPar->SeaWaterComp); fGenPar->XSecTotSR=this->CalcXsecTot(fGenPar->RockComp); fGenPar->XSecTotMantle=this->CalcXsecTot(fGenPar->MantleComp); fGenPar->XSecTotCore=this->CalcXsecTot(fGenPar->CoreComp); } //___________________________________________________________________________ GGenerateEventExternal::~GGenerateEventExternal(){ } //________________________________________________________________________________________ void GGenerateEventExternal::Initialize(){ // called for initialization done only one time at the beginning (when the constructor is called) } //________________________________________________________________________________________ void GGenerateEventExternal::Configure(int NTot){ // called at the beginning of each energy bin to configure the generator // NTot is the number of neutrinos to be generated in the bin and it is input by the main fNTot=NTot; } //________________________________________________________________________________________ void GGenerateEventExternal::CleanEvent(void){ fSeaEvent->Reset(); } //________________________________________________________________________________________ void GGenerateEventExternal::SetGeometry(string RootGeomFile){ return; } //________________________________________________________________________________________ void GGenerateEventExternal::InitGenBin(double Emin, double Emax, double RL, double RT, double X0, double Y0, double Z0) { return; } //________________________________________________________________________________________ double GGenerateEventExternal::GetNFluxNeutrinos(void) { } //________________________________________________________________________________________ void GGenerateEventExternal::FillSeaEvent(GSeaEvent * SeaEvent){ // fill the gSeaGen event class with interaction results } //________________________________________________________________________________________ void GGenerateEventExternal::ComputeWeights(GSeaEvent * SeaEvt){ // computes the event weights and save them in the gSeaGen event class } //________________________________________________________________________________________ void GGenerateEventExternal::GenerateEvent(void) { } //________________________________________________________________________________________ vector GGenerateEventExternal::GetInterFinalTracks(void){ // return a vector with nuwro particles at the interaction final state // Created a final track coincident with the generated neutrino to test the output vector FinalTracks; GSeaTrack track; return FinalTracks; } //________________________________________________________________________________________ vector GGenerateEventExternal::GetGeneratorTracks(){ // return a vector with particles at the interaction final state vector GeneratorTracks; return GeneratorTracks; } //________________________________________________________________________________________ void GGenerateEventExternal::CalcXSecWater(void){ // called at the constructor. It calculates the cross section in m2 in pure water // and for the simulated interaction channel (CC, NC, CC+NC) and // for each neutrino type and save it in a map fGenPar->XSecWater // this cross section is not used in the simulation but it is saved for each // event in the output file to calculate the effective volume // cross sexcion set to 1.E-40 return; } //__________________________________________________________________________ map GGenerateEventExternal::CalcXsecTot(map MediaComp){ // called at the constructor. It calculates the total (CC+NC) cross sections in m2 // XSecMedia for each medium with composition MediaComp. These cross sections are // used by gSeaGen to calculate the PEarth entering in the event weight // cross sexcion set to 1.E-40 map XSecMedia; return XSecMedia; } //___________________________________________________________________________ void GGenerateEventExternal::WriteNative(GSeaEvent * SeaEvt){ // this method is to write the native output (for instance to do checks) return; } //___________________________________________________________________________ TLorentzVector GGenerateEventExternal::GetVertex(void){ // return the interaction vertex TLorentzVector vertex(0,0,0,0); fSeaEvent->Vertex=vertex; return vertex; } #endif // _KM3NET_ENABLED__