20 #include "art/Framework/Core/ModuleMacros.h"
21 #include "art/Framework/Core/EDAnalyzer.h"
22 #include "canvas/Persistency/Common/FindManyP.h"
23 #include "art/Framework/Principal/Event.h"
24 #include "fhiclcpp/ParameterSet.h"
25 #include "art/Framework/Principal/Handle.h"
26 #include "canvas/Persistency/Common/Ptr.h"
27 #include "canvas/Persistency/Common/PtrVector.h"
28 #include "art/Framework/Services/Registry/ServiceHandle.h"
29 #include "art_root_io/TFileService.h"
30 #include "messagefacility/MessageLogger/MessageLogger.h"
48 void analyze(
const art::Event&);
86 , fHoughModuleLabel (pset.
get<
std::string >(
"HoughModuleLabel"))
87 , fDigitModuleLabel (pset.
get<
std::string >(
"DigitModuleLabel"))
88 , fHitsModuleLabel (pset.
get<
std::string >(
"HitsModuleLabel"))
89 , fDBScanModuleLabel(pset.
get<
std::string >(
"DBScanModuleLabel"))
96 , fm_sizeClusterZ(10000)
99 , fm_clusterintercept(0)
120 art::ServiceHandle<art::TFileService const>
tfs;
121 ftree= tfs->make<TTree>(
"HoughTree",
"HoughTree");
139 ftree->Branch(
"hitidZ",fm_hitidZ,
"hitidZ[numberHits]/I");
150 art::Handle< std::vector<recob::Cluster> > hlfListHandle;
152 art::Handle< std::vector<recob::Hit> > hitListHandle;
154 art::Handle< std::vector<recob::Cluster> > dbscanListHandle;
160 art::PtrVector<recob::Cluster> clusters;
161 art::PtrVector<recob::Cluster> dbclusters;
164 for (
size_t ii = 0; ii < hlfListHandle->size(); ++ii){
165 art::Ptr<recob::Cluster>
cluster(hlfListHandle,ii);
166 clusters.push_back(cluster);
169 for (
size_t ii = 0; ii < dbscanListHandle->size(); ++ii){
170 art::Ptr<recob::Cluster>
dbcluster(dbscanListHandle,ii);
171 dbclusters.push_back(dbcluster);
174 MF_LOG_VERBATIM(
"HoughLineFinderAna") <<
"run : " << evt.id().run();
176 MF_LOG_VERBATIM(
"HoughLineFinderAna") <<
"event : " << evt.id().event();
180 unsigned int firstwire=0;
181 unsigned int lastwire=0;
185 art::ServiceHandle<geo::Geometry const> geo;
187 for(
auto view : geo->Views()){
192 for(
size_t j = 0; j < dbclusters.size(); ++j) {
193 if(dbclusters[j]->View() == view){
194 std::vector< art::Ptr<recob::Hit> > _dbhits = fmh.at(j);
196 if(_dbhits.size() > 0)
fm_plane = _dbhits.at(0)->WireID().Plane;
200 for(
size_t j = 0; j < clusters.size(); ++j) {
201 if(clusters[j]->View() == view){
203 std::vector< art::Ptr<recob::Hit> > _hits = fmhhl.at(j);
207 fm_plane = _hits.at(0)->WireID().Plane;
208 firstwire = _hits[0]->WireID().Wire;
209 lastwire = _hits[_hits.size()-1]->WireID().Wire;
213 for(
unsigned int i = 0; i < _hits.size(); ++i){
216 fm_wireZ[i] = _hits[i]->WireID().Wire;
217 fm_mipZ[i] = (double)_hits[i]->Integral();
219 fm_widthZ[i] = (double) (2. * _hits[i]->RMS());
220 fm_upadcZ[i] = (double)_hits[i]->Integral();
236 DEFINE_ART_MODULE(HoughLineFinderAna)
std::string fHitsModuleLabel
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
std::string fDigitModuleLabel
process_name can override from command line with o or output dbcluster
Declaration of signal hit object.
float fm_clusterintercept
std::string fHoughModuleLabel
void analyze(const art::Event &)
Declaration of cluster object.
HoughLineFinderAna(fhicl::ParameterSet const &pset)
std::string fDBScanModuleLabel
unsigned long int fm_run_timestamp
art::ServiceHandle< art::TFileService > tfs
art framework interface to geometry description