SliceRemover.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file: SliceRemover.cxx
3 // \brief Remove hits associated with slices.
4 // \author Justin Vasel <justin.vasel@gmail.com>
5 // \date 2020-01-21
6 ////////////////////////////////////////////////////////////////////////
7 
8 // ART includes
13 #include "fhiclcpp/ParameterSet.h"
14 
15 // ROOT includes
16 #include "TVector3.h"
17 
18 // NOvASOFT includes
19 #include "RecoBase/CellHit.h"
20 #include "RecoBase/Cluster.h"
23 
24 // ............................................................................
26 fVetoMap(vetoMap),
27 fNumRemoved(0)
28 {
29 }
30 
31 // ............................................................................
33 
34 // ............................................................................
35 void sn::SliceRemover::remove(std::vector<art::Ptr<rb::CellHit>>& hits, std::vector<art::Ptr<rb::Cluster>>& clusters)
36 {
37  std::cout << "Cleaning up " << clusters.size() << " clusters." << std::endl;
38  for (size_t clusterId=0; clusterId<clusters.size(); ++clusterId) {
39  art::Ptr<rb::Cluster> cluster = clusters.at(clusterId);
40 
41  if (cluster->IsNoise()) continue;
42 
43  art::PtrVector<rb::CellHit> clusterHits = cluster->AllCells();
44  for (art::Ptr<rb::CellHit> clusterHit : clusterHits) {
45  this->fVetoMap.AddHit(*clusterHit);
46  ++this->fNumRemoved;
47  }
48  }
49 
50  return;
51 }
void remove(std::vector< art::Ptr< rb::CellHit >> &hits, std::vector< art::Ptr< rb::Cluster >> &clusters)
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
void hits()
Definition: readHits.C:15
SliceRemover(sn::HitVetoMap &vetoMap)
void AddHit(rawdata::RawDigit h)
Definition: HitVetoMap.cxx:27
OStream cout
Definition: OStream.cxx:6
sn::HitVetoMap & fVetoMap
Definition: SliceRemover.h:33
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163