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);
genie::NucleonDecayMode_t gOptDecayMode
int RescatterCode(void) const
virtual void ProcessEventRecord(GHepRecord *event_rec) const =0
double E(void) const
Get energy.
void SetOrigin(simb::Origin_t origin)
const genie::EventRecordVisitorI * mcgen
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.
double Pz(void) const
Get Pz.
GHepStatus_t Status(void) const
double Px(void) const
Get Px.
int FirstMother(void) const
Summary information for an interaction.
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={})
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...
void Add(simb::MCParticle const &part)
double MaxZ() const
Returns the world z coordinate of the end of the box.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
Event generator information.
LArSoft geometry interface.
double MinY() const
Returns the world y coordinate of the start of the box.
STDHEP-like event record entry that can fit a particle or a nucleus.
Event finding and building.
double Py(void) const
Get Py.