234 std::vector< art::Handle<std::vector<simb::MCTruth>> > mcthandlelist;
236 mcthandlelist =
e.getMany<std::vector<simb::MCTruth> >();
240 mcthandlelist.at(i) =
e.getHandle<std::vector<simb::MCTruth> >(
fGeneratorLabels.at(i));
241 if (!mcthandlelist.at(i))
243 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
249 auto MCPHandle =
e.getHandle<std::vector<simb::MCParticle> >(
fGeantLabel);
252 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
258 auto SimHitHandle =
e.getHandle< std::vector<gar::sdp::CaloDeposit> >(
fGeantLabel);
260 throw cet::exception(
"anatest") <<
" No gar::sdp::CaloDeposit branch." 261 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
267 auto HitHandle =
e.getHandle< std::vector<rec::Hit> >(
fHitLabel);
270 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
276 auto TPCClusterHandle =
e.getHandle< std::vector<rec::TPCCluster> >(
fTPCClusterLabel);
277 if (!TPCClusterHandle) {
279 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
285 auto TrackHandle =
e.getHandle< std::vector<rec::Track> >(
fTrackLabel);
288 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
296 auto VertexHandle =
e.getHandle< std::vector<rec::Vertex> >(
fVertexLabel);
299 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
306 auto RawHitHandle =
e.getHandle< std::vector<gar::raw::CaloRawDigit> >(
fRawCaloHitLabel);
308 throw cet::exception(
"anatest") <<
" No :raw::CaloRawDigit branch." 309 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
314 auto RecoHitHandle =
e.getHandle< std::vector<rec::CaloHit> >(
fCaloHitLabel);
315 if (!RecoHitHandle) {
317 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
322 auto RecoClusterHandle =
e.getHandle< std::vector<rec::Cluster> >(
fClusterLabel);
323 if (!RecoClusterHandle) {
325 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
338 for (
size_t imchl = 0; imchl < mcthandlelist.size(); ++imchl) {
339 for (
auto const& mct : (*mcthandlelist.at(imchl)) ) {
340 if (mct.NeutrinoSet()) {
349 cheat::BackTrackerCore
const* const_bt = gar::providerFrom<cheat::BackTracker>();
350 cheat::BackTrackerCore*
bt =
const_cast<cheat::BackTrackerCore*
>(const_bt);
352 bool const dumpMCP =
false;
353 sim::ParticleList* partList = bt->GetParticleList();
355 for (
auto const& mcp : *MCPHandle ) {
356 if (mcp.Mother() > 0) {
358 if ( TPCeve->
TrackId() == mcp.TrackId() ) ++nMotherless;
361 std::cout <<
"TrackID: " << mcp.
TrackId() <<
" is PDG: " << mcp.PdgCode() <<
362 " with mother " << mcp.Mother() <<
" produced by process " << mcp.Process()
367 std::cout <<
"Number of children: " << partList->size() <<
std::endl;
368 std::cout <<
"Number of motherless children: " << nMotherless <<
std::endl;
374 std::vector<art::Ptr<rec::Hit>> allhits;
376 for (
size_t iHit=0; iHit<HitHandle->size(); ++iHit) {
378 allhits.push_back(aPtr);
381 if ( mcp.Mother() > 0 )
continue;
382 if (
abs(mcp.PdgCode()) == 13 ) bt->ParticleToHits(&mcp,allhits);
std::string fRawCaloHitLabel
Int_t fSubRun
number of the sub-run being processed
Int_t fEvent
number of the event being processed
std::string fClusterLabel
const simb::MCParticle & Nu() const
int InteractionType() const
std::string fTPCClusterLabel
std::string fCaloHitLabel
std::vector< Int_t > fInteractionType
std::vector< std::string > fGeneratorLabels
Int_t fRun
number of the run being processed
Event generator information.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
std::vector< Int_t > fNeutrinoType