201 mf::LogDebug(
"LArPandora") <<
" *** PFParticleCosmicAna::beginJob() *** " << std::endl;
266 std::cout <<
" *** PFParticleCosmicAna::analyze(...) *** " << std::endl;
275 std::cout <<
" Run: " <<
m_run << std::endl;
276 std::cout <<
" Event: " <<
m_event << std::endl;
303 std::cout <<
" PFParticles: " << recoParticleVector.size() << std::endl;
322 this->
FillRecoTree(recoParticlesToHits, recoParticlesToTracks, recoTracksToCosmicTags);
327 this->
FillTrueTree(hitVector, trueHitsToParticles, recoHitsToParticles, particlesToTruth, recoParticlesToTracks, recoTracksToCosmicTags);
339 const double xmin(0.0);
343 const double zmin(0.0);
344 const double zmax(theGeometry->
DetLength());
383 iter1 != iterEnd1; ++iter1)
387 const HitVector &hitVector = iter1->second;
388 if (hitVector.empty())
392 if (recoParticlesToTracks.end() == iter2)
396 if (trackVector.empty())
433 const float trackLength(track->
Length());
440 const TVector3 &trackVtxPosition = track->
Vertex();
442 const TVector3 &trackEndPosition = track->
End();
443 const TVector3 &trackEndDirection = track->
EndDirection();
508 if (trueHitsToParticles.end() == iter3)
514 if (particlesToTruth.end() == iter4)
515 throw cet::exception(
"LArPandora") <<
" PFParticleCosmicAna::analyze --- Found a true particle without any ancestry information ";
519 float cosmicScore(-0.2);
522 if (recoHitsToParticles.end() != iter5)
525 cosmicScore = this->
GetCosmicScore(particle, particlesToTracks, tracksToCosmicTags);
562 float cosmicScore(0.
f);
566 if (recoParticlesToTracks.end() != iter2)
573 if (recoTracksToCosmicTags.end() != iter4)
576 iter5 != iterEnd5; ++iter5)
static void BuildPFParticleHitMaps(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits, PFParticlesToHits &particlesToHits, HitsToPFParticles &hitsToParticles, const DaughterMode daughterMode=kUseDaughters)
Build mapping between PFParticles and Hits using PFParticle/SpacePoint/Hit maps.
PFParticleCosmicAna class.
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
size_t Self() const
Returns the index of this particle.
int m_nNeutrinoHitsSemiTagged
TVector3 VertexDirection() const
Covariance matrices are either set or not.
int m_nNeutrinoHitsReconstructed
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< simb::MCTruth >, MCParticleVector > MCTruthToMCParticles
void FillTrueTree(const HitVector &hitVector, const HitsToMCParticles &trueHitsToParticles, const HitsToPFParticles &recoHitsToParticles, const MCParticlesToMCTruth &particlesToTruth, const PFParticlesToTracks &particlesToTracks, const TracksToCosmicTags &tracksToCosmicTags)
Fill track-level variables using input maps between reconstructed objects.
int PdgCode() const
Return the type of particle as a PDG ID.
int m_nNeutrinoHitsNotTagged
int m_nCosmicHitsNotTagged
int m_nCosmicHitsSemiTagged
std::map< art::Ptr< simb::MCParticle >, art::Ptr< simb::MCTruth > > MCParticlesToMCTruth
std::string m_hitfinderLabel
std::vector< art::Ptr< recob::Track > > TrackVector
void reconfigure(fhicl::ParameterSet const &pset)
static void BuildMCParticleHitMaps(const HitVector &hitVector, const SimChannelVector &simChannelVector, HitsToTrackIDEs &hitsToTrackIDEs)
Collect the links from reconstructed hits to their true energy deposits.
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
double Length(size_t p=0) const
Access to various track properties.
#define DEFINE_ART_MODULE(klass)
int m_nCosmicHitsReconstructed
double m_cosmicContainmentCut
T get(std::string const &key) const
std::string m_cosmicLabel
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
bool IsPrimary() const
Returns whether the particle is the root of the flow.
std::string m_particleLabel
int m_nNeutrinoHitsNotReconstructed
EDAnalyzer(Table< Config > const &config)
Provides recob::Track data product.
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
std::vector< art::Ptr< recob::Hit > > HitVector
void FillRecoTree(const PFParticlesToHits &recoParticlesToHits, const PFParticlesToTracks &recoParticlesToTracks, const TracksToCosmicTags &recoTracksToCosmicTags)
Fill event-level variables using input maps between reconstructed objects.
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
static void CollectHits(const art::Event &evt, const std::string &label, HitVector &hitVector)
Collect the reconstructed Hits from the ART event record.
Detector simulation of raw signals on wires.
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
bool m_useDaughterMCParticles
std::string m_geantModuleLabel
virtual ~PFParticleCosmicAna()
Destructor.
T * make(ARGS...args) const
std::map< art::Ptr< recob::Track >, CosmicTagVector > TracksToCosmicTags
std::map< art::Ptr< simb::MCParticle >, HitVector > MCParticlesToHits
float GetCosmicScore(const art::Ptr< recob::PFParticle > particle, const PFParticlesToTracks &recoParticlesToTracks, const TracksToCosmicTags &recoTracksToCosmicTags) const
Get cosmic score for a PFParticle using track-level information.
std::vector< art::Ptr< anab::CosmicTag > > CosmicTagVector
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
TVector3 Vertex() const
Covariance matrices are either set or not.
static bool IsTrack(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as track-like.
TVector3 EndDirection() const
Covariance matrices are either set or not.
std::string m_trackfitLabel
EventNumber_t event() const
int m_nNeutrinoHitsFullyTagged
int m_nCosmicHitsNotReconstructed
static void CollectMCParticles(const art::Event &evt, const std::string &label, MCParticleVector &particleVector)
Collect a vector of MCParticle objects from the ART event record.
bool m_useDaughterPFParticles
TVector3 End() const
Covariance matrices are either set or not.
helper function for LArPandoraInterface producer module
PFParticleCosmicAna(fhicl::ParameterSet const &pset)
Constructor.
std::map< art::Ptr< recob::Hit >, art::Ptr< simb::MCParticle > > HitsToMCParticles
int m_nCosmicHitsFullyTagged
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
void analyze(const art::Event &evt)
static void CollectCosmicTags(const art::Event &evt, const std::string &label, CosmicTagVector &cosmicTagVector, TracksToCosmicTags &tracksToCosmicTags)
Collect a vector of cosmic tags from the ART event record.