All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Functions
MuPVertexStudy_module.cc File Reference
#include "art/Framework/Core/EDAnalyzer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/SubRun.h"
#include "canvas/Utilities/InputTag.h"
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "lardataalg/DetectorInfo/DetectorPropertiesStandard.h"
#include "lardata/DetectorInfoServices/DetectorPropertiesService.h"
#include "lardata/DetectorInfoServices/DetectorClocksService.h"
#include "larcore/Geometry/Geometry.h"
#include "larcore/CoreUtils/ServiceUtil.h"
#include "larcorealg/Geometry/GeometryCore.h"
#include "larcorealg/Geometry/BoxBoundedGeo.h"
#include "larsim/MCCheater/BackTrackerService.h"
#include "larsim/MCCheater/ParticleInventoryService.h"
#include "art_root_io/TFileService.h"
#include "lardataobj/AnalysisBase/T0.h"
#include "larreco/RecoAlg/TrackMomentumCalculator.h"
#include "lardataobj/RecoBase/PFParticle.h"
#include "lardataobj/RecoBase/Shower.h"
#include "lardataobj/RecoBase/Slice.h"
#include "lardataobj/RecoBase/Track.h"
#include "lardataobj/RecoBase/Hit.h"
#include "lardataobj/RecoBase/Cluster.h"
#include "lardataobj/AnalysisBase/Calorimetry.h"
#include "lardataobj/AnalysisBase/ParticleID.h"
#include "lardataobj/RecoBase/PFParticleMetadata.h"
#include "lardataobj/RecoBase/MCSFitResult.h"
#include "nusimdata/SimulationBase/MCParticle.h"
#include "nusimdata/SimulationBase/MCTruth.h"
#include "larcorealg/GeoAlgo/GeoAlgo.h"
#include "TH1D.h"
#include "sbncode/CAFMaker/RecoUtils/RecoUtils.h"

Go to the source code of this file.

Classes

struct  TrackHistos
 
struct  VertexHistos
 
struct  TrueHistos
 
class  numu::MuPVertexStudy
 

Namespaces

 numu
 

Functions

float Completion (const simb::MCParticle &particle, float particleE, const std::vector< std::pair< int, float >> &matches, const std::vector< simb::MCParticle > &particles)
 
float Purity (const simb::MCParticle &particle, float totalE, const std::vector< std::pair< int, float >> &matches, const std::vector< simb::MCParticle > &particles)
 
float ContainedLength (const TVector3 &v0, const TVector3 &v1, const std::vector< geoalgo::AABox > &boxes)
 

Function Documentation

float Completion ( const simb::MCParticle &  particle,
float  particleE,
const std::vector< std::pair< int, float >> &  matches,
const std::vector< simb::MCParticle > &  particles 
)

Definition at line 318 of file MuPVertexStudy_module.cc.

318  {
319  for (auto const &pair: matches) {
320  if (pair.first == particle.TrackId()) {
321  return pair.second / particleE;
322  }
323  }
324  return 0.;
325 }
float ContainedLength ( const TVector3 &  v0,
const TVector3 &  v1,
const std::vector< geoalgo::AABox > &  boxes 
)
float Purity ( const simb::MCParticle &  particle,
float  totalE,
const std::vector< std::pair< int, float >> &  matches,
const std::vector< simb::MCParticle > &  particles 
)

Definition at line 327 of file MuPVertexStudy_module.cc.

327  {
328  float matchE = 0.;
329  for (auto const &pair: matches) {
330  bool matches = false;
331  if (pair.first == particle.TrackId()) matches = true;
332  else {
333  for (int i_d = 0; i_d < particle.NumberDaughters(); i_d++) {
334  if (pair.first == particle.Daughter(i_d)) {
335  bool showerDaughter = true;
336  for (unsigned i_p = 0; i_p < particles.size(); i_p++) {
337  if (pair.first == particles[i_p].TrackId()) {
338  showerDaughter = particles[i_p].Process() == "muIoni";
339  break;
340  }
341  }
342  matches = showerDaughter;
343  break;
344  }
345  }
346  }
347  if (matches) matchE += pair.second;
348  }
349  return matchE / totalE;
350 }