35 #include "nugen/EventGeneratorBase/GENIE/GENIE2ART.h" 39 #include "nurandom/RandomUtils/NuRandomService.h" 45 #include "CLHEP/Random/RandFlat.h" 87 string sname =
"genie::EventGenerator";
88 string sconfig =
"NucleonDecay";
90 evgb::SetEventGeneratorListAndTune(
"Default",
"Default");
96 throw cet::exception(
"NucleonDecay") <<
"Couldn't instantiate the nucleon decay generator";
98 int fDecayMode =
p.get<
int>(
"DecayMode");
101 if (
p.get<
int>(
"DecayedNucleon") > 0 ){
102 dpdg =
p.get<
int>(
"DecayedNucleon");
108 produces< std::vector<simb::MCTruth> >();
109 produces< sumdata::RunData, art::InRun >();
122 event->AttachSummary(interaction);
133 <<
"Generated event: " << *
event;
135 std::unique_ptr< std::vector<simb::MCTruth> > truthcol(
new std::vector<simb::MCTruth>);
147 for (
size_t i = 0; i<geo->
NTPC(); ++i){
149 if (minx>tpc.
MinX()) minx = tpc.
MinX();
150 if (maxx<tpc.
MaxX()) maxx = tpc.
MaxX();
151 if (miny>tpc.
MinY()) miny = tpc.
MinY();
152 if (maxy<tpc.
MaxY()) maxy = tpc.
MaxY();
153 if (minz>tpc.
MinZ()) minz = tpc.
MinZ();
154 if (maxz<tpc.
MaxZ()) maxz = tpc.
MaxZ();
158 double X0 =
flatDist.fire( minx, maxx );
159 double Y0 =
flatDist.fire( miny, maxy );
160 double Z0 =
flatDist.fire( minz, maxz );
162 TIter partitr(
event);
170 while( (part = dynamic_cast<genie::GHepParticle *>(partitr.Next())) ){
179 TLorentzVector
pos(X0, Y0, Z0, 0);
180 TLorentzVector mom(part->
Px(), part->
Py(), part->
Pz(), part->
E());
181 tpart.AddTrajectoryPoint(pos,mom);
185 tpart.SetPolarization(polz);
193 truthcol->push_back(truth);
void RandGen(long int seed)
genie::NucleonDecayMode_t gOptDecayMode
int RescatterCode(void) const
NucleonDecay(fhicl::ParameterSet const &p)
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
double E(void) const
Get energy.
void SetOrigin(simb::Origin_t origin)
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
const genie::EventRecordVisitorI * mcgen
EDProducer(fhicl::ParameterSet const &pset)
double MinX() const
Returns the world x coordinate of the start of the box.
Geometry information for a single TPC.
static Interaction * NDecay(int tgt, int decay_mode=-1, int decayed_nucleon=0)
double MaxX() const
Returns the world x coordinate of the end of the box.
double Mass(void) const
Mass that corresponds to the PDG code.
void beginRun(art::Run &run) override
double Pz(void) const
Get Pz.
GHepStatus_t Status(void) const
art framework interface to geometry description
double Px(void) const
Get Px.
int FirstMother(void) const
Summary information for an interaction.
#define DEFINE_ART_MODULE(klass)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
const Algorithm * GetAlgorithm(const AlgId &algid)
double MinZ() const
Returns the world z coordinate of the start of the box.
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
void produce(art::Event &e) override
bool PolzIsSet(void) const
double MaxY() const
Returns the world y coordinate of the end of the box.
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
void GetPolarization(TVector3 &polz)
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
NucleonDecay & operator=(NucleonDecay const &)=delete
void Add(simb::MCParticle const &part)
static PDGLibrary * Instance(void)
static AlgFactory * Instance()
double MaxZ() const
Returns the world z coordinate of the end of the box.
enum genie::ENucleonDecayMode NucleonDecayMode_t
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
The GENIE Algorithm Factory.
Event generator information.
LArSoft geometry interface.
double MinY() const
Returns the world y coordinate of the start of the box.
Event Generation using GENIE, cosmics or single particles.
STDHEP-like event record entry that can fit a particle or a nucleus.
int DecayedNucleonPdgCode(NucleonDecayMode_t ndm)
cet::coded_exception< error, detail::translate > exception
Event finding and building.
double Py(void) const
Get Py.