63 Name(
"ClusterModuleLabel"),
64 Comment(
"input tag for the clusters to be dumped")
67 Name(
"OutputCategory"),
68 Comment(
"name of the category used for message facility output"),
73 Comment(
"number of hits per line (0 suppresses hit dumping)"),
102 template <
typename T>
103 size_t StringLength(
const T&
value) {
104 std::ostringstream sstr;
106 return sstr.str().length();
129 = evt.
getValidHandle<std::vector<recob::Cluster>>(ClusterInputTag);
135 <<
"The event contains " << Clusters->size() <<
" '" 136 << ClusterInputTag.
encode() <<
"' clusters";
138 unsigned int iCluster = 0;
139 std::vector<size_t> HitBuffer(
fHitsPerLine), LastBuffer;
141 decltype(
auto) ClusterHits = HitAssn.at(iCluster);
145 <<
"Cluster #" << (iCluster++) <<
" from " << ClusterHits.size()
151 std::vector<size_t> HitIndices;
153 HitIndices.push_back(pHit.key());
154 std::sort(HitIndices.begin(), HitIndices.end());
156 unsigned int Padding = ::StringLength(HitIndices.back());
161 hend = HitIndices.end();
162 size_t RangeStart = *iHit, RangeStop = RangeStart;
163 std::ostringstream output_line;
164 size_t nItemsInLine = 0;
165 while (++iHit != hend) {
167 if (*iHit == RangeStop + 1) {
173 if (RangeStart == RangeStop) {
174 output_line <<
" " << std::setw(Padding) << RangeStart;
178 char fill = (RangeStart + 1 == RangeStop)?
' ':
'-';
179 output_line <<
" " << std::setw(Padding) << RangeStart
181 << std::setw(Padding) << std::setfill(fill) << RangeStop
182 << std::setfill(
' ');
186 RangeStart = RangeStop = *iHit;
199 line_out <<
" " << output_line.str();
200 if (RangeStart == RangeStop)
201 line_out <<
" " << std::setw(Padding) << RangeStart;
203 char fill = (RangeStart + 1 == RangeStop)?
' ':
'-';
204 line_out <<
" " << std::setw(Padding) << RangeStart
206 << std::setw(Padding) << std::setfill(fill) << RangeStop;
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
Reconstruction base classes.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Declaration of signal hit object.
Prints the content of all the clusters on screen.
Set of hits with a 2D structure.
Cluster finding and building.
unsigned int fHitsPerLine
hits per line in the output
fhicl::Atom< art::InputTag > ClusterModuleLabel
#define DEFINE_ART_MODULE(klass)
fhicl::Atom< unsigned int > HitsPerLine
art::InputTag fClusterModuleLabel
tag of the cluster data product
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
EDAnalyzer(Table< Config > const &config)
Declaration of cluster object.
fhicl::Atom< std::string > OutputCategory
std::string value(boost::any const &)
void analyze(const art::Event &evt)
Does the printing.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::string fOutputCategory
category for LogInfo output
DumpClusters(Parameters const &config)
Default constructor.