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

Public Types

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

Public Member Functions

 CovarianceMatrixFitter (fhicl::ParameterSet const &pset)
 
virtual ~CovarianceMatrixFitter ()
 
 CovarianceMatrixFitter (CovarianceMatrixFitter const &)=delete
 
 CovarianceMatrixFitter (CovarianceMatrixFitter &&)=delete
 
CovarianceMatrixFitteroperator= (CovarianceMatrixFitter const &)=delete
 
CovarianceMatrixFitteroperator= (CovarianceMatrixFitter &&)=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 &pset)
 
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 Member Functions

void FillDataSpectrum (cmf::Spectrum &spec)
 

Private Attributes

fhicl::ParameterSet fManipulatorPars
 event list manipulator parameters More...
 
fhicl::ParameterSet fFakeParameters
 the fake point parameters More...
 
fhicl::ParameterSet fChiSqrCalcPars
 configuration for the ChiSqrCalculator singleton More...
 
fhicl::ParameterSet fHelperPars
 event list manipulator parameters More...
 
fhicl::ParameterSet fSAWParameters
 ShifterAndWeighter parameters. More...
 
fhicl::ParameterSet fMinimizerPars
 ROOT minimizer configuration. More...
 
std::vector< std::stringfChiSqrToUse
 vector of chi^2 calculation methods to use for fitting More...
 
std::vector< cmf::OscParamPointfPredictionLib
 library of predictions More...
 
std::vector< cmf::FakeUniversefFakeUniverses
 library of predictions More...
 
std::string fPredictionModule
 label for module containing the prediction point library More...
 
std::string fInputUniverseLabel
 label for module containing the fake universe we want to fit More...
 
size_t fUniverseToFit
 which universe to fit, if std::numeric_limits<unsigned int>::max(), then Asimov More...
 
bool fPerformMinimization
 tell fitter whether to perform minimisation or not More...
 

Detailed Description

Definition at line 34 of file CovarianceMatrixFitter_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::CovarianceMatrixFitter::CovarianceMatrixFitter ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 73 of file CovarianceMatrixFitter_plugin.cc.

References fChiSqrToUse, fFakeParameters, fhicl::ParameterSet::is_empty(), and reconfigure().

74  : fManipulatorPars(pset.get<fhicl::ParameterSet>("EventListManipulator" ))
75  , fFakeParameters (pset.get<fhicl::ParameterSet>("FakeParameters", fhicl::ParameterSet()))
76  , fChiSqrCalcPars (pset.get<fhicl::ParameterSet>("ChiSqrCalculationParameters" ))
77  , fHelperPars (pset.get<fhicl::ParameterSet>("FitHelperParameters" ))
78  , fSAWParameters (pset.get<fhicl::ParameterSet>("ShifterAndWeighterParameters" ))
79  , fMinimizerPars (pset.get<fhicl::ParameterSet>("ROOTMinimizerParameters" ))
80  {
81  this->reconfigure(pset);
82 
83  for(auto const& itr : fChiSqrToUse)
84  produces<cmf::PointResult>(itr);
85 
86  if( !fFakeParameters.is_empty() )
87  produces<cmf::InputPoint>("FakeInput");
88  }
fhicl::ParameterSet fChiSqrCalcPars
configuration for the ChiSqrCalculator singleton
bool is_empty() const
void reconfigure(fhicl::ParameterSet const &pset)
std::vector< std::string > fChiSqrToUse
vector of chi^2 calculation methods to use for fitting
fhicl::ParameterSet fMinimizerPars
ROOT minimizer configuration.
fhicl::ParameterSet fHelperPars
event list manipulator parameters
fhicl::ParameterSet fFakeParameters
the fake point parameters
fhicl::ParameterSet fManipulatorPars
event list manipulator parameters
fhicl::ParameterSet fSAWParameters
ShifterAndWeighter parameters.
cmf::CovarianceMatrixFitter::~CovarianceMatrixFitter ( )
virtual
cmf::CovarianceMatrixFitter::CovarianceMatrixFitter ( CovarianceMatrixFitter const &  )
delete
cmf::CovarianceMatrixFitter::CovarianceMatrixFitter ( CovarianceMatrixFitter &&  )
delete

Member Function Documentation

void cmf::CovarianceMatrixFitter::beginJob ( )
overridevirtual

Reimplemented from art::ResultsProducer.

Definition at line 123 of file CovarianceMatrixFitter_plugin.cc.

124  {
125  }
void cmf::CovarianceMatrixFitter::clear ( )
overridevirtual

Implements art::ResultsProducer.

Definition at line 118 of file CovarianceMatrixFitter_plugin.cc.

119  {
120  }
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
void cmf::CovarianceMatrixFitter::FillDataSpectrum ( cmf::Spectrum spec)
private

