Classes | Namespaces | Functions
MichelEfinder_module.cc File Reference
#include "art/Framework/Core/EDProducer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Principal/Run.h"
#include "art/Framework/Principal/SubRun.h"
#include "canvas/Utilities/InputTag.h"
#include "fhiclcpp/ParameterSet.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "DDTBaseDataProducts/BaseProducts.h"
#include "DDTBaseDataProducts/HitList.h"
#include "DDTBaseDataProducts/DAQHit.h"
#include "DDTBaseDataProducts/HitSet.h"
#include "DDTBaseDataProducts/CompareDAQHit.h"
#include <memory>
#include <algorithm>

Go to the source code of this file.

Classes

class  novaddt::MichelEfinder
 

Namespaces

 novaddt
 

Functions

bool cmp_tdc (const novaddt::DAQHit &h, const novaddt::TDC &tdc)
 
static std::vector< novaddt::DAQHitfindtrackends2d (const std::vector< novaddt::DAQHit > &trackhits)
 
 __attribute__ ((unused)) static std
 

Function Documentation

__attribute__ ( (unused)  )

Definition at line 186 of file MichelEfinder_module.cc.

References novaddt::DAQHit::Plane(), novaddt::Plane::val, daqchannelmap::X_VIEW, and daqchannelmap::Y_VIEW.

Referenced by osc::analytic::Hermitian< T >::Hermitian(), LZ4_isLittleEndian(), and mouseover().

188 {
189  std::vector<novaddt::DAQHit> answer;
190 
191  // Just in case, bail on no track hits
192  if(trackhits.empty()) return answer;
193 
194  // According to doc-11570, the bottom y cell has number zero.
195  novaddt::DAQHit * lastycell = NULL;
196  {
197  int lowest = 1000;
198  for(const auto & hit: trackhits){
199  if(hit.View().val != daqchannelmap::Y_VIEW) continue;
200  if(hit.Cell().val < lowest){
201  lowest = hit.Cell().val;
202  lastycell = (novaddt::DAQHit*)&hit;
203  }
204  }
205  }
206 
207  // No y hits, return empty vector
208  if(lastycell == NULL) return answer;
209  answer.push_back(*lastycell);
210 
211  // Find out which way the track is going
212  novaddt::DAQHit * someotheryhit = NULL;
213  for(const auto & hit: trackhits){
214  if(hit.View().val != daqchannelmap::Y_VIEW) continue;
215  if(lastycell != (novaddt::DAQHit*)&hit)
216  someotheryhit = (novaddt::DAQHit*)&hit;
217  }
218 
219  const bool increasingplane = someotheryhit == NULL ||
220  lastycell->Plane().val > someotheryhit->Plane().val;
221 
222  // Find ends in x.
223  novaddt::DAQHit * lastxcell = NULL;
224  {
225  int endinest = increasingplane? 0: 10000;
226  for(const auto & hit: trackhits){
227  if(hit.View().val != daqchannelmap::X_VIEW) continue;
228 
229  if(increasingplane ^ (hit.Plane().val < endinest)){
230  endinest= hit.Plane().val;
231  lastxcell = (novaddt::DAQHit*)&hit;
232  }
233  }
234  }
235 
236  // y hits, but no x hits, return vector of size one.
237  if(lastxcell == NULL) return answer;
238  answer.push_back(*lastxcell);
239 
240  return answer;
241 }
novaddt::Plane const & Plane() const
Definition: DAQHit.h:70
Identifier for the Y measuring view of the detector (side)
Identifier for the X measuring view of the detector (top)
value_type val
Definition: BaseProducts.h:84
Definition: structs.h:12
bool cmp_tdc ( const novaddt::DAQHit h,
const novaddt::TDC tdc 
)

Definition at line 102 of file MichelEfinder_module.cc.

References novaddt::DAQHit::TDC().

Referenced by novaddt::MichelEfinder::findmichelexclusion().

102  {
103  return h.TDC()<tdc;
104 }
novaddt::TDC const & TDC() const
Definition: DAQHit.h:74
static std::vector<novaddt::DAQHit> findtrackends2d ( const std::vector< novaddt::DAQHit > &  trackhits)
static

Definition at line 139 of file MichelEfinder_module.cc.

References daqchannelmap::Y_VIEW.

Referenced by novaddt::MichelEfinder::produce().

140 {
141  std::vector<novaddt::DAQHit> answer;
142 
143  // Just in case, bail on no track hits
144  if(trackhits.empty()) return answer;
145 
146  // This is a track in the Y view
147  if(trackhits[0].View().val == daqchannelmap::Y_VIEW){
148  // According to doc-11570, the bottom y cell has number zero.
149  novaddt::DAQHit * lastycell = NULL;
150  {
151  int lowest = 1000;
152  for(const auto & hit: trackhits){
153  if(hit.Cell().val < lowest){
154  lowest = hit.Cell().val;
155  lastycell = (novaddt::DAQHit*)&hit;
156  }
157  }
158  }
159 
160  answer.push_back(*lastycell);
161  return answer;
162  }
163 
164  // This is a track in the X view. Find each end.
165  for(int increasingplane = 0; increasingplane < 2; increasingplane++){
166  novaddt::DAQHit * lastxcell = NULL;
167  {
168  int endiest = increasingplane? 0: 10000;
169  for(const auto & hit: trackhits){
170  if(increasingplane ^ (hit.Plane().val < endiest)){
171  endiest = hit.Plane().val;
172  lastxcell = (novaddt::DAQHit*)&hit;
173  }
174  }
175  }
176  answer.push_back(*lastxcell);
177  }
178 
179  return answer;
180 }
Identifier for the Y measuring view of the detector (side)
Definition: View.py:1
Definition: structs.h:12