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

Public Member Functions

 TriggerPrimitiveFinder (fhicl::ParameterSet const &p)
 
 TriggerPrimitiveFinder (TriggerPrimitiveFinder const &)=delete
 
 TriggerPrimitiveFinder (TriggerPrimitiveFinder &&)=delete
 
TriggerPrimitiveFinderoperator= (TriggerPrimitiveFinder const &)=delete
 
TriggerPrimitiveFinderoperator= (TriggerPrimitiveFinder &&)=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< TriggerPrimitiveFinderToolm_finder
 

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 TriggerPrimitiveFinder_module.cc.

Constructor & Destructor Documentation

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

Definition at line 54 of file TriggerPrimitiveFinder_module.cc.

55  : EDProducer{p}, m_inputTag(p.get<std::string>("InputTag", "daq")),
56  m_finder{art::make_tool<TriggerPrimitiveFinderTool>(p.get<fhicl::ParameterSet>("finder"))}
57 {
58  produces<std::vector<recob::Hit>>();
59  produces<art::Assns<raw::RawDigit, recob::Hit>>();
60 }
std::unique_ptr< TriggerPrimitiveFinderTool > m_finder
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
p
Definition: test.py:223
TriggerPrimitiveFinder::TriggerPrimitiveFinder ( TriggerPrimitiveFinder const &  )
delete
TriggerPrimitiveFinder::TriggerPrimitiveFinder ( TriggerPrimitiveFinder &&  )
delete

Member Function Documentation

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

Implements art::EDProducer.

Definition at line 62 of file TriggerPrimitiveFinder_module.cc.

63 {
64  auto const& digits_handle=e.getValidHandle<std::vector<raw::RawDigit>>(m_inputTag);
65  auto& digits_in =*digits_handle;
66 
68  std::vector<std::vector<short>> collection_samples;
69  std::vector<unsigned int> channel_numbers;
70  std::map<raw::ChannelID_t, const raw::RawDigit*> chanToDigit;
71  for(auto&& digit: digits_in){
72  // Select just the collection channels for the primitive-finding algorithm
73  const geo::SigType_t sigType = geo->SignalType(digit.Channel());
74  if(sigType==geo::kCollection){
75  chanToDigit[digit.Channel()]=&digit;
76  channel_numbers.push_back(digit.Channel());
77  collection_samples.push_back(digit.ADCs());
78  }
79  }
80 
81  // Pass the full list of collection channels to the hit finding algorithm
82  std::vector<TriggerPrimitiveFinderTool::Hit> hits=m_finder->findHits(channel_numbers, collection_samples);
83 
84  // Loop over the returned trigger primitives and turn them into recob::Hits
85  recob::HitCollectionCreator hcol(e, false /* doWireAssns */, true /* doRawDigitAssns */);
86  for(auto const& hit : hits){
87  const raw::RawDigit* digit=chanToDigit[hit.channel];
88  if(!digit){
89  std::cout << "No digit with channel " << hit.channel << " found. Did you set the channel correctly?" << std::endl;
90  }
91  std::vector<geo::WireID> wids = geo->ChannelToWire(hit.channel);
92  geo::WireID wid = wids[0];
93 
94  recob::HitCreator lar_hit(*digit, //RAW DIGIT REFERENCE.
95  wid, //WIRE ID.
96  hit.startTime, //START TICK.
97  hit.startTime+hit.timeOverThreshold, //END TICK.
98  hit.timeOverThreshold, //RMS.
99  hit.startTime, //PEAK_TIME.
100  0, //SIGMA_PEAK_TIME.
101  0, //PEAK_AMPLITUDE.
102  0, //SIGMA_PEAK_AMPLITUDE.
103  hit.charge, //HIT_INTEGRAL.
104  0, //HIT_SIGMA_INTEGRAL.
105  hit.charge, //SUMMED CHARGE.
106  0, //MULTIPLICITY.
107  0, //LOCAL_INDEX.
108  0, //WIRE ID.
109  0 //DEGREES OF FREEDOM.
110  );
111  hcol.emplace_back(std::move(lar_hit), art::Ptr<raw::RawDigit>{digits_handle, 0});
112  }
113  hcol.put_into(e);
114 }
std::unique_ptr< TriggerPrimitiveFinderTool > m_finder
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.
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
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

Member Data Documentation

std::unique_ptr<TriggerPrimitiveFinderTool> TriggerPrimitiveFinder::m_finder
private

Definition at line 50 of file TriggerPrimitiveFinder_module.cc.

std::string TriggerPrimitiveFinder::m_inputTag
private

Definition at line 48 of file TriggerPrimitiveFinder_module.cc.


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