All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
icaruscode/icaruscode/RecoUtils/RecoUtils.h
Go to the documentation of this file.
1 #ifndef FDSELECTIONUTILS_H_SEEN
2 #define FDSELECTIONUTILS_H_SEEN
3 
4 
5 ///////////////////////////////////////////////
6 // RecoUtils.h
7 //
8 // A few reco utilities like truth matching
9 // D Brailsford (adapted from work by D Brailsford and M Wallbank), October 2017
10 ///////////////////////////////////////////////
11 
12 // framework
13 #include "art/Framework/Principal/Event.h"
14 #include "fhiclcpp/ParameterSet.h"
15 #include "art/Framework/Principal/Handle.h"
16 #include "canvas/Persistency/Common/Ptr.h"
17 #include "canvas/Persistency/Common/PtrVector.h"
18 #include "art/Framework/Services/Registry/ServiceHandle.h"
19 #include "art_root_io/TFileService.h"
20 #include "art_root_io/TFileDirectory.h"
21 #include "messagefacility/MessageLogger/MessageLogger.h"
22 #include "canvas/Persistency/Common/FindManyP.h"
23 
24 // LArSoft
25 #include "nusimdata/SimulationBase/MCParticle.h"
26 #include "nusimdata/SimulationBase/MCTruth.h"
28 //#include "lardataobj/RecoBase/Track.h"
29 //#include "lardataobj/RecoBase/Shower.h"
30 //#include "lardataobj/AnalysisBase/MVAPIDResult.h"
31 //#include "lardataobj/AnalysisBase/ParticleID.h"
34 namespace detinfo {
35  class DetectorClocksData;
36 }
37 
38 // c++
39 #include <vector>
40 #include <map>
41 
42 // ROOT
43 #include "TTree.h"
44 
45 
46 namespace RecoUtils{
47  int TrueParticleID(const detinfo::DetectorClocksData& clockData,
48  const art::Ptr<recob::Hit>& hit); //Returns the geant4 ID which contributes the most to a single reco hit. The matching method looks for true particle which deposits the most true energy in the reco hit
50  const std::vector<art::Ptr<recob::Hit> >& hits); //Returns the geant4 ID which contributes the most to the vector of hits. The matching method looks for which true particle deposits the most true energy in the reco hits
52  const std::vector<art::Ptr<recob::Hit> >& hits); //Returns the geant4 ID which contributes the most to the vector of hits. The matching method looks for which true particle contributes the most reconstructed charge to the hit selection (the reco charge of each hit is correlated with each maximally contributing true particle and summed)
54  const std::vector<art::Ptr<recob::Hit> >& hits); //Returns the geant4 ID which contributes the most to the vector of hits. The matching method looks for which true particle maximally contributes to the most reco hits
55  bool IsInsideTPC(TVector3 position, double distance_buffer); //Checks if a position is within any of the TPCs in the geometry (user can define some distance buffer from the TPC walls)
56 }
57 
58 #endif
int TrueParticleIDFromTotalTrueEnergy(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
Declaration of signal hit object.
process_name hit
Definition: cheaterreco.fcl:51
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
int TrueParticleIDFromTotalRecoHits(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
Contains all timing reference information for the detector.
int TrueParticleIDFromTotalRecoCharge(detinfo::DetectorClocksData const &clockData, const std::vector< art::Ptr< recob::Hit > > &hits, bool rollup_unsaved_ids=1)
art framework interface to geometry description
int TrueParticleID(detinfo::DetectorClocksData const &clockData, const art::Ptr< recob::Hit > hit, bool rollup_unsaved_ids=1)
bool IsInsideTPC(TVector3 position, double distance_buffer)