89 mf::LogWarning(
"TTHitFinder") <<
"IndWidth must be 1 at minimum. Resetting width to one time tick";
93 mf::LogWarning(
"TTHitFinder") <<
"ColWidth must be 1 at minimum. Resetting width to one time tick";
118 std::vector<recob::Wire>
const& wireVec(*wireVecHandle);
127 float threshold_peak = 0;
128 float threshold_tail = -99;
132 for(
unsigned int wireIter = 0; wireIter < wireVec.size(); wireIter++) {
138 std::vector<float> signal(wire->
Signal());
157 float half_width = ((float)width-1)/2.;
162 for(timeIter = signal.begin(); timeIter < signal.end(); timeIter++){
166 if(width%2==1) peak_val = *timeIter;
167 else if(width%2==0) peak_val = 0.5 * (*timeIter + *(timeIter+1));
170 if(peak_val < threshold_peak)
continue;
173 if( time_bin-half_width < 0 )
continue;
174 if( time_bin+half_width > signal.size() )
continue;
177 int begin_tail_tick = std::floor(time_bin-half_width);
178 float totalCharge =
getTotalCharge(&signal[begin_tail_tick],width,threshold_tail);
179 if(totalCharge==-999) {
180 LOG_DEBUG(
"TTHitFinder") <<
"Rejecting would be hit at (plane,wire,time_bin,first_bin,last_bin)=(" 181 << wire_id.
Plane <<
"," << wire_id.
Wire <<
"," << time_bin <<
"," << begin_tail_tick <<
"," << begin_tail_tick+width-1 <<
"): " 182 << signal.at(time_bin-1) <<
" " 183 << signal.at(time_bin) <<
" " 184 << signal.at(time_bin+1);
190 float hit_time = time_bin;
191 if(width%2==0) hit_time = time_bin+0.5;
195 end_tick = hit_time + width;
218 else if(wire_id.
Plane==1)
220 else if(wire_id.
Plane==2)
225 LOG_DEBUG(
"TTHitFinder") <<
"Finished wire " << wire_id.
Wire <<
" (plane " << wire_id.
Plane <<
")" 226 <<
"\tTotal hits (U,V,Y)= (" 227 << hitCollection_U.
size() <<
"," 228 << hitCollection_V.
size() <<
"," 229 << hitCollection_Y.
size() <<
")";
234 mf::LogInfo(
"TTHitFinder") <<
"Total TTHitFinder hits (U,V,Y)=(" 235 << hitCollection_U.
size() <<
"," 236 << hitCollection_V.
size() <<
"," 237 << hitCollection_Y.
size() <<
")";
248 float totalCharge = 0;
249 for(
int tick=0; tick<width; tick++){
250 if(signal_vector[tick] < threshold){
254 totalCharge += signal_vector[tick];
265 #endif // TTHITFINDER_H int fColWidth
Induction wire hit width (in time ticks)
float fMinSigTailInd
Collection wire signal height threshold at peak.
void produce(art::Event &evt)
float fMinSigPeakCol
Induction wire signal height threshold at peak.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
Definition of basic raw digits.
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(ModuleType &producer, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
int TDCtick_t
Type representing a TDC tick.
Class managing the creation of a new recob::Hit object.
Helper functions to create a hit.
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
Enumerate the possible plane projections.
T get(std::string const &key) const
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.
std::string fCalDataModuleLabel
size_t size() const
Returns the number of hits currently in the collection.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
float fMinSigPeakInd
Input caldata module name.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
Declaration of basic channel signal object.
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.
art framework interface to geometry description
float getTotalCharge(const float *, int, float)
Collection wire hit width (in time ticks)
Signal from collection planes.
void reconfigure(fhicl::ParameterSet const &p)