20 #include "canvas/Persistency/Common/FindOneP.h" 62 fIndWidth = pset.get<
int >(
"IndWidth", 3);
63 fColWidth = pset.get<
int >(
"ColWidth", 3);
67 mf::LogWarning(
"TTHitFinder") <<
"IndWidth must be 1 at minimum. Resetting width to one time tick";
71 mf::LogWarning(
"TTHitFinder") <<
"ColWidth must be 1 at minimum. Resetting width to one time tick";
96 std::vector<recob::Wire>
const& wireVec(*wireVecHandle);
99 art::FindOneP<raw::RawDigit> WireToRawDigits
105 float threshold_peak = 0;
106 float threshold_tail = -99;
110 for(
unsigned int wireIter = 0; wireIter < wireVec.size(); wireIter++) {
116 std::vector<float> signal(wire->
Signal());
135 float half_width = ((
float)width-1)/2.;
140 for(timeIter = signal.begin(); timeIter < signal.end(); timeIter++){
144 if(width%2==1) peak_val = *timeIter;
145 else if(width%2==0) peak_val = 0.5 * (*timeIter + *(timeIter+1));
148 if(peak_val < threshold_peak)
continue;
151 if( time_bin-half_width < 0 )
continue;
152 if( time_bin+half_width > signal.size() )
continue;
155 int begin_tail_tick = std::floor(time_bin-half_width);
156 float totalCharge =
getTotalCharge(&signal[begin_tail_tick],width,threshold_tail);
157 if(totalCharge==-999) {
158 MF_LOG_DEBUG(
"TTHitFinder") <<
"Rejecting would be hit at (plane,wire,time_bin,first_bin,last_bin)=(" 159 << wire_id.
Plane <<
"," << wire_id.
Wire <<
"," << time_bin <<
"," << begin_tail_tick <<
"," << begin_tail_tick+width-1 <<
"): " 160 << signal.at(time_bin-1) <<
" " 161 << signal.at(time_bin) <<
" " 162 << signal.at(time_bin+1);
168 float hit_time = time_bin;
169 if(width%2==0) hit_time = time_bin+0.5;
173 end_tick = hit_time + width;
196 else if(wire_id.
Plane==1)
198 else if(wire_id.
Plane==2)
203 MF_LOG_DEBUG(
"TTHitFinder") <<
"Finished wire " << wire_id.
Wire <<
" (plane " << wire_id.
Plane <<
")" 204 <<
"\tTotal hits (U,V,Y)= (" 205 << hitCollection_U.
size() <<
"," 206 << hitCollection_V.
size() <<
"," 207 << hitCollection_Y.
size() <<
")";
212 mf::LogInfo(
"TTHitFinder") <<
"Total TTHitFinder hits (U,V,Y)=(" 213 << hitCollection_U.
size() <<
"," 214 << hitCollection_V.
size() <<
"," 215 << hitCollection_Y.
size() <<
")";
226 float totalCharge = 0;
228 if(signal_vector[
tick] < threshold){
232 totalCharge += signal_vector[
tick];
int fColWidth
Induction wire hit width (in time ticks)
float fMinSigTailInd
Collection wire signal height threshold at peak.
float fMinSigPeakCol
Induction wire signal height threshold at peak.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDProducer(fhicl::ParameterSet const &pset)
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
WireID_t Wire
Index of the wire within its plane.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
art framework interface to geometry description
int TDCtick_t
Type representing a TDC tick.
Class managing the creation of a new recob::Hit object.
Helper functions to create a hit.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
A class handling a collection of hits and its associations.
#define DEFINE_ART_MODULE(klass)
Signal from induction planes.
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
enum geo::_plane_sigtype SigType_t
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
void emplace_back(recob::Hit &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >())
Adds the specified hit to the data collection.
PlaneID_t Plane
Index of the plane within its TPC.
float fMinSigTailCol
Induction wire signal height threshold outside peak.
Definition of data types for geometry description.
void put_into(art::Event &)
Moves the data into an event.
Detector simulation of raw signals on wires.
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
ProducesCollector & producesCollector() noexcept
std::string fCalDataModuleLabel
size_t size() const
Returns the number of hits currently in the collection.
float fMinSigPeakInd
Input caldata module name.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Declaration of basic channel signal object.
void produce(art::Event &evt) override
int fIndWidth
Collection wire signal height threshold outside peak.
TTHitFinder(fhicl::ParameterSet const &pset)
recob::Hit && move()
Prepares the constructed hit to be moved away.
float getTotalCharge(const float *, int, float)
Collection wire hit width (in time ticks)
Signal from collection planes.