All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cluster::HoughLineFinderAna Class Reference
Inheritance diagram for cluster::HoughLineFinderAna:

Public Member Functions

 HoughLineFinderAna (fhicl::ParameterSet const &pset)
 
 ~HoughLineFinderAna ()
 

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
 

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  }
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 
150  art::Handle< std::vector<recob::Cluster> > hlfListHandle;
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 
160  art::PtrVector<recob::Cluster> clusters;
161  art::PtrVector<recob::Cluster> dbclusters;
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;
185  art::ServiceHandle<geo::Geometry const> geo;
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  }
unsigned int event
Definition: DataStructs.h:634
unsigned int run
Definition: DataStructs.h:635
process_name cluster
Definition: cheaterreco.fcl:51
process_name can override from command line with o or output dbcluster
Definition: pid.fcl:40
BEGIN_PROLOG StartTick
TCEvent evt
Definition: DataStructs.cxx:8
void cluster::HoughLineFinderAna::beginJob ( )
private

Definition at line 115 of file HoughLineFinderAna_module.cc.

116  {
117 
118 
119  // get access to the TFile service
120  art::ServiceHandle<art::TFileService const> tfs;
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  }
art::ServiceHandle< art::TFileService > tfs

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: