All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Enumerations | Functions | Variables
caf Namespace Reference

Common Analysis Files. More...

Classes

class  ParticleMatch
 
class  SRBNBInfo
 
class  SRCRTHit
 A hit from the CRT. More...
 
class  SRCRTHitMatch
 Matching information between a TPC Track and a CRT Hit. More...
 
class  SRCRTTrack
 
class  SRCRTTrackMatch
 Matching information between a TPC Track and a CRT Track. More...
 
class  SRCRUMBSTPCVars
 < TPC input variables for CRUMBS PDS input variables for CRUMBS More...
 
class  SRCRUMBSPDSVars
 CRT input variables for CRUMBS. More...
 
class  SRCRUMBSCRTVars
 Result of the CRUMBS slice ID MVA. More...
 
class  SRCRUMBSResult
 
class  SRFakeReco
 The SRFakeReco is a faked reconstruction using estimates from the SBN proposal. More...
 
class  SRFakeRecoParticle
 The SRFakeRecoParticle is a faked reconstruction using estimates from the SBN proposal. More...
 
class  SRFlashMatch
 A matching of TPC flashmatch charge to Optical flash light. More...
 
class  SRGlobal
 
class  SRHeader
 Header representing overview information for the current event/slice. More...
 
class  SRSpacePoint
 Representation of a rb::Spacepoint, knows pfp ID and position. More...
 
class  SRHit
 Representation of a rb::Hit, knows hit amplitude and integral, geometric IDs, and time. More...
 
class  SRLorentzVector
 4-vector with more efficient storage than TLorentzVector More...
 
class  SRMeVPrtl
 
class  SRNuID
 Slice Neutrino ID Score features (MVA inputs) More...
 
class  SRNuMIInfo
 
class  SROpFlash
 Optical Flash – a summary of multiple optical hits that have been determined to be associated. More...
 
class  SRParticleMatch
 Match from a reconstructed track to a true particle */. More...
 
class  SRPFOChar
 Pfo Characterisation (track vs shower) features (MVA inputs) More...
 
class  SRPFP
 Representation of a rb::PFParticle, with hierarchy and Pandora metadata. More...
 
class  SRShowerPlaneInfo
 
class  SRShower
 
class  SRShowerRazzle
 Representation of Shower MVA PID outputs. More...
 
class  SRShowerSelection
 Shower Selection metrics calculated by ShowerSelectionVals. More...
 
class  SRSlice
 An SRSlice contains overarching information for a slice. More...
 
class  SRSliceRecoBranch
 Vectors of reconstructed objects found by various algorithms. More...
 
class  SRStubHit
 
class  SRStubPlane
 
class  SRStub
 
class  SRTrack
 
class  SRCaloPoint
 
class  SRTrackCalo
 Calorimetry information. More...
 
class  SRTrackDazzle
 Representation of Track MVA PID outputs. More...
 
class  SRTrackScatterClosestApproach
 Representation of track scattering variables compare to interpolated start and end points. More...
 
class  SRTrackStoppingChi2Fit
 Representation of a Pol0 and Exp fit to dEdx vs res. range. More...
 
class  SRTrackTruth
 
class  SRTrigger
 
class  SRTrkChi2PID
 Track PID from dE/dx v. residual range Chi2. More...
 
class  SRTrkMCS
 
class  SRTrkRange
 Representation of the reco momentum and PID a rb::Track from range. More...
 
class  SRMultiverse
 
class  SRTrueInteractionPlaneInfo
 
class  SRTrueInteraction
 The SRTrueInteraction is a representation of neutrino interaction information. More...
 
class  SRTrueParticlePlaneInfo
 
class  SRTrueParticle
 Representation of a simb::MCParticle, knows energy, direction,. More...
 
class  SRTruthBranch
 Vectors of reconstructed vertices found by various algorithms. More...
 
class  SRTruthMatch
 An SRTruthMatch contains overarching information for a slice. More...
 
class  SRVector3D
 A 3-vector with more efficient storage than TVector3. More...
 
class  SRWeightMapEntry
 
class  SRWeightParam
 
class  SRWeightPSet
 
class  StandardRecord
 The StandardRecord is the primary top-level object in the Common Analysis File trees. More...
 
class  CAFMaker
 Module to create Common Analysis Files from ART files. More...
 
struct  CAFMakerParams
 
struct  HitsEnergy
 

Typedefs

using SRSliceProxy = caf::Proxy< caf::SRSlice >
 
using SRSpillProxy = caf::Proxy< caf::StandardRecord >
 

Enumerations

enum  Det_t { kUNKNOWN, kSBND, kICARUS }
 Which SBN detector? More...
 
enum  Plane_t { kUnknown =-1, k1stInduction =0, k2ndInduction =1, kCollection =2 }
 
enum  Wall_t {
  kWallNone =0, kWallTop =1, kWallBottom =2, kWallLeft =3,
  kWallRight =4, kWallFront =5, kWallBack =6
}
 
enum  MCType_t {
  kMCUnknown =0, kMCParticleGun =1, kMCNeutrino =2, kMCCosmic =3,
  kMCOverlay =4
}
 Which type of MC? More...
 
enum  generator_ { kUnknownGenerator = 0, kGENIE = 1, kMeVPrtl = 2 }
 Which generator? More...
 
enum  mevprtlchannel_ { kUnknownMeVPrtlChannel = 0, kMeVPrtlHiggs = 1, kMeVPrtlHNL = 2 }
 
enum  genie_interaction_mode_ {
  kUnknownInteractionMode = -1, kQE = 0, kRes = 1, kDIS = 2,
  kCoh = 3, kCohElastic = 4, kElectronScattering = 5, kIMDAnnihilation = 6,
  kInverseBetaDecay = 7, kGlashowResonance = 8, kAMNuGamma = 9, kMEC = 10,
  kDiffractive = 11, kEM = 12, kWeakMix = 13
}
 
enum  genie_interaction_type_ {
  kUnknownInteractionType = -1, kNuanceOffset = 1000, kCCQE = kNuanceOffset + 1, kNCQE = kNuanceOffset + 2,
  kResCCNuProtonPiPlus = kNuanceOffset + 3, kResCCNuNeutronPi0 = kNuanceOffset + 4, kResCCNuNeutronPiPlus = kNuanceOffset + 5, kResNCNuProtonPi0 = kNuanceOffset + 6,
  kResNCNuProtonPiPlus = kNuanceOffset + 7, kResNCNuNeutronPi0 = kNuanceOffset + 8, kResNCNuNeutronPiMinus = kNuanceOffset + 9, kResCCNuBarNeutronPiMinus = kNuanceOffset + 10,
  kResCCNuBarProtonPi0 = kNuanceOffset + 11, kResCCNuBarProtonPiMinus = kNuanceOffset + 12, kResNCNuBarProtonPi0 = kNuanceOffset + 13, kResNCNuBarProtonPiPlus = kNuanceOffset + 14,
  kResNCNuBarNeutronPi0 = kNuanceOffset + 15, kResNCNuBarNeutronPiMinus = kNuanceOffset + 16, kResCCNuDeltaPlusPiPlus = kNuanceOffset + 17, kResCCNuDelta2PlusPiMinus = kNuanceOffset + 21,
  kResCCNuBarDelta0PiMinus = kNuanceOffset + 28, kResCCNuBarDeltaMinusPiPlus = kNuanceOffset + 32, kResCCNuProtonRhoPlus = kNuanceOffset + 39, kResCCNuNeutronRhoPlus = kNuanceOffset + 41,
  kResCCNuBarNeutronRhoMinus = kNuanceOffset + 46, kResCCNuBarNeutronRho0 = kNuanceOffset + 48, kResCCNuSigmaPlusKaonPlus = kNuanceOffset + 53, kResCCNuSigmaPlusKaon0 = kNuanceOffset + 55,
  kResCCNuBarSigmaMinusKaon0 = kNuanceOffset + 60, kResCCNuBarSigma0Kaon0 = kNuanceOffset + 62, kResCCNuProtonEta = kNuanceOffset + 67, kResCCNuBarNeutronEta = kNuanceOffset + 70,
  kResCCNuKaonPlusLambda0 = kNuanceOffset + 73, kResCCNuBarKaon0Lambda0 = kNuanceOffset + 76, kResCCNuProtonPiPlusPiMinus = kNuanceOffset + 79, kResCCNuProtonPi0Pi0 = kNuanceOffset + 80,
  kResCCNuBarNeutronPiPlusPiMinus = kNuanceOffset + 85, kResCCNuBarNeutronPi0Pi0 = kNuanceOffset + 86, kResCCNuBarProtonPi0Pi0 = kNuanceOffset + 90, kCCDIS = kNuanceOffset + 91,
  kNCDIS = kNuanceOffset + 92, kUnUsed1 = kNuanceOffset + 93, kUnUsed2 = kNuanceOffset + 94, kCCQEHyperon = kNuanceOffset + 95,
  kNCCOH = kNuanceOffset + 96, kCCCOH = kNuanceOffset + 97, kNuElectronElastic = kNuanceOffset + 98, kInverseMuDecay = kNuanceOffset + 99,
  kMEC2p2h = kNuanceOffset + 100
}
 
enum  genie_status_ {
  kIStUndefined = -1, kIStInitialState = 0, kIStStableFinalState = 1, kIStIntermediateState = 2,
  kIStDecayedState = 3, kIStCorrelatedNucleon = 10, kIStNucleonTarget = 11, kIStDISPreFragmHadronicState = 12,
  kIStPreDecayResonantState = 13, kIStHadronInTheNucleus = 14, kIStFinalStateNuclearRemnant = 15, kIStNucleonClusterTarget = 16,
  kNotGenie = 17
}
 Which genie status? More...
 
enum  g4_process_ {
  kG4primary =0, kG4CoupledTransportation =1, kG4FastScintillation =2, kG4Decay =3,
  kG4anti_neutronInelastic =4, kG4neutronInelastic =5, kG4anti_protonInelastic =6, kG4protonInelastic =7,
  kG4hadInelastic =8, kG4pipInelastic =9, kG4pimInelastic =10, kG4xipInelastic =11,
  kG4ximInelastic =12, kG4kaonpInelastic =13, kG4kaonmInelastic =14, kG4sigmapInelastic =15,
  kG4sigmamInelastic =16, kG4kaon0LInelastic =17, kG4kaon0SInelastic =18, kG4lambdaInelastic =19,
  kG4anti_lambdaInelastic =20, kG4He3Inelastic =21, kG4ionInelastic =22, kG4xi0Inelastic =23,
  kG4alphaInelastic =24, kG4tInelastic =25, kG4dInelastic =26, kG4anti_neutronElastic =27,
  kG4neutronElastic =28, kG4anti_protonElastic =29, kG4protonElastic =30, kG4hadElastic =31,
  kG4pipElastic =32, kG4pimElastic =33, kG4kaonpElastic =34, kG4kaonmElastic =35,
  kG4conv =36, kG4phot =37, kG4annihil =38, kG4nCapture =39,
  kG4nKiller =40, kG4muMinusCaptureAtRest =41, kG4muIoni =42, kG4eBrem =43,
  kG4CoulombScat =44, kG4hBertiniCaptureAtRest =45, kG4hFritiofCaptureAtRest =46, kG4photonNuclear =47,
  kG4muonNuclear =48, kG4electronNuclear =49, kG4positronNuclear =50, kG4compt =51,
  kG4eIoni =52, kG4muBrems =53, kG4hIoni =54, kG4muPairProd =55,
  kG4hPairProd =56, kG4LArVoxelReadoutScoringProcess =57, kG4ionIoni =58, kG4hBrems =59,
  kG4Transportation =60, kG4msc =61, kG4StepLimiter =62, kG4UNKNOWN =63
}
 Which G4 process ? More...
 
enum  ReweightType_t {
  kDefault = -1, kMultiSim = 0, kPMNSigma = 1, kFixed = 2,
  kMultiSigma = 3
}
 

Functions

caf::SRBNBInfo makeSRBNBInfo (sbn::BNBSpillInfo const &info)
 
void FillExposure (const std::vector< sbn::BNBSpillInfo > &bnb_spill_info, std::vector< caf::SRBNBInfo > &BNBInfo, double &subRunPOT)
 
void FillExposureNuMI (const std::vector< sbn::NuMISpillInfo > &numi_spill_info, std::vector< caf::SRNuMIInfo > &NuMIInfo, double &subRunPOT)
 
void FillSliceFlashMatch (const sbn::SimpleFlashMatch *fmatch, caf::SRSlice &srslice, bool allowEmpty)
 
void FillSliceFlashMatchA (const sbn::SimpleFlashMatch *fmatch, caf::SRSlice &srslice, bool allowEmpty)
 
void FillSliceFlashMatchB (const sbn::SimpleFlashMatch *fmatch, caf::SRSlice &srslice, bool allowEmpty)
 
bool SelectSlice (const caf::SRSlice &slice, bool cut_clear_cosmic)
 
void FillStubVars (const sbn::Stub &stub, const art::Ptr< recob::PFParticle > stubpfp, caf::SRStub &srstub, bool allowEmpty)
 
void FillCRTHit (const sbn::crt::CRTHit &hit, uint64_t gate_start_timestamp, bool use_ts0, caf::SRCRTHit &srhit, bool allowEmpty)
 
void FillCRTTrack (const sbn::crt::CRTTrack &track, bool use_ts0, caf::SRCRTTrack &srtrack, bool allowEmpty)
 
void FillOpFlash (const recob::OpFlash &flash, int cryo, caf::SROpFlash &srflash, bool allowEmpty)
 
std::vector< float > double_to_float_vector (const std::vector< double > &v)
 
void FillShowerVars (const recob::Shower &shower, const recob::Vertex *vertex, const std::vector< art::Ptr< recob::Hit >> &hits, const geo::GeometryCore *geom, unsigned producer, caf::SRShower &srshower, bool allowEmpty)
 
void FillShowerRazzle (const art::Ptr< sbn::MVAPID > razzle, caf::SRShower &srshower, bool allowEmpty)
 
void FillShowerCosmicDist (const std::vector< art::Ptr< float > > &cosmicDistVec, caf::SRShower &srshower)
 
void FillShowerResiduals (const std::vector< art::Ptr< float > > &residuals, caf::SRShower &srshower)
 
void FillShowerTrackFit (const sbn::ShowerTrackFit &trackFit, caf::SRShower &srshower)
 
void FillShowerDensityFit (const sbn::ShowerDensityFit &densityFit, caf::SRShower &srshower)
 
void FillSliceVars (const recob::Slice &slice, const recob::PFParticle *primary, unsigned producer, caf::SRSlice &srslice, bool allowEmpty)
 
void FillSliceMetadata (const larpandoraobj::PFParticleMetadata *primary_meta, caf::SRSlice &srslice, bool allowEmpty)
 
void FillSliceVertex (const recob::Vertex *vertex, caf::SRSlice &slice, bool allowEmpty)
 
void FillSliceCRUMBS (const sbn::CRUMBSResult *crumbs, caf::SRSlice &slice, bool allowEmpty)
 
