66 #include "cetlib_except/exception.h" 69 #include "TLorentzVector.h" 76 #include "CoreUtils/ServiceUtil.h" 106 produces< std::vector<simb::MCTruth> >();
107 produces< sumdata::RunData, ::art::InRun >();
123 <<
"input text file " 125 <<
" cannot be read.";
135 auto geo = gar::providerFrom<geo::GeometryGAr>();
149 <<
"input text file " 151 <<
" cannot be read in produce().";
154 std::unique_ptr< std::vector<simb::MCTruth> > truthcol(
new std::vector<simb::MCTruth>);
159 unsigned short nParticles = 0;
163 int secondMother = 0;
164 int firstDaughter = 0;
165 int secondDaughter = 0;
166 double xMomentum = 0.;
167 double yMomentum = 0.;
168 double zMomentum = 0.;
171 double xPosition = 0.;
172 double yPosition = 0.;
173 double zPosition = 0.;
179 std::istringstream inputLine;
180 inputLine.str(oneLine);
182 inputLine >>
event >> nParticles;
187 for(
unsigned short i = 0; i < nParticles; ++i){
190 inputLine.str(oneLine);
192 inputLine >> status >> pdg
193 >> firstMother >> secondMother >> firstDaughter >> secondDaughter
194 >> xMomentum >> yMomentum >> zMomentum >> energy >> mass
195 >> xPosition >> yPosition >> zPosition >> time;
199 double totmom = sqrt(
pow(xMomentum,2)+
pow(yMomentum,2)+
pow(zMomentum,2));
200 double kx = xMomentum/totmom;
201 double ky = yMomentum/totmom;
202 double kz = zMomentum/totmom;
204 double l = (
fMoveY-yPosition)/ky;
211 TLorentzVector
pos(xPosition, yPosition, zPosition, time);
212 TLorentzVector mom(xMomentum, yMomentum, zMomentum, energy);
220 truthcol->push_back(truth);
234 <<
"Particles will be moved to a new plane y = "
void produce(::art::Event &e) override
void AddTrajectoryPoint(TLorentzVector const &position, TLorentzVector const &momentum)
double fMoveY
Project particles to a new y plane.
void reconfigure(fhicl::ParameterSet const &p)
std::string fInputFileName
Name of text file containing events to simulate.
#define DEFINE_ART_MODULE(klass)
virtual void reconfigure(fhicl::ParameterSet const &pset)
std::ifstream * fInputFile
pointer to input text file
T get(std::string const &key) const
void beginRun(::art::Run &run) override
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
General GArSoft Utilities.
void Add(simb::MCParticle const &part)
Event generator information.
#define MF_LOG_WARNING(category)
LArSoft geometry interface.
art framework interface to geometry description
Event Generation using GENIE, cosmics or single particles.
TextFileGen(fhicl::ParameterSet const &p)
cet::coded_exception< error, detail::translate > exception