Public Member Functions | Private Member Functions | Private Attributes | List of all members
cluster::HoughLineFinderAna Class Reference
Inheritance diagram for cluster::HoughLineFinderAna:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 HoughLineFinderAna (fhicl::ParameterSet const &pset)
 
 ~HoughLineFinderAna ()
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void analyze (const art::Event &)
 
void beginJob ()
 

Private Attributes

std::string fHoughModuleLabel
 
std::string fDigitModuleLabel
 
std::string fHitsModuleLabel
 
std::string fDBScanModuleLabel
 
TTree * ftree
 
int fm_run
 
unsigned long int fm_run_timestamp
 
int fm_event
 
int fm_plane
 
int fm_dbsize
 
int fm_clusterid
 
int fm_wirespan
 
int fm_sizeClusterZ
 
int fm_sizeHitZ
 
float fm_clusterslope
 
float fm_clusterintercept
 
int * fm_wireZ
 
int * fm_hitidZ
 
float * fm_mipZ
 
float * fm_drifttimeZ
 
float * fm_widthZ
 
float * fm_upadcZ
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 39 of file HoughLineFinderAna_module.cc.

Constructor & Destructor Documentation

cluster::HoughLineFinderAna::HoughLineFinderAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 84 of file HoughLineFinderAna_module.cc.

85  : EDAnalyzer(pset)
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"))
90  , fm_run(0)
91  , fm_event(0)
92  , fm_plane(0)
93  , fm_dbsize(0)
94  , fm_clusterid(0)
95  , fm_wirespan(0)
96  , fm_sizeClusterZ(10000)
97  , fm_sizeHitZ(10000)
98  , fm_clusterslope(0)
100  {
101  }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
cluster::HoughLineFinderAna::~HoughLineFinderAna ( )

Member Function Documentation

void cluster::HoughLineFinderAna::analyze ( const art::Event evt)
private

Definition at line 147 of file HoughLineFinderAna_module.cc.

148  {
149 
151  evt.getByLabel(fHoughModuleLabel,hlfListHandle);
152  art::Handle< std::vector<recob::Hit> > hitListHandle;
153  evt.getByLabel(fHitsModuleLabel,hitListHandle);
154  art::Handle< std::vector<recob::Cluster> > dbscanListHandle;
155  evt.getByLabel(fDBScanModuleLabel,dbscanListHandle);
156 
157  art::FindManyP<recob::Hit> fmh(dbscanListHandle, evt, fDBScanModuleLabel);
158  art::FindManyP<recob::Hit> fmhhl(hlfListHandle, evt, fHoughModuleLabel);
159 
162  // art::PtrVector<recob::Hit> hits;// unused, as yet. EC, 5-Oct-2010.
163 
164  for (size_t ii = 0; ii < hlfListHandle->size(); ++ii){
165  art::Ptr<recob::Cluster> cluster(hlfListHandle,ii);
166  clusters.push_back(cluster);
167  }
168 
169  for (size_t ii = 0; ii < dbscanListHandle->size(); ++ii){
170  art::Ptr<recob::Cluster> dbcluster(dbscanListHandle,ii);
171  dbclusters.push_back(dbcluster);
172  }
173 
174  MF_LOG_VERBATIM("HoughLineFinderAna") << "run : " << evt.id().run();
175  //std::cout << "subrun : " << evt.subRun() << std::endl;
176  MF_LOG_VERBATIM("HoughLineFinderAna") << "event : " << evt.id().event();
177  fm_run=evt.id().run();
178  fm_event=evt.id().event();
179  fm_run_timestamp=evt.time().value(); // won't cast, EC, 7-Oct-2010.
180  unsigned int firstwire=0;
181  unsigned int lastwire=0;
182  fm_sizeClusterZ=0;
183  fm_sizeHitZ=0;
184  fm_dbsize=0;
186 
187  for(auto view : geo->Views()){
188 
189  fm_dbsize = 0;
190  fm_sizeClusterZ = clusters.size();
191 
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);
195  fm_dbsize += _dbhits.size();
196  if(_dbhits.size() > 0) fm_plane = _dbhits.at(0)->WireID().Plane;
197  }
198  }
199 
200  for(size_t j = 0; j < clusters.size(); ++j) {
201  if(clusters[j]->View() == view){
202  fm_clusterid=clusters[j]->ID();
203  std::vector< art::Ptr<recob::Hit> > _hits = fmhhl.at(j);
204  fm_clusterslope=(double) std::tan(clusters[j]->StartAngle());
205  fm_clusterintercept=(double)clusters[j]->StartTick();
206  if(_hits.size()!=0){
207  fm_plane = _hits.at(0)->WireID().Plane;
208  firstwire = _hits[0]->WireID().Wire;
209  lastwire = _hits[_hits.size()-1]->WireID().Wire;
210  fm_wirespan = lastwire-firstwire;
211  fm_sizeHitZ = _hits.size();
212 
213  for(unsigned int i = 0; i < _hits.size(); ++i){
214 
215  fm_hitidZ[i] = i;
216  fm_wireZ[i] = _hits[i]->WireID().Wire;
217  fm_mipZ[i] = (double)_hits[i]->Integral();
218  fm_drifttimeZ[i] = (double)_hits[i]->PeakTime();
219  fm_widthZ[i] = (double) (2. * _hits[i]->RMS());
220  fm_upadcZ[i] = (double)_hits[i]->Integral();
221  }
222 
223  ftree->Fill();
224  }
225  }//end if in the correct view
226  }// end loop over clusters
227  }// end loop over views
228 
229  }
AdcChannelData::View View
std::set< geo::View_t > const & Views() const
Returns a list of possible views in the detector.
Cluster finding and building.
constexpr TimeValue_t value() const
Definition: Timestamp.h:23
RunNumber_t run() const
Definition: EventID.h:98
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
Timestamp time() const
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
reference at(size_type n)
Definition: PtrVector.h:359
size_type size() const
Definition: PtrVector.h:302
#define MF_LOG_VERBATIM(category)
EventNumber_t event() const
Definition: EventID.h:116
LArSoft geometry interface.
Definition: ChannelGeo.h:16
EventID id() const
Definition: Event.cc:34
void cluster::HoughLineFinderAna::beginJob ( )
privatevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 115 of file HoughLineFinderAna_module.cc.