void FillTrackCRTHit (const std::vector< art::Ptr< anab::T0 >> &t0match, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackCRTTrack (const std::vector< art::Ptr< anab::T0 >> &t0match, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackMCS (const recob::Track &track, const std::array< std::vector< art::Ptr< recob::MCSFitResult >>, 4 > &mcs_results, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackRangeP (const recob::Track &track, const std::array< std::vector< art::Ptr< sbn::RangeP >>, 3 > &range_results, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillPlaneChi2PID (const anab::ParticleID &particle_id, caf::SRTrkChi2PID &srpid)
 
void FillTrackChi2PID (const std::vector< art::Ptr< anab::ParticleID >> particleIDs, const geo::GeometryCore *geom, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackPlaneCalo (const anab::Calorimetry &calo, const std::vector< art::Ptr< recob::Hit >> &hits, bool fill_calo_points, float fillhit_rrstart, float fillhit_rrend, const detinfo::DetectorPropertiesData &dprop, caf::SRTrackCalo &srcalo)
 
void FillTrackScatterClosestApproach (const art::Ptr< sbn::ScatterClosestApproach > closestapproach, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackStoppingChi2Fit (const art::Ptr< sbn::StoppingChi2Fit > stoppingChi2, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackDazzle (const art::Ptr< sbn::MVAPID > dazzle, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackCalo (const std::vector< art::Ptr< anab::Calorimetry >> &calos, const std::vector< art::Ptr< recob::Hit >> &hits, bool fill_calo_points, float fillhit_rrstart, float fillhit_rrend, const geo::GeometryCore *geom, const detinfo::DetectorPropertiesData &dprop, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillTrackVars (const recob::Track &track, unsigned producer, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillPFPVars (const recob::PFParticle &particle, const recob::PFParticle *primary, const larpandoraobj::PFParticleMetadata *pfpMeta, caf::SRPFP &srpfp, bool allowEmpty)
 
void FillHitVars (const recob::Hit &hit, unsigned producer, const recob::SpacePoint &spacepoint, const recob::PFParticle &particle, caf::SRHit &srhit, bool allowEmpty)
 
void SetNuMuCCPrimary (std::vector< caf::StandardRecord > &recs, std::vector< caf::SRTrueInteraction > &srneutrinos)
 
void ApplyNumuCCMatching (std::vector< caf::StandardRecord > &recs, const std::vector< caf::SRTrueInteraction > &srneutrinos, unsigned truth_ind)
 
template<class T , class U >
void CopyPropertyIfSet (const std::map< std::string, T > &props, const std::string &search, U &value)
 
void FillTrigger (const sbn::ExtraTriggerInfo &addltrig_info, const std::vector< raw::Trigger > &trig_info, std::vector< caf::SRTrigger > &triggerInfo)
 
void FillSRGlobal (const sbn::evwgh::EventWeightParameterSet &pset, caf::SRGlobal &srglobal, std::map< std::string, unsigned int > &weightPSetIndex)
 
void FillTrackTruth (const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRTrack &srtrack, bool allowEmpty)
 
void FillShowerTruth (const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRShower &srshower, bool allowEmpty)
 
void FillStubTruth (const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &id_hits_map, const std::vector< caf::SRTrueParticle > &particles, const detinfo::DetectorClocksData &clockData, caf::SRStub &srstub, bool allowEmpty)
 
void FillSliceTruth (const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srmc, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData, caf::SRSlice &srslice, bool allowEmpty)
 
void FillMeVPrtlTruth (const evgen::ldm::MeVPrtlTruth &truth, const std::vector< geo::BoxBoundedGeo > &active_volumes, caf::SRMeVPrtl &srtruth)
 
void FillSliceFakeReco (const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srmc, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData, caf::SRSlice &srslice, const std::vector< caf::SRTrueParticle > &srparticles, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand)
 
void FillTrueNeutrino (const art::Ptr< simb::MCTruth > mctruth, const simb::MCFlux &mcflux, const simb::GTruth &gtruth, const std::vector< caf::SRTrueParticle > &srparticles, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &id_to_truehit_map, caf::SRTrueInteraction &srneutrino, size_t i, const std::vector< geo::BoxBoundedGeo > &active_volumes)
 
void FillEventWeight (const sbn::evwgh::EventWeightMap &wgtmap, caf::SRTrueInteraction &srint, const std::map< std::string, unsigned int > &weightPSetIndex)
 
void FillTrueG4Particle (const simb::MCParticle &particle, const std::vector< geo::BoxBoundedGeo > &active_volumes, const std::vector< std::vector< geo::BoxBoundedGeo >> &tpc_volumes, const std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * >>> &id_to_ide_map, const std::map< int, std::vector< art::Ptr< recob::Hit >>> &id_to_truehit_map, const cheat::BackTrackerService &backtracker, const cheat::ParticleInventoryService &inventory_service, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, caf::SRTrueParticle &srparticle)
 
void FillFakeReco (const std::vector< art::Ptr< simb::MCTruth >> &mctruths, const std::vector< caf::SRTrueParticle > &srparticles, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, std::vector< caf::SRFakeReco > &srfakereco)
 
std::map< int, caf::HitsEnergySetupIDHitEnergyMap (const std::vector< art::Ptr< recob::Hit >> &allHits, const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker)
 
std::map< int, std::vector
< art::Ptr< recob::Hit > > > 
PrepTrueHits (const std::vector< art::Ptr< recob::Hit >> &allHits, const detinfo::DetectorClocksData &clockData, const cheat::BackTrackerService &backtracker)
 
std::map< int, std::vector
< std::pair< geo::WireID,
const sim::IDE * > > > 
PrepSimChannels (const std::vector< art::Ptr< sim::SimChannel >> &simchannels, const geo::GeometryCore &geo)
 
caf::Wall_t GetWallCross (const geo::BoxBoundedGeo &volume, const TVector3 p0, const TVector3 p1)
 
caf::g4_process_ GetG4ProcessID (const std::string &name)
 
template<class T >
std::vector< T > PtrVecToVec (const art::PtrVector< T > &xs)
 

Variables

constexpr float kSignalingNaN = std::numeric_limits<float>::signaling_NaN()
 
constexpr int kUninitializedInt = -1
 

Detailed Description

Common Analysis Files.

Typedef Documentation

using caf::SRSliceProxy = typedef caf::Proxy<caf::SRSlice>

Definition at line 2 of file EpilogFwd.h.

using caf::SRSpillProxy = typedef caf::Proxy<caf::StandardRecord>

Definition at line 3 of file EpilogFwd.h.

Enumeration Type Documentation

enum caf::Det_t

Which SBN detector?

Enumerator
kUNKNOWN 

Unknown detector.

kSBND 

Near Detector.

kICARUS 

Far Detector.

Definition at line 7 of file SREnums.h.

8  {
9  kUNKNOWN, ///< Unknown detector
10  kSBND, ///< Near Detector
11  kICARUS ///< Far Detector
12  };
const int kSBND
Definition: ExpInfo.h:11
const int kICARUS
Definition: ExpInfo.h:13

Which G4 process ?

Enumerator
kG4primary 
kG4CoupledTransportation 
kG4FastScintillation 
kG4Decay 
kG4anti_neutronInelastic 
kG4neutronInelastic 
kG4anti_protonInelastic 
kG4protonInelastic 
kG4hadInelastic 
kG4pipInelastic 
kG4pimInelastic 
kG4xipInelastic 
kG4ximInelastic 
kG4kaonpInelastic 
kG4kaonmInelastic 
kG4sigmapInelastic 
kG4sigmamInelastic 
kG4kaon0LInelastic 
kG4kaon0SInelastic 
kG4lambdaInelastic 
kG4anti_lambdaInelastic 
kG4He3Inelastic 
kG4ionInelastic 
kG4xi0Inelastic 
kG4alphaInelastic 
kG4tInelastic 
kG4dInelastic 
kG4anti_neutronElastic 
kG4neutronElastic 
kG4anti_protonElastic 
kG4protonElastic 
kG4hadElastic 
kG4pipElastic 
kG4pimElastic 
kG4kaonpElastic 
kG4kaonmElastic 
kG4conv 
kG4phot 
kG4annihil 
kG4nCapture 
kG4nKiller 
kG4muMinusCaptureAtRest 
kG4muIoni 
kG4eBrem 
kG4CoulombScat 
kG4hBertiniCaptureAtRest 
kG4hFritiofCaptureAtRest 
kG4photonNuclear 
kG4muonNuclear 
kG4electronNuclear 
kG4positronNuclear 
kG4compt 
kG4eIoni 
kG4muBrems 
kG4hIoni 
kG4muPairProd 
kG4hPairProd 
kG4LArVoxelReadoutScoringProcess 
kG4ionIoni 
kG4hBrems 
kG4Transportation 
kG4msc 
kG4StepLimiter 
kG4UNKNOWN 

Definition at line 155 of file SREnums.h.

156  {
157  kG4primary=0,
160  kG4Decay=3,
165  kG4hadInelastic=8,
166  kG4pipInelastic=9,
167  kG4pimInelastic=10,
168  kG4xipInelastic=11,
169  kG4ximInelastic=12,
178  kG4He3Inelastic=21,
179  kG4ionInelastic=22,
180  kG4xi0Inelastic=23,
182  kG4tInelastic=25,
183  kG4dInelastic=26,
187  kG4protonElastic=30,
188  kG4hadElastic=31,
189  kG4pipElastic=32,
190  kG4pimElastic=33,
191  kG4kaonpElastic=34,
192  kG4kaonmElastic=35,
193  kG4conv=36,
194  kG4phot=37,
195  kG4annihil=38,
196  kG4nCapture=39,
197  kG4nKiller=40,
199  kG4muIoni=42,
200  kG4eBrem=43,
201  kG4CoulombScat=44,
204  kG4photonNuclear=47,
205  kG4muonNuclear=48,
208  kG4compt=51,
209  kG4eIoni=52,
210  kG4muBrems=53,
211  kG4hIoni=54,
212  kG4muPairProd=55,
213  kG4hPairProd=56,
215  kG4ionIoni=58,
216  kG4hBrems=59,
218  kG4msc=61,
219  kG4StepLimiter=62,
220  kG4UNKNOWN=63
221  };// g4_process_

Which generator?

Enumerator
kUnknownGenerator 
kGENIE 
kMeVPrtl 

Definition at line 44 of file SREnums.h.

45  {
47  kGENIE = 1,
48  kMeVPrtl = 2
49  };

These values are taken from nusimdata/SimulationBase/MCNeutrino.h (where they are probably copied from some genie header). Duplicating that information here is sub-optimal, but less sub-optimal than adding a dependency on larsoft to interpret the CAF files.

Enumerator
kUnknownInteractionMode 
kQE 
kRes 
kDIS 
kCoh 
kCohElastic 
kElectronScattering 
kIMDAnnihilation 
kInverseBetaDecay 
kGlashowResonance 
kAMNuGamma 
kMEC 
kDiffractive 
kEM 
kWeakMix 

Definition at line 62 of file SREnums.h.

63  {
64  // Low part of the enum, used to encode mode
66  kQE = 0,
67  kRes = 1,
68  kDIS = 2,
69  kCoh = 3,
70  kCohElastic = 4,
72  kIMDAnnihilation = 6,
75  kAMNuGamma = 9,
76  kMEC = 10,
77  kDiffractive = 11,
78  kEM = 12,
79  kWeakMix = 13
80  };
Enumerator
kUnknownInteractionType 
kNuanceOffset 

offset to account for adding in Nuance codes to this enum

kCCQE 

charged current quasi-elastic

kNCQE 

neutral current quasi-elastic

kResCCNuProtonPiPlus 

resonant charged current, nu p -> l- p pi+

kResCCNuNeutronPi0 

resonant charged current, nu n -> l- p pi0

kResCCNuNeutronPiPlus 

resonant charged current, nu n -> l- n pi+

kResNCNuProtonPi0 

resonant neutral current, nu p -> nu p pi0

kResNCNuProtonPiPlus 

resonant neutral current, nu p -> nu p pi+

kResNCNuNeutronPi0 

resonant neutral current, nu n -> nu n pi0

kResNCNuNeutronPiMinus 

resonant neutral current, nu n -> nu p pi-

kResCCNuBarNeutronPiMinus 

resonant charged current, nubar n -> l+ n pi-

kResCCNuBarProtonPi0 

resonant charged current, nubar p -> l+ n pi0

kResCCNuBarProtonPiMinus 

resonant charged current, nubar p -> l+ p pi-

kResNCNuBarProtonPi0 

resonant charged current, nubar p -> nubar p pi0

kResNCNuBarProtonPiPlus 

resonant charged current, nubar p -> nubar n pi+

kResNCNuBarNeutronPi0 

resonant charged current, nubar n -> nubar n pi0

kResNCNuBarNeutronPiMinus 

resonant charged current, nubar n -> nubar p pi-

kResCCNuDeltaPlusPiPlus 
kResCCNuDelta2PlusPiMinus 
kResCCNuBarDelta0PiMinus 
kResCCNuBarDeltaMinusPiPlus 
kResCCNuProtonRhoPlus 
kResCCNuNeutronRhoPlus 
kResCCNuBarNeutronRhoMinus 
kResCCNuBarNeutronRho0 
kResCCNuSigmaPlusKaonPlus 
kResCCNuSigmaPlusKaon0 
kResCCNuBarSigmaMinusKaon0 
kResCCNuBarSigma0Kaon0 
kResCCNuProtonEta 
kResCCNuBarNeutronEta 
kResCCNuKaonPlusLambda0 
kResCCNuBarKaon0Lambda0 
kResCCNuProtonPiPlusPiMinus 
kResCCNuProtonPi0Pi0 
kResCCNuBarNeutronPiPlusPiMinus 
kResCCNuBarNeutronPi0Pi0 
kResCCNuBarProtonPi0Pi0 
kCCDIS 

charged current deep inelastic scatter

kNCDIS 

charged current deep inelastic scatter

kUnUsed1 
kUnUsed2 
kCCQEHyperon 
kNCCOH 
kCCCOH 

charged current coherent pion

kNuElectronElastic 

neutrino electron elastic scatter

kInverseMuDecay 

inverse muon decay

kMEC2p2h 

extension of nuance encoding for MEC / 2p2h

Definition at line 82 of file SREnums.h.

83  {
85  kNuanceOffset = 1000, ///< offset to account for adding in Nuance codes to this enum
86  kCCQE = kNuanceOffset + 1, ///< charged current quasi-elastic
87  kNCQE = kNuanceOffset + 2, ///< neutral current quasi-elastic
88  kResCCNuProtonPiPlus = kNuanceOffset + 3, ///< resonant charged current, nu p -> l- p pi+
89  kResCCNuNeutronPi0 = kNuanceOffset + 4, ///< resonant charged current, nu n -> l- p pi0
90  kResCCNuNeutronPiPlus = kNuanceOffset + 5, ///< resonant charged current, nu n -> l- n pi+
91  kResNCNuProtonPi0 = kNuanceOffset + 6, ///< resonant neutral current, nu p -> nu p pi0
92  kResNCNuProtonPiPlus = kNuanceOffset + 7, ///< resonant neutral current, nu p -> nu p pi+
93  kResNCNuNeutronPi0 = kNuanceOffset + 8, ///< resonant neutral current, nu n -> nu n pi0
94  kResNCNuNeutronPiMinus = kNuanceOffset + 9, ///< resonant neutral current, nu n -> nu p pi-
95  kResCCNuBarNeutronPiMinus = kNuanceOffset + 10, ///< resonant charged current, nubar n -> l+ n pi-
96  kResCCNuBarProtonPi0 = kNuanceOffset + 11, ///< resonant charged current, nubar p -> l+ n pi0
97  kResCCNuBarProtonPiMinus = kNuanceOffset + 12, ///< resonant charged current, nubar p -> l+ p pi-
98  kResNCNuBarProtonPi0 = kNuanceOffset + 13, ///< resonant charged current, nubar p -> nubar p pi0
99  kResNCNuBarProtonPiPlus = kNuanceOffset + 14, ///< resonant charged current, nubar p -> nubar n pi+
100  kResNCNuBarNeutronPi0 = kNuanceOffset + 15, ///< resonant charged current, nubar n -> nubar n pi0
101  kResNCNuBarNeutronPiMinus = kNuanceOffset + 16, ///< resonant charged current, nubar n -> nubar p pi-
123  kCCDIS = kNuanceOffset + 91, ///< charged current deep inelastic scatter
124  kNCDIS = kNuanceOffset + 92, ///< charged current deep inelastic scatter
125  kUnUsed1 = kNuanceOffset + 93,
126  kUnUsed2 = kNuanceOffset + 94,
128  kNCCOH = kNuanceOffset + 96,
129  kCCCOH = kNuanceOffset + 97, ///< charged current coherent pion
130  kNuElectronElastic = kNuanceOffset + 98, ///< neutrino electron elastic scatter
131  kInverseMuDecay = kNuanceOffset + 99, ///< inverse muon decay
132  kMEC2p2h = kNuanceOffset + 100 ///< extension of nuance encoding for MEC / 2p2h
133 
134  };
resonant neutral current, nu p -&gt; nu p pi0
Definition: SREnums.h:91
resonant charged current, nubar p -&gt; nubar p pi0
Definition: SREnums.h:98
offset to account for adding in Nuance codes to this enum
Definition: SREnums.h:85
resonant charged current, nubar n -&gt; nubar p pi-
Definition: SREnums.h:101
resonant charged current, nu n -&gt; l- n pi+
Definition: SREnums.h:90
resonant charged current, nubar p -&gt; l+ p pi-
Definition: SREnums.h:97
resonant neutral current, nu n -&gt; nu p pi-
Definition: SREnums.h:94
extension of nuance encoding for MEC / 2p2h
Definition: SREnums.h:132
inverse muon decay
Definition: SREnums.h:131
charged current deep inelastic scatter
Definition: SREnums.h:124
resonant neutral current, nu n -&gt; nu n pi0
Definition: SREnums.h:93
neutrino electron elastic scatter
Definition: SREnums.h:130
resonant charged current, nubar p -&gt; nubar n pi+
Definition: SREnums.h:99
charged current coherent pion
Definition: SREnums.h:129
resonant neutral current, nu p -&gt; nu p pi+
Definition: SREnums.h:92
resonant charged current, nu n -&gt; l- p pi0
Definition: SREnums.h:89
resonant charged current, nubar n -&gt; l+ n pi-
Definition: SREnums.h:95
resonant charged current, nubar p -&gt; l+ n pi0
Definition: SREnums.h:96
resonant charged current, nubar n -&gt; nubar n pi0
Definition: SREnums.h:100
neutral current quasi-elastic
Definition: SREnums.h:87
charged current quasi-elastic
Definition: SREnums.h:86
resonant charged current, nu p -&gt; l- p pi+
Definition: SREnums.h:88
charged current deep inelastic scatter
Definition: SREnums.h:123

Which genie status?

Enumerator
kIStUndefined 
kIStInitialState 
kIStStableFinalState 
kIStIntermediateState 
kIStDecayedState 
kIStCorrelatedNucleon 
kIStNucleonTarget 
kIStDISPreFragmHadronicState 
kIStPreDecayResonantState 
kIStHadronInTheNucleus 
kIStFinalStateNuclearRemnant 
kIStNucleonClusterTarget 
kNotGenie 

Not a genie particle.

Definition at line 137 of file SREnums.h.

Which type of MC?

Enumerator
kMCUnknown 
kMCParticleGun 
kMCNeutrino 
kMCCosmic 
kMCOverlay 

Definition at line 34 of file SREnums.h.

Enumerator
kUnknownMeVPrtlChannel 
kMeVPrtlHiggs 
kMeVPrtlHNL 

Definition at line 52 of file SREnums.h.

Enumerator
kUnknown 
k1stInduction 
k2ndInduction 
kCollection 

Definition at line 14 of file SREnums.h.

15  {
16  kUnknown=-1,
17  k1stInduction=0,
18  k2ndInduction=1,
19  kCollection=2
20  };
Unknown view.
Definition: geo_types.h:136
Signal from collection planes.
Definition: geo_types.h:146
Enumerator
kDefault 
kMultiSim 
kPMNSigma 
kFixed 
kMultiSigma 

Definition at line 224 of file SREnums.h.

224  {
225  kDefault = -1,
226  kMultiSim = 0,
227  kPMNSigma = 1,
228  kFixed = 2,
229  kMultiSigma = 3
230  };
vertex position fixed manually - no fitting done
Definition: DataStructs.h:93
Enumerator
kWallNone 
kWallTop 
kWallBottom 
kWallLeft 
kWallRight 
kWallFront 
kWallBack 

Definition at line 22 of file SREnums.h.

23  {
24  kWallNone=0,
25  kWallTop=1,
26  kWallBottom=2,
27  kWallLeft=3,
28  kWallRight=4,
29  kWallFront=5,
30  kWallBack=6
31  };

Function Documentation

void caf::ApplyNumuCCMatching ( std::vector< caf::StandardRecord > &  recs,
const std::vector< caf::SRTrueInteraction > &  srneutrinos,
unsigned  truth_ind 
)

Definition at line 777 of file FillReco.cxx.

779  {
780 
781  // std::vector<unsigned> matches_truth;
782  // for (unsigned i = 0; i < recs.size(); i++) {
783  // if (recs[i].slc.tmatch.index == (int)truth_ind) {
784  // matches_truth.push_back(i);
785  // }
786  // }
787 
788  // // first -- remove any cases where most of the slice
789  // // matches to non-primary particles of the neutrino
790  // unsigned ind = 0;
791  // std::vector<float> matching_primary_energy;
792  // while (ind < matches_truth.size()) {
793  // const caf::SRSliceRecoBranch &reco = recs[matches_truth[ind]].reco;
794  // const caf::SRSlice &slice = recs[matches_truth[ind]].slc;
795 
796  // caf::SRVector3D vertex = slice.vertex;
797 
798  // float primary_energy = 0.;
799  // float total_energy = 0.;
800 
801  // // check the primary tracks of the slice
802  // for (const caf::SRTrack &track: reco.trk) {
803  // caf::SRVector3D start = track.start;
804  // float dist = sqrt((start.x - vertex.x) * (start.x - vertex.x) +
805  // (start.y - vertex.y) * (start.y - vertex.y) +
806  // (start.z - vertex.z) * (start.z - vertex.z));
807 
808  // if (track.parent == slice.self && dist < 10.) {
809  // for (const caf::SRTrackTruth::ParticleMatch &pmatch: track.truth.matches) {
810  // total_energy += pmatch.energy;
811  // for (unsigned i_part = 0; i_part < recs[0].true_particles.size(); i_part++) {
812  // const caf::SRTrueParticle &particle = recs[0].true_particles[i_part];
813  // if (particle.G4ID == pmatch.G4ID) {
814  // if (particle.start_process == caf::kG4primary) {
815  // primary_energy += pmatch.energy;
816  // }
817  // break;
818  // }
819  // }
820  // }
821  // }
822  // }
823  // if (primary_energy / total_energy < 0.5) {
824  // recs[matches_truth[ind]].slc.tmatch.is_numucc_primary = false;
825  // matches_truth.erase(matches_truth.begin()+ind);
826  // }
827  // else {
828  // matching_primary_energy.push_back(primary_energy);
829  // ind ++;
830  // }
831  // }
832 
833  // // less than two matches! All good
834  // if (matches_truth.size() < 2) return;
835 
836  // // If this is a numu CC interaction, break
837  // // tie by matching the muon
838  // // Whoever has a track matching closer to the
839  // // start of the muon wins
840  // if (abs(srneutrinos[truth_ind].pdg == 14) && srneutrinos[truth_ind].iscc) {
841  // const caf::SRTrueParticle &muon = srneutrinos[truth_ind].prim[0];
842  // float closest_dist = -1;
843  // int best_index = -1;
844  // for (unsigned ind = 0; ind < matches_truth.size(); ind++) {
845  // const caf::SRSliceRecoBranch &reco = recs[matches_truth[ind]].reco;
846  // const caf::SRSlice &slice = recs[matches_truth[ind]].slc;
847 
848  // caf::SRVector3D vertex = slice.vertex;
849 
850  // for (const caf::SRTrack &track: reco.trk) {
851  // caf::SRVector3D start = track.start;
852  // float dist = sqrt((start.x - vertex.x) * (start.x - vertex.x) +
853  // (start.y - vertex.y) * (start.y - vertex.y) +
854  // (start.z - vertex.z) * (start.z - vertex.z));
855 
856  // if (track.parent == slice.self && dist < 10. && track.truth.matches.size()) {
857  // const caf::SRTrackTruth::ParticleMatch &pmatch = track.truth.matches[0];
858  // if (pmatch.energy / muon.planeVisE > 0.05 && pmatch.G4ID == muon.G4ID) {
859  // caf::SRVector3D start = track.start;
860  // caf::SRVector3D end = track.end;
861  // float start_dist = sqrt((start.x - muon.start.x) * (start.x - muon.start.x) +
862  // (start.y - muon.start.y) * (start.y - muon.start.y) +
863  // (start.z - muon.start.z) * (start.z - muon.start.z));
864  // float end_dist = sqrt((end.x - muon.start.x) * (end.x - muon.start.x) +
865  // (end.y - muon.start.y) * (end.y - muon.start.y) +
866  // (end.z - muon.start.z) * (end.z - muon.start.z));
867  // float this_dist = std::min(start_dist, end_dist);
868  // if (closest_dist < 0. || this_dist < closest_dist) {
869  // closest_dist = this_dist;
870  // best_index = ind;
871  // }
872  // }
873  // }
874  // }
875  // }
876 
877  // // found a match!
878  // if (best_index >= 0) {
879  // for (unsigned i = 0; i < matches_truth.size(); i++) {
880  // if ((int)i == best_index) recs[matches_truth[i]].slc.tmatch.is_numucc_primary = true;
881  // else recs[matches_truth[i]].slc.tmatch.is_numucc_primary = false;
882  // }
883  // return;
884  // }
885  // // no match :( fallback on non numu-CC matching
886  // else {}
887  // }
888 
889  // // Otherwise, take the most energetic one
890  // unsigned best_index = std::distance(matching_primary_energy.begin(),
891  // std::max_element(matching_primary_energy.begin(), matching_primary_energy.end()));
892 
893  // for (unsigned i = 0; i < matches_truth.size(); i++) {
894  // if (i == best_index) recs[matches_truth[i]].slc.tmatch.is_numucc_primary = true;
895  // else recs[matches_truth[i]].slc.tmatch.is_numucc_primary = false;
896  // }
897  return;
898  }
template<class T , class U >
void caf::CopyPropertyIfSet ( const std::map< std::string, T > &  props,
const std::string &  search,
U &  value 
)

Definition at line 902 of file FillReco.cxx.

903  {
904  auto it = props.find(search);
905  if ( it != props.end() ) value = it->second;
906  }
temporary value
std::vector<float> caf::double_to_float_vector ( const std::vector< double > &  v)

Definition at line 152 of file FillReco.cxx.

153  {
154  std::vector<float> ret;
155  ret.reserve(v.size());
156  for(double x: v) ret.push_back(x);
157  return ret;
158  }
process_name opflash particleana ie x
void caf::FillCRTHit ( const sbn::crt::CRTHit hit,
uint64_t  gate_start_timestamp,
bool  use_ts0,
caf::SRCRTHit srhit,
bool  allowEmpty 
)

Definition at line 63 of file FillReco.cxx.

67  {
68 
69  srhit.time = (use_ts0 ? (float)hit.ts0() : hit.ts1()) / 1000.;
70  srhit.t0 = ((long long)(hit.ts0())-(long long)(gate_start_timestamp))/1000.;
71  srhit.t1 = hit.ts1()/1000.;
72 
73  srhit.position.x = hit.x_pos;
74  srhit.position.y = hit.y_pos;
75  srhit.position.z = hit.z_pos;
76 
77  srhit.position_err.x = hit.x_err;
78  srhit.position_err.y = hit.y_err;
79  srhit.position_err.z = hit.z_err;
80 
81  srhit.pe = hit.peshit;
82  srhit.plane = hit.plane;
83 
84  }
SRVector3D position_err
Definition: SRCRTHit.h:19
int64_t ts0() const
Definition: CRTHit.hh:49
float z_err
position uncertainty in z-direction (cm).
Definition: CRTHit.hh:43
float x_err
position uncertainty in x-direction (cm).
Definition: CRTHit.hh:39
int plane
Name of the CRT wall (in the form of numbers).
Definition: CRTHit.hh:36
float peshit
Total photo-electron (PE) in a crt hit.
Definition: CRTHit.hh:27
float y_err
position uncertainty in y-direction (cm).
Definition: CRTHit.hh:41
int plane
Plane that the CRT hit is on.
Definition: SRCRTHit.h:24
float z_pos
position in z-direction (cm).
Definition: CRTHit.hh:42
float t1
Relatvie time w.r.t. beam early warning (from T1 module) [us].
Definition: SRCRTHit.h:22
float pe
Definition: SRCRTHit.h:23
float t0
Hit time (from absolute time T0) relative to the gate start time [us].
Definition: SRCRTHit.h:21
float time
Definition: SRCRTHit.h:20
float y_pos
position in y-direction (cm).
Definition: CRTHit.hh:40
float x_pos
position in x-direction (cm).
Definition: CRTHit.hh:38
int64_t ts1() const
Definition: CRTHit.hh:50
SRVector3D position
Definition: SRCRTHit.h:18
void caf::FillCRTTrack ( const sbn::crt::CRTTrack track,
bool  use_ts0,
caf::SRCRTTrack srtrack,
bool  allowEmpty 
)

Definition at line 86 of file FillReco.cxx.

89  {
90 
91  srtrack.time = (use_ts0 ? (float)track.ts0_ns : track.ts1_ns) / 1000.;
92 
93  srtrack.hita.position.x = track.x1_pos;
94  srtrack.hita.position.y = track.y1_pos;
95  srtrack.hita.position.z = track.z1_pos;
96 
97  srtrack.hita.position_err.x = track.x1_err;
98  srtrack.hita.position_err.y = track.y1_err;
99  srtrack.hita.position_err.z = track.z1_err;
100 
101  srtrack.hita.plane = track.plane1;
102 
103  srtrack.hitb.position.x = track.x2_pos;
104  srtrack.hitb.position.y = track.y2_pos;
105  srtrack.hitb.position.z = track.z2_pos;
106 
107  srtrack.hitb.position_err.x = track.x2_err;
108  srtrack.hitb.position_err.y = track.y2_err;
109  srtrack.hitb.position_err.z = track.z2_err;
110 
111  srtrack.hitb.plane = track.plane2;
112  }
SRVector3D position_err
Definition: SRCRTHit.h:19
int plane
Plane that the CRT hit is on.
Definition: SRCRTHit.h:24
float x1_pos
X position of first CRTHit.
Definition: CRTTrack.hh:33
float y1_err
Y position error of first CRTHit.
Definition: CRTTrack.hh:36
float z1_err
Z position error of first CRTHit.
Definition: CRTTrack.hh:38
float y2_err
Y position error of second CRTHit.
Definition: CRTTrack.hh:42
double ts1_ns
Average T1 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:28
double ts0_ns
Average T0 (nanosecond) of the two hits making the track.
Definition: CRTTrack.hh:26
float time
Combined time of CRT Track.
Definition: SRCRTTrack.h:20
float z1_pos
Z position of first CRTHit.
Definition: CRTTrack.hh:37
SRCRTHit hita
First hit in CRT track.
Definition: SRCRTTrack.h:18
int plane1
Plane ID of first CRTHit.
Definition: CRTTrack.hh:30
float z2_pos
Z position of second CRTHit.
Definition: CRTTrack.hh:43
SRVector3D position
Definition: SRCRTHit.h:18
float y2_pos
Y position of second CRTHit.
Definition: CRTTrack.hh:41
float y1_pos
Y position of first CRTHit.
Definition: CRTTrack.hh:35
SRCRTHit hitb
Second git in CRT Track.
Definition: SRCRTTrack.h:19
float x2_pos
X position of second CRTHit.
Definition: CRTTrack.hh:39
float x1_err
X position error of first CRTHit.
Definition: CRTTrack.hh:34
int plane2
Plane ID of second CRTHit.
Definition: CRTTrack.hh:31
float z2_err
Z position error of second CRTHit.
Definition: CRTTrack.hh:44
float x2_err
X position error of second CRTHit.
Definition: CRTTrack.hh:40
void caf::FillEventWeight ( const sbn::evwgh::EventWeightMap wgtmap,
caf::SRTrueInteraction srint,
const std::map< std::string, unsigned int > &  weightPSetIndex 
)

Definition at line 414 of file FillTrue.cxx.

417  {
418  for(auto& it: wgtmap){
419  if(weightPSetIndex.count(it.first) == 0){
420  std::cout << "CAFMaker: Unknown EventWeightMap name '" << it.first << "'" << std::endl;
421  std::cout << "Known names from EventWeightParameterSet:" << std::endl;
422  for(auto k: weightPSetIndex) std::cout << " " << k.first << std::endl;
423  abort();
424  }
425 
426  const unsigned int idx = weightPSetIndex.at(it.first);
427  if(idx >= srint.wgt.size()) srint.wgt.resize(idx+1);
428  srint.wgt[idx].univ = it.second;
429  }
430  }
pdgs k
Definition: selectors.fcl:22
std::vector< SRMultiverse > wgt
Systematic weights.
BEGIN_PROLOG could also be cout
void caf::FillExposure ( const std::vector< sbn::BNBSpillInfo > &  bnb_spill_info,
std::vector< caf::SRBNBInfo > &  BNBInfo,
double &  subRunPOT 
)

Definition at line 35 of file FillExposure.cxx.

38  {
39  for(const sbn::BNBSpillInfo& info: bnb_spill_info)
40  {
41  subRunPOT += info.POT();
42  BNBInfo.push_back(makeSRBNBInfo(info));
43  }
44  }
caf::SRBNBInfo makeSRBNBInfo(sbn::BNBSpillInfo const &info)
Definition: FillExposure.cxx:7
void caf::FillExposureNuMI ( const std::vector< sbn::NuMISpillInfo > &  numi_spill_info,
std::vector< caf::SRNuMIInfo > &  NuMIInfo,
double &  subRunPOT 
)

Definition at line 45 of file FillExposure.cxx.

47  {
48  for (const sbn::NuMISpillInfo &info: numi_spill_info) {
49  subRunPOT += info.POT();
50 
51  NuMIInfo.emplace_back();
52  NuMIInfo.back().HP121 = info.HP121;
53  NuMIInfo.back().VP121 = info.VP121;
54  NuMIInfo.back().HPTGT = info.HPTGT;
55  NuMIInfo.back().VPTGT = info.VPTGT;
56  NuMIInfo.back().HITGT = info.HITGT;
57  NuMIInfo.back().VITGT = info.VITGT;
58  NuMIInfo.back().MTGTDS = info.MTGTDS;
59  NuMIInfo.back().HRNDIR = info.HRNDIR;
60  NuMIInfo.back().NSLINA = info.NSLINA;
61  NuMIInfo.back().NSLINB = info.NSLINB;
62  NuMIInfo.back().NSLINC = info.NSLINC;
63  NuMIInfo.back().NSLIND = info.NSLIND;
64  NuMIInfo.back().TRTGTD = info.TRTGTD;
65  NuMIInfo.back().TR101D = info.TR101D;
66  NuMIInfo.back().TORTGT = info.TORTGT;
67  NuMIInfo.back().TOR101 = info.TOR101;
68  NuMIInfo.back().time = info.time;
69  NuMIInfo.back().spill_time_s = info.spill_time_s;
70  NuMIInfo.back().spill_time_ns = info.spill_time_ns;
71  NuMIInfo.back().event = info.event;
72  NuMIInfo.back().daq_gates = info.daq_gates;
73  }
74  }
void caf::FillFakeReco ( const std::vector< art::Ptr< simb::MCTruth >> &  mctruths,
const std::vector< caf::SRTrueParticle > &  srparticles,
const std::vector< art::Ptr< sim::MCTrack >> &  mctracks,
const std::vector< geo::BoxBoundedGeo > &  volumes,
TRandom &  rand,
std::vector< caf::SRFakeReco > &  srfakereco 
)

Definition at line 636 of file FillTrue.cxx.

641  {
642  // iterate and fill
643  for (const art::Ptr<simb::MCTruth> mctruth: mctruths) {
644  bool do_fill = false;
645  caf::SRFakeReco this_fakereco;
646  do_fill = FRFillNumuCC(*mctruth, mctracks, volumes, rand, this_fakereco);
647  if(!do_fill) do_fill = FRFillNueCC(*mctruth, srparticles, volumes, rand, this_fakereco);
648 
649  // TODO: others?
650  // if (!do_fill) ...
651 
652  if (do_fill) srfakereco.push_back(this_fakereco);
653 
654  }
655  }
bool FRFillNueCC(const simb::MCTruth &mctruth, const std::vector< caf::SRTrueParticle > &srparticle, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, caf::SRFakeReco &fakereco)
Definition: FillTrue.cxx:873
bool FRFillNumuCC(const simb::MCTruth &mctruth, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, caf::SRFakeReco &fakereco)
Definition: FillTrue.cxx:710
The SRFakeReco is a faked reconstruction using estimates from the SBN proposal.
Definition: SRFakeReco.h:15
void caf::FillHitVars ( const recob::Hit hit,
unsigned  producer,
const recob::SpacePoint spacepoint,
const recob::PFParticle particle,
caf::SRHit srhit,
bool  allowEmpty 
)

Definition at line 738 of file FillReco.cxx.

744  {
745  srhit.setDefault();
746 
747  srhit.peakTime = hit.PeakTime();
748  srhit.RMS = hit.RMS();
749 
750  srhit.peakAmplitude = hit.PeakAmplitude();
751  srhit.integral = hit.Integral();
752 
753  const geo::WireID wire = hit.WireID();
754  srhit.cryoID = wire.Cryostat;
755  srhit.tpcID = wire.TPC;
756  srhit.planeID = wire.Plane;
757  srhit.wireID = wire.Wire;
758  srhit.spacepoint.XYZ = SRVector3D (spacepoint.XYZ());
759  srhit.spacepoint.chisq = spacepoint.Chisq();
760  srhit.spacepoint.pfpID = particle.Self();
761  srhit.spacepoint.ID = spacepoint.ID();
762  }
double chisq
Definition: SRHit.h:20
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
geo::WireID WireID() const
Definition: Hit.h:233
float peakTime
Definition: SRHit.h:32
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
Double32_t Chisq() const
Definition: SpacePoint.h:78
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:224
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
int wireID
Definition: SRHit.h:42
float RMS
Definition: SRHit.h:34
int planeID
Definition: SRHit.h:41
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
Definition: Hit.h:221
float peakAmplitude
Definition: SRHit.h:36
int cryoID
Definition: SRHit.h:39
SRVector3D XYZ
Definition: SRHit.h:19
SRSpacePoint spacepoint
Definition: SRHit.h:44
const Double32_t * XYZ() const
Definition: SpacePoint.h:76
int tpcID
Definition: SRHit.h:40
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
float integral
Definition: SRHit.h:37
ID_t ID() const
Definition: SpacePoint.h:75
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
void setDefault()
Definition: SRHit.cxx:20
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
void caf::FillMeVPrtlTruth ( const evgen::ldm::MeVPrtlTruth truth,
const std::vector< geo::BoxBoundedGeo > &  active_volumes,
caf::SRMeVPrtl srtruth 
)

Definition at line 182 of file FillTrue.cxx.

184  {
185  // Fill stuff!!
186  srtruth.position.x = truth.decay_pos.X();
187  srtruth.position.y = truth.decay_pos.Y();
188  srtruth.position.z = truth.decay_pos.Z();
189  srtruth.time = truth.decay_pos.T();
190 
191  srtruth.momentum.x = truth.mevprtl_mom.X();
192  srtruth.momentum.y = truth.mevprtl_mom.Y();
193  srtruth.momentum.z = truth.mevprtl_mom.Z();
194  srtruth.E = truth.mevprtl_mom.E();
195 
196  // Set the cryostat of the position
197  for (int icryo = 0; icryo < (int)active_volumes.size(); icryo++) {
198  if (active_volumes[icryo].ContainsPosition(truth.decay_pos.Vect())) {
199  srtruth.cryostat = icryo;
200  break;
201  }
202  }
203 
204  srtruth.M = truth.mass;
205  srtruth.flux_weight = truth.flux_weight;
206  srtruth.ray_weight = truth.ray_weight;
207  srtruth.decay_weight = truth.decay_weight;
208  srtruth.decay_length = truth.mean_distance;
209 
210  srtruth.enter.x = truth.mevprtl_enter.X();
211  srtruth.enter.y = truth.mevprtl_enter.Y();
212  srtruth.enter.z = truth.mevprtl_enter.Z();
213  srtruth.exit.x = truth.mevprtl_exit.X();
214  srtruth.exit.y = truth.mevprtl_exit.Y();
215  srtruth.exit.z = truth.mevprtl_exit.Z();
216  srtruth.start.x = truth.mevprtl_start.X();
217  srtruth.start.y = truth.mevprtl_start.Y();
218  srtruth.start.z = truth.mevprtl_start.Z();
219 
220  srtruth.C1 = truth.C1;
221  srtruth.C2 = truth.C2;
222  srtruth.C3 = truth.C3;
223  srtruth.C4 = truth.C4;
224  srtruth.C5 = truth.C5;
225 
226  switch(truth.gen) {
228  srtruth.gen = caf::kMeVPrtlHiggs;
229  break;
230  case evgen::ldm::kHNL:
231  srtruth.gen = caf::kMeVPrtlHNL;
232  break;
233  default:
234  break;
235  }
236  }
TLorentzVector decay_pos
Definition: MeVPrtlTruth.h:30
double ray_weight
Weight associated with the Portal hitting the detector.
Definition: SRMeVPrtl.h:31
double time
Decay time [us].
Definition: SRMeVPrtl.h:23
double flux_weight
Weight associated with the production of the Portal.
Definition: SRMeVPrtl.h:30
caf::SRVector3D momentum
Portal momentum [GeV].
Definition: SRMeVPrtl.h:24
double decay_length
Mean decay length of particle.
Definition: SRMeVPrtl.h:34
caf::mevprtlchannel_ gen
Generator physics channel for this event.
Definition: SRMeVPrtl.h:21
caf::SRVector3D position
Decay location [cm].
Definition: SRMeVPrtl.h:22
double M
Portal Mass [GeV].
Definition: SRMeVPrtl.h:26
caf::SRVector3D enter
Entry position of particle into Active Volume.
Definition: SRMeVPrtl.h:35
double E
Portal Energy [GeV].
Definition: SRMeVPrtl.h:25
int cryostat
Cryostat that the decay occurs in.
Definition: SRMeVPrtl.h:28
caf::SRVector3D exit
Exit position of particle into Active Volume.
Definition: SRMeVPrtl.h:36
TLorentzVector mevprtl_start
Definition: MeVPrtlTruth.h:26
caf::SRVector3D start
Start position of Portal in detector coordinates [cm].
Definition: SRMeVPrtl.h:37
TLorentzVector mevprtl_mom
Definition: MeVPrtlTruth.h:25
double decay_weight
Weight associated with the Portal decaying.
Definition: SRMeVPrtl.h:32
void caf::FillOpFlash ( const recob::OpFlash flash,
int  cryo,
caf::SROpFlash srflash,
bool  allowEmpty 
)

Definition at line 114 of file FillReco.cxx.

117  {
118 
119  srflash.setDefault();
120 
121  srflash.time = flash.Time();
122  srflash.timewidth = flash.TimeWidth();
123  srflash.cryo = cryo; // 0 in SBND, 0/1 for E/W in ICARUS
124 
125  // Sum over each wall, not very SBND-compliant
126  float sumEast = 0.;
127  float sumWest = 0.;
128  int countingOffset = 0;
129  if ( cryo == 1 ) countingOffset += 180;
130  for ( int PMT = 0 ; PMT < 180 ; PMT++ ) {
131  if ( PMT <= 89 ) sumEast += flash.PEs().at(PMT + countingOffset);
132  else sumWest += flash.PEs().at(PMT + countingOffset);
133  }
134  srflash.peperwall[0] = sumEast;
135  srflash.peperwall[1] = sumWest;
136 
137  srflash.totalpe = flash.TotalPE();
138  srflash.fasttototal = flash.FastToTotal();
139  srflash.onbeamtime = flash.OnBeamTime();
140 
141  srflash.center.SetXYZ( -9999.f, flash.YCenter(), flash.ZCenter() );
142  srflash.width.SetXYZ( -9999.f, flash.YWidth(), flash.ZWidth() );
143 
144  // Checks if ( recob::OpFlash.XCenter() != std::numeric_limits<double>::max() )
145  // See LArSoft OpFlash.h at https://nusoft.fnal.gov/larsoft/doxsvn/html/OpFlash_8h_source.html
146  if ( flash.hasXCenter() ) {
147  srflash.center.SetX( flash.XCenter() );
148  srflash.width.SetX( flash.XWidth() );
149  }
150  }
double XWidth() const
Definition: OpFlash.h:114
void SetXYZ(float x, float y, float z)
Definition: SRVector3D.cxx:33
double FastToTotal() const
Definition: OpFlash.h:119
double TimeWidth() const
Definition: OpFlash.h:107
#define PMT
Definition: NestAlg.cxx:19
void SetX(float _x)
Definition: SRVector3D.h:32
SRVector3D width
Geometric width in &lt;x,y,z&gt; [cm].
Definition: SROpFlash.h:34
float totalpe
Total number of PE across all PMTs.
Definition: SROpFlash.h:29
bool hasXCenter() const
Returns whether the estimated center on x direction is available.
Definition: OpFlash.h:112
float timewidth
Width of the flash in time [us].
Definition: SROpFlash.h:25
double ZCenter() const
Definition: OpFlash.h:117
void setDefault()
Definition: SROpFlash.cxx:17
double Time() const
Definition: OpFlash.h:106
float fasttototal
Fast to total light ratio.
Definition: SROpFlash.h:30
int OnBeamTime() const
Definition: OpFlash.h:123
SRVector3D center
Geometric center in &lt;x,y,z&gt; [cm].
Definition: SROpFlash.h:33
int cryo
0 for SBND/ICARUS East, 1 for ICARUS West.
Definition: SROpFlash.h:22
bool onbeamtime
Is this in time with beam?
Definition: SROpFlash.h:21
double YWidth() const
Definition: OpFlash.h:116
std::vector< double > const & PEs() const
Returns a vector with a number of photoelectrons per channel.
Definition: OpFlash.h:111
double TotalPE() const
Definition: OpFlash.cxx:68
double XCenter() const
Returns the estimated center on x direction (.
Definition: OpFlash.h:113
double YCenter() const
Definition: OpFlash.h:115
float peperwall[2]
Definition: SROpFlash.h:31
double ZWidth() const
Definition: OpFlash.h:118
float time
Time on trigger time scale [us].
Definition: SROpFlash.h:24
void caf::FillPFPVars ( const recob::PFParticle particle,
const recob::PFParticle primary,
const larpandoraobj::PFParticleMetadata pfpMeta,
caf::SRPFP srpfp,
bool  allowEmpty 
)

Definition at line 698 of file FillReco.cxx.

703  {
704  srpfp.id = particle.Self();
705  srpfp.slcID = (primary) ? primary->Self() : -1;
706 
707  // set the daughters in the particle flow
708  for (unsigned id: particle.Daughters()) {
709  srpfp.daughters.push_back(id);
710  }
711  srpfp.ndaughters = srpfp.daughters.size();
712 
713  srpfp.parent = particle.Parent();
715  || (primary && particle.Parent() == primary->Self());
716 
717  if (pfpMeta) {
718  auto const &propertiesMap (pfpMeta->GetPropertiesMap());
719  auto const &pfpTrackScoreIter(propertiesMap.find("TrackScore"));
720  srpfp.trackScore = (pfpTrackScoreIter == propertiesMap.end()) ? -5.f : pfpTrackScoreIter->second;
721 
722  // Pfo Characterisation features
723  srpfp.pfochar.setDefault();
724 
725  CopyPropertyIfSet(propertiesMap, "LArThreeDChargeFeatureTool_EndFraction", srpfp.pfochar.chgendfrac);
726  CopyPropertyIfSet(propertiesMap, "LArThreeDChargeFeatureTool_FractionalSpread", srpfp.pfochar.chgfracspread);
727  CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_DiffStraightLineMean", srpfp.pfochar.linfitdiff);
728  CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_Length", srpfp.pfochar.linfitlen);
729  CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_MaxFitGapLength", srpfp.pfochar.linfitgaplen);
730  CopyPropertyIfSet(propertiesMap, "LArThreeDLinearFitFeatureTool_SlidingLinearFitRMS", srpfp.pfochar.linfitrms);
731  CopyPropertyIfSet(propertiesMap, "LArThreeDOpeningAngleFeatureTool_AngleDiff", srpfp.pfochar.openanglediff);
732  CopyPropertyIfSet(propertiesMap, "LArThreeDPCAFeatureTool_SecondaryPCARatio", srpfp.pfochar.pca2ratio);
733  CopyPropertyIfSet(propertiesMap, "LArThreeDPCAFeatureTool_TertiaryPCARatio", srpfp.pfochar.pca3ratio);
734  CopyPropertyIfSet(propertiesMap, "LArThreeDVertexDistanceFeatureTool_VertexDistance", srpfp.pfochar.vtxdist);
735  }
736  }
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
Definition: PFParticle.h:114
float chgendfrac
Definition: SRPFOChar.h:19
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
static constexpr size_t kPFParticlePrimary
Define index to signify primary particle.
Definition: PFParticle.h:61
bool parent_is_primary
If this is a primary daughter of a neutrino/cosmic.
Definition: SRPFP.h:23
int parent
ID of parent particle of this pfp.
Definition: SRPFP.h:22
int slcID
Definition: SRPFP.h:28
float pca3ratio
Definition: SRPFOChar.h:27
float linfitgaplen
Definition: SRPFOChar.h:23
unsigned int ndaughters
Number of daughters.
Definition: SRPFP.h:19
size_t Parent() const
Definition: PFParticle.h:96
float vtxdist
Definition: SRPFOChar.h:28
float linfitlen
Definition: SRPFOChar.h:22
const PropertiesMap & GetPropertiesMap() const
float trackScore
The MVA score that determines how track/shower like a PFP is.
Definition: SRPFP.h:25
float openanglediff
Definition: SRPFOChar.h:25
float pca2ratio
Definition: SRPFOChar.h:26
SRPFOChar pfochar
The MVA inputs (features) in determination of the track score (PFO Characterisation) ...
Definition: SRPFP.h:26
float chgfracspread
Definition: SRPFOChar.h:20
void setDefault()
Definition: SRPFOChar.cxx:14
void CopyPropertyIfSet(const std::map< std::string, T > &props, const std::string &search, U &value)
Definition: FillReco.cxx:902
int id
ID of this pfp (taken from the pandora particle &quot;ID&quot; of this PFP)
Definition: SRPFP.h:18
float linfitdiff
Definition: SRPFOChar.h:21
float linfitrms
Definition: SRPFOChar.h:24
std::vector< int > daughters
ID&#39;s of daughters of this pfp.
Definition: SRPFP.h:20
void caf::FillPlaneChi2PID ( const anab::ParticleID particle_id,
caf::SRTrkChi2PID srpid 
)

Definition at line 477 of file FillReco.cxx.

477  {
478 
479  // Assign dummy values.
480 
481  srpid.chi2_muon = 0.;
482  srpid.chi2_pion = 0.;
483  srpid.chi2_kaon = 0.;
484  srpid.chi2_proton = 0.;
485  srpid.pid_ndof = 0;
486  srpid.pida = 0.;
487 
488  // Loop over algorithm scores and extract the ones we want.
489  // Get the ndof from any chi2 algorithm
490 
491  std::vector<anab::sParticleIDAlgScores> AlgScoresVec = particle_id.ParticleIDAlgScores();
492  for (size_t i_algscore=0; i_algscore<AlgScoresVec.size(); i_algscore++){
493  anab::sParticleIDAlgScores AlgScore = AlgScoresVec.at(i_algscore);
494  if (AlgScore.fAlgName == "Chi2"){
495  if (TMath::Abs(AlgScore.fAssumedPdg) == 13) { // chi2mu
496  srpid.chi2_muon = AlgScore.fValue;
497  srpid.pid_ndof = AlgScore.fNdf;
498  }
499  else if (TMath::Abs(AlgScore.fAssumedPdg) == 211) { // chi2pi
500  srpid.chi2_pion = AlgScore.fValue;
501  srpid.pid_ndof = AlgScore.fNdf;
502  }
503  else if (TMath::Abs(AlgScore.fAssumedPdg) == 321) { // chi2ka
504  srpid.chi2_kaon = AlgScore.fValue;
505  srpid.pid_ndof = AlgScore.fNdf;
506  }
507  else if (TMath::Abs(AlgScore.fAssumedPdg) == 2212) { // chi2pr
508  srpid.chi2_proton = AlgScore.fValue;
509  srpid.pid_ndof = AlgScore.fNdf;
510  }
511  }
512  else if (AlgScore.fVariableType==anab::kPIDA){
513  srpid.pida = AlgScore.fValue;
514  }
515  }
516  }
float chi2_kaon
dE/dx v. residual range Chi2 (kaon hypothesis)
Definition: SRTrkChi2PID.h:21
float chi2_proton
dE/dx v. residual range Chi2 (proton hypothesis)
Definition: SRTrkChi2PID.h:22
float fValue
Result of Particle ID algorithm/test.
Definition: ParticleID.h:28
float pida
PIDA.
Definition: SRTrkChi2PID.h:24
std::string fAlgName
&lt; determined particle ID
Definition: ParticleID.h:23
int fNdf
Number of degrees of freedom used by algorithm, if applicable. Set to -9999 by default.
Definition: ParticleID.h:26
kVariableType fVariableType
Variable type enum: defined in ParticleID_VariableTypeEnums.h. Set to kNotSet by default.
Definition: ParticleID.h:24
const std::vector< anab::sParticleIDAlgScores > & ParticleIDAlgScores() const
Definition: ParticleID.h:65
float chi2_pion
dE/dx v. residual range Chi2 (pion hypothesis)
Definition: SRTrkChi2PID.h:20
int pid_ndof
Number of degress of freedom in Chi2 PID fit.
Definition: SRTrkChi2PID.h:18
float chi2_muon
dE/dx v. residual range Chi2 (muon hypothesis)
Definition: SRTrkChi2PID.h:19
int fAssumedPdg
PDG of particle hypothesis assumed by algorithm, if applicable. Set to 0 by default.
Definition: ParticleID.h:27
void caf::FillShowerCosmicDist ( const std::vector< art::Ptr< float > > &  cosmicDistVec,
caf::SRShower srshower 
)

Definition at line 239 of file FillReco.cxx.

241  {
242  if (cosmicDistVec.size() != 1)
243  return;
244  srshower.cosmicDist = *cosmicDistVec.front();
245  }
float cosmicDist
Distance of closest approach to cosmic ray [cm].
Definition: SRShower.h:44
void caf::FillShowerDensityFit ( const sbn::ShowerDensityFit densityFit,
caf::SRShower srshower 
)

Definition at line 262 of file FillReco.cxx.

264  {
265  srshower.selVars.densityGradient = densityFit.mDensityGrad;
266  srshower.selVars.densityGradientPower = densityFit.mDensityPow;
267  }
float densityGradient
Constant in the density gradient fit.
float densityGradientPower
Power in the density gradient fit.
SRShowerSelection selVars
Definition: SRShower.h:49
void caf::FillShowerRazzle ( const art::Ptr< sbn::MVAPID razzle,
caf::SRShower srshower,
bool  allowEmpty 
)

Definition at line 226 of file FillReco.cxx.

229  {
230  srshower.razzle.electronScore = razzle->mvaScoreMap.at(11);
231  srshower.razzle.photonScore = razzle->mvaScoreMap.at(22);
232  srshower.razzle.otherScore = razzle->mvaScoreMap.at(0);
233 
234  srshower.razzle.pdg = razzle->BestPDG();
235  srshower.razzle.bestScore = razzle->BestScore();
236  }
SRShowerRazzle razzle
Results from the shower PID MVA.
Definition: SRShower.h:48
void caf::FillShowerResiduals ( const std::vector< art::Ptr< float > > &  residuals,
caf::SRShower srshower 
)

Definition at line 247 of file FillReco.cxx.

249  {
250  for (auto const& res: residuals) {
251  srshower.selVars.showerResiduals.push_back(*res);
252  }
253  }
std::vector< float > showerResiduals
Vector of residuals, size (sliceShowers-1) [cm].
SRShowerSelection selVars
Definition: SRShower.h:49
void caf::FillShowerTrackFit ( const sbn::ShowerTrackFit trackFit,
caf::SRShower srshower 
)

Definition at line 255 of file FillReco.cxx.

257  {
258  srshower.selVars.trackLength = trackFit.mTrackLength;
259  srshower.selVars.trackWidth = trackFit.mTrackWidth;
260  }
float trackWidth
Width of fitted track (Average redidual) [cm].
float trackLength
Lenth of fitted track [cm].
SRShowerSelection selVars
Definition: SRShower.h:49
void caf::FillShowerTruth ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::map< int, caf::HitsEnergy > &  id_hits_map,
const std::vector< caf::SRTrueParticle > &  particles,
const detinfo::DetectorClocksData clockData,
caf::SRShower srshower,
bool  allowEmpty 
)

Definition at line 134 of file FillTrue.cxx.

140  {
141  // Truth matching
142  srshower.truth = MatchTrack2Truth(clockData, particles, hits, id_hits_map);
143 
144  }//FillShowerTruth
caf::SRTrackTruth MatchTrack2Truth(const detinfo::DetectorClocksData &clockData, const std::vector< caf::SRTrueParticle > &particles, const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &all_hits_map)
Definition: FillTrue.cxx:1279
SRTrackTruth truth
truth information TODO: make seperate showe info class
Definition: SRShower.h:50
void caf::FillShowerVars ( const recob::Shower shower,
const recob::Vertex vertex,
const std::vector< art::Ptr< recob::Hit >> &  hits,
const geo::GeometryCore geom,
unsigned  producer,
caf::SRShower srshower,
bool  allowEmpty 
)

Definition at line 161 of file FillReco.cxx.

168  {
169 
170  srshower.producer = producer;
171 
172  // We need to convert the energy from MeV to GeV
173  // Also convert -999 -> -5 for consistency with other defaults in the CAFs
174  for(int i = 0; i < 3; ++i){
175  const float e = shower.Energy()[i];
176  srshower.plane[i].energy = e > 0 ? e / 1000.f : -5.f;
177  srshower.plane[i].dEdx = shower.dEdx()[i];
178  }
179 
180  srshower.dir = SRVector3D( shower.Direction() );
181  srshower.start = SRVector3D( shower.ShowerStart() );
182 
183  // TO DO: work out conversion gap
184  // It's sth like this but not quite. And will need to pass a simb::MCtruth object vtx position anyway.
185  // srshower.conversion_gap = (shower.ShowerStart() - vertex.Position()).Mag();
186 
187  if(shower.best_plane() != -999){
188  srshower.bestplane = shower.best_plane();
189  srshower.bestplane_dEdx = srshower.plane[shower.best_plane()].dEdx;
190  srshower.bestplane_energy = srshower.plane[shower.best_plane()].energy;
191  }
192 
193  if(shower.has_open_angle())
194  srshower.open_angle = shower.OpenAngle();
195  if(shower.has_length())
196  srshower.len = shower.Length();
197 
198  // We want density to be in MeV/cm so need to convert the energy back to MeV from GeV
199  if(srshower.len > std::numeric_limits<float>::epsilon() && srshower.bestplane_energy > 0)
200  srshower.density = 1000.f * srshower.bestplane_energy / srshower.len;
201 
202  if (vertex && shower.ShowerStart().Z()>-990) {
203  // Need to do some rearranging to make consistent types
204  const geo::Point_t vertexPos(vertex->position());
205  const TVector3 vertexTVec3{vertexPos.X(), vertexPos.Y(), vertexPos.Z()};
206 
207  srshower.conversion_gap = (shower.ShowerStart() - vertexTVec3).Mag();
208  }
209 
210  if (shower.Direction().Z()>-990 && shower.ShowerStart().Z()>-990 && shower.Length()>0) {
211  srshower.end = shower.ShowerStart()+ (shower.Length() * shower.Direction());
212  }
213 
214  for(int p = 0; p < 3; ++p) srshower.plane[p].nHits = 0;
215  for (auto const& hit:hits) ++srshower.plane[hit->WireID().Plane].nHits;
216 
217  for (geo::PlaneGeo const& plane: geom->IteratePlanes()) {
218 
219  const double angleToVert(geom->WireAngleToVertical(plane.View(), plane.ID()) - 0.5*M_PI);
220  const double cosgamma(std::abs(std::sin(angleToVert)*shower.Direction().Y()+std::cos(angleToVert)*shower.Direction().Z()));
221 
222  srshower.plane[plane.ID().Plane].wirePitch = plane.WirePitch()/cosgamma;
223  }
224  }
int bestplane
shower best reconstructed plane
Definition: SRShower.h:33
bool has_length() const
Returns whether the shower has a valid length.
Definition: Shower.h:211
SRVector3D dir
direction cosines at the start of the shower
Definition: SRShower.h:41
IteratorBox< plane_iterator,&GeometryCore::begin_plane,&GeometryCore::end_plane > IteratePlanes() const
Enables ranged-for loops on all planes of the detector.
float wirePitch
Wire pitch corrected for the angle of the shower for this plane [cm].
Definition: SRShower.h:23
const TVector3 & Direction() const
Definition: Shower.h:189
float dEdx
shower calculated dEdx for this plane [MeV/cm]
Definition: SRShower.h:20
pdgs p
Definition: selectors.fcl:22
bool has_open_angle() const
Returns whether the shower has a valid opening angle.
Definition: Shower.h:210
const std::vector< double > & dEdx() const
Definition: Shower.h:203
float density
shower density [MeV/cm]
Definition: SRShower.h:37
int best_plane() const
Definition: Shower.h:200
float bestplane_dEdx
shower dEdx at best plane [MeV/cm]
Definition: SRShower.h:34
process_name hit
Definition: cheaterreco.fcl:51
SRShowerPlaneInfo plane[3]
Definition: SRShower.h:40
double Length() const
Definition: Shower.h:201
float open_angle
shower opening angle [rad]
Definition: SRShower.h:39
T abs(T value)
double OpenAngle() const
Definition: Shower.h:202
for($it=0;$it< $RaceTrack_number;$it++)
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
unsigned int nHits
Number of hits associated to the shower for this plane.
Definition: SRShower.h:22
SRVector3D start
shower start point in detector coordinates [cm]
Definition: SRShower.h:42
SRVector3D end
shower end point (start+len*dir) in detector coordinates [cm]
Definition: SRShower.h:43
const std::vector< double > & Energy() const
Definition: Shower.h:195
do i e
float bestplane_energy
shower energy at best plane [GeV]
Definition: SRShower.h:35
const TVector3 & ShowerStart() const
Definition: Shower.h:192
unsigned producer
Index of the producer that produced this object. In ICARUS, this is the same as the cryostat...
Definition: SRShower.h:52
float conversion_gap
shower start and vertex position difference [cm]
Definition: SRShower.h:36
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
float energy
shower calculated energy for this plane [GeV]
Definition: SRShower.h:21
float len
shower length [cm]
Definition: SRShower.h:38
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60
void caf::FillSliceCRUMBS ( const sbn::CRUMBSResult crumbs,
caf::SRSlice slice,
bool  allowEmpty 
)

Definition at line 345 of file FillReco.cxx.

347  {
348  if (crumbs != nullptr) {
349  slice.crumbs_result.score = crumbs->score;
350  slice.crumbs_result.ccnumuscore = crumbs->ccnumuscore;
351  slice.crumbs_result.ccnuescore = crumbs->ccnuescore;
352  slice.crumbs_result.ncscore = crumbs->ncscore;
353  slice.crumbs_result.bestscore = crumbs->bestscore;
354  slice.crumbs_result.bestid = crumbs->bestid;
358  slice.crumbs_result.tpc.crnhitsmax = crumbs->tpc_CRNHitsMax;
363  slice.crumbs_result.tpc.nuvertexy = crumbs->tpc_NuVertexY;
367  slice.crumbs_result.pds.fmpe = crumbs->pds_FMPE;
368  slice.crumbs_result.pds.fmtime = crumbs->pds_FMTime;
369  slice.crumbs_result.crt.trackscore = crumbs->crt_TrackScore;
370  slice.crumbs_result.crt.hitscore = crumbs->crt_HitScore;
371  slice.crumbs_result.crt.tracktime = crumbs->crt_TrackTime;
372  slice.crumbs_result.crt.hittime = crumbs->crt_HitTime;
373  }
374  }
float crlongtrackdefl
1 - the cosine of the angle between the starting and finishing directions of the longest track (cosmi...
float tpc_CRFracHitsInLongestTrack
fraction of slice’s space points in longest track (cosmic reco)
Definition: CRUMBSResult.h:29
float crt_HitTime
the time associated with the matched CRT hit [us]
Definition: CRUMBSResult.h:46
float tpc_CRLongestTrackDeflection
1 - the cosine of the angle between the starting and finishing directions of the longest track (cosmi...
Definition: CRUMBSResult.h:30
float ccnuescore
CRUMBS result, for CCNuE signal.
int tpc_NuNHitsTotal
the total number of space points (nu reco)
Definition: CRUMBSResult.h:35
float fmtime
the time associated with the flash [us]
float score
CRUMBS result, for inclusive neutrino signal.
float ncscore
CRUMBS result, for NC signal.
Definition: CRUMBSResult.h:26
int bestid
ID corresponding to the best score, 14 for CCNuMu, 12 for CCNuE, 1 for NC.
Definition: CRUMBSResult.h:28
int nufinalstatepfos
the number of final state pfos (nu reco)
float crlongtrackhitfrac
fraction of slice’s space points in longest track (cosmic reco)
float hittime
the time associated with the matched CRT hit [us]
float ccnumuscore
CRUMBS result, for CCNuMu signal.
float tpc_NuEigenRatioInSphere
the ratio between the first and second eigenvalues from a PCA of spacepoints within 10cm of the verte...
Definition: CRUMBSResult.h:33
float hitscore
the best distance from an extrapolated TPC track to a CRT hit [cm]
float fmpe
the total number of photoelectrons in the associated flash
float pds_FMTotalScore
the total flash match score
Definition: CRUMBSResult.h:40
float ccnumuscore
CRUMBS result, for CCNuMu signal.
Definition: CRUMBSResult.h:24
float fmtotalscore
the total flash match score
float score
CRUMBS result, for inclusive neutrino signal.
Definition: CRUMBSResult.h:23
int bestid
ID corresponding to the bestscore, 14 for CCNuMu, 12 for CCNuE, 1 for NC.
float tpc_NuVertexY
the vertex position in Y (nu reco) [cm]
Definition: CRUMBSResult.h:37
float pds_FMTime
the time associated with the flash [us]
Definition: CRUMBSResult.h:42
float crt_TrackTime
the time associated with the matched CRT track [us]
Definition: CRUMBSResult.h:45
float bestscore
Best score from the three signal-specific versions.
int tpc_CRNHitsMax
the number of space points in the largest pfp
Definition: CRUMBSResult.h:32
float pds_FMPE
the total number of photoelectrons in the associated flash
Definition: CRUMBSResult.h:41
float crt_HitScore
the best distance from an extrapolated TPC track to a CRT hit [cm]
Definition: CRUMBSResult.h:44
float nusphereeigenratio
the ratio between the first and second eigenvalues from a PCA of spacepoints within 10cm of the verte...
SRCRUMBSCRTVars crt
CRT input variables.
float trackscore
a combination of the DCA and angle between the best matched TPC &amp; CRT tracks
SRCRUMBSResult crumbs_result
Score of how neutrino-like the slice is according to the CRUMBS ID.
Definition: SRSlice.h:49
int nuspherespacepoints
the total number of space points within 10cm of the vertex (nu reco)
SRCRUMBSTPCVars tpc
TPC input variables.
float ncscore
CRUMBS result, for NC signal.
float tpc_NuWeightedDirZ
the Z component of the space-point weighted direction of the final state pfos (nu reco) ...
Definition: CRUMBSResult.h:38
float tpc_CRLongestTrackDirY
relative direction of the longest track in Y (cosmic reco)
Definition: CRUMBSResult.h:31
float bestscore
Best score from the three signal-specific versions.
Definition: CRUMBSResult.h:27
int nutotalhits
the total number of space points (nu reco)
int tpc_NuNFinalStatePfos
the number of final state pfos (nu reco)
Definition: CRUMBSResult.h:34
float tpc_StoppingChi2CosmicRatio
a ratio of chi2 values intended to find Bragg peaks in stopping muon tracks
Definition: CRUMBSResult.h:39
float nuwgtdirz
the Z component of the space-point weighted direction of the final state pfos (nu reco) ...
float crt_TrackScore
a combination of the DCA and angle between the best matched TPC &amp; CRT tracks
Definition: CRUMBSResult.h:43
float ccnuescore
CRUMBS result, for CCNuE signal.
Definition: CRUMBSResult.h:25
float tracktime
the time associated with the matched CRT track [us]
SRCRUMBSPDSVars pds
PDS input variables.
int tpc_NuNSpacePointsInSphere
the total number of space points within 10cm of the vertex (nu reco)
Definition: CRUMBSResult.h:36
float nuvertexy
the vertex position in Y (nu reco) [cm]
float stoppingchi2ratio
a ratio of chi2 values intended to find Bragg peaks in stopping muon tracks
float crlongtrackdiry
relative direction of the longest track in Y (cosmic reco)
int crnhitsmax
the number of space points in the largest pfp
void caf::FillSliceFakeReco ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::vector< art::Ptr< simb::MCTruth >> &  neutrinos,
const caf::SRTruthBranch srmc,
const cheat::ParticleInventoryService inventory_service,
const detinfo::DetectorClocksData clockData,
caf::SRSlice srslice,
const std::vector< caf::SRTrueParticle > &  srparticles,
const std::vector< art::Ptr< sim::MCTrack >> &  mctracks,
const std::vector< geo::BoxBoundedGeo > &  volumes,
TRandom &  rand 
)

Definition at line 238 of file FillTrue.cxx.

247  {
248  caf::SRTruthMatch tmatch = MatchSlice2Truth(hits, neutrinos, srmc, inventory_service, clockData);
249  if(tmatch.index >= 0) {
250  FRFillNumuCC(*neutrinos[tmatch.index], mctracks, volumes, rand, srslice.fake_reco);
251  if(!srslice.fake_reco.filled)
252  FRFillNueCC(*neutrinos[tmatch.index], srparticles, volumes, rand, srslice.fake_reco);
253  }
254  }//FillSliceFakeReco
caf::SRTruthMatch MatchSlice2Truth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srtruth, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData)
Definition: FillTrue.cxx:1367
An SRTruthMatch contains overarching information for a slice.
Definition: SRTruthMatch.h:15
bool FRFillNueCC(const simb::MCTruth &mctruth, const std::vector< caf::SRTrueParticle > &srparticle, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, caf::SRFakeReco &fakereco)
Definition: FillTrue.cxx:873
bool FRFillNumuCC(const simb::MCTruth &mctruth, const std::vector< art::Ptr< sim::MCTrack >> &mctracks, const std::vector< geo::BoxBoundedGeo > &volumes, TRandom &rand, caf::SRFakeReco &fakereco)
Definition: FillTrue.cxx:710
int index
Index of the matched true neutrino interaction (-1 if not matched to neutrino)
Definition: SRTruthMatch.h:27
SRFakeReco fake_reco
Definition: SRSlice.h:43
void caf::FillSliceFlashMatch ( const sbn::SimpleFlashMatch fmatch,
caf::SRSlice srslice,
bool  allowEmpty 
)

Definition at line 14 of file FillFlashMatch.cxx.

17  {
18  if (fmatch == nullptr) {
19  srslice.fmatch.present = false;
20  return;
21  }
22  srslice.fmatch.present = fmatch->present;
23  srslice.fmatch.time = fmatch->time;
24  srslice.fmatch.chargeQ = fmatch->charge.q;
25  srslice.fmatch.lightPE = fmatch->light.pe;
26  srslice.fmatch.score = fmatch->score.total;
27  srslice.fmatch.scoreY = fmatch->score.y;
28  srslice.fmatch.scoreZ = fmatch->score.z;
29  srslice.fmatch.scoreRR = fmatch->score.rr;
30  srslice.fmatch.scoreRatio = fmatch->score.ratio;
31  srslice.fmatch.chargeCenter = fmatch->charge.center;
32  srslice.fmatch.lightCenter = fmatch->light.center;
33  }
bool present
whether there&#39;s a match
Definition: SRFlashMatch.h:21
double y
score for y metric
float scoreRR
score for rr metric
Definition: SRFlashMatch.h:30
SRVector3D lightCenter
Weighted center position [cm].
Definition: SRFlashMatch.h:26
double z
score for z metric
float scoreY
score for y metric
Definition: SRFlashMatch.h:28
Flash light
object that contains flash pe and its position
TVector3 center
Weighted center position [cm].
float chargeQ
charge in slc
Definition: SRFlashMatch.h:23
float lightPE
photo-electrons on simple flash
Definition: SRFlashMatch.h:25
double ratio
score for ratio metric
TVector3 center
Weighted center position [cm].
Score score
overall and partial scores to the match
float score
total score, sum of terms
Definition: SRFlashMatch.h:27
double rr
score for rr metric
SRVector3D chargeCenter
Weighted center position [cm].
Definition: SRFlashMatch.h:24
SRFlashMatch fmatch
Optical flash-match for this slice of TPC charge.
Definition: SRSlice.h:39
Charge charge
object that contains charge and its position
float scoreRatio
score for ratio metric
Definition: SRFlashMatch.h:31
float scoreZ
score for z metric
Definition: SRFlashMatch.h:29
double pe
photo-electrons on flash
bool present
Whether there&#39;s a match.
double total
total score, sum of terms
float time
time of flash
Definition: SRFlashMatch.h:22
double time
time of flash
void caf::FillSliceFlashMatchA ( const sbn::SimpleFlashMatch fmatch,
caf::SRSlice srslice,
bool  allowEmpty 
)

Definition at line 36 of file FillFlashMatch.cxx.

39  {
40  if (fmatch == nullptr) {
41  srslice.fmatch_a.present = false;
42  return;
43  }
44  srslice.fmatch_a.present = fmatch->present;
45  srslice.fmatch_a.time = fmatch->time;
46  srslice.fmatch_a.chargeQ = fmatch->charge.q;
47  srslice.fmatch_a.lightPE = fmatch->light.pe;
48  srslice.fmatch_a.score = fmatch->score.total;
49  srslice.fmatch_a.scoreY = fmatch->score.y;
50  srslice.fmatch_a.scoreZ = fmatch->score.z;
51  srslice.fmatch_a.scoreRR = fmatch->score.rr;
52  srslice.fmatch_a.scoreRatio = fmatch->score.ratio;
53  srslice.fmatch_a.chargeCenter = fmatch->charge.center;
54  srslice.fmatch_a.lightCenter = fmatch->light.center;
55  }
bool present
whether there&#39;s a match
Definition: SRFlashMatch.h:21
double y
score for y metric
float scoreRR
score for rr metric
Definition: SRFlashMatch.h:30
SRVector3D lightCenter
Weighted center position [cm].
Definition: SRFlashMatch.h:26
double z
score for z metric
float scoreY
score for y metric
Definition: SRFlashMatch.h:28
Flash light
object that contains flash pe and its position
TVector3 center
Weighted center position [cm].
float chargeQ
charge in slc
Definition: SRFlashMatch.h:23
float lightPE
photo-electrons on simple flash
Definition: SRFlashMatch.h:25
double ratio
score for ratio metric
TVector3 center
Weighted center position [cm].
Score score
overall and partial scores to the match
float score
total score, sum of terms
Definition: SRFlashMatch.h:27
SRFlashMatch fmatch_a
Optical flash-match for this slice of TPC charge.
Definition: SRSlice.h:40
double rr
score for rr metric
SRVector3D chargeCenter
Weighted center position [cm].
Definition: SRFlashMatch.h:24
Charge charge
object that contains charge and its position
float scoreRatio
score for ratio metric
Definition: SRFlashMatch.h:31
float scoreZ
score for z metric
Definition: SRFlashMatch.h:29
double pe
photo-electrons on flash
bool present
Whether there&#39;s a match.
double total
total score, sum of terms
float time
time of flash
Definition: SRFlashMatch.h:22
double time
time of flash
void caf::FillSliceFlashMatchB ( const sbn::SimpleFlashMatch fmatch,
caf::SRSlice srslice,
bool  allowEmpty 
)

Definition at line 58 of file FillFlashMatch.cxx.

61  {
62  if (fmatch == nullptr) {
63  srslice.fmatch_b.present = false;
64  return;
65  }
66  srslice.fmatch_b.present = fmatch->present;
67  srslice.fmatch_b.time = fmatch->time;
68  srslice.fmatch_b.chargeQ = fmatch->charge.q;
69  srslice.fmatch_b.lightPE = fmatch->light.pe;
70  srslice.fmatch_b.score = fmatch->score.total;
71  srslice.fmatch_b.scoreY = fmatch->score.y;
72  srslice.fmatch_b.scoreZ = fmatch->score.z;
73  srslice.fmatch_b.scoreRR = fmatch->score.rr;
74  srslice.fmatch_b.scoreRatio = fmatch->score.ratio;
75  srslice.fmatch_b.chargeCenter = fmatch->charge.center;
76  srslice.fmatch_b.lightCenter = fmatch->light.center;
77  }
bool present
whether there&#39;s a match
Definition: SRFlashMatch.h:21
SRFlashMatch fmatch_b
Optical flash-match for this slice of TPC charge.
Definition: SRSlice.h:41
double y
score for y metric
float scoreRR
score for rr metric
Definition: SRFlashMatch.h:30
SRVector3D lightCenter
Weighted center position [cm].
Definition: SRFlashMatch.h:26
double z
score for z metric
float scoreY
score for y metric
Definition: SRFlashMatch.h:28
Flash light
object that contains flash pe and its position
TVector3 center
Weighted center position [cm].
float chargeQ
charge in slc
Definition: SRFlashMatch.h:23
float lightPE
photo-electrons on simple flash
Definition: SRFlashMatch.h:25
double ratio
score for ratio metric
TVector3 center
Weighted center position [cm].
Score score
overall and partial scores to the match
float score
total score, sum of terms
Definition: SRFlashMatch.h:27
double rr
score for rr metric
SRVector3D chargeCenter
Weighted center position [cm].
Definition: SRFlashMatch.h:24
Charge charge
object that contains charge and its position
float scoreRatio
score for ratio metric
Definition: SRFlashMatch.h:31
float scoreZ
score for z metric
Definition: SRFlashMatch.h:29
double pe
photo-electrons on flash
bool present
Whether there&#39;s a match.
double total
total score, sum of terms
float time
time of flash
Definition: SRFlashMatch.h:22
double time
time of flash
void caf::FillSliceMetadata ( const larpandoraobj::PFParticleMetadata primary_meta,
caf::SRSlice srslice,
bool  allowEmpty 
)

Definition at line 292 of file FillReco.cxx.

295  {
296  // default values
297  srslice.nu_score = -1;
298  srslice.is_clear_cosmic = true;
299  srslice.nuid.setDefault();
300 
301  // collect the properties
302  if (primary_meta != NULL) {
303  auto const &properties = primary_meta->GetPropertiesMap();
304  if (properties.count("IsClearCosmic")) {
305  assert(!properties.count("IsNeutrino"));
306  srslice.is_clear_cosmic = true;
307  }
308  else {
309  assert(properties.count("IsNeutrino"));
310  srslice.is_clear_cosmic = false;
311  }
312  if (properties.count("NuScore")) {
313  srslice.nu_score = properties.at("NuScore");
314  }
315  else {
316  srslice.nu_score = -1;
317  }
318  // NeutrinoID (SliceID) features
319  CopyPropertyIfSet(properties, "NuNFinalStatePfos", srslice.nuid.nufspfos);
320  CopyPropertyIfSet(properties, "NuNHitsTotal", srslice.nuid.nutothits);
321  CopyPropertyIfSet(properties, "NuVertexY", srslice.nuid.nuvtxy);
322  CopyPropertyIfSet(properties, "NuWeightedDirZ", srslice.nuid.nuwgtdirz);
323  CopyPropertyIfSet(properties, "NuNSpacePointsInSphere", srslice.nuid.nusps);
324  CopyPropertyIfSet(properties, "NuEigenRatioInSphere", srslice.nuid.nueigen);
325  CopyPropertyIfSet(properties, "CRLongestTrackDirY", srslice.nuid.crlongtrkdiry);
326  CopyPropertyIfSet(properties, "CRLongestTrackDeflection", srslice.nuid.crlongtrkdef);
327  CopyPropertyIfSet(properties, "CRFracHitsInLongestTrack", srslice.nuid.crlongtrkhitfrac);
328  CopyPropertyIfSet(properties, "CRNHitsMax", srslice.nuid.crmaxhits);
329  }
330 
331  }
float nuwgtdirz
NuWeightedDirZ feature in NeutrinoID.
Definition: SRNuID.h:22
float nufspfos
NuNFinalStatePfos feature in NeutrinoID.
Definition: SRNuID.h:19
void setDefault()
Definition: SRNuID.cxx:14
float crlongtrkhitfrac
CRFracHitsInLongestTrack feature in NeutrinoID.
Definition: SRNuID.h:27
SRNuID nuid
Neutrino ID Features (BDT inputs) going into nu_score calculation.
Definition: SRSlice.h:51
int nutothits
NuNHitsTotal feature in NeutrinoID.
Definition: SRNuID.h:20
float nu_score
Score of how neutrino-like the slice is according to pandora.
Definition: SRSlice.h:48
bool is_clear_cosmic
Whether pandora marks the slice as a &quot;clear&quot; cosmic.
Definition: SRSlice.h:46
int crmaxhits
CRNHitsMax feature in NeutrinoID.
Definition: SRNuID.h:28
const PropertiesMap & GetPropertiesMap() const
float nusps
NuNSpacePointsInSphere feature in NeutrinoID.
Definition: SRNuID.h:23
void CopyPropertyIfSet(const std::map< std::string, T > &props, const std::string &search, U &value)
Definition: FillReco.cxx:902
float crlongtrkdef
CRLongestTrackDeflection feature in NeutrinoID.
Definition: SRNuID.h:26
float nuvtxy
NuVertexY feature in NeutrinoID.
Definition: SRNuID.h:21
float crlongtrkdiry
CRLongestTrackDirY feature in NeutrinoID.
Definition: SRNuID.h:25
float nueigen
NuEigenRatioInSphere feature in NeutrinoID.
Definition: SRNuID.h:24
void caf::FillSliceTruth ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::vector< art::Ptr< simb::MCTruth >> &  neutrinos,
const caf::SRTruthBranch srmc,
const cheat::ParticleInventoryService inventory_service,
const detinfo::DetectorClocksData clockData,
caf::SRSlice srslice,
bool  allowEmpty 
)

Definition at line 160 of file FillTrue.cxx.

167  {
168 
169  caf::SRTruthMatch tmatch = MatchSlice2Truth(hits, neutrinos, srmc, inventory_service, clockData);
170 
171  if (tmatch.index >= 0) {
172  srslice.truth = srmc.nu[tmatch.index];
173  srslice.tmatch = tmatch;
174  }
175 
176  std::cout << "Slice matched to index: " << tmatch.index
177  << " with match frac: " << tmatch.pur << std::endl;
178 
179  }//FillSliceTruth
SRTruthMatch tmatch
Matching information between truth and reco objects.
Definition: SRSlice.h:37
caf::SRTruthMatch MatchSlice2Truth(const std::vector< art::Ptr< recob::Hit >> &hits, const std::vector< art::Ptr< simb::MCTruth >> &neutrinos, const caf::SRTruthBranch &srtruth, const cheat::ParticleInventoryService &inventory_service, const detinfo::DetectorClocksData &clockData)
Definition: FillTrue.cxx:1367
An SRTruthMatch contains overarching information for a slice.
Definition: SRTruthMatch.h:15
SRTrueInteraction truth
Truth information on the slice.
Definition: SRSlice.h:36
std::vector< SRTrueInteraction > nu
Vector of true nu or cosmic.
Definition: SRTruthBranch.h:21
float pur
Slice purity for this interaction.
Definition: SRTruthMatch.h:24
int index
Index of the matched true neutrino interaction (-1 if not matched to neutrino)
Definition: SRTruthMatch.h:27
BEGIN_PROLOG could also be cout
void caf::FillSliceVars ( const recob::Slice slice,
const recob::PFParticle primary,
unsigned  producer,
caf::SRSlice srslice,
bool  allowEmpty 
)

Definition at line 269 of file FillReco.cxx.

274  {
275 
276  srslice.producer = producer;
277  srslice.charge = slice.Charge();
278 
279  // get the primary tracks/showers
280  if (primary != NULL) {
281  for (unsigned id: primary->Daughters()) {
282  srslice.primary.push_back(id);
283  }
284  srslice.self = primary->Self();
285  srslice.nu_pdg = primary->PdgCode();
286  }
287  else {
288  srslice.self = -1;
289  }
290  }
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
Definition: PFParticle.h:114
int nu_pdg
PDG assigned to the PFParticle Neutrino.
Definition: SRSlice.h:47
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
unsigned producer
Definition: SRSlice.h:31
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:83
int self
ID of the particle representing this slice.
Definition: SRSlice.h:54
std::vector< size_t > primary
ID&#39;s of primary tracks and showers in slice.
Definition: SRSlice.h:53
float charge
Calorimetric energy.
Definition: SRSlice.h:33
void caf::FillSliceVertex ( const recob::Vertex vertex,
caf::SRSlice slice,
bool  allowEmpty 
)

Definition at line 334 of file FillReco.cxx.

336  {
337  if (vertex != NULL) {
338  slice.vertex.x = vertex->position().X();
339  slice.vertex.y = vertex->position().Y();
340  slice.vertex.z = vertex->position().Z();
341  }
342  }
SRVector3D vertex
Candidate neutrino vertex in local detector coordinates [cm].
Definition: SRSlice.h:34
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60
void caf::FillSRGlobal ( const sbn::evwgh::EventWeightParameterSet pset,
caf::SRGlobal srglobal,
std::map< std::string, unsigned int > &  weightPSetIndex 
)

Definition at line 89 of file FillTrue.cxx.

92  {
93  SRWeightPSet& cafpset = srglobal.wgts.emplace_back();
94 
95  cafpset.name = pset.fName;
96  cafpset.type = caf::ReweightType_t(pset.fRWType);
97  cafpset.nuniv = pset.fNuniverses;
98  if(pset.fCovarianceMatrix) CopyTMatrixDToVector(*pset.fCovarianceMatrix, cafpset.covmx);
99 
100  weightPSetIndex[cafpset.name] = srglobal.wgts.size()-1;
101 
102  for(const auto& it: pset.fParameterMap){
103  const sbn::evwgh::EventWeightParameter& param = it.first;
104  const std::vector<float>& vals = it.second;
105 
106  SRWeightParam cafparam;
107  cafparam.name = param.fName;
108  cafparam.mean = param.fMean;
109  cafparam.width = param.fWidth;
110  cafparam.covidx = param.fCovIndex;
111 
112  cafpset.map.emplace_back(cafparam, vals);
113  } // end for it
114  }
std::string fName
Parameter name.
std::vector< SRWeightPSet > wgts
Definition: SRGlobal.h:13
TMatrixD * fCovarianceMatrix
Covariance matrix for correlated throws (optional)
ReweightType fRWType
Type of throws (the same for all parameters in a set)
size_t fCovIndex
Index in the covariance matrix (if any)
A single parameter to be reweighted.
ReweightType_t
Definition: SREnums.h:224
std::map< EventWeightParameter, std::vector< float > > fParameterMap
Mapping of definitions to the set of values.
size_t fNuniverses
Number of universes (i.e. random throws)
void CopyTMatrixDToVector(const TMatrixD &m, std::vector< float > &v)
Definition: FillTrue.cxx:79
std::string fName
Name of the parameter set.
void caf::FillStubTruth ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::map< int, caf::HitsEnergy > &  id_hits_map,
const std::vector< caf::SRTrueParticle > &  particles,
const detinfo::DetectorClocksData clockData,
caf::SRStub srstub,
bool  allowEmpty 
)

Definition at line 147 of file FillTrue.cxx.

153  {
154  srstub.truth = MatchTrack2Truth(clockData, particles, hits, id_hits_map);
155  }
SRTrackTruth truth
truth information
Definition: SRStub.h:52
caf::SRTrackTruth MatchTrack2Truth(const detinfo::DetectorClocksData &clockData, const std::vector< caf::SRTrueParticle > &particles, const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &all_hits_map)
Definition: FillTrue.cxx:1279
void caf::FillStubVars ( const sbn::Stub stub,
const art::Ptr< recob::PFParticle stubpfp,
caf::SRStub srstub,
bool  allowEmpty 
)

Definition at line 19 of file FillReco.cxx.

22  {
23 
24  // allowEmpty does not (yet) matter here
25  (void) allowEmpty;
26 
27  // Copy the stub object over
28  srstub.vtx.x = stub.vtx.x();
29  srstub.vtx.y = stub.vtx.y();
30  srstub.vtx.z = stub.vtx.z();
31 
32  srstub.end.x = stub.end.x();
33  srstub.end.y = stub.end.y();
34  srstub.end.z = stub.end.z();
35 
36  srstub.efield_vtx = stub.efield_vtx;
37  srstub.efield_end = stub.efield_end;
38 
39  for (unsigned ip = 0; ip < stub.plane.size(); ip++) {
40  caf::SRStubPlane plane;
41  plane.p = (caf::Plane_t)stub.plane[ip].Plane;
42  plane.pitch = stub.pitch[ip];
43  plane.trkpitch = stub.trkpitch[ip];
44  plane.vtx_w = stub.vtx_w[ip];
45  plane.hit_w = stub.hit_w[ip];
46  for (unsigned ih = 0; ih < stub.hits[ip].size(); ih++) {
48  hit.charge = stub.hits[ip][ih].charge;
49  hit.wire = stub.hits[ip][ih].wire;
50  hit.ontrack = stub.hits[ip][ih].ontrack;
51 
52  plane.hits.push_back(hit);
53  }
54 
55  srstub.planes.push_back(plane);
56  }
57 
58  // If there is an overlaid PFParticle, save its ID
59  if (stubpfp) srstub.pfpid = stubpfp->Self();
60 
61  }
Plane_t
Definition: SREnums.h:14
std::vector< geo::PlaneID > plane
The plane ID.
Definition: Stub.h:25
float pitch
Pitch of the stub on each wire [cm].
Definition: SRStub.h:32
int pfpid
PFP ID of an object that &quot;overlays&quot; the stub. -1 if there is no such object.
Definition: SRStub.h:51
std::vector< std::vector< StubHit > > hits
Hits on each plane. Ordered vtx-&gt;end.
Definition: Stub.h:32
geo::Point_t end
End of Stub. Space charge corrected. [cm].
Definition: Stub.h:19
short hit_w
Wire of the end-point-hit.
Definition: SRStub.h:35
std::vector< SRStubPlane > planes
Definition: SRStub.h:47
process_name hit
Definition: cheaterreco.fcl:51
short wire
Wire number of the hit.
Definition: SRStub.h:22
geo::Point_t vtx
Interaction Vertex / Start of Stub. Space charge corrected. [cm].
Definition: Stub.h:18
std::vector< float > vtx_w
Wire coordinate of the vertex on this plane.
Definition: Stub.h:29
caf::Plane_t p
Plane number.
Definition: SRStub.h:31
bool ontrack
Whether this hit is also on an overlaid track.
Definition: SRStub.h:23
std::vector< short > hit_w
Wire of the end point hit on this plane.
Definition: Stub.h:30
for($it=0;$it< $RaceTrack_number;$it++)
j template void())
Definition: json.hpp:3108
float vtx_w
Wire coordinate of vertex on this plane (not space charge corrected).
Definition: SRStub.h:34
float efield_end
The E-Field at the stub end point.
Definition: Stub.h:21
float efield_vtx
The E-Field at the reconstructed vertex.
Definition: Stub.h:22
float trkpitch
Pitch of the overlaid track on each wire [cm].
Definition: SRStub.h:33
SRVector3D end
End position of stub [cm].
Definition: SRStub.h:45
float charge
Calibrated and electron-lifetime-corrected charge [#elec].
Definition: SRStub.h:21
std::vector< SRStubHit > hits
List of all the hits on this plane.
Definition: SRStub.h:36
float efield_end
Electric field at the end position of the stub [kV/cm].
Definition: SRStub.h:49
std::vector< float > trkpitch
Pitch of the matched track on each wire [cm].
Definition: Stub.h:28
std::vector< float > pitch
Pitch of stub on each wire [cm].
Definition: Stub.h:27
SRVector3D vtx
Vertex/start position of stub [cm].
Definition: SRStub.h:44
float efield_vtx
Electric field at the vertex position of the stub [kV/cm].
Definition: SRStub.h:48
void caf::FillTrackCalo ( const std::vector< art::Ptr< anab::Calorimetry >> &  calos,
const std::vector< art::Ptr< recob::Hit >> &  hits,
bool  fill_calo_points,
float  fillhit_rrstart,
float  fillhit_rrend,
const geo::GeometryCore geom,
const detinfo::DetectorPropertiesData dprop,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 630 of file FillReco.cxx.

636  {
637  // count up the kinetic energy on each plane --
638  // ignore any charge with a deposition > 1000 MeV/cm
639  // TODO: ignore first and last hit???
640  // assert(calos.size() == 0 || calos == 3);
641  for (unsigned i = 0; i < calos.size(); i++) {
642  const anab::Calorimetry &calo = *calos[i];
643  if (calo.PlaneID()) {
644  unsigned plane_id = calo.PlaneID().Plane;
645  assert(plane_id < 3);
646  FillTrackPlaneCalo(calo, hits, fill_calo_points, fillhit_rrstart, fillhit_rrend, dprop, srtrack.calo[plane_id]);
647  }
648  }
649 
650  // Set the plane with the most hits
651  //
652  // We expect the noise to be lowest at planes 2 -> 0 -> 1, so use this to break ties
653  caf::Plane_t bestplane = caf::kUnknown;
654  int bestnhit = -1;
655  for(int plane: {2, 0, 1}){
656  if(srtrack.calo[plane].nhit > bestnhit){
657  bestplane = caf::Plane_t(plane);
658  bestnhit = srtrack.calo[plane].nhit;
659  }
660  }
661 
662  srtrack.bestplane = bestplane;
663 
664  }
Plane_t
Definition: SREnums.h:14
const geo::PlaneID & PlaneID() const
Definition: Calorimetry.h:116
process_name can override from command line with o or output calo
Definition: pid.fcl:40
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
void FillTrackPlaneCalo(const anab::Calorimetry &calo, const std::vector< art::Ptr< recob::Hit >> &hits, bool fill_calo_points, float fillhit_rrstart, float fillhit_rrend, const detinfo::DetectorPropertiesData &dprop, caf::SRTrackCalo &srcalo)
Definition: FillReco.cxx:534
SRTrackCalo calo[3]
Per-plane Calorimetry information.
Definition: SRTrack.h:48
int nhit
Number of hits on this plane counted in the calorimetry.
Definition: SRTrackCalo.h:39
Plane_t bestplane
Plane index with the most hits. -1 if no calorimetry.
Definition: SRTrack.h:49
void caf::FillTrackChi2PID ( const std::vector< art::Ptr< anab::ParticleID >>  particleIDs,
const geo::GeometryCore geom,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 518 of file FillReco.cxx.

522  {
523  // get the particle ID's
524  for (unsigned i = 0; i < particleIDs.size(); i++) {
525  const anab::ParticleID &particle_id = *particleIDs[i];
526  if (particle_id.PlaneID()) {
527  unsigned plane_id = particle_id.PlaneID().Plane;
528  assert(plane_id < 3);
529  FillPlaneChi2PID(particle_id, srtrack.chi2pid[plane_id]);
530  }
531  }
532  }
const geo::PlaneID & PlaneID() const
Definition: ParticleID.h:67
SRTrkChi2PID chi2pid[3]
Per-plane Chi2 Particle ID.
Definition: SRTrack.h:47
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
void FillPlaneChi2PID(const anab::ParticleID &particle_id, caf::SRTrkChi2PID &srpid)
Definition: FillReco.cxx:477
void caf::FillTrackCRTHit ( const std::vector< art::Ptr< anab::T0 >> &  t0match,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 379 of file FillReco.cxx.

382  {
383  if (t0match.size()) {
384  assert(t0match.size() == 1);
385  srtrack.crthit.distance = t0match[0]->fTriggerConfidence;
386  srtrack.crthit.hit.time = t0match[0]->fTime / 1e3; /* ns -> us */
387 
388  // TODO/FIXME: FILL THESE ONCE WE HAVE THE CRT HIT!!!
389  // srtrack.crthit.hit.position.x = hitmatch[0]->x_pos;
390  // srtrack.crthit.hit.position.y = hitmatch[0]->y_pos;
391  // srtrack.crthit.hit.position.z = hitmatch[0]->z_pos;
392  // srtrack.crthit.hit.position_err.x = hitmatch[0]->x_err;
393  // srtrack.crthit.hit.position_err.y = hitmatch[0]->y_err;
394  // srtrack.crthit.hit.position_err.z = hitmatch[0]->z_err;
395 
396  }
397  }
SRCRTHit hit
The CRT hit.
Definition: SRCRTHitMatch.h:19
float distance
Distance from the projected TPC track to the CRT hit [cm].
Definition: SRCRTHitMatch.h:20
float time
Definition: SRCRTHit.h:20
SRCRTHitMatch crthit
CRT Hit match.
Definition: SRTrack.h:55
void caf::FillTrackCRTTrack ( const std::vector< art::Ptr< anab::T0 >> &  t0match,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 399 of file FillReco.cxx.

402  {
403  if (t0match.size()) {
404  assert(t0match.size() == 1);
405  srtrack.crttrack.angle = t0match[0]->fTriggerConfidence;
406  srtrack.crttrack.time = t0match[0]->fTime / 1e3; /* ns -> us */
407 
408  // TODO/FIXME: FILL MORE ONCE WE HAVE THE CRT HIT!!!
409 
410  }
411  }
SRCRTTrackMatch crttrack
CRT Track match.
Definition: SRTrack.h:56
float angle
Relative angle between the TPC track and CRT track [rad].
float time
Time of the CRT Track [us].
void caf::FillTrackDazzle ( const art::Ptr< sbn::MVAPID dazzle,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 617 of file FillReco.cxx.

620  {
621  srtrack.dazzle.muonScore = dazzle->mvaScoreMap.at(13);
622  srtrack.dazzle.pionScore = dazzle->mvaScoreMap.at(211);
623  srtrack.dazzle.protonScore = dazzle->mvaScoreMap.at(2212);
624  srtrack.dazzle.otherScore = dazzle->mvaScoreMap.at(0);
625 
626  srtrack.dazzle.pdg = dazzle->BestPDG();
627  srtrack.dazzle.bestScore = dazzle->BestScore();
628  }
SRTrackDazzle dazzle
Results from the track PID MVA.
Definition: SRTrack.h:61
void caf::FillTrackMCS ( const recob::Track track,
const std::array< std::vector< art::Ptr< recob::MCSFitResult >>, 4 > &  mcs_results,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 413 of file FillReco.cxx.

417  {
418  // gather MCS fits
419  if (mcs_results[0].size()) {
420  recob::MCSFitResult mcs_fit_muon = *mcs_results[0][0];
421 
422  srtrack.mcsP.fwdP_muon = mcs_fit_muon.fwdMomentum();
423  srtrack.mcsP.fwdP_err_muon = mcs_fit_muon.fwdMomUncertainty();
424  srtrack.mcsP.bwdP_muon = mcs_fit_muon.bwdMomentum();
425  srtrack.mcsP.bwdP_err_muon = mcs_fit_muon.bwdMomUncertainty();
426  }
427 
428  if (mcs_results[1].size()) {
429  recob::MCSFitResult mcs_fit_proton = *mcs_results[1][0];
430 
431  srtrack.mcsP.fwdP_proton = mcs_fit_proton.fwdMomentum();
432  srtrack.mcsP.fwdP_err_proton = mcs_fit_proton.fwdMomUncertainty();
433  srtrack.mcsP.bwdP_proton = mcs_fit_proton.bwdMomentum();
434  srtrack.mcsP.bwdP_err_proton = mcs_fit_proton.bwdMomUncertainty();
435  }
436 
437  if (mcs_results[2].size()) {
438  recob::MCSFitResult mcs_fit_pion = *mcs_results[2][0];
439 
440  srtrack.mcsP.fwdP_pion = mcs_fit_pion.fwdMomentum();
441  srtrack.mcsP.fwdP_err_pion = mcs_fit_pion.fwdMomUncertainty();
442  srtrack.mcsP.bwdP_pion = mcs_fit_pion.bwdMomentum();
443  srtrack.mcsP.bwdP_err_pion = mcs_fit_pion.bwdMomUncertainty();
444  }
445 
446  if (mcs_results[3].size()) {
447  recob::MCSFitResult mcs_fit_kaon = *mcs_results[3][0];
448 
449  srtrack.mcsP.fwdP_kaon = mcs_fit_kaon.fwdMomentum();
450  srtrack.mcsP.fwdP_err_kaon = mcs_fit_kaon.fwdMomUncertainty();
451  srtrack.mcsP.bwdP_kaon = mcs_fit_kaon.bwdMomentum();
452  srtrack.mcsP.bwdP_err_kaon = mcs_fit_kaon.bwdMomUncertainty();
453  }
454  }
float bwdP_muon
Momentum result from end-&gt;start fit for muon [Ge/c].
Definition: SRTrkMCS.h:28
float fwdP_err_kaon
Error on momentum from start-&gt;end fit for kaon [GeV/c].
Definition: SRTrkMCS.h:25
float bwdP_err_proton
Error on momentum from end-&gt;start fit for proton [GeV/c].
Definition: SRTrkMCS.h:36
float bwdMomentum() const
momentum value from fit assuming a backward track direction
Definition: MCSFitResult.h:38
float fwdMomUncertainty() const
momentum uncertainty from fit assuming a forward track direction
Definition: MCSFitResult.h:32
std::size_t size(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:561
float bwdP_pion
Momentum result from end-&gt;start fit for pion [Ge/c].
Definition: SRTrkMCS.h:29
float fwdP_proton
Momentum from start-&gt;end fit for proton [GeV/c].
Definition: SRTrkMCS.h:21
float bwdP_kaon
Momentum result from end-&gt;start fit for kaon [Ge/c].
Definition: SRTrkMCS.h:30
float fwdP_pion
Momentum from start-&gt;end fit for pion [GeV/c].
Definition: SRTrkMCS.h:19
float bwdP_err_muon
Error on momentum from end-&gt;start fit for muon [GeV/c].
Definition: SRTrkMCS.h:33
float fwdP_muon
Momentum from start-&gt;end fit for muon [GeV/c].
Definition: SRTrkMCS.h:18
float bwdP_err_kaon
Error on momentum from end-&gt;start fit for kaon [GeV/c].
Definition: SRTrkMCS.h:35
SRTrkMCS mcsP
Definition: SRTrack.h:51
float bwdP_err_pion
Error on momentum from end-&gt;start fit for pion [GeV/c].
Definition: SRTrkMCS.h:34
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
Definition: MCSFitResult.h:19
float fwdP_err_pion
Error on momentum from start-&gt;end fit for pion [GeV/c].
Definition: SRTrkMCS.h:24
float bwdP_proton
Momentum result from end-&gt;start fit for proton [Ge/c].
Definition: SRTrkMCS.h:31
float bwdMomUncertainty() const
momentum uncertainty from fit assuming a backward track direction
Definition: MCSFitResult.h:41
float fwdP_kaon
Momentum from start-&gt;end fit for kaon [GeV/c].
Definition: SRTrkMCS.h:20
float fwdMomentum() const
momentum value from fit assuming a forward track direction
Definition: MCSFitResult.h:29
float fwdP_err_proton
Error on momentum from start-&gt;end fit for proton [GeV/c].
Definition: SRTrkMCS.h:26
float fwdP_err_muon
Error on momentum from start-&gt;end fit for muon [GeV/c].
Definition: SRTrkMCS.h:23
void caf::FillTrackPlaneCalo ( const anab::Calorimetry calo,
const std::vector< art::Ptr< recob::Hit >> &  hits,
bool  fill_calo_points,
float  fillhit_rrstart,
float  fillhit_rrend,
const detinfo::DetectorPropertiesData dprop,
caf::SRTrackCalo srcalo 
)

Definition at line 534 of file FillReco.cxx.

538  {
539 
540  // Collect info from Calorimetry
541  const std::vector<float> &dqdx = calo.dQdx();
542  const std::vector<float> &dedx = calo.dEdx();
543  const std::vector<float> &pitch = calo.TrkPitchVec();
544  const std::vector<float> &rr = calo.ResidualRange();
545  const std::vector<geo::Point_t> &xyz = calo.XYZ();
546  const std::vector<size_t> &tps = calo.TpIndices();
547 
548  srcalo.charge = 0.;
549  srcalo.ke = 0.;
550  srcalo.nhit = 0;
551 
552  float rrmax = !rr.empty() ? *std::max_element(rr.begin(), rr.end()) : 0.;
553 
554  for (unsigned i = 0; i < dedx.size(); i++) {
555  // Save the points we need to
556  if (fill_calo_points && (
557  (rrmax - rr[i]) < fillhit_rrstart || // near start
558  rr[i] < fillhit_rrend)) { // near end
559 
560  // Point information
562  p.rr = rr[i];
563  p.dqdx = dqdx[i];
564  p.dedx = dedx[i];
565  p.pitch = pitch[i];
566  p.t = dprop.ConvertXToTicks(xyz[i].x(), calo.PlaneID());
567  p.p.x = xyz[i].x();
568  p.p.y = xyz[i].y();
569  p.p.z = xyz[i].z();
570 
571  // lookup the wire -- the Calorimery object makes this
572  // __way__ harder than it should be
573  for (const art::Ptr<recob::Hit> &h: hits) {
574  if (h.key() == tps[i]) {
575  p.wire = h->WireID().Wire;
576  p.sumadc = h->SummedADC();
577  p.integral = h->Integral();
578  }
579  }
580 
581  // Save
582  srcalo.points.push_back(p);
583  }
584 
585  if (dedx[i] > 1000.) continue;
586  srcalo.nhit ++;
587  srcalo.charge += dqdx[i] * pitch[i]; // ADC
588  srcalo.ke += dedx[i] * pitch[i];
589  }
590 
591  // Sort the points by residual range hi->lo
592  std::sort(srcalo.points.begin(), srcalo.points.end(),
593  [](const caf::SRCaloPoint &lhs, const caf::SRCaloPoint &rhs) {
594  return lhs.rr > rhs.rr;
595  });
596 
597  }
float integral
Hit Charge Integral [ADC].
Definition: SRTrackCalo.h:25
process_name opflash particleana ie x
pdgs p
Definition: selectors.fcl:22
SRVector3D p
Position of deposition [cm].
Definition: SRTrackCalo.h:24
const geo::PlaneID & PlaneID() const
Definition: Calorimetry.h:116
const std::vector< Point_t > & XYZ() const
Definition: Calorimetry.h:114
float sumadc
Hit Charge SummedADC [ADC].
Definition: SRTrackCalo.h:26
const std::vector< float > & ResidualRange() const
Definition: Calorimetry.h:103
while getopts h
float dqdx
dE/dx [MeV/cm]
Definition: SRTrackCalo.h:20
float rr
Residual Range [cm].
Definition: SRTrackCalo.h:19
float charge
Deposited charge as seen by wireplane (pre recombination and electric lifetime corrections) [ADC]...
Definition: SRTrackCalo.h:41
const std::vector< float > & dQdx() const
Definition: Calorimetry.h:102
std::vector< SRCaloPoint > points
Information saved per-point.
Definition: SRTrackCalo.h:42
double ConvertXToTicks(double X, int p, int t, int c) const
float dedx
dQ/dx [ADC/cm] – pre calibration and electron lifetime correction
Definition: SRTrackCalo.h:21
const std::vector< float > & dEdx() const
Definition: Calorimetry.h:101
float ke
Kinetic energy deposited on this plane [GeV].
Definition: SRTrackCalo.h:40
const std::vector< size_t > & TpIndices() const
Definition: Calorimetry.h:115
const std::vector< float > & TrkPitchVec() const
Definition: Calorimetry.h:107
float t
Time of deposition [ticks].
Definition: SRTrackCalo.h:23
int nhit
Number of hits on this plane counted in the calorimetry.
Definition: SRTrackCalo.h:39
float pitch
Track pitch [cm].
Definition: SRTrackCalo.h:22
short wire
Wire of Calo-Point.
Definition: SRTrackCalo.h:27
void caf::FillTrackRangeP ( const recob::Track track,
const std::array< std::vector< art::Ptr< sbn::RangeP >>, 3 > &  range_results,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 456 of file FillReco.cxx.

460  {
461  if (range_results[0].size()) {
462  srtrack.rangeP.p_muon = range_results[0][0]->range_p;
463  assert(track.ID() == range_results[0][0]->trackID);
464  }
465 
466  if (range_results[1].size()) {
467  srtrack.rangeP.p_pion = range_results[1][0]->range_p;
468  assert(track.ID() == range_results[1][0]->trackID);
469  }
470 
471  if (range_results[2].size()) {
472  srtrack.rangeP.p_proton = range_results[2][0]->range_p;
473  assert(track.ID() == range_results[2][0]->trackID);
474  }
475  }
std::size_t size(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:561
float p_pion
momentum estimate from trk range (pion hypothesis)
Definition: SRTrkRange.h:18
float p_muon
momentum estimate from trk range (muon hypothesis)
Definition: SRTrkRange.h:17
SRTrkRange rangeP
Definition: SRTrack.h:52
float p_proton
momentum estimate from trk range (proton hypothesis)
Definition: SRTrkRange.h:19
void caf::FillTrackScatterClosestApproach ( const art::Ptr< sbn::ScatterClosestApproach closestapproach,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 599 of file FillReco.cxx.

602  {
603  srtrack.scatterClosestApproach.mean = closestapproach->mean;
604  srtrack.scatterClosestApproach.stdDev = closestapproach->stdDev;
605  srtrack.scatterClosestApproach.max = closestapproach->max;
606  }
SRTrackScatterClosestApproach scatterClosestApproach
Scattering variables relating to spread about interpolated track.
Definition: SRTrack.h:59
void caf::FillTrackStoppingChi2Fit ( const art::Ptr< sbn::StoppingChi2Fit stoppingChi2,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 608 of file FillReco.cxx.

611  {
612  srtrack.stoppingChi2Fit.pol0Chi2 = stoppingChi2->pol0Chi2;
613  srtrack.stoppingChi2Fit.expChi2 = stoppingChi2->expChi2;
614  srtrack.stoppingChi2Fit.pol0Fit = stoppingChi2->pol0Fit;
615  }
SRTrackStoppingChi2Fit stoppingChi2Fit
Fit results from Pol0 and Exp to dEdx vs res. range.
Definition: SRTrack.h:60
void caf::FillTrackTruth ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const std::map< int, caf::HitsEnergy > &  id_hits_map,
const std::vector< caf::SRTrueParticle > &  particles,
const detinfo::DetectorClocksData clockData,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 118 of file FillTrue.cxx.

124  {
125  // Truth matching
126  srtrack.truth = MatchTrack2Truth(clockData, particles, hits, id_hits_map);
127 
128  }//FillTrackTruth
SRTrackTruth truth
truth information
Definition: SRTrack.h:54
caf::SRTrackTruth MatchTrack2Truth(const detinfo::DetectorClocksData &clockData, const std::vector< caf::SRTrueParticle > &particles, const std::vector< art::Ptr< recob::Hit >> &hits, const std::map< int, caf::HitsEnergy > &all_hits_map)
Definition: FillTrue.cxx:1279
void caf::FillTrackVars ( const recob::Track track,
unsigned  producer,
caf::SRTrack srtrack,
bool  allowEmpty 
)

Definition at line 668 of file FillReco.cxx.

672  {
673 
674  srtrack.producer = producer;
675  srtrack.npts = track.CountValidPoints();
676  srtrack.len = track.Length();
677  srtrack.costh = track.StartDirection().Z() / sqrt(track.StartDirection().Mag2());
678  srtrack.phi = track.StartDirection().Phi();
679 
680  srtrack.dir_end.x = track.EndDirection().X();
681  srtrack.dir_end.y = track.EndDirection().Y();
682  srtrack.dir_end.z = track.EndDirection().Z();
683 
684  srtrack.dir.x = track.StartDirection().X();
685  srtrack.dir.y = track.StartDirection().Y();
686  srtrack.dir.z = track.StartDirection().Z();
687 
688  srtrack.start.x = track.Start().X();
689  srtrack.start.y = track.Start().Y();
690  srtrack.start.z = track.Start().Z();
691 
692  srtrack.end.x = track.End().X();
693  srtrack.end.y = track.End().Y();
694  srtrack.end.z = track.End().Z();
695 
696  }
SRVector3D dir
Direction of track at start.
Definition: SRTrack.h:41
unsigned short npts
number of points (recob Track.NPoints)
Definition: SRTrack.h:37
float phi
Angle of the start direction of the track in the x-y plane.
Definition: SRTrack.h:40
unsigned int CountValidPoints() const
Vector_t StartDirection() const
Access to track direction at different points.
double Length(size_t p=0) const
Access to various track properties.
Point_t const & Start() const
Access to track position at different points.
float costh
Costh of start direction of track.
Definition: SRTrack.h:39
SRVector3D start
Start point of track.
Definition: SRTrack.h:43
SRVector3D end
End point of track.
Definition: SRTrack.h:44
float len
track length [cm]
Definition: SRTrack.h:38
SRVector3D dir_end
Direction of track at end.
Definition: SRTrack.h:42
unsigned producer
Index of the producer that produced this object. In ICARUS, this is the same as the cryostat...
Definition: SRTrack.h:36
Vector_t EndDirection() const
Point_t const & End() const
void caf::FillTrigger ( const sbn::ExtraTriggerInfo addltrig_info,
const std::vector< raw::Trigger > &  trig_info,
std::vector< caf::SRTrigger > &  triggerInfo 
)

Definition at line 6 of file FillTrigger.cxx.

9  {
10  uint64_t beam_ts = 0;
11  uint64_t trigger_ts = 0;
12  triggerInfo.emplace_back();
13  triggerInfo.back().global_trigger_time = addltrig_info.triggerTimestamp;
14  triggerInfo.back().beam_gate_time_abs = addltrig_info.beamGateTimestamp;
15  beam_ts = addltrig_info.beamGateTimestamp;
16  trigger_ts = addltrig_info.triggerTimestamp;
17  int64_t diff_ts = trigger_ts - beam_ts;
18  triggerInfo.back().trigger_within_gate = diff_ts;
19  for(const raw::Trigger& trig: trig_info)
20  {
21  triggerInfo.back().beam_gate_det_time = trig.BeamGateTime();
22  triggerInfo.back().global_trigger_det_time = trig.TriggerTime();
23  }
24  }
std::uint64_t beamGateTimestamp
Absolute timestamp of the opening of this beam gate [ns].
std::uint64_t triggerTimestamp
Absolute timestamp of this trigger [ns].
void caf::FillTrueG4Particle ( const simb::MCParticle &  particle,
const std::vector< geo::BoxBoundedGeo > &  active_volumes,
const std::vector< std::vector< geo::BoxBoundedGeo >> &  tpc_volumes,
const std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * >>> &  id_to_ide_map,
const std::map< int, std::vector< art::Ptr< recob::Hit >>> &  id_to_truehit_map,
const cheat::BackTrackerService backtracker,
const cheat::ParticleInventoryService inventory_service,
const std::vector< art::Ptr< simb::MCTruth >> &  neutrinos,
caf::SRTrueParticle srparticle 
)

Definition at line 434 of file FillTrue.cxx.

442  {
443 
444  std::vector<std::pair<geo::WireID, const sim::IDE *>> empty;
445  const std::vector<std::pair<geo::WireID, const sim::IDE *>> &particle_ides = id_to_ide_map.count(particle.TrackId()) ? id_to_ide_map.at(particle.TrackId()) : empty;
446 
447  std::vector<art::Ptr<recob::Hit>> emptyHits;
448  const std::vector<art::Ptr<recob::Hit>> &particle_hits = id_to_truehit_map.count(particle.TrackId()) ? id_to_truehit_map.at(particle.TrackId()) : emptyHits;
449 
450  srparticle.length = 0.;
451  srparticle.crosses_tpc = false;
452  srparticle.wallin = caf::kWallNone;
453  srparticle.wallout = caf::kWallNone;
454 
455  for (unsigned c = 0; c < 2; c++) {
456  SRTrueParticlePlaneInfo init;
457  init.visE = 0.;
458  init.nhit = 0;
459 
460  for (int p = 0; p < 3; p++) {
461  srparticle.plane[c][p] = init;
462  }
463  }
464 
465  for (auto const &ide_pair: particle_ides) {
466  const geo::WireID &w = ide_pair.first;
467  const sim::IDE *ide = ide_pair.second;
468 
469  if(w.Plane >= 0 && w.Plane < 3 && w.Cryostat < 2){
470  srparticle.plane[w.Cryostat][w.Plane].visE += ide->energy / 1000. /* MeV -> GeV*/;
471  }
472  }
473 
474  for (const art::Ptr<recob::Hit> h: particle_hits) {
475  const geo::WireID &w = h->WireID();
476 
477  if(w.Plane >= 0 && w.Plane < 3 && w.Cryostat < 2) {
478  srparticle.plane[w.Cryostat][w.Plane].nhit ++;
479  }
480  }
481 
482  // if no trajectory points, then assume outside AV
483  srparticle.cont_tpc = particle.NumberTrajectoryPoints() > 0;
484  srparticle.contained = particle.NumberTrajectoryPoints() > 0;
485 
486  // Get the entry and exit points
487  int entry_point = -1;
488 
489  int cryostat_index = -1;
490  int tpc_index = -1;
491 
492  for (unsigned j = 0; j < particle.NumberTrajectoryPoints(); j++) {
493  for (unsigned i = 0; i < active_volumes.size(); i++) {
494  if (active_volumes.at(i).ContainsPosition(particle.Position(j).Vect())) {
495  entry_point = j;
496  cryostat_index = i;
497  break;
498  }
499  }
500  if (entry_point != -1) break;
501  }
502  // get the wall
503  if (entry_point > 0) {
504  srparticle.wallin = GetWallCross(active_volumes.at(cryostat_index), particle.Position(entry_point).Vect(), particle.Position(entry_point-1).Vect());
505  }
506 
507  int exit_point = -1;
508 
509  // now setup the cryostat the particle is in
510  std::vector<geo::BoxBoundedGeo> volumes;
511  if (entry_point >= 0) {
512  volumes = tpc_volumes.at(cryostat_index);
513  for (unsigned i = 0; i < volumes.size(); i++) {
514  if (volumes[i].ContainsPosition(particle.Position(entry_point).Vect())) {
515  tpc_index = i;
516  srparticle.cont_tpc = entry_point == 0;
517  break;
518  }
519  }
520  srparticle.contained = entry_point == 0;
521  }
522  // if we couldn't find the initial point, set not contained
523  else {
524  srparticle.contained = false;
525  }
526  if (tpc_index < 0) {
527  srparticle.cont_tpc = false;
528  }
529 
530  // setup aa volumes too for length calc
531  // Define the volume used for length calculation to be the cryostat volume in question
532  std::vector<geoalgo::AABox> aa_volumes;
533  if (entry_point >= 0) {
534  const geo::BoxBoundedGeo &v = active_volumes.at(cryostat_index);
535  aa_volumes.emplace_back(v.MinX(), v.MinY(), v.MinZ(), v.MaxX(), v.MaxY(), v.MaxZ());
536  }
537 
538  // Get the length and determine if any point leaves the active volume
539  //
540  // Use every trajectory point if possible
541  if (entry_point >= 0) {
542  // particle trajectory
543  const simb::MCTrajectory &trajectory = particle.Trajectory();
544  TVector3 pos = trajectory.Position(entry_point).Vect();
545  for (unsigned i = entry_point+1; i < particle.NumberTrajectoryPoints(); i++) {
546  TVector3 this_point = trajectory.Position(i).Vect();
547  // get the exit point
548  // update if particle is contained
549  // check if particle has crossed TPC
550  if (!srparticle.crosses_tpc) {
551  for (unsigned j = 0; j < volumes.size(); j++) {
552  if (volumes[j].ContainsPosition(this_point) && tpc_index >= 0 && j != ((unsigned)tpc_index)) {
553  srparticle.crosses_tpc = true;
554  break;
555  }
556  }
557  }
558  // check if particle has left tpc
559  if (srparticle.cont_tpc) {
560  srparticle.cont_tpc = volumes[tpc_index].ContainsPosition(this_point);
561  }
562 
563  if (srparticle.contained) {
564  srparticle.contained = active_volumes.at(cryostat_index).ContainsPosition(this_point);
565  }
566 
567  // update length
568  srparticle.length += ContainedLength(this_point, pos, aa_volumes);
569 
570  if (!active_volumes.at(cryostat_index).ContainsPosition(this_point) && active_volumes.at(cryostat_index).ContainsPosition(pos)) {
571  exit_point = i-1;
572  }
573 
574  pos = trajectory.Position(i).Vect();
575  }
576  }
577  if (exit_point < 0 && entry_point >= 0) {
578  exit_point = particle.NumberTrajectoryPoints() - 1;
579  }
580  if (exit_point >= 0 && ((unsigned)exit_point) < particle.NumberTrajectoryPoints() - 1) {
581  srparticle.wallout = GetWallCross(active_volumes.at(cryostat_index), particle.Position(exit_point).Vect(), particle.Position(exit_point+1).Vect());
582  }
583 
584  // other truth information
585  srparticle.pdg = particle.PdgCode();
586 
587  srparticle.gen = particle.NumberTrajectoryPoints() ? particle.Position().Vect() : TVector3(-9999, -9999, -9999);
588  srparticle.genT = particle.NumberTrajectoryPoints() ? particle.Position().T() / 1000. /* ns -> us*/: -9999;
589  srparticle.genp = particle.NumberTrajectoryPoints() ? particle.Momentum().Vect(): TVector3(-9999, -9999, -9999);
590  srparticle.genE = particle.NumberTrajectoryPoints() ? particle.Momentum().E(): -9999;
591 
592  srparticle.start = (entry_point >= 0) ? particle.Position(entry_point).Vect(): TVector3(-9999, -9999, -9999);
593  srparticle.startT = (entry_point >= 0) ? particle.Position(entry_point).T() / 1000. /* ns-> us*/: -9999;
594  srparticle.end = (exit_point >= 0) ? particle.Position(exit_point).Vect(): TVector3(-9999, -9999, -9999);
595  srparticle.endT = (exit_point >= 0) ? particle.Position(exit_point).T() / 1000. /* ns -> us */ : -9999;
596 
597  srparticle.startp = (entry_point >= 0) ? particle.Momentum(entry_point).Vect() : TVector3(-9999, -9999, -9999);
598  srparticle.startE = (entry_point >= 0) ? particle.Momentum(entry_point).E() : -9999.;
599  srparticle.endp = (exit_point >= 0) ? particle.Momentum(exit_point).Vect() : TVector3(-9999, -9999, -9999);
600  srparticle.endE = (exit_point >= 0) ? particle.Momentum(exit_point).E() : -9999.;
601 
602  srparticle.start_process = GetG4ProcessID(particle.Process());
603  srparticle.end_process = GetG4ProcessID(particle.EndProcess());
604 
605  srparticle.G4ID = particle.TrackId();
606  srparticle.parent = particle.Mother();
607 
608  // Set the initial cryostat
609  srparticle.cryostat = -1;
610  if (entry_point >= 0) {
611  for (unsigned c = 0; c < active_volumes.size(); c++) {
612  if (active_volumes[c].ContainsPosition(particle.Position(entry_point).Vect())) {
613  srparticle.cryostat = c;
614  break;
615  }
616  }
617  }
618 
619  // Save the daughter particles
620  for (int i_d = 0; i_d < particle.NumberDaughters(); i_d++) {
621  srparticle.daughters.push_back(particle.Daughter(i_d));
622  }
623 
624  // See if this MCParticle matches a genie truth
625  srparticle.interaction_id = -1;
626 
627  art::Ptr<simb::MCTruth> truth = inventory_service.TrackIdToMCTruth_P(particle.TrackId());
628  for (unsigned i = 0; i < neutrinos.size(); i++) {
629  if (truth.get() == neutrinos[i].get()) {
630  srparticle.interaction_id = i;
631  break;
632  }
633  }
634  } //FillTrueG4Particle
float genE
Energy at generation pt [GeV].
double ContainedLength(const TVector3 &v0, const TVector3 &v1, const std::vector< geo::BoxBoundedGeo > &boxes)
Definition: Interaction.cxx:28
unsigned parent
ID&#39;s of parent particle from this particle.
SRVector3D start
Start position in the active TPC volume [cm].
pdgs p
Definition: selectors.fcl:22
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
float endT
End time last point in the active [us – t=0 is spill time].
int cryostat
Cryostat that the particle enters first – -1 if it does not enter a Cryostat.
SRVector3D startp
Momentum at first point in the active TPC volume [GeV/c].
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
bool contained
Whether the particle is contained in a single active volume.
Wall_t wallout
Wall of cryostat particle exits (wNone if stopping in detector)
while getopts h
bool crosses_tpc
Whether the particle crosses a TPC boundary.
SRVector3D genp
Momentum at generation point [GeV/c].
caf::g4_process_ GetG4ProcessID(const std::string &name)
Definition: FillTrue.cxx:1094
Ionization at a point of the TPC sensitive volume.
Definition: SimChannel.h:86
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
g4_process_ end_process
End G4 process of the particle.
float length
Trajectory length in active TPC volume the particle first enters [cm].
numu::Wall GetWallCross(const geo::BoxBoundedGeo &volume, const TVector3 p0, const TVector3 p1)
Definition: NumuReco.cxx:79
float energy
energy deposited by ionization by this track ID and time [MeV]
Definition: SimChannel.h:118
double MinZ() const
Returns the world z coordinate of the start of the box.
float startT
Start time of first TPC point [us – t=0 is spill time].
float genT
Start time of gen point [us – t=0 is spill time].
float endE
Energy at last pt in active TPC volume [GeV].
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
double MaxY() const
Returns the world y coordinate of the end of the box.
int interaction_id
Neutrino interaction ID of the source of this particle (-1 if cosmic)
SRVector3D end
End position in the active TPC volume [cm].
float startE
Energy at first pt in active TPC volume [GeV].
g4_process_ start_process
Start G4 process of the particle.
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
SRVector3D endp
Momentum at last point in the active TPC volume [GeV/c].
Wall_t wallin
Wall of cryostat particle enters (wNone if starting in detector)
double MaxZ() const
Returns the world z coordinate of the end of the box.
int G4ID
ID of the particle (taken from G4 – -1 if this particle is not propogated by G4)
SRVector3D gen
Generation position [cm].
bool cont_tpc
Whether the particle is contained in a single TPC.
std::vector< unsigned > daughters
ID&#39;s of daughter particles from this particle.
int pdg
Particle ID code.
double MinY() const
Returns the world y coordinate of the start of the box.
bool empty(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:555
SRTrueParticlePlaneInfo plane[2][3]
Per-plane, per-cryostat deposition information.
float visE
Sum of energy deposited on plane [GeV].
unsigned int nhit
Number of hits on plane.
void caf::FillTrueNeutrino ( const art::Ptr< simb::MCTruth >  mctruth,
const simb::MCFlux &  mcflux,
const simb::GTruth &  gtruth,
const std::vector< caf::SRTrueParticle > &  srparticles,
const std::map< int, std::vector< art::Ptr< recob::Hit >>> &  id_to_truehit_map,
caf::SRTrueInteraction srneutrino,
size_t  i,
const std::vector< geo::BoxBoundedGeo > &  active_volumes 
)

Definition at line 258 of file FillTrue.cxx.

264  {
265 
266  srneutrino.index = i;
267 
268  for (int c = 0; c < 2; c++) {
269  SRTrueInteractionPlaneInfo init;
270  init.visE = 0.;
271  init.nhit = 0;
272  init.nhitprim = 0;
273 
274  for (int p = 0; p < 3; p++) {
275  srneutrino.plane[c][p] = init;
276  }
277  }
278 
279  for(const caf::SRTrueParticle& part: srparticles){
280  // save the G4 particles that came from this interaction
281  if(part.interaction_id == (int)i) {
282  if(part.start_process == caf::kG4primary) srneutrino.prim.push_back(part);
283 
284  // total up the deposited energy
285  for(int p = 0; p < 3; ++p) {
286  for (int i_cryo = 0; i_cryo < 2; i_cryo++) {
287  srneutrino.plane[i_cryo][p].visE += part.plane[i_cryo][p].visE;
288  }
289  }
290  }
291  }
292  srneutrino.nprim = srneutrino.prim.size();
293 
294  // Set of hits per-plane: primary particles
295  {
296  std::vector<std::array<std::set<unsigned>, 3>> planehitIDs(2);
297  for (unsigned i_part = 0; i_part < srparticles.size(); i_part++) {
298  if (srparticles[i_part].start_process == caf::kG4primary && srparticles[i_part].interaction_id == (int)i) {
299  int track_id = srparticles[i_part].G4ID;
300  // Look for hits
301  if (!id_to_truehit_map.count(track_id)) continue;
302  for (const art::Ptr<recob::Hit> &h: id_to_truehit_map.at(track_id)) {
303  if (!h->WireID()) continue;
304  planehitIDs[h->WireID().Cryostat][h->WireID().Plane].insert(h.key());
305  }
306  }
307  }
308 
309  for(int p = 0; p < 3; ++p) {
310  for (int i_cryo = 0; i_cryo < 2; i_cryo++) {
311  srneutrino.plane[i_cryo][p].nhitprim = planehitIDs[i_cryo][p].size();
312  }
313  }
314  }
315 
316  // Set of hits per-plane: all particles
317  {
318  std::vector<std::array<std::set<unsigned>, 3>> planehitIDs(2);
319  for (unsigned i_part = 0; i_part < srparticles.size(); i_part++) {
320  if (srparticles[i_part].interaction_id == (int)i) {
321  int track_id = srparticles[i_part].G4ID;
322  // Look for hits
323  if (!id_to_truehit_map.count(track_id)) continue;
324  for (const art::Ptr<recob::Hit> &h: id_to_truehit_map.at(track_id)) {
325  if (!h->WireID()) continue;
326  planehitIDs[h->WireID().Cryostat][h->WireID().Plane].insert(h.key());
327  }
328  }
329  }
330 
331  for(int p = 0; p < 3; ++p) {
332  for (int i_cryo = 0; i_cryo < 2; i_cryo++) {
333  srneutrino.plane[i_cryo][p].nhit = planehitIDs[i_cryo][p].size();
334  }
335  }
336  }
337 
338  // Set the GTruth stuff
339  srneutrino.npiplus = gtruth.fNumPiPlus;
340  srneutrino.npiminus = gtruth.fNumPiMinus;
341  srneutrino.npizero = gtruth.fNumPi0;
342  srneutrino.nproton = gtruth.fNumProton;
343  srneutrino.nneutron = gtruth.fNumNeutron;
344  srneutrino.ischarm = gtruth.fIsCharm;
345  srneutrino.isseaquark = gtruth.fIsSeaQuark;
346  srneutrino.resnum = gtruth.fResNum;
347  srneutrino.xsec = gtruth.fXsec;
348 
349  // Set the MCFlux stuff
350  srneutrino.initpdg = mcflux.fntype;
351  srneutrino.baseline = mcflux.fdk2gen + mcflux.fgen2vtx;
352  srneutrino.parent_pdg = mcflux.fptype;
353  srneutrino.parent_dcy_mode = mcflux.fndecay;
354  srneutrino.prod_vtx.x = mcflux.fvx;
355  srneutrino.prod_vtx.y = mcflux.fvy;
356  srneutrino.prod_vtx.z = mcflux.fvz;
357  srneutrino.parent_dcy_mom.x = mcflux.fpdpx;
358  srneutrino.parent_dcy_mom.y = mcflux.fpdpy;
359  srneutrino.parent_dcy_mom.z = mcflux.fpdpz;
360  float Pmass = PDGMass(mcflux.fptype) / 1000.; // MeV -> GeV
361  srneutrino.parent_dcy_E = sqrt(mcflux.fpdpx*mcflux.fpdpx + mcflux.fpdpy*mcflux.fpdpy + mcflux.fpdpz*mcflux.fpdpz + Pmass*Pmass);
362  srneutrino.imp_weight = mcflux.fnimpwt;
363 
364  if (mctruth->NeutrinoSet()) {
365  // Neutrino
366  const simb::MCNeutrino& nu = mctruth->GetNeutrino();
367  srneutrino.isnc = nu.CCNC() && (nu.Mode() != simb::kWeakMix);
368  srneutrino.iscc = (!nu.CCNC()) && (nu.Mode() != simb::kWeakMix);
369  srneutrino.pdg = nu.Nu().PdgCode();
370  srneutrino.targetPDG = nu.Target();
371  srneutrino.hitnuc = nu.HitNuc();
372  srneutrino.genie_mode = (caf::genie_interaction_mode_)nu.Mode();
373  srneutrino.genie_inttype = (caf::genie_interaction_type_)nu.InteractionType();
374  srneutrino.bjorkenX = nu.X();
375  srneutrino.inelasticityY = nu.Y();
376  srneutrino.Q2 = nu.QSqr();
377  srneutrino.w = nu.W();
378  srneutrino.E = nu.Nu().EndMomentum().Energy();
379  srneutrino.momentum = nu.Nu().EndMomentum().Vect();
380  srneutrino.position = nu.Nu().Position().Vect();
381  srneutrino.time = nu.Nu().Position().T() / 1000. /* ns -> us */;
382  srneutrino.genweight = nu.Nu().Weight();
383 
384  const simb::MCParticle& lepton = nu.Lepton();
385  TLorentzVector q_labframe;
386  q_labframe = nu.Nu().EndMomentum() - lepton.Momentum(0);
387  srneutrino.q0_lab = q_labframe.E();
388  srneutrino.modq_lab = q_labframe.P();
389 
390  // make sure the lepton comes first in the list of prim
391  for (unsigned i_part = 0; i_part < srneutrino.prim.size(); i_part++) {
392  if (srneutrino.prim[i_part].pdg == lepton.PdgCode()) {
393  // swap them
394  caf::SRTrueParticle temp = srneutrino.prim[0];
395  srneutrino.prim[0] = srneutrino.prim[i_part];
396  srneutrino.prim[i_part] = temp;
397  break;
398  }
399  }
400 
401  // Set the cryostat of the position
402  for (int icryo = 0; icryo < 2; icryo++) {
403  if (active_volumes[icryo].ContainsPosition(nu.Nu().Position().Vect())) {
404  srneutrino.cryostat = icryo;
405  break;
406  }
407  }
408  }
409 
410  }
float imp_weight
Importance weight from flux file.
unsigned int npiplus
Number of &#39;s after neutrino reaction, before FSI.
float genweight
Weight, if any, assigned by the generator.
int initpdg
Initial PDG code of probe neutrino.
unsigned int nneutron
Number of neutrons after neutrino reaction, before FSI.
bool isseaquark
Did neutrino scatter off a sea quark.
double PDGMass(int pdg)
Definition: FillTrue.cxx:44
SRVector3D parent_dcy_mom
Neutrino parent momentum at decay [GeV; beam coordinates].
float inelasticityY
Inelasticity y.
SRVector3D position
Neutrino interaction position.
float xsec
xsec for thrown interaction, in 1/GeV^2, as stored by the GENIE spline
int resnum
Resonance number, straight from GENIE.
int nprim
Number of primary daughters.
SRVector3D prod_vtx
Neutrino production vertex [cm; beam coordinates].
float E
True energy [GeV].
pdgs p
Definition: selectors.fcl:22
genie_interaction_type_ genie_inttype
Following LARSoft MCNeutrino::InteractionType()
unsigned int nproton
Number of protons after neutrino reaction, before FSI.
genie_interaction_mode_
Definition: SREnums.h:62
int parent_pdg
PDG Code of parent particle ID.
int pdg
PDG code of probe neutrino.
while getopts h
std::vector< SRTrueParticle > prim
Primary daughters, lepton comes first in vector.
unsigned int nhitprim
Number of hits from primary particles on plane.
bool ischarm
Is a charmed quark in interaction.
unsigned int nhit
Number of hits on plane.
SRVector3D momentum
Neutrino three-momentum.
float bjorkenX
Bjorken x = (k-k&#39;)^2/(2*p.q) [Dimensionless].
unsigned int npizero
Number of &#39;s after neutrino reaction, before FSI.
bool isnc
same as LArSoft &quot;ccnc&quot; - 0=CC, 1=NC
genie_interaction_type_
Definition: SREnums.h:82
float w
Hadronic invariant mass W.
SRTrueInteractionPlaneInfo plane[2][3]
Per-plane, per-cryostat deposition information.
float q0_lab
q0, lab frame
bool iscc
CC (true) or NC/interference (false)
float parent_dcy_E
Neutrino parent energy at decay [GeV].
float baseline
Distance from decay to interaction [m].
unsigned int npiminus
Number of &#39;s after neutrino reaction, before FSI.
Representation of a simb::MCParticle, knows energy, direction,.
int index
Index of the matched true neutrino interaction (-1 if not matched to neutrino)
int parent_dcy_mode
Parent hadron/muon decay mode.
genie_interaction_mode_ genie_mode
Interaction mode (as for LArSoft MCNeutrino::Mode() )
BEGIN_PROLOG SN nu
int cryostat
Cryostat the the Interaction originates in. -1 if it originates outside a cryostat.
float visE
Sum of energy deposited on plane [GeV].
float modq_lab
|q|, lab frame
caf::g4_process_ caf::GetG4ProcessID ( const std::string &  name)

Definition at line 1094 of file FillTrue.cxx.

1094  {
1095 #define MATCH_PROCESS(name) if (process_name == #name) {return caf::kG4 ## name;}
1096 #define MATCH_PROCESS_NAMED(strname, id) if (process_name == #strname) {return caf::kG4 ## id;}
1097  MATCH_PROCESS(primary)
1098  MATCH_PROCESS(CoupledTransportation)
1099  MATCH_PROCESS(FastScintillation)
1101  MATCH_PROCESS(anti_neutronInelastic)
1102  MATCH_PROCESS(neutronInelastic)
1103  MATCH_PROCESS(anti_protonInelastic)
1104  MATCH_PROCESS(protonInelastic)
1105  MATCH_PROCESS(hadInelastic)
1106  MATCH_PROCESS_NAMED(kaon+Inelastic, kaonpInelastic)
1107  MATCH_PROCESS_NAMED(kaon-Inelastic, kaonmInelastic)
1108  MATCH_PROCESS_NAMED(kaon+Inelastic, kaonpInelastic)
1109  MATCH_PROCESS_NAMED(kaon-Inelastic, kaonmInelastic)
1110  MATCH_PROCESS_NAMED(sigma+Inelastic, sigmapInelastic)
1111  MATCH_PROCESS_NAMED(sigma-Inelastic, sigmamInelastic)
1112  MATCH_PROCESS_NAMED(pi+Inelastic, pipInelastic)
1113  MATCH_PROCESS_NAMED(pi-Inelastic, pimInelastic)
1114  MATCH_PROCESS_NAMED(xi+Inelastic, xipInelastic)
1115  MATCH_PROCESS_NAMED(xi-Inelastic, ximInelastic)
1116  MATCH_PROCESS(kaon0LInelastic)
1117  MATCH_PROCESS(kaon0SInelastic)
1118  MATCH_PROCESS(lambdaInelastic)
1119  MATCH_PROCESS_NAMED(anti-lambdaInelastic, anti_lambdaInelastic)
1120  MATCH_PROCESS(He3Inelastic)
1121  MATCH_PROCESS(ionInelastic)
1122  MATCH_PROCESS(xi0Inelastic)
1123  MATCH_PROCESS(alphaInelastic)
1124  MATCH_PROCESS(tInelastic)
1125  MATCH_PROCESS(dInelastic)
1126  MATCH_PROCESS(anti_neutronElastic)
1127  MATCH_PROCESS(neutronElastic)
1128  MATCH_PROCESS(anti_protonElastic)
1129  MATCH_PROCESS(protonElastic)
1130  MATCH_PROCESS(hadElastic)
1131  MATCH_PROCESS_NAMED(kaon+Elastic, kaonpElastic)
1132  MATCH_PROCESS_NAMED(kaon-Elastic, kaonmElastic)
1133  MATCH_PROCESS_NAMED(pi+Elastic, pipElastic)
1134  MATCH_PROCESS_NAMED(pi-Elastic, pimElastic)
1135  MATCH_PROCESS(conv)
1136  MATCH_PROCESS(phot)
1137  MATCH_PROCESS(annihil)
1138  MATCH_PROCESS(nCapture)
1139  MATCH_PROCESS(nKiller)
1140  MATCH_PROCESS(muMinusCaptureAtRest)
1141  MATCH_PROCESS(muIoni)
1142  MATCH_PROCESS(eBrem)
1143  MATCH_PROCESS(CoulombScat)
1144  MATCH_PROCESS(hBertiniCaptureAtRest)
1145  MATCH_PROCESS(hFritiofCaptureAtRest)
1146  MATCH_PROCESS(photonNuclear)
1147  MATCH_PROCESS(muonNuclear)
1148  MATCH_PROCESS(electronNuclear)
1149  MATCH_PROCESS(positronNuclear)
1150  MATCH_PROCESS(compt)
1151  MATCH_PROCESS(eIoni)
1152  MATCH_PROCESS(muBrems)
1153  MATCH_PROCESS(hIoni)
1154  MATCH_PROCESS(ionIoni)
1155  MATCH_PROCESS(hBrems)
1156  MATCH_PROCESS(muPairProd)
1157  MATCH_PROCESS(hPairProd)
1158  MATCH_PROCESS(LArVoxelReadoutScoringProcess)
1159  MATCH_PROCESS(Transportation)
1160  MATCH_PROCESS(msc)
1161  MATCH_PROCESS(StepLimiter)
1162  std::cerr << "Error: Process name with no match (" << process_name << ")\n";
1163  assert(false);
1164  return caf::kG4UNKNOWN; // unreachable in debug mode
1165 #undef MATCH_PROCESS
1166 #undef MATCH_PROCESS_NAMED
1167 
1168 }//GetG4ProcessID
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
BEGIN_PROLOG could also be cerr
process_name Decay
pdgs pi
Definition: selectors.fcl:22
#define MATCH_PROCESS(name)
then echo fcl name
#define MATCH_PROCESS_NAMED(strname, id)
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG process_name
caf::Wall_t caf::GetWallCross ( const geo::BoxBoundedGeo volume,
const TVector3  p0,
const TVector3  p1 
)

Definition at line 1052 of file FillTrue.cxx.

1052  {
1053  TVector3 direction = (p1 - p0) * ( 1. / (p1 - p0).Mag());
1054  std::vector<TVector3> intersections = volume.GetIntersections(p0, direction);
1055 
1056  assert(intersections.size() == 2);
1057 
1058  // get the intersection point closer to p0
1059  int intersection_i = ((intersections[0] - p0).Mag() < (intersections[1] - p0).Mag()) ? 0 : 1;
1060 
1061  double eps = 1e-3;
1062  if (abs(intersections[intersection_i].X() - volume.MinX()) < eps) {
1063  //std::cout << "Left\n";
1064  return caf::kWallLeft;
1065  }
1066  else if (abs(intersections[intersection_i].X() - volume.MaxX()) < eps) {
1067  //std::cout << "Right\n";
1068  return caf::kWallRight;
1069  }
1070  else if (abs(intersections[intersection_i].Y() - volume.MinY()) < eps) {
1071  //std::cout << "Bottom\n";
1072  return caf::kWallBottom;
1073  }
1074  else if (abs(intersections[intersection_i].Y() - volume.MaxY()) < eps) {
1075  //std::cout << "Top\n";
1076  return caf::kWallTop;
1077  }
1078  else if (abs(intersections[intersection_i].Z() - volume.MinZ()) < eps) {
1079  //std::cout << "Front\n";
1080  return caf::kWallFront;
1081  }
1082  else if (abs(intersections[intersection_i].Z() - volume.MaxZ()) < eps) {
1083  //std::cout << "Back\n";
1084  return caf::kWallBack;
1085  }
1086  else assert(false);
1087  //std::cout << "None\n";
1088 
1089  return caf::kWallNone;
1090 }//GetWallCross
double MinX() const
Returns the world x coordinate of the start of the box.
Definition: BoxBoundedGeo.h:88
double MaxX() const
Returns the world x coordinate of the end of the box.
Definition: BoxBoundedGeo.h:91
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more echo see *Note or object file format specific echo echo For Mac OS X
T abs(T value)
double MinZ() const
Returns the world z coordinate of the start of the box.
double MaxY() const
Returns the world y coordinate of the end of the box.
double MaxZ() const
Returns the world z coordinate of the end of the box.
do i e
std::vector< TVector3 > GetIntersections(TVector3 const &TrajectoryStart, TVector3 const &TrajectoryDirect) const
Calculates the entry and exit points of a trajectory on the box surface.
double MinY() const
Returns the world y coordinate of the start of the box.
physics associatedGroupsWithLeft p1
caf::SRBNBInfo caf::makeSRBNBInfo ( sbn::BNBSpillInfo const &  info)

Definition at line 7 of file FillExposure.cxx.

8  {
9  caf::SRBNBInfo single_store;
10  single_store.spill_time_sec = info.spill_time_s;
11  single_store.spill_time_nsec = info.spill_time_ns;
12  single_store.event = info.event;
13  single_store.TOR860 = info.TOR860;
14  single_store.TOR875 = info.TOR875;
15  single_store.LM875A = info.LM875A;
16  single_store.LM875B = info.LM875B;
17  single_store.LM875C = info.LM875C;
18  single_store.HP875 = info.HP875;
19  single_store.VP875 = info.VP875;
20  single_store.HPTG1 = info.HPTG1;
21  single_store.VPTG1 = info.VPTG1;
22  single_store.HPTG2 = info.HPTG2;
23  single_store.VPTG2 = info.VPTG2;
24  single_store.BTJT2 = info.BTJT2;
25  single_store.THCURR = info.THCURR;
26  single_store.M875BB = info.M875BB;
27  single_store.M876BB = info.M876BB;
28  single_store.MMBTBB = info.MMBTBB;
29  single_store.M875BB_spill_time_diff = info.M875BB_spill_time_diff;
30  single_store.M876BB_spill_time_diff = info.M876BB_spill_time_diff;
31  single_store.MMBTBB_spill_time_diff = info.MMBTBB_spill_time_diff;
32  return single_store;
33  }
float BTJT2
Temperature of air exiting target, units Deg C.
Definition: SRBNBInfo.h:32
float TOR860
Definition: SRBNBInfo.h:17
float TOR875
Value used for POT accounting.
Definition: SRBNBInfo.h:18
float LM875C
Loss Monitor after the RWM, unit R/s.
Definition: SRBNBInfo.h:22
unsigned long int spill_time_sec
Definition: SRBNBInfo.h:13
float HP875
Horizontal Position Monitor after Mag 875, units mm.
Definition: SRBNBInfo.h:23
float LM875B
Loss Monitor after the RWM, unit R/s.
Definition: SRBNBInfo.h:21
std::vector< int > M875BB
Multiwire station before Mag 875...?
Definition: SRBNBInfo.h:37
float THCURR
Current applied to Horn, units kiloAmperes.
Definition: SRBNBInfo.h:34
unsigned int event
Definition: SRBNBInfo.h:15
std::vector< int > MMBTBB
Multiwire station at the target station,.
Definition: SRBNBInfo.h:39
float LM875A
Loss Monitor before the RWM, unit R/s.
Definition: SRBNBInfo.h:20
unsigned long int spill_time_nsec
Definition: SRBNBInfo.h:14
float VPTG1
Horizontal Position Monitor at Target Station 1, units mm.
Definition: SRBNBInfo.h:27
float HPTG1
Horizontal Position Monitor at Target Station 1, units mm.
Definition: SRBNBInfo.h:26
float M875BB_spill_time_diff
the time difference between M875BB and the matched spill
Definition: SRBNBInfo.h:41
float VP875
Verticle Position Monitor after Mag 875, units mm.
Definition: SRBNBInfo.h:24
std::vector< int > M876BB
Multiwire station after Mag 875...?
Definition: SRBNBInfo.h:38
float HPTG2
Horizontal Position Monitor at Target Station 2, closest to target, units mm.
Definition: SRBNBInfo.h:29
float M876BB_spill_time_diff
the time difference between M876BB and the matched spill
Definition: SRBNBInfo.h:42
float MMBTBB_spill_time_diff
the time difference between MMBTBB and the matched spill
Definition: SRBNBInfo.h:43
float VPTG2
Horizontal Position Monitor at Target Station 2, closest to target, units mm.
Definition: SRBNBInfo.h:30
std::map< int, std::vector< std::pair< geo::WireID, const sim::IDE * > > > caf::PrepSimChannels ( const std::vector< art::Ptr< sim::SimChannel >> &  simchannels,
const geo::GeometryCore geo 
)

Definition at line 685 of file FillTrue.cxx.

685  {
686  std::map<int, std::vector<std::pair<geo::WireID, const sim::IDE*>>> ret;
687 
688  for (const art::Ptr<sim::SimChannel> sc : simchannels) {
689  // Lookup the wire of this channel
690  raw::ChannelID_t channel = sc->Channel();
691  std::vector<geo::WireID> maybewire = geo.ChannelToWire(channel);
692  geo::WireID thisWire; // Default constructor makes invalid wire
693  if (maybewire.size()) thisWire = maybewire[0];
694 
695  for (const auto &item : sc->TDCIDEMap()) {
696  for (const sim::IDE &ide: item.second) {
697  // indexing initializes empty vector
698  ret[abs(ide.trackID)].push_back({thisWire, &ide});
699  }
700  }
701  }
702  return ret;
703  }
TrackID_t trackID
Geant4 supplied track ID.
Definition: SimChannel.h:116
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
T abs(T value)
Ionization at a point of the TPC sensitive volume.
Definition: SimChannel.h:86
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
std::map< int, std::vector< art::Ptr< recob::Hit > > > caf::PrepTrueHits ( const std::vector< art::Ptr< recob::Hit >> &  allHits,
const detinfo::DetectorClocksData clockData,
const cheat::BackTrackerService backtracker 
)

Definition at line 674 of file FillTrue.cxx.

675  {
676  std::map<int, std::vector<art::Ptr<recob::Hit>>> ret;
677  for (const art::Ptr<recob::Hit> h: allHits) {
678  for (int ID: backtracker.HitToTrackIds(clockData, *h)) {
679  ret[abs(ID)].push_back(h);
680  }
681  }
682  return ret;
683  }
std::vector< int > HitToTrackIds(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
while getopts h
T abs(T value)
template<class T >
std::vector<T> caf::PtrVecToVec ( const art::PtrVector< T > &  xs)

Definition at line 16 of file sbncode/sbncode/CAFMaker/Utils.h.

17  {
18  std::vector<T> ret;
19  ret.reserve(xs.size());
20  for(const art::Ptr<T>& x: xs) ret.push_back(*x);
21  return ret;
22  }
process_name opflash particleana ie x
bool caf::SelectSlice ( const caf::SRSlice slice,
bool  cut_clear_cosmic 
)

Definition at line 14 of file FillReco.cxx.

14  {
15  return (!slice.is_clear_cosmic || !cut_clear_cosmic) // No clear cosmics
16  && slice.primary.size() > 0; // must have primary tracks/showers
17  }
std::vector< size_t > primary
ID&#39;s of primary tracks and showers in slice.
Definition: SRSlice.h:53
bool is_clear_cosmic
Whether pandora marks the slice as a &quot;clear&quot; cosmic.
Definition: SRSlice.h:46
void caf::SetNuMuCCPrimary ( std::vector< caf::StandardRecord > &  recs,
std::vector< caf::SRTrueInteraction > &  srneutrinos 
)

Definition at line 765 of file FillReco.cxx.

766  {
767  // // set is_primary to true by default
768  // for (caf::StandardRecord &rec: recs) {
769  // rec.slc.tmatch.is_numucc_primary = true;
770  // }
771 
772  // for (unsigned i = 0; i < srneutrinos.size(); i++) {
773  // ApplyNumuCCMatching(recs, srneutrinos, i);
774  // }
775  }
std::map< int, caf::HitsEnergy > caf::SetupIDHitEnergyMap ( const std::vector< art::Ptr< recob::Hit >> &  allHits,
const detinfo::DetectorClocksData clockData,
const cheat::BackTrackerService backtracker 
)

Definition at line 657 of file FillTrue.cxx.

659  {
660  std::map<int, caf::HitsEnergy> ret;
661 
662  for (const art::Ptr<recob::Hit> h : allHits) {
663  const int hit_trackID = CAFRecoUtils::GetShowerPrimary(TruthMatchUtils::TrueParticleID(clockData, h, true));
664  ++ret[hit_trackID].nHits;
665 
666  for (const sim::TrackIDE ide : backtracker.HitToTrackIDEs(clockData, h)) {
667  const int ide_trackID = CAFRecoUtils::GetShowerPrimary(ide.trackID);
668  ret[ide_trackID].totE += ide.energy;
669  }
670  }
671  return ret;
672  }
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
G4ID TrueParticleID(detinfo::DetectorClocksData const &clockData, const art::Ptr< recob::Hit > &pHit, const bool rollupUnsavedIDs)
The G4 ID of the true particle which deposits the most energy in the recob::Hit.
while getopts h
Ionization energy from a Geant4 track.
Definition: SimChannel.h:26

Variable Documentation

constexpr float caf::kSignalingNaN = std::numeric_limits<float>::signaling_NaN()

Definition at line 8 of file SRConstants.h.

constexpr int caf::kUninitializedInt = -1

Definition at line 9 of file SRConstants.h.