Public Member Functions | Private Attributes | List of all members
RunningSumTPFinder Class Reference
Inheritance diagram for RunningSumTPFinder:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 RunningSumTPFinder (fhicl::ParameterSet const &p)
 
 RunningSumTPFinder (RunningSumTPFinder const &)=delete
 
 RunningSumTPFinder (RunningSumTPFinder &&)=delete
 
RunningSumTPFinderoperator= (RunningSumTPFinder const &)=delete
 
RunningSumTPFinderoperator= (RunningSumTPFinder &&)=delete
 
void produce (art::Event &e) override
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
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::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- 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 Attributes

std::string m_inputTag
 
std::unique_ptr< RunningSumTPFinderToolm_finder1
 
std::unique_ptr< RunningSumTPFinderToolm_finder2
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- 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 31 of file RunningSumTPFinder_module.cc.

Constructor & Destructor Documentation

RunningSumTPFinder::RunningSumTPFinder ( fhicl::ParameterSet const &  p)
explicit

Definition at line 55 of file RunningSumTPFinder_module.cc.

56  : EDProducer{p}, m_inputTag(p.get<std::string>("InputTag", "daq")),
57  m_finder1{art::make_tool<RunningSumTPFinderTool>(p.get<fhicl::ParameterSet>("finder1"))},
58  m_finder2{art::make_tool<RunningSumTPFinderTool>(p.get<fhicl::ParameterSet>("finder2"))}
59 {
60  produces<std::vector<recob::Hit>>();
61  produces<art::Assns<raw::RawDigit, recob::Hit>>();
62 }
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
std::unique_ptr< RunningSumTPFinderTool > m_finder1
p
Definition: test.py:223
std::unique_ptr< RunningSumTPFinderTool > m_finder2
RunningSumTPFinder::RunningSumTPFinder ( RunningSumTPFinder const &  )
delete
RunningSumTPFinder::RunningSumTPFinder ( RunningSumTPFinder &&  )
delete

Member Function Documentation

RunningSumTPFinder& RunningSumTPFinder::operator= ( RunningSumTPFinder const &  )
delete
RunningSumTPFinder& RunningSumTPFinder::operator= ( RunningSumTPFinder &&  )
delete
void RunningSumTPFinder::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 64 of file RunningSumTPFinder_module.cc.