Definition at line 157 of file CovarianceMatrixFitter_plugin.cc.

References confusionMatrixTree::count, cmf::EventListManipulator::Deserialize(), cmf::EventListManipulator::ExposureMap(), fFakeParameters, fFakeUniverses, cmf::FillSpectrum(), fManipulatorPars, fSAWParameters, fUniverseToFit, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_names(), cmf::ShifterAndWeighter::InitShiftsAndWeightsToUse(), cmf::ParameterUtility::Instance(), cmf::ShifterAndWeighter::Instance(), fhicl::ParameterSet::is_empty(), cmf::kData, cmf::kFARDET, cmf::kMC, cmf::kNEARDET, LOG_DEBUG, LOG_VERBATIM, cet::sqlite::max(), cmf::ParameterSetToLocation(), cmf::ShifterAndWeighter::SetCurrentVals(), and fhicl::ParameterSet::to_string().

Referenced by writeResults().

158  {
159 
160  // if we were passed fake universes, we don't need to do anything with the
161  // event list manipulator
162  if(!fFakeUniverses.empty()){
164  spec = fFakeUniverses.front().AsimovSpectrum();
165  else if(fUniverseToFit < fFakeUniverses.size())
166  spec = fFakeUniverses[fUniverseToFit].PoissonSpectrum();
167  else
168  throw cet::exception("CovarianceMatrixFitter")
169  << "Requested to fit fake universe "
170  << fUniverseToFit
171  << " but vector only contains "
172  << fFakeUniverses.size()
173  << " universes";
174 
175  return;
176  }
177 
179  cmf::EventListColl evLists;
180 
181  if(!fFakeParameters.is_empty()){
184  cmf::Location fakeLoc;
185  // loop over the systematic and oscillation parameters
186  auto const& partypes = fFakeParameters.get_names();
187 
188  LOG_DEBUG("CovarianceMatrixFitter")
190 
191  for(auto const& itr : partypes){
192  LOG_DEBUG("CovarianceMatrixFitter")
193  << itr;
194 
197  fakeLoc);
199  cmf::kFARDET,
200  fakeLoc);
201  }
202 
203  LOG_VERBATIM("CovarianceMatrixFitter")
204  << "We have fake parameters, so making fake data generated at\n"
205  << fakeLoc;
206 
208 
209  elm.Deserialize(evLists, cmf::kMC);
210 
211  } // end if we want fake data
212  else{
213  elm.Deserialize(evLists, cmf::kData);
214  }
215 
216  std::vector<float> count;
217 
218  cmf::FillSpectrum(evLists,
219  elm.ExposureMap(),
220  spec,
221  count);
222 
223 
224  // for(size_t b = 0; b < spec.size(); ++b)
225  // LOG_VERBATIM("CovarianceFitHelper")
226  // << "Data "
227  // << b
228  // << " "
229  // << spec[b];
230 
231  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
bool is_empty() const
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
static ParameterUtility * Instance()
T get(std::string const &key) const
Definition: ParameterSet.h:231
void FillSpectrum(cmf::EventListColl const &eventLists, cmf::ExposureMap const &exposureMap, std::vector< float > &spectrum, std::vector< float > &count, cmf::InteractionType_t intType, bool applyExposureNorm)
static ShifterAndWeighter * Instance()
std::vector< std::string > get_names() const
void ParameterSetToLocation(fhicl::ParameterSet const &pset, cmf::DetType_t const &det, cmf::Location &loc)
std::vector< cmf::EventList > EventListColl
Definition: Event.h:147
void InitShiftsAndWeightsToUse(cmf::Location const &loc, fhicl::ParameterSet const &parset)
fhicl::ParameterSet fFakeParameters
the fake point parameters
std::vector< cmf::FakeUniverse > fFakeUniverses
library of predictions
size_t fUniverseToFit
which universe to fit, if std::numeric_limits<unsigned int>::max(), then Asimov
#define LOG_VERBATIM(category)
fhicl::ParameterSet fManipulatorPars
event list manipulator parameters
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
void SetCurrentVals(cmf::Location const &loc)
fhicl::ParameterSet fSAWParameters
ShifterAndWeighter parameters.
std::string to_string() const
Definition: ParameterSet.h:137
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
CovarianceMatrixFitter& cmf::CovarianceMatrixFitter::operator= ( CovarianceMatrixFitter const &  )
delete
CovarianceMatrixFitter& cmf::CovarianceMatrixFitter::operator= ( CovarianceMatrixFitter &&  )
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::CovarianceMatrixFitter::readResults ( art::Results const &  r)
overridevirtual

Reimplemented from art::ResultsProducer.

Definition at line 128 of file CovarianceMatrixFitter_plugin.cc.

References fFakeUniverses, fInputUniverseLabel, fPredictionLib, fPredictionModule, LOG_VERBATIM, and cmf::readVectorResults().

129  {
131  LOG_VERBATIM("FitFeldmanCousinsPoint")
132  << "Valid handle to std::vector<cmf::FakeUniverse> "
133  << "objects found in "
135  << " vector size "
136  << fFakeUniverses.size();
137  }
138 
139  if(fPredictionModule.empty()){
140  LOG_VERBATIM("CovarianceMatrixFitter")
141  << "no prediction module label specified, will not attempt to read in a library";
142  return;
143  }
144 
146  LOG_VERBATIM("CovarianceMatrixFitter")
147  << "Valid handle to std::vector<cmf::OscParamPoint> "
148  << "objects found in "
150  << " "
151  << " vector size "
152  << fPredictionLib.size();
153  }
154  }
std::string fInputUniverseLabel
label for module containing the fake universe we want to fit
static bool readVectorResults(art::Results const &r, std::string const &module, std::string const &instance, std::vector< T > &resvec, bool clearResVec=true)
std::string fPredictionModule
label for module containing the prediction point library
std::vector< cmf::OscParamPoint > fPredictionLib
library of predictions
std::vector< cmf::FakeUniverse > fFakeUniverses
library of predictions
TRandom3 r(0)
#define LOG_VERBATIM(category)
void cmf::CovarianceMatrixFitter::reconfigure ( fhicl::ParameterSet const &  pset)
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::CovarianceMatrixFitter::writeResults ( art::Results r)
overridevirtual

Implements art::ResultsProducer.

Definition at line 239 of file CovarianceMatrixFitter_plugin.cc.

References DEFINE_ART_RESULTS_PLUGIN, fChiSqrCalcPars, fChiSqrToUse, fFakeParameters, fHelperPars, FillDataSpectrum(), cmf::CovarianceFitHelper::FindInitialGuess(), fManipulatorPars, fMinimizerPars, fPerformMinimization, fPredictionLib, fSAWParameters, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_names(), cmf::CovarianceFitHelper::Initialize(), cmf::CovarianceFitHelper::Instance(), fhicl::ParameterSet::is_empty(), cmf::kFARDET, cmf::kNEARDET, PandAna.Demos.demo0::loc, LOG_VERBATIM, cmf::CovarianceFitHelper::MakeResultPlots(), cmf::CovarianceFitHelper::Minimize(), cmf::ParameterSetToLocation(), gammaraytel::pr, art::Results::put(), cmf::CovarianceFitHelper::Result(), and cmf::StringToChiSqrType().

240  {
241  // get the data spectrum and exposure map to pass to the fit helper
242  cmf::Spectrum dataSpectrum;
243  this->FillDataSpectrum(dataSpectrum);
244 
250  dataSpectrum);
251 
252  if(fPredictionLib.size() > 0 && fPerformMinimization)
254 
255  for(auto const& chiSqrCalc : fChiSqrToUse){
256 
259 
260  // create plots showing the minimizer progress
261  cmf::CovarianceFitHelper::Instance()->MakeResultPlots("FitResults", chiSqrCalc);
262 
263  // create the point result to store
264  std::unique_ptr<cmf::PointResult> pr = cmf::CovarianceFitHelper::Instance()->Result();
265 
266  r.put(std::move(pr), chiSqrCalc);
267  } // end loop over chi^2 calculation methods
268 
269  if( !fFakeParameters.is_empty() ){
270 
272  // loop over the systematic and oscillation parameters
273  auto const& partypes = fFakeParameters.get_names();
274  for(auto const& itr : partypes){
277  loc);
279  cmf::kFARDET,
280  loc);
281  }
282 
283  std::unique_ptr<cmf::InputPoint> fakeInputPoint = std::make_unique<InputPoint>(loc);
284  LOG_VERBATIM("FitPoint")
285  << "Fake Input Point\n"
286  << *fakeInputPoint;
287 
288  r.put(std::move(fakeInputPoint), "FakeInput");
289  } // end if we are making the fake input point to store
290  }
bool fPerformMinimization
tell fitter whether to perform minimisation or not
fhicl::ParameterSet fChiSqrCalcPars
configuration for the ChiSqrCalculator singleton
bool is_empty() const
art::ProductID put(std::unique_ptr< PROD > &&product)
Definition: Results.h:78
std::vector< std::string > fChiSqrToUse
vector of chi^2 calculation methods to use for fitting
void Minimize(cmf::ChiSqrCalc_t const &chiSqrCalc=cmf::kCovMat)
fhicl::ParameterSet fMinimizerPars
ROOT minimizer configuration.
T get(std::string const &key) const
Definition: ParameterSet.h:231
void FindInitialGuess(std::vector< cmf::OscParamPoint > const &library)
std::vector< std::string > get_names() const
std::vector< float > Spectrum
Definition: Constants.h:610
static CovarianceFitHelper * Instance()
fhicl::ParameterSet fHelperPars
event list manipulator parameters
static cmf::ChiSqrCalc_t StringToChiSqrType(std::string const &str)
void ParameterSetToLocation(fhicl::ParameterSet const &pset, cmf::DetType_t const &det, cmf::Location &loc)
void MakeResultPlots(std::string const &dirBaseName, std::string const &uniqueID=std::string(), bool fillFromLists=true)
std::vector< cmf::OscParamPoint > fPredictionLib
library of predictions
fhicl::ParameterSet fFakeParameters
the fake point parameters
void Initialize(fhicl::ParameterSet const &helperPars, fhicl::ParameterSet const &chiSqrCalcPars, fhicl::ParameterSet const &manipulatorPars, fhicl::ParameterSet const &minimizerPars, fhicl::ParameterSet const &sawPars)
void FillDataSpectrum(cmf::Spectrum &spec)
#define LOG_VERBATIM(category)
fhicl::ParameterSet fManipulatorPars
event list manipulator parameters
std::unique_ptr< cmf::PointResult > Result(bool loadFromEventList=true)
fhicl::ParameterSet fSAWParameters
ShifterAndWeighter parameters.

Member Data Documentation

fhicl::ParameterSet cmf::CovarianceMatrixFitter::fChiSqrCalcPars
private

configuration for the ChiSqrCalculator singleton

Definition at line 59 of file CovarianceMatrixFitter_plugin.cc.

Referenced by writeResults().

std::vector<std::string> cmf::CovarianceMatrixFitter::fChiSqrToUse
private

vector of chi^2 calculation methods to use for fitting

Definition at line 63 of file CovarianceMatrixFitter_plugin.cc.

Referenced by CovarianceMatrixFitter(), writeResults(), and ~CovarianceMatrixFitter().

fhicl::ParameterSet cmf::CovarianceMatrixFitter::fFakeParameters
private

the fake point parameters

Definition at line 58 of file CovarianceMatrixFitter_plugin.cc.

Referenced by CovarianceMatrixFitter(), FillDataSpectrum(), and writeResults().

std::vector<cmf::FakeUniverse> cmf::CovarianceMatrixFitter::fFakeUniverses
private

library of predictions

Definition at line 65 of file CovarianceMatrixFitter_plugin.cc.

Referenced by FillDataSpectrum(), and readResults().

fhicl::ParameterSet cmf::CovarianceMatrixFitter::fHelperPars
private

event list manipulator parameters

Definition at line 60 of file CovarianceMatrixFitter_plugin.cc.

Referenced by writeResults().

std::string cmf::CovarianceMatrixFitter::fInputUniverseLabel
private

label for module containing the fake universe we want to fit

Definition at line 67 of file CovarianceMatrixFitter_plugin.cc.

Referenced by readResults(), and ~CovarianceMatrixFitter().

fhicl::ParameterSet cmf::CovarianceMatrixFitter::fManipulatorPars
private

event list manipulator parameters

Definition at line 57 of file CovarianceMatrixFitter_plugin.cc.

Referenced by FillDataSpectrum(), and writeResults().

fhicl::ParameterSet cmf::CovarianceMatrixFitter::fMinimizerPars
private

ROOT minimizer configuration.

Definition at line 62 of file CovarianceMatrixFitter_plugin.cc.

Referenced by writeResults().

bool cmf::CovarianceMatrixFitter::fPerformMinimization
private

tell fitter whether to perform minimisation or not

Definition at line 69 of file CovarianceMatrixFitter_plugin.cc.

Referenced by writeResults(), and ~CovarianceMatrixFitter().

std::vector<cmf::OscParamPoint> cmf::CovarianceMatrixFitter::fPredictionLib
private

library of predictions

Definition at line 64 of file CovarianceMatrixFitter_plugin.cc.

Referenced by readResults(), and writeResults().

std::string cmf::CovarianceMatrixFitter::fPredictionModule
private

label for module containing the prediction point library

Definition at line 66 of file CovarianceMatrixFitter_plugin.cc.

Referenced by readResults(), and ~CovarianceMatrixFitter().

fhicl::ParameterSet cmf::CovarianceMatrixFitter::fSAWParameters
private

ShifterAndWeighter parameters.

Definition at line 61 of file CovarianceMatrixFitter_plugin.cc.

Referenced by FillDataSpectrum(), and writeResults().

size_t cmf::CovarianceMatrixFitter::fUniverseToFit
private

which universe to fit, if std::numeric_limits<unsigned int>::max(), then Asimov

Definition at line 68 of file CovarianceMatrixFitter_plugin.cc.

Referenced by FillDataSpectrum(), and ~CovarianceMatrixFitter().


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