65 #include "cetlib_except/exception.h" 68 #include "TLorentzVector.h" 99 ,
fMoveY{
p.get<
double>(
"MoveY", -1e9)}
106 produces< std::vector<simb::MCTruth> >();
107 produces< sumdata::RunData, art::InRun >();
119 <<
" cannot be read.\n";
136 <<
" cannot be read in produce().\n";
139 std::unique_ptr< std::vector<simb::MCTruth> > truthcol(
new std::vector<simb::MCTruth>);
144 unsigned short nParticles = 0;
148 int secondMother = 0;
149 int firstDaughter = 0;
150 int secondDaughter = 0;
151 double xMomentum = 0.;
152 double yMomentum = 0.;
153 double zMomentum = 0.;
156 double xPosition = 0.;
157 double yPosition = 0.;
158 double zPosition = 0.;
164 std::istringstream inputLine;
165 inputLine.str(oneLine);
167 inputLine >>
event >> nParticles;
172 for(
unsigned short i = 0; i < nParticles; ++i){
175 inputLine.str(oneLine);
177 inputLine >> status >> pdg
178 >> firstMother >> secondMother >> firstDaughter >> secondDaughter
179 >> xMomentum >> yMomentum >> zMomentum >> energy >> mass
180 >> xPosition >> yPosition >> zPosition >> time;
184 double totmom = sqrt(
pow(xMomentum,2)+
pow(yMomentum,2)+
pow(zMomentum,2));
185 double kx = xMomentum/totmom;
186 double ky = yMomentum/totmom;
187 double kz = zMomentum/totmom;
189 double l = (
fMoveY-yPosition)/ky;
196 TLorentzVector
pos(xPosition, yPosition, zPosition, time);
197 TLorentzVector mom(xMomentum, yMomentum, zMomentum, energy);
205 truthcol->push_back(truth);
void AddTrajectoryPoint(TLorentzVector const &position, TLorentzVector const &momentum)
EDProducer(fhicl::ParameterSet const &pset)
void produce(art::Event &e) override
art framework interface to geometry description
std::string fInputFileName
Name of text file containing events to simulate.
std::ifstream * fInputFile
#define DEFINE_ART_MODULE(klass)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
void beginRun(art::Run &run) override
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
TextFileGen(fhicl::ParameterSet const &p)
void Add(simb::MCParticle const &part)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Event generator information.
LArSoft geometry interface.
Event Generation using GENIE, cosmics or single particles.
double fMoveY
Project particles to a new y plane.
cet::coded_exception< error, detail::translate > exception