30 #include "canvas/Persistency/Common/FindManyP.h" 36 #include "art_root_io/TFileService.h" 115 fTreere = tfs->make<TTree>(
"entries",
"entries tree");
116 fTree = tfs->make<TTree>(
"DEdx",
"dedx tree");
122 fTree->Branch(
"fRun", &
fRun,
"fRun/I");
123 fTree->Branch(
"fSubRun", &
fSubRun,
"fSubRun/I");
124 fTree->Branch(
"fEvent", &
fEvent,
"fEvent/I");
125 fTree->Branch(
"fCryo", &
fCryo,
"fCryo/I");
126 fTree->Branch(
"fTPC", &
fTPC,
"fTPC/I");
127 fTree->Branch(
"fTrackID", &
fTrackID,
"fTrackID/I");
128 fTree->Branch(
"fView", &
fView,
"fView/I");
129 fTree->Branch(
"fdQdx", &
fdQdx,
"fdQdx/D");
130 fTree->Branch(
"fdEdx", &
fdEdx,
"fdEdx/D");
131 fTree->Branch(
"fdQ", &
fdQ,
"fdQ/D");
132 fTree->Branch(
"fdx", &
fdx,
"fdx/D");
158 const art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trkHandle, e,
fTrackModuleLabel);
165 for (
size_t t = 0;
t < trkHandle->size(); ++
t)
167 auto vhit = fmthm.at(
t);
168 auto vmeta = fmthm.data(
t);
171 CountdEdx(clockData, detProp, vhit, vmeta);
181 for (
size_t h = 0;
h < hits.size(); ++
h)
183 fCryo = hits[
h]->WireID().Cryostat;
184 fTPC = hits[
h]->WireID().TPC;
185 fView = hits[
h]->WireID().Plane;
187 unsigned short plane = hits[
h]->WireID().Plane;
188 unsigned short time = hits[
h]->PeakTime();
190 double dqadc = hits[
h]->Integral();
191 if (!std::isnormal(dqadc) || (dqadc < 0)) dqadc = 0.0;
199 if ((
fdx > 0) && (
fdQ > 0))
code to link reconstructed objects back to the MC truth information
calo::CalorimetryAlg fCalorimetryAlg
DEdxdp(fhicl::ParameterSet const &p)
std::string fHitModuleLabel
EDAnalyzer(fhicl::ParameterSet const &pset)
std::string fTrackModuleLabel
art framework interface to geometry description
DEdxdp & operator=(DEdxdp const &)=delete
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
void reconfigure(fhicl::ParameterSet const &p)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
SubRunNumber_t subRun() const
Declaration of signal hit object.
Contains all timing reference information for the detector.
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
EventNumber_t event() const
Access the description of detector geometry.
auto const & get(AssnsNode< L, R, D > const &r)
double LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
Collection of Physical constants used in LArSoft.
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)
std::string fCalorimetryModuleLabel
void analyze(art::Event const &e) override