13 #include "canvas/Persistency/Common/FindManyP.h" 70 fRcone = pset.get<
double > (
"Rcone");
71 fLcone = pset.get<
double > (
"Lcone");
73 produces< std::vector<recob::Shower> >();
74 produces< art::Assns<recob::Shower, recob::Cluster> >();
75 produces< art::Assns<recob::Shower, recob::Hit> >();
86 std::unique_ptr<std::vector<recob::Shower> > showercol(
new std::vector<recob::Shower>);
108 std::vector<size_t> protoShowers;
110 std::vector< art::Ptr<recob::Hit> > clusterhits;
119 mf::LogInfo(
"ShowerFinder") <<
"Vertex STRENGTH list size = " << vertexStrengthListHandle->size()
120 <<
" AND vertices:" << vertexListHandle->size()
121 <<
"\nCLUSTER list size = " << clusterListHandle->size()
122 <<
" AND Hough: :" << houghListHandle->size();
124 for(
size_t iv = 0; iv < vertexListHandle->size(); ++iv){
128 if(vertex->
ID() == 1 || vertex->
Strength() == 3){
135 double scan_angle = 0;
147 double cone_angle = (TMath::ATan(fRcone / fLcone)) / 2.0;
148 mf::LogInfo(
"ShowerFinder") <<
"Cone Opening Angle: " << (180.0*cone_angle)/TMath::Pi();
149 double compl_angle = 0;
151 unsigned int n_scan =1 + (
int)(TMath::Pi() / (2.0*cone_angle));
152 mf::LogInfo(
"ShowerFinder") <<
"N scan: " << n_scan;
157 int hits_cluster_counter = 0;
163 for(
size_t ivert = 0; ivert < vertSel.
size(); ++ivert){
165 mf::LogInfo(
"ShowerFinder") <<
"Number of STRONG vertices = " << vertSel.
size();
168 xa_cone = vertSel[ivert]->WireID().Wire;
169 ya_cone = vertSel[ivert]->DriftTime();
171 mf::LogInfo(
"ShowerFinder") <<
"Vertex at: (" << xa_cone <<
", " << ya_cone <<
")";
174 for(
unsigned int iscan = 0; iscan < n_scan; ++iscan){
176 mf::LogInfo(
"ShowerFinder") <<
">>>> Start SCAN: " << iscan;
179 scan_angle = (TMath::Pi()/2.0) - (iscan*(2.0*cone_angle));
181 mf::LogInfo(
"ShowerFinder") <<
"Scan Angle: " << (180.*scan_angle)/TMath::Pi();
184 compl_angle = scan_angle - cone_angle;
187 x1_cone = xa_cone + fScone*(std::cos(compl_angle));
188 y1_cone = ya_cone + fScone*(std::sin(compl_angle));
191 x2_cone = xa_cone + fScone*(std::cos(scan_angle + cone_angle));
192 y2_cone = ya_cone + fScone*(std::sin(scan_angle + cone_angle));
195 protoShowers.clear();
196 for(
size_t iclust = 0; iclust < clusterListHandle->size(); ++iclust){
202 clusterhits = fmh.at(iclust);
203 if(clusterhits.size() == 0)
continue;
207 for(
size_t ihits = 0; ihits < clusterhits.size(); ++ihits){
210 x_hit = clusterhits[ihits]->WireID().Wire;
211 y_hit = clusterhits[ihits]->PeakTime();
216 if(y_hit <= ((y2_cone - ya_cone)/(x2_cone - xa_cone))*x_hit + ya_cone &&
217 y_hit >= ((y1_cone - ya_cone)/(x1_cone - xa_cone))*x_hit + ya_cone){
218 hits_cluster_counter++;
224 if(clusterhits.size() == 0)
continue;
225 if(((
double)hits_cluster_counter / (
double)clusterhits.size()) >= 0.5){
226 mf::LogInfo(
"ShowerFinder") <<
"GOT A SHOWER!!! in scan " << iscan
227 <<
" cluster: " << iclust <<
" : " << clust.
ID();
233 protoShowers.push_back(iclust);
236 hits_cluster_counter = 0;
240 if(protoShowers.empty())
continue;
243 double totalCharge = 0.;
245 for(
size_t p = 0;
p < protoShowers.size(); ++
p){
246 const size_t psIndex = protoShowers[
p];
263 showercol->size() - 1, protoShowers.begin(), protoShowers.end());
266 for(
size_t p = 0;
p < protoShowers.size(); ++
p){
267 const size_t psIndex = protoShowers[
p];
268 std::vector< art::Ptr<recob::Hit> > hits = fmh.at(psIndex);
280 mf::LogInfo(
"ShowerFinder") <<
"---> Recorded shower = "<< showercol->size();
std::string fHoughLineModuleLabel
label of module finding hough line
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
EDProducer(fhicl::ParameterSet const &pset)
std::string fVertexModuleLabel
label of module finding 2D endpoint
Set of hits with a 2D structure.
std::string fClusterModuleLabel
label of module finding clusters
art framework interface to geometry description
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
void produce(art::Event &evt)
Detector simulation of raw signals on wires.
Declaration of signal hit object.
std::string fVertexStrengthModuleLabel
label of module finding 2D endpoint
double fRcone
radious of cone for method
ID_t ID() const
Identifier of this cluster.
double fLcone
length of the cone
ShowerFinder(fhicl::ParameterSet const &)
Signal from collection planes.