65 {
66  auto const& digits_handle=e.getValidHandle<std::vector<raw::RawDigit>>(m_inputTag);
67  auto& digits_in =*digits_handle;
68 
70  std::vector<std::vector<short>> induction_samples;
71  std::vector<std::vector<short>> collection_samples;
72  std::vector<unsigned int> induction_channel_numbers;
73  std::vector<unsigned int> collection_channel_numbers;
74  std::map<raw::ChannelID_t, const raw::RawDigit*> indChanToDigit;
75  std::map<raw::ChannelID_t, const raw::RawDigit*> colChanToDigit;
76  for(auto&& digit: digits_in){
77  // Select just the collection channels for the primitive-finding algorithm
78  const geo::SigType_t sigType = geo->SignalType(digit.Channel());
79  if(sigType==geo::kInduction){
80  indChanToDigit[digit.Channel()]=&digit;
81  induction_channel_numbers.push_back(digit.Channel());
82  induction_samples.push_back(digit.ADCs());
83  }
84  if(sigType==geo::kCollection){
85  colChanToDigit[digit.Channel()]=&digit;
86  collection_channel_numbers.push_back(digit.Channel());
87  collection_samples.push_back(digit.ADCs());
88  }
89  }
90 
91  // Pass the full list of collection channels to the hit finding algorithm
92  std::vector<RunningSumTPFinderTool::Hit> hits1=m_finder1->findHits( induction_channel_numbers, induction_samples);
93  std::vector<RunningSumTPFinderTool::Hit> hits2=m_finder2->findHits(collection_channel_numbers, collection_samples);
94 
95  // Loop over the returned trigger primitives and turn them into recob::Hits
96  recob::HitCollectionCreator hcol(e, false /* doWireAssns */, true /* doRawDigitAssns */);
97  for(auto const& hit : hits1){
98  const raw::RawDigit* digit=indChanToDigit[hit.channel];
99  if(!digit){
100  std::cout << "No digit with channel " << hit.channel << " found. Did you set the channel correctly?" << std::endl;
101  }
102  std::vector<geo::WireID> wids = geo->ChannelToWire(hit.channel);
103  geo::WireID wid = wids[0];
104 
105  recob::HitCreator lar_hit(*digit, //RAW DIGIT REFERENCE.
106  wid, //WIRE ID.
107  hit.startTime, //START TICK.
108  hit.startTime+hit.timeOverThreshold, //END TICK.
109  hit.timeOverThreshold, //RMS.
110  hit.startTime, //PEAK_TIME.
111  0, //SIGMA_PEAK_TIME.
112  0, //PEAK_AMPLITUDE.
113  0, //SIGMA_PEAK_AMPLITUDE.
114  hit.charge, //HIT_INTEGRAL.
115  0, //HIT_SIGMA_INTEGRAL.
116  hit.charge, //SUMMED CHARGE.
117  0, //MULTIPLICITY.
118  0, //LOCAL_INDEX.
119  0, //WIRE ID.
120  0 //DEGREES OF FREEDOM.
121  );
122  hcol.emplace_back(std::move(lar_hit), art::Ptr<raw::RawDigit>{digits_handle, 0});
123  }
124  // Loop over the returned trigger primitives and turn them into recob::Hits
125  for(auto const& hit : hits2){
126  const raw::RawDigit* digit=colChanToDigit[hit.channel];
127  if(!digit){
128  std::cout << "No digit with channel " << hit.channel << " found. Did you set the channel correctly?" << std::endl;
129  }
130  std::vector<geo::WireID> wids = geo->ChannelToWire(hit.channel);
131  geo::WireID wid = wids[0];
132 
133  recob::HitCreator lar_hit(*digit, //RAW DIGIT REFERENCE.
134  wid, //WIRE ID.
135  hit.startTime, //START TICK.
136  hit.startTime+hit.timeOverThreshold, //END TICK.
137  hit.timeOverThreshold, //RMS.
138  hit.startTime, //PEAK_TIME.
139  0, //SIGMA_PEAK_TIME.
140  0, //PEAK_AMPLITUDE.
141  0, //SIGMA_PEAK_AMPLITUDE.
142  hit.charge, //HIT_INTEGRAL.
143  0, //HIT_SIGMA_INTEGRAL.
144  hit.charge, //SUMMED CHARGE.
145  0, //MULTIPLICITY.
146  0, //LOCAL_INDEX.
147  0, //WIRE ID.
148  0 //DEGREES OF FREEDOM.
149  );
150  hcol.emplace_back(std::move(lar_hit), art::Ptr<raw::RawDigit>{digits_handle, 0});
151  }
152  hcol.put_into(e);
153 }
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
std::unique_ptr< RunningSumTPFinderTool > m_finder1
Class managing the creation of a new recob::Hit object.
Definition: HitCreator.h:83
A class handling a collection of hits and its associations.
Definition: HitCreator.h:508
Signal from induction planes.
Definition: geo_types.h:145
enum geo::_plane_sigtype SigType_t
def move(depos, offset)
Definition: depos.py:107
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
Detector simulation of raw signals on wires.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
QTextStream & endl(QTextStream &s)
Signal from collection planes.
Definition: geo_types.h:146
std::unique_ptr< RunningSumTPFinderTool > m_finder2

Member Data Documentation

std::unique_ptr<RunningSumTPFinderTool> RunningSumTPFinder::m_finder1
private

Definition at line 50 of file RunningSumTPFinder_module.cc.

std::unique_ptr<RunningSumTPFinderTool> RunningSumTPFinder::m_finder2
private

Definition at line 51 of file RunningSumTPFinder_module.cc.

std::string RunningSumTPFinder::m_inputTag
private

Definition at line 48 of file RunningSumTPFinder_module.cc.


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