All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StubBuilder.h
Go to the documentation of this file.
1 #ifndef StubBuilder_HH
2 #define StubBuilder_HH
3 
4 #include "art/Framework/Principal/Event.h"
5 #include "art/Framework/Principal/Handle.h"
6 #include "canvas/Persistency/Common/FindManyP.h"
7 
24 
25 #include "art/Utilities/make_tool.h"
26 
27 #include <map>
28 #include <memory>
29 
30 namespace sbn {
31 
32 /**
33  * Helper class which takes in data product information from the event and makes stub
34  * objects from hits near the vertex.
35  */
36 class StubBuilder {
37 public:
38  void Setup(const art::Event &e, const art::InputTag &pfplabel, const art::InputTag &trklabel);
39  // Build a 1-Plane stub
40  sbn::Stub FromVertexHit(const art::Ptr<recob::Slice> &slice,
41  const sbn::VertexHit &vhit,
42  const recob::Hit &vhit_hit,
43  const geo::GeometryCore *geo,
44  const spacecharge::SpaceCharge *sce,
45  const detinfo::DetectorClocksData &dclock,
47  const art::Event &e,
48  std::vector<art::Ptr<recob::Hit>> &stub_hits,
49  art::Ptr<recob::PFParticle> &stub_pfp);
50 
51  StubBuilder(fhicl::ParameterSet const& p, bool PositionsAreSCECorrected):
52  fCaloAlg(p),
53  fPositionsAreSCECorrected(PositionsAreSCECorrected),
54  fNormToolConfig(p.get<std::vector<fhicl::ParameterSet>>("NormTools", {}))
55  {
56  for (const fhicl::ParameterSet &p: fNormToolConfig) {
57  fNormTools.push_back(art::make_tool<INormalizeCharge>(p));
58  }
59  }
60 
61 private:
62  // config
65  std::vector<fhicl::ParameterSet> fNormToolConfig;
66  std::vector<std::unique_ptr<INormalizeCharge>> fNormTools;
67 
68  // data holders
69  std::map<unsigned, std::vector<art::Ptr<recob::Hit>>> fSliceHits;
70  std::map<unsigned, std::vector<art::Ptr<recob::PFParticle>>> fSlicePFPs;
71  std::map<unsigned, std::vector<art::Ptr<recob::Track>>> fSliceTrks;
72  std::map<unsigned, std::vector<std::vector<art::Ptr<recob::Hit>>>> fSlicePFPHits;
73  std::map<unsigned, std::vector<std::vector<art::Ptr<recob::Hit>>>> fSliceTrkHits;
74  std::map<unsigned, std::vector<std::vector<const recob::TrackHitMeta *>>> fSliceTrkTHMs;
75 
76  // Helper Function
77  double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0);
78 };
79 
80 } // end namespace sbn
81 #endif
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Definition: UtilFunc.cxx:42
double Normalize(double dQdx, const art::Event &e, const recob::Hit &h, const geo::Point_t &location, const geo::Vector_t &direction, double t0)
std::map< unsigned, std::vector< art::Ptr< recob::PFParticle > > > fSlicePFPs
Definition: StubBuilder.h:70
std::map< unsigned, std::vector< std::vector< art::Ptr< recob::Hit > > > > fSliceTrkHits
Definition: StubBuilder.h:73
void Setup(const art::Event &e, const art::InputTag &pfplabel, const art::InputTag &trklabel)
Declaration of signal hit object.
pdgs p
Definition: selectors.fcl:22
Class to keep data related to recob::Hit associated with recob::Track.
std::vector< std::unique_ptr< INormalizeCharge > > fNormTools
Definition: StubBuilder.h:66
while getopts h
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Access the description of detector geometry.
calo::CalorimetryAlg fCaloAlg
Definition: StubBuilder.h:63
std::map< unsigned, std::vector< std::vector< art::Ptr< recob::Hit > > > > fSlicePFPHits
Definition: StubBuilder.h:72
bool fPositionsAreSCECorrected
Definition: StubBuilder.h:64
StubBuilder(fhicl::ParameterSet const &p, bool PositionsAreSCECorrected)
Definition: StubBuilder.h:51
Description of geometry of one entire detector.
Declaration of cluster object.
Provides recob::Track data product.
std::map< unsigned, std::vector< std::vector< const recob::TrackHitMeta * > > > fSliceTrkTHMs
Definition: StubBuilder.h:74
Contains all timing reference information for the detector.
sbn::Stub FromVertexHit(const art::Ptr< recob::Slice > &slice, const sbn::VertexHit &vhit, const recob::Hit &vhit_hit, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorClocksData &dclock, const detinfo::DetectorPropertiesData &dprop, const art::Event &e, std::vector< art::Ptr< recob::Hit >> &stub_hits, art::Ptr< recob::PFParticle > &stub_pfp)
std::map< unsigned, std::vector< art::Ptr< recob::Hit > > > fSliceHits
Definition: StubBuilder.h:69
do i e
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
Definition: Stub.h:16
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
std::map< unsigned, std::vector< art::Ptr< recob::Track > > > fSliceTrks
Definition: StubBuilder.h:71
std::vector< fhicl::ParameterSet > fNormToolConfig
Definition: StubBuilder.h:65
This is an interface for an art Tool which scales charge by some factor given information about its a...