Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
cmf::PredictionLibraryMaker Class Reference
Inheritance diagram for cmf::PredictionLibraryMaker:
art::ResultsProducer art::ProductRegistryHelper art::Consumer

Public Types

template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::PluginConfig, KeysToIgnore >
 

Public Member Functions

 PredictionLibraryMaker (fhicl::ParameterSet const &pset)
 
 ~PredictionLibraryMaker () override
 
 PredictionLibraryMaker (PredictionLibraryMaker const &)=delete
 
 PredictionLibraryMaker (PredictionLibraryMaker &&)=delete
 
PredictionLibraryMakeroperator= (PredictionLibraryMaker const &)=delete
 
PredictionLibraryMakeroperator= (PredictionLibraryMaker &&)=delete
 
void readResults (art::Results const &r) override
 
void writeResults (art::Results &r) override
 
void clear () override
 
void beginJob () override
 
void reconfigure (fhicl::ParameterSet const &p)
 
void doBeginJob ()
 
void doEndJob ()
 
void doBeginSubRun (SubRunPrincipal const &)
 
void doEndSubRun (SubRunPrincipal const &)
 
void doBeginRun (RunPrincipal const &)
 
void doEndRun (RunPrincipal const &)
 
void doEvent (EventPrincipal const &)
 
void doReadResults (ResultsPrincipal const &)
 
void doWriteResults (ResultsPrincipal &)
 
void doClear ()
 
void registerProducts (MasterProductRegistry &mpr, ProductDescriptions &producedProducts, ModuleDescription const &md)
 
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)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

template<class P >
void produces (std::string const &instanceName={})
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void setModuleDescription (ModuleDescription const &md)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

bool fUseTrig
 do we want to use a sin function for the values of one parameter? More...
 
cmf::OscParm_t fParamX
 oscillation parameter for the x axis More...
 
cmf::OscParm_t fParamY
 oscillation parameter for the y axis More...
 
std::vector< cmf::GridPointfGridPoints
 

Detailed Description

Definition at line 40 of file CMFPredictionLibraryMaker_plugin.cc.

Member Typedef Documentation

template<typename UserConfig , typename KeysToIgnore = void>
using art::ResultsProducer::Table = ProducerTable<UserConfig, detail::PluginConfig, KeysToIgnore>
inherited

Definition at line 114 of file ResultsProducer.h.

Constructor & Destructor Documentation

cmf::PredictionLibraryMaker::PredictionLibraryMaker ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 66 of file CMFPredictionLibraryMaker_plugin.cc.

References fhicl::ParameterSet::get(), cmf::CovarianceBinUtility::Initialize(), cmf::ParameterUtility::Initialize(), cmf::SpectrumPredictionMaker::Initialize(), cmf::SelectionUtility::Initialize(), cmf::CovarianceBinUtility::Instance(), cmf::ParameterUtility::Instance(), cmf::SpectrumPredictionMaker::Instance(), cmf::SelectionUtility::Instance(), and ~PredictionLibraryMaker().

67  {
69  cmf::CovarianceBinUtility::Instance() ->Initialize(pset.get< fhicl::ParameterSet >("BinningToUse" ));
70  cmf::ParameterUtility::Instance() ->Initialize(pset.get< fhicl::ParameterSet >("ParametersToUse" ));
72 
73  // produce a vector of OscParamPoints
74  produces< std::vector<cmf::OscParamPoint> >();
75  }
void Initialize(fhicl::ParameterSet const &pset)
static SelectionUtility * Instance()
static ParameterUtility * Instance()
void Initialize(fhicl::ParameterSet const &pset)
void Initialize(fhicl::ParameterSet const &pset)
static SpectrumPredictionMaker * Instance()
void Initialize(fhicl::ParameterSet const &pset)
static CovarianceBinUtility * Instance()
cmf::PredictionLibraryMaker::~PredictionLibraryMaker ( )
overridedefault

Referenced by PredictionLibraryMaker().

cmf::PredictionLibraryMaker::PredictionLibraryMaker ( PredictionLibraryMaker const &  )
delete
cmf::PredictionLibraryMaker::PredictionLibraryMaker ( PredictionLibraryMaker &&  )
delete

Member Function Documentation

void cmf::PredictionLibraryMaker::beginJob ( )
overridevirtual

Reimplemented from art::ResultsProducer.

Definition at line 94 of file CMFPredictionLibraryMaker_plugin.cc.

95  {}
void cmf::PredictionLibraryMaker::clear ( )
overridevirtual

Implements art::ResultsProducer.

Definition at line 84 of file CMFPredictionLibraryMaker_plugin.cc.

85  {
86  }
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
void art::ResultsProducer::doBeginJob ( )
inlineinherited

Definition at line 165 of file ResultsProducer.h.

References ana::assert(), breakpoints::beginJob(), fhicl::ParameterSetRegistry::get(), and art::Consumer::setModuleDescription().

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

166 {
168  // Preparing the consumer for the job must be done after the
169  // constructer has been called.
170  auto const& mainID = moduleDescription_->mainParameterSetID();
171  auto const& scheduler_pset =
173  "services.scheduler");
175  prepareForJob(scheduler_pset);
176  beginJob();
177 }
static collection_type const & get() noexcept
void setModuleDescription(ModuleDescription const &md)
void prepareForJob(fhicl::ParameterSet const &pset)
assert(nhit_max >=nhit_nbins)
virtual void beginJob()
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doBeginRun ( RunPrincipal const &  rp)
inlineinherited

Definition at line 201 of file ResultsProducer.h.

References r().

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

