Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
novaddt::SupernovaTrigger Class Reference
Inheritance diagram for novaddt::SupernovaTrigger:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 SupernovaTrigger (fhicl::ParameterSet const &p)
 
virtual ~SupernovaTrigger ()
 
virtual bool filter (art::Event &e) override
 
virtual void endJob () override
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Member Functions

uint64_t GetCandidates (const art::Event &e)
 
uint64_t GetTime (const art::Event &e)
 

Private Attributes

bool fVerbose
 
std::string fHeaderTag
 
std::string fSlicesTag
 
SliceSelector fSelector
 
bool fGroupDoRemove
 
size_t fGroupCountMax
 
int fGroupDTmax
 
bool fGroupNeighbours
 

Detailed Description

Definition at line 38 of file SupernovaTrigger_module.cc.

Member Typedef Documentation

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

using art::EDFilter::WorkerType = WorkerT<EDFilter>
inherited

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

novaddt::SupernovaTrigger::SupernovaTrigger ( fhicl::ParameterSet const &  p)
explicit

Definition at line 59 of file SupernovaTrigger_module.cc.

References fGroupCountMax, fGroupDoRemove, fGroupDTmax, fGroupNeighbours, fHeaderTag, fSelector, and fSlicesTag.

59  :
60  fVerbose(p.get<bool>("verbose")),
61  fHeaderTag (p.get< std::string >("header_tag" )),
62  fSlicesTag (p.get< std::string >("slices_tag" )),
63  fSelector (p.get<fhicl::ParameterSet>("slice_cuts")),
64  fGroupDoRemove (p.get<bool>("group.remove",false)),
65  fGroupCountMax (p.get<size_t>("group.size_max",5)),
66  fGroupDTmax (p.get<int>("group.DT_max",3)),
67  fGroupNeighbours (p.get<bool>("group.neighbours",false))
68 {
69  mf::LogInfo("SupernovaTrigger")<<"config:"
70  <<"\n slices_tag: "<<fSlicesTag
71  <<"\n header_tag: "<<fHeaderTag
72  <<"\n slice_cuts: "<<fSelector
73  <<"\n group: "
74  <<"\n \t remove: "<<fGroupDoRemove
75  <<"\n \t neighbours: "<<fGroupNeighbours
76  <<"\n \t size_max: "<<fGroupCountMax
77  <<"\n \t DT_max: "<<fGroupDTmax;
78 
79 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const char * p
Definition: xmltok.h:285
enum BeamMode string
novaddt::SupernovaTrigger::~SupernovaTrigger ( )
virtual

Definition at line 81 of file SupernovaTrigger_module.cc.

82 {
83  // Clean up dynamic memory and other resources here.
84 }

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDFilter::currentContext ( ) const
protectedinherited
void novaddt::SupernovaTrigger::endJob ( )
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 146 of file SupernovaTrigger_module.cc.

References DEFINE_ART_MODULE().

147 {
148 }
bool novaddt::SupernovaTrigger::filter ( art::Event e)
overridevirtual

Implements art::EDFilter.

Definition at line 136 of file SupernovaTrigger_module.cc.

References GetCandidates(), GetTime(), lem_server::msg, and novaddt::SNMessageInterface::PushPoint().

137 {
138  //service to send the data points
140  //send the data
141  msg->PushPoint(GetTime(e),GetCandidates(e));
142  return false;
143 }
uint64_t GetTime(const art::Event &e)
uint64_t GetCandidates(const art::Event &e)
virtual void PushPoint(uint64_t time, uint64_t hits)=0
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
uint64_t novaddt::SupernovaTrigger::GetCandidates ( const art::Event e)
private

subtract large groups of candidates, clustered in time - they are mostly remnants of unreconstructed muon tracks

Definition at line 87 of file SupernovaTrigger_module.cc.

References CalcCluster(), novaddt::SliceSelector::checkCluster(), novaddt::SliceSelector::countPassing(), fGroupCountMax, fGroupDoRemove, fGroupDTmax, fGroupNeighbours, fSelector, fSlicesTag, art::DataViewImpl::getValidHandle(), getGoodRuns4SAM::t0, and getGoodRuns4SAM::t1.

Referenced by filter().

88 {
89 
90  auto slices=e.getValidHandle<std::vector<novaddt::HitList>>(fSlicesTag);
91 
92  if(!fGroupDoRemove)
93  //no Groups removal needed, just simple counting
94  return fSelector.countPassing(*slices);
95 
96 
97  size_t Nselected = 0; //count number of candidates
98  size_t groupCount=0;
99 
100  uint64_t t0=0, t1=0;
101  int dT;
102  ///subtract large groups of candidates, clustered in time -
103  ///they are mostly remnants of unreconstructed muon tracks
104  for(const auto& slice: *slices){
105  auto cluster=CalcCluster(slice);
106  if(fSelector.checkCluster(cluster)==false) continue;
107  t1=cluster.t;
108  dT=t1-t0;
109  if(dT>fGroupDTmax){
110  if(groupCount<fGroupCountMax)Nselected+=groupCount;
111  groupCount=0;
112  }
113  ++groupCount;
114  if(groupCount==1||fGroupNeighbours)t0=t1;
115  mf::LogDebug("SupernovaTrigger")<<Nselected<<" "<<groupCount<<" "<<dT;
116  }
117  if(groupCount<fGroupCountMax)Nselected+=groupCount;
118 
119  mf::LogDebug("SupernovaTrigger")<<"counting slices:"
120  <<"\nNSlices All="<<slices->size()
121  <<"\nNSlices Sel="<<Nselected;
122  //calculate hits in signal region
123  return Nselected;
124 }
clusterInfo CalcCluster(const novaddt::HitList &slice)
Definition: clusterInfo.h:26
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
bool checkCluster(const clusterInfo &c)
Definition: SliceSelector.h:68
size_t countPassing(const std::vector< novaddt::HitList > &slices)
Definition: SliceSelector.h:79
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
uint64_t novaddt::SupernovaTrigger::GetTime ( const art::Event e)
private

Definition at line 126 of file SupernovaTrigger_module.cc.

References art::Event::event(), fHeaderTag, art::DataViewImpl::getByLabel(), submit_syst::header, and novaddt::EventHeader::timeStart.

Referenced by filter().

127 {
128  const uint64_t msec=64000; //TDC ticks/msec
131  return header->timeStart/msec;
132  else
133  return e.event()*5;
134 }
EventNumber_t event() const
Definition: Event.h:67
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

size_t novaddt::SupernovaTrigger::fGroupCountMax
private

Definition at line 54 of file SupernovaTrigger_module.cc.

Referenced by GetCandidates(), and SupernovaTrigger().

bool novaddt::SupernovaTrigger::fGroupDoRemove
private

Definition at line 53 of file SupernovaTrigger_module.cc.

Referenced by GetCandidates(), and SupernovaTrigger().

int novaddt::SupernovaTrigger::fGroupDTmax
private

Definition at line 55 of file SupernovaTrigger_module.cc.

Referenced by GetCandidates(), and SupernovaTrigger().

bool novaddt::SupernovaTrigger::fGroupNeighbours
private

Definition at line 56 of file SupernovaTrigger_module.cc.

Referenced by GetCandidates(), and SupernovaTrigger().

std::string novaddt::SupernovaTrigger::fHeaderTag
private

Definition at line 49 of file SupernovaTrigger_module.cc.

Referenced by GetTime(), and SupernovaTrigger().

SliceSelector novaddt::SupernovaTrigger::fSelector
private

Definition at line 51 of file SupernovaTrigger_module.cc.

Referenced by GetCandidates(), and SupernovaTrigger().

std::string novaddt::SupernovaTrigger::fSlicesTag
private

Definition at line 50 of file SupernovaTrigger_module.cc.

Referenced by GetCandidates(), and SupernovaTrigger().

bool novaddt::SupernovaTrigger::fVerbose
private

Definition at line 48 of file SupernovaTrigger_module.cc.

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


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