Static Public Member Functions | List of all members
dune_ana::DUNEAnaHitUtils Class Reference

DUNEAnaHitUtils class. More...

#include <DUNEAnaHitUtils.h>

Inheritance diagram for dune_ana::DUNEAnaHitUtils:
dune_ana::DUNEAnaUtilsBase

Static Public Member Functions

static std::vector< art::Ptr< recob::SpacePoint > > GetSpacePoints (const art::Ptr< recob::Hit > &pHit, const art::Event &evt, const std::string &hitLabel, const std::string &hitToSpacePointLabel)
 Get the space points associated with the hit. More...
 
static std::vector< art::Ptr< recob::Hit > > GetHitsOnPlane (const std::vector< art::Ptr< recob::Hit >> &hits, const geo::PlaneID::PlaneID_t planeID)
 Get all hits on a specific plane. More...
 
static double LifetimeCorrection (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::Ptr< recob::Hit > &pHit)
 get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0 More...
 
static double LifetimeCorrection (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const double timeInTicks, const double t0InMicroS)
 get the lifetime correction for a particular time More...
 
static double LifetimeCorrectedTotalHitCharge (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &hits)
 get the total hit charge, corrected for lifetime More...
 

Additional Inherited Members

- Static Private Member Functions inherited from dune_ana::DUNEAnaUtilsBase
template<typename T >
static std::vector< art::Ptr< T > > GetProductVector (const art::Event &evt, const std::string &label)
 
template<typename T , typename U >
static std::vector< art::Ptr< T > > GetAssocProductVector (const art::Ptr< U > &part, const art::Event &evt, const std::string &label, const std::string &assocLabel)
 
template<typename T , typename U >
static art::Ptr< T > GetAssocProduct (const art::Ptr< U > &part, const art::Event &evt, const std::string &label, const std::string &assocLabel)
 

Detailed Description

DUNEAnaHitUtils class.

Definition at line 30 of file DUNEAnaHitUtils.h.

Member Function Documentation

std::vector< art::Ptr< recob::Hit > > dune_ana::DUNEAnaHitUtils::GetHitsOnPlane ( const std::vector< art::Ptr< recob::Hit >> &  hits,
const geo::PlaneID::PlaneID_t  planeID 
)
static

Get all hits on a specific plane.

Parameters
hitsthe hit vector to be searched for hits on a specific plane
planeIDthe requested plane number
Returns
the hit vector containing hits on a specific plane

Definition at line 31 of file DUNEAnaHitUtils.cxx.

33 {
34  std::vector<art::Ptr<recob::Hit>> hitsOnPlane;
35  std::vector<art::Ptr<recob::Hit>>::const_iterator hitIt = hits.begin();
36  while ((hitIt
37  = std::find_if(hitIt, hits.end(), [planeID](const art::Ptr<recob::Hit> &hit){return hit->WireID().Plane==planeID; }))
38  != hits.end())
39  hitsOnPlane.emplace_back(*(hitIt++));
40  return hitsOnPlane;
41 
42 }
Detector simulation of raw signals on wires.
std::vector< art::Ptr< recob::SpacePoint > > dune_ana::DUNEAnaHitUtils::GetSpacePoints ( const art::Ptr< recob::Hit > &  pHit,
const art::Event evt,
const std::string hitLabel,
const std::string hitToSpacePointLabel 
)
static

Get the space points associated with the hit.

Parameters
pHitis the spacepoint for which we want the hits
evtis the underlying art event
hitLabelis the label for the hit producer
hitToSpacePointLabelis the label for the association between hit and space point
Returns
vector of art::Ptrs to the hits

Definition at line 24 of file DUNEAnaHitUtils.cxx.

27 {
28  return DUNEAnaHitUtils::GetAssocProductVector<recob::SpacePoint>(pHit,evt,hitLabel,hitToSpacePointLabel);
29 }
TCEvent evt
Definition: DataStructs.cxx:7
double dune_ana::DUNEAnaHitUtils::LifetimeCorrectedTotalHitCharge ( detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const std::vector< art::Ptr< recob::Hit > > &  hits 
)
static

get the total hit charge, corrected for lifetime

Parameters
hitsthe vector of hits to be summed over
Returns
the lifetime corrected total hit charge

Definition at line 65 of file DUNEAnaHitUtils.cxx.

68 {
69  double totalHitCharge(0);
70  for (unsigned int iHit = 0; iHit < hits.size(); iHit++)
71  totalHitCharge += hits[iHit]->Integral() * DUNEAnaHitUtils::LifetimeCorrection(clockData, detProp, hits[iHit]);
72 
73  return totalHitCharge;
74 }
static double LifetimeCorrection(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::Ptr< recob::Hit > &pHit)
get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0 ...
double dune_ana::DUNEAnaHitUtils::LifetimeCorrection ( detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const art::Ptr< recob::Hit > &  pHit 
)
static

get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0

Parameters
phitis the hit
Returns
the charge normalisation correction

Definition at line 44 of file DUNEAnaHitUtils.cxx.

47 {
48  return DUNEAnaHitUtils::LifetimeCorrection(clockData, detProp,
49  pHit->PeakTime(), clockData.TriggerTime());
50 }
static double LifetimeCorrection(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::Ptr< recob::Hit > &pHit)
get the lifetime correction for a hit, assumes the detector properties GetTriggerOffset is T0 ...
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
double dune_ana::DUNEAnaHitUtils::LifetimeCorrection ( detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const double  timeInTicks,
const double  t0InMicroS 
)
static

get the lifetime correction for a particular time

Parameters
timeinTicksthe time in ticks
t0InMicroSthe t0 time in micro seconds
Returns
the charge normalisation correction

Definition at line 52 of file DUNEAnaHitUtils.cxx.

55 {
56  const double tpcSamplingRateInMicroS(clockData.TPCClock().TickPeriod());
57  const double tpcTriggerOffsetInTicks(trigger_offset(clockData));
58 
59  const double timeCorrectedForT0((timeInTicks - tpcTriggerOffsetInTicks)*tpcSamplingRateInMicroS - t0InMicroS);
60  const double tauLifetime(detProp.ElectronLifetime());
61 
62  return std::exp(timeCorrectedForT0/tauLifetime);
63 }
int trigger_offset(DetectorClocksData const &data)

The documentation for this class was generated from the following files: