28 #include "canvas/Persistency/Common/FindManyP.h" 34 #include "art_root_io/TFileService.h" 113 fTreere = tfs->make<TTree>(
"entries",
"entries tree");
114 fTree = tfs->make<TTree>(
"dedx",
"dedx tree");
122 fTree->Branch(
"fdQdx", &
fdQdx,
"fdQdx/D");
123 fTree->Branch(
"fdEdx", &
fdEdx,
"fdEdx/D");
124 fTree->Branch(
"fdQ", &
fdQ,
"fdQ/D");
125 fTree->Branch(
"fdx", &
fdx,
"fdx/D");
151 const art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trkHandle, e,
fTrackModuleLabel);
163 for (
size_t t = 0;
t < trkHandle->size(); ++
t)
169 auto vhit = fmthm.at(
t);
170 auto vmeta = fmthm.data(
t);
172 CountdEdx(clockData, detProp, vhit, vmeta);
177 else if (fmthm.isValid())
181 for (
size_t t = 0;
t < trkHandle->size(); ++
t)
183 auto vhit = fmthm.at(
t);
184 auto vmeta = fmthm.data(
t);
186 CountdEdx(clockData, detProp, vhit, vmeta);
196 const std::vector< recob::TrackHitMeta const* > &
data)
198 for (
size_t h = 0;
h < hits.size(); ++
h)
200 unsigned short plane = hits[
h]->WireID().Plane;
201 unsigned short time = hits[
h]->PeakTime();
205 double dqadc = hits[
h]->Integral();
206 if (!std::isnormal(dqadc) || (dqadc < 0)) dqadc = 0.0;
213 if ((
fdx > 0) && (
fdQ > 0))
219 else if ((
fdx == 0) && (
fdQ > 0))
code to link reconstructed objects back to the MC truth information
void analyze(art::Event const &e) override
DEdx(fhicl::ParameterSet const &p)
DEdx & operator=(DEdx const &)=delete
EDAnalyzer(fhicl::ParameterSet const &pset)
void reconfigure(fhicl::ParameterSet const &p)
art framework interface to geometry description
#define DEFINE_ART_MODULE(klass)
void CountdEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &hits, const std::vector< recob::TrackHitMeta const * > &data)
T get(std::string const &key) const
std::string fHitModuleLabel
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
General LArSoft Utilities.
std::string fCalorimetryModuleLabel
Declaration of signal hit object.
Contains all timing reference information for the detector.
std::string fTrackModuleLabel
Provides recob::Track data product.
double dEdx_AREA(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, recob::Hit const &hit, double pitch, double T0=0) const
calo::CalorimetryAlg fCalorimetryAlg
EventNumber_t event() const
Access the description of detector geometry.
size_t fNumberOfTaggedTracks
auto const & get(AssnsNode< L, R, D > const &r)
Collection of Physical constants used in LArSoft.