33 using namespace fhicl;
42 Comment(
"data product with the MC showers to be dumped")
46 Name(
"OutputCategory"),
47 Comment(
"name of the output stream (managed by the message facility)"),
52 Name(
"DaughtersPerLine"),
53 Comment(
"daughter IDs to print on each output line"),
72 <<
"Unexpected origin type #" << ((
int) origin) <<
"\n";
77 template <
typename Stream>
80 << step.
X() <<
", " << step.
Y() <<
", " << step.
Z() <<
") cm, t=" 81 << step.
T() <<
" ns; momentum (" 82 << step.
Px() <<
", " << step.
Py() <<
", " << step.
Pz() <<
"; " 83 << step.
E() <<
") MeV/c";
122 template <
typename Stream>
150 template <
typename Stream>
155 if (bIndentFirst) out <<
indent;
157 <<
"from GEANT track ID=" << shower.
TrackID()
158 <<
" PDG ID=" << shower.
PdgCode()
159 <<
" from " << OriginDescription(shower.
Origin())
160 <<
" via '" << shower.
Process() <<
"'";
161 out <<
"\n" << indent
163 ::PrintMCStep(out, shower.
Start());
164 out <<
"\n" << indent
166 ::PrintMCStep(out, shower.
End());
168 TVector3
const& startDir = shower.
StartDir();
169 out <<
"\n" << indent
170 <<
"pointing toward (" 171 << startDir.X() <<
", " << startDir.Y() <<
", " << startDir.Z() <<
") cm";
172 std::vector<double>
const& charges = shower.
Charge();
173 std::vector<double>
const& dQdx = shower.
dQdx();
174 size_t const nQPlanes = dQdx.size(), nChPlanes = charges.size();
175 size_t const nPlanes =
std::max(nQPlanes, nChPlanes);
179 <<
"dE/dx=" << shower.
dEdx() <<
" MeV/cm and dQ/dx (charge) on " 180 << nPlanes <<
" planes:";
181 for (
size_t iPlane = 0; iPlane < nPlanes; ++iPlane) {
182 out <<
" [#" << iPlane <<
"] ";
183 if (iPlane < dQdx.size()) out << dQdx[iPlane];
185 if (iPlane < charges.size()) out <<
" (" << charges[iPlane] <<
")";
189 else out <<
"no energy or charge information available";
192 out <<
"\n" << indent
193 <<
"combined energy deposition information: ";
195 out <<
"\n" << indent
196 << daughters.size() <<
" daughters, ID:";
197 for (
size_t i = 0; i < daughters.size(); ++i) {
199 out <<
" " <<
std::setw(8) << daughters[i];
202 out <<
"\n" << indent
206 out <<
"\n" << indent
209 out <<
"\n" << indent
213 out <<
"\n" << indent
217 out <<
"\n" << indent
220 out <<
"\n" << indent
232 = *(
event.getValidHandle<std::vector<sim::MCShower>>(
fInputShowers));
235 <<
"Event " <<
event.id() <<
": data product '" 237 << Showers.size() <<
" MCShower objects";
239 unsigned int iShower = 0;
244 log <<
"\n[#" << (iShower++) <<
"] ";
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
const MCStep & End() const
art::InputTag fInputShowers
name of MCShower's data product
unsigned int TrackID() const
std::string fOutputCategory
name of the stream for output
DumpMCShowers(Parameters const &config)
Configuration-checking constructor.
enum simb::_ev_origin Origin_t
event origin types
ChannelGroupService::Name Name
DumpMCShowers & operator=(DumpMCShowers const &)=delete
EDAnalyzer(fhicl::ParameterSet const &pset)
Class def header for mcstep data container.
const std::vector< unsigned int > & DaughterTrackID() const
const TVector3 & StartDir() const
typename config_impl< T >::type Config
simb::Origin_t Origin() const
#define DEFINE_ART_MODULE(klass)
int MotherPdgCode() const
const std::string & AncestorProcess() const
single particles thrown at the detector
unsigned int fDaughtersPerLine
number of daughter IDs printed per line
const MCStep & AncestorStart() const
static int max(int a, int b)
const std::string & MotherProcess() const
Code to link reconstructed objects back to the MC truth information.
unsigned int AncestorTrackID() const
const MCStep & AncestorEnd() const
const MCStep & DetProfile() const
Q_EXPORT QTSManip setw(int w)
const MCStep & Start() const
double Charge(size_t plane) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
virtual void analyze(art::Event const &event) override
const MCStep & MotherEnd() const
void DumpMCShower(Stream &&out, sim::MCShower const &shower, std::string indent="", bool bIndentFirst=true) const
Dumps the content of the specified particle in the output stream.
Class def header for MCShower data container.
unsigned int MotherTrackID() const
const std::string & Process() const
const MCStep & MotherStart() const
int AncestorPdgCode() const
double dQdx(size_t plane) const
constexpr Point origin()
Returns a origin position with a point of the specified type.
Event finding and building.