202 {
203  Run const r{rp, *moduleDescription_, this};
204  beginRun(r);
205 }
virtual void beginRun(Run const &)
TRandom3 r(0)
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doBeginSubRun ( SubRunPrincipal const &  srp)
inlineinherited

Definition at line 187 of file ResultsProducer.h.

References sr.

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

188 {
189  SubRun const sr{srp, *moduleDescription_, this};
190  beginSubRun(sr);
191 }
virtual void beginSubRun(SubRun const &)
caf::StandardRecord * sr
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doClear ( )
inlineinherited

Definition at line 229 of file ResultsProducer.h.

References clear.

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

230 {
231  clear();
232 }
virtual void clear()=0
void art::ResultsProducer::doEndJob ( )
inlineinherited

Definition at line 180 of file ResultsProducer.h.

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

181 {
182  endJob();
184 }
virtual void endJob()
void showMissingConsumes() const
void art::ResultsProducer::doEndRun ( RunPrincipal const &  rp)
inlineinherited

Definition at line 208 of file ResultsProducer.h.

References r().

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

209 {
210  Run const r{rp, *moduleDescription_, this};
211  endRun(r);
212 }
virtual void endRun(Run const &)
TRandom3 r(0)
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doEndSubRun ( SubRunPrincipal const &  srp)
inlineinherited

Definition at line 194 of file ResultsProducer.h.

References sr.

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

195 {
196  SubRun const sr{srp, *moduleDescription_, this};
197  endSubRun(sr);
198 }
caf::StandardRecord * sr
virtual void endSubRun(SubRun const &)
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doEvent ( EventPrincipal const &  ep)
inlineinherited

Definition at line 215 of file ResultsProducer.h.

References e, and lem_server::ep.

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

216 {
217  Event const e{ep, *moduleDescription_, this};
218  event(e);
219 }
Float_t e
Definition: plot.C:35
virtual void event(Event const &)
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doReadResults ( ResultsPrincipal const &  resp)
inlineinherited

Definition at line 222 of file ResultsProducer.h.

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

223 {
224  Results const res{resp, *moduleDescription_, this};
225  readResults(res);
226 }
virtual void readResults(Results const &)
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::ResultsProducer::doWriteResults ( ResultsPrincipal )
inherited
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
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
PredictionLibraryMaker& cmf::PredictionLibraryMaker::operator= ( PredictionLibraryMaker const &  )
delete
PredictionLibraryMaker& cmf::PredictionLibraryMaker::operator= ( PredictionLibraryMaker &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
template<class P >
void art::ResultsProducer::produces ( std::string const &  instanceName = {})
inlineprotectedinherited

Definition at line 159 of file ResultsProducer.h.

160 {
161  ProductRegistryHelper::produces<P, InResults>(instanceName);
162 }
void cmf::PredictionLibraryMaker::readResults ( art::Results const &  r)
overridevirtual

Reimplemented from art::ResultsProducer.

Definition at line 98 of file CMFPredictionLibraryMaker_plugin.cc.

99  {
100  }
void cmf::PredictionLibraryMaker::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 89 of file CMFPredictionLibraryMaker_plugin.cc.

90  {
91  }
void art::ResultsProducer::registerProducts ( MasterProductRegistry mpr,
ProductDescriptions producedProducts,
ModuleDescription const &  md 
)
inlineinherited

Definition at line 128 of file ResultsProducer.h.

References fetch_tb_beamline_files::md, and art::ProductRegistryHelper::registerProducts().

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

131  {
132  ProductRegistryHelper::registerProducts(mpr, producedProducts, md);
134  }
void registerProducts(MasterProductRegistry &mpr, ProductDescriptions &productsToRegister, ModuleDescription const &md)
cet::exempt_ptr< ModuleDescription const > moduleDescription_
void art::Consumer::setModuleDescription ( ModuleDescription const &  md)
protectedinherited
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
void cmf::PredictionLibraryMaker::writeResults ( art::Results r)
overridevirtual

Implements art::ResultsProducer.

Definition at line 103 of file CMFPredictionLibraryMaker_plugin.cc.

References DEFINE_ART_RESULTS_PLUGIN, cmf::SpectrumPredictionMaker::Instance(), cmf::SpectrumPredictionMaker::MakePredictions(), and art::Results::put().

104  {
105  // the idea is to loop over the grid in the x and y parameters and
106  // create a cmf::OscParamPoint at each of the points in space
107 
108  // create a vector of OscParamPoints
109  std::unique_ptr<std::vector<cmf::OscParamPoint>> ppVec = std::make_unique<std::vector<cmf::OscParamPoint>>();
110 
112 
113  r.put(std::move(ppVec));
114 
115  } // end writeResults
void MakePredictions(std::vector< cmf::OscParamPoint > &predVec)
art::ProductID put(std::unique_ptr< PROD > &&product)
Definition: Results.h:78
static SpectrumPredictionMaker * Instance()

Member Data Documentation

std::vector<cmf::GridPoint> cmf::PredictionLibraryMaker::fGridPoints
private

Definition at line 62 of file CMFPredictionLibraryMaker_plugin.cc.

cmf::OscParm_t cmf::PredictionLibraryMaker::fParamX
private

oscillation parameter for the x axis

Definition at line 60 of file CMFPredictionLibraryMaker_plugin.cc.

cmf::OscParm_t cmf::PredictionLibraryMaker::fParamY
private

oscillation parameter for the y axis

Definition at line 61 of file CMFPredictionLibraryMaker_plugin.cc.

bool cmf::PredictionLibraryMaker::fUseTrig
private

do we want to use a sin function for the values of one parameter?

Definition at line 59 of file CMFPredictionLibraryMaker_plugin.cc.


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