116  {
117 
118 
119  // get access to the TFile service
121  ftree= tfs->make<TTree>("HoughTree","HoughTree");
122  fm_hitidZ = new int[fm_sizeHitZ];
123  fm_mipZ = new float[fm_sizeHitZ];
124  fm_drifttimeZ = new float[fm_sizeHitZ];
125  fm_widthZ = new float[fm_sizeHitZ];
126  fm_upadcZ = new float[fm_sizeHitZ];
127  fm_wireZ = new int[fm_sizeHitZ];
128  ftree->Branch("run", &fm_run, "run/I");
129  ftree->Branch("run_timestamp", &fm_run_timestamp, "run_timestamp/l"); //l is for ULong64_t
130  ftree->Branch("event", &fm_event, "event/I");
131  ftree->Branch("plane",&fm_plane,"plane/I");
132  ftree->Branch("dbsize",&fm_dbsize,"dbsize/I");
133  ftree->Branch("clusterid",&fm_clusterid,"clusterid/I");
134  ftree->Branch("clusterslope",&fm_clusterslope,"clusterslope/F");
135  ftree->Branch("clusterintercept",&fm_clusterintercept,"clusterintecept/F");
136  ftree->Branch("wirespan",&fm_wirespan,"wirespan/I");
137  ftree->Branch("numberHits",&fm_sizeHitZ,"numberHits/I");
138  ftree->Branch("numberClusters",&fm_sizeClusterZ,"numberClusters/I");
139  ftree->Branch("hitidZ",fm_hitidZ,"hitidZ[numberHits]/I");
140  ftree->Branch("wireZ",fm_wireZ,"wireZ[numberHits]/I");
141  ftree->Branch("mipZ",fm_mipZ,"mipZ[numberHits]/F");
142  ftree->Branch("drifttimeZ",fm_drifttimeZ,"drifttitmeZ[numberHits]/F");
143  ftree->Branch("widthZ",fm_widthZ,"widthZ[numberHits]/F");
144  }

Member Data Documentation

std::string cluster::HoughLineFinderAna::fDBScanModuleLabel
private

Definition at line 54 of file HoughLineFinderAna_module.cc.

std::string cluster::HoughLineFinderAna::fDigitModuleLabel
private

Definition at line 52 of file HoughLineFinderAna_module.cc.

std::string cluster::HoughLineFinderAna::fHitsModuleLabel
private

Definition at line 53 of file HoughLineFinderAna_module.cc.

std::string cluster::HoughLineFinderAna::fHoughModuleLabel
private

Definition at line 51 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_clusterid
private

Definition at line 61 of file HoughLineFinderAna_module.cc.

float cluster::HoughLineFinderAna::fm_clusterintercept
private

Definition at line 66 of file HoughLineFinderAna_module.cc.

float cluster::HoughLineFinderAna::fm_clusterslope
private

Definition at line 65 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_dbsize
private

Definition at line 60 of file HoughLineFinderAna_module.cc.

float* cluster::HoughLineFinderAna::fm_drifttimeZ
private

Definition at line 70 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_event
private

Definition at line 58 of file HoughLineFinderAna_module.cc.

int* cluster::HoughLineFinderAna::fm_hitidZ
private

Definition at line 68 of file HoughLineFinderAna_module.cc.

float* cluster::HoughLineFinderAna::fm_mipZ
private

Definition at line 69 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_plane
private

Definition at line 59 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_run
private

Definition at line 56 of file HoughLineFinderAna_module.cc.

unsigned long int cluster::HoughLineFinderAna::fm_run_timestamp
private

Definition at line 57 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_sizeClusterZ
private

Definition at line 63 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_sizeHitZ
private

Definition at line 64 of file HoughLineFinderAna_module.cc.

float* cluster::HoughLineFinderAna::fm_upadcZ
private

Definition at line 72 of file HoughLineFinderAna_module.cc.

float* cluster::HoughLineFinderAna::fm_widthZ
private

Definition at line 71 of file HoughLineFinderAna_module.cc.

int cluster::HoughLineFinderAna::fm_wirespan
private

Definition at line 62 of file HoughLineFinderAna_module.cc.

int* cluster::HoughLineFinderAna::fm_wireZ
private

Definition at line 67 of file HoughLineFinderAna_module.cc.

TTree* cluster::HoughLineFinderAna::ftree
private

Definition at line 55 of file HoughLineFinderAna_module.cc.


The documentation for this class was generated from the following file: