Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
calib::SumSubrunsCalib Class Reference

Sum up AttenProfilesMap objects. More...

Inheritance diagram for calib::SumSubrunsCalib:
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

 SumSubrunsCalib (const fhicl::ParameterSet &pset)
 
 ~SumSubrunsCalib ()
 
void reconfigure (const fhicl::ParameterSet &pset)
 
virtual bool filter (art::Event &evt)
 
virtual bool endSubRun (art::SubRun &sr)
 
virtual bool endRun (art::Run &run)
 
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
 

Protected Attributes

std::string fAttenHistsMapLabel
 
int fMinBlock
 
int fMaxBlock
 
std::map< int, std::unique_ptr< caldp::AttenProfilesMap > > fChannelMapProf
 

Detailed Description

Sum up AttenProfilesMap objects.

Definition at line 20 of file SumSubrunsCalib_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

calib::SumSubrunsCalib::SumSubrunsCalib ( const fhicl::ParameterSet pset)
explicit

Definition at line 40 of file SumSubrunsCalib_module.cc.

References elec2geo::block, fMaxBlock, fMinBlock, genie::utils::style::Format(), and reconfigure().

41  {
42  reconfigure(pset);
43 
44  for(int block = fMinBlock; block <= fMaxBlock; ++block){
45  produces<caldp::AttenProfilesMap, art::InRun>(TString::Format("block%d", block).Data());
46  }
47  }
block
print "ROW IS " print row
Definition: elec2geo.py:31
void reconfigure(const fhicl::ParameterSet &pset)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
calib::SumSubrunsCalib::~SumSubrunsCalib ( )

Definition at line 50 of file SumSubrunsCalib_module.cc.

51  {
52  }

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
bool calib::SumSubrunsCalib::endRun ( art::Run run)
virtual

Reimplemented from art::EDFilter.

Definition at line 87 of file SumSubrunsCalib_module.cc.

References elec2geo::block, DEFINE_ART_MODULE(), fChannelMapProf, genie::utils::style::Format(), it, and art::Run::put().

Referenced by filter().

88  {
89  for(auto& it: fChannelMapProf){
90  const int block = it.first;
91  run.put(std::move(it.second), TString::Format("block%d", block).Data());
92  }
93 
94  // Don't double count if run over more than one run
95  fChannelMapProf.clear();
96 
97  return true;
98  }
set< int >::iterator it
art::ProductID put(std::unique_ptr< PROD > &&)
Definition: Run.h:149
block
print "ROW IS " print row
Definition: elec2geo.py:31
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
std::map< int, std::unique_ptr< caldp::AttenProfilesMap > > fChannelMapProf
bool calib::SumSubrunsCalib::endSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDFilter.

Definition at line 68 of file SumSubrunsCalib_module.cc.

References elec2geo::block, art::Handle< T >::failedToGet(), fAttenHistsMapLabel, fChannelMapProf, fMaxBlock, fMinBlock, genie::utils::style::Format(), art::DataViewImpl::getByLabel(), caldp::AttenProfilesMap::MaxW(), caldp::AttenProfilesMap::MinW(), and art::DataViewImpl::removeCachedProduct().

Referenced by filter().

69  {
70  for(int block = fMinBlock; block <= fMaxBlock; ++block){
72  sr.getByLabel(fAttenHistsMapLabel, TString::Format("block%d", block).Data(), profsmap);
73  if(profsmap.failedToGet()) continue;
74 
75  if(!fChannelMapProf[block]) fChannelMapProf[block] = std::unique_ptr<caldp::AttenProfilesMap>(new caldp::AttenProfilesMap(profsmap->MinW(), profsmap->MaxW()));
76 
77  *fChannelMapProf[block] += *profsmap;
78 
79  // No one else will ever want this. Save the memory
80  sr.removeCachedProduct(profsmap);
81  }
82 
83  return false;
84  }
double MinW() const
AttenProfiles for many channels.
Definition: AttenProfiles.h:89
block
print "ROW IS " print row
Definition: elec2geo.py:31
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
std::map< int, std::unique_ptr< caldp::AttenProfilesMap > > fChannelMapProf
bool removeCachedProduct(Handle< PROD > &h) const
Definition: DataViewImpl.h:551
bool failedToGet() const
Definition: Handle.h:196
double MaxW() const
virtual bool calib::SumSubrunsCalib::filter ( art::Event evt)
inlinevirtual

Implements art::EDFilter.

Definition at line 27 of file SumSubrunsCalib_module.cc.

References endRun(), endSubRun(), and sr.

27 {return false;}
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
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  }
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 calib::SumSubrunsCalib::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 55 of file SumSubrunsCalib_module.cc.

References ana::assert(), fAttenHistsMapLabel, fMaxBlock, fMinBlock, fhicl::ParameterSet::get(), and string.

Referenced by SumSubrunsCalib().

56  {
57  fAttenHistsMapLabel = pset.get<std::string>("AttenHistsMapLabel");
58  fMinBlock = pset.get<int>("MinBlock");
59  fMaxBlock = pset.get<int>("MaxBlock");
60 
61  assert(fMinBlock >= 0);
62  assert(fMaxBlock < 0 || fMaxBlock >= fMinBlock);
63  // I don't think we can determine the detector in time
64  if(fMaxBlock < 0) fMaxBlock = 27;
65  }
T get(std::string const &key) const
Definition: ParameterSet.h:231
assert(nhit_max >=nhit_nbins)
enum BeamMode string
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().

std::string calib::SumSubrunsCalib::fAttenHistsMapLabel
protected

Definition at line 32 of file SumSubrunsCalib_module.cc.

Referenced by endSubRun(), and reconfigure().

std::map<int, std::unique_ptr<caldp::AttenProfilesMap> > calib::SumSubrunsCalib::fChannelMapProf
protected

Definition at line 36 of file SumSubrunsCalib_module.cc.

Referenced by endRun(), and endSubRun().

int calib::SumSubrunsCalib::fMaxBlock
protected

Definition at line 34 of file SumSubrunsCalib_module.cc.

Referenced by endSubRun(), reconfigure(), and SumSubrunsCalib().

int calib::SumSubrunsCalib::fMinBlock
protected

Definition at line 34 of file SumSubrunsCalib_module.cc.

Referenced by endSubRun(), reconfigure(), and SumSubrunsCalib().

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: