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

Public Types

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

Public Member Functions

 FakePointResultMaker (fhicl::ParameterSet const &pset)
 
virtual ~FakePointResultMaker ()
 
void readResults (art::Results const &r)
 
void writeResults (art::Results &r)
 
void reconfigure (const fhicl::ParameterSet &p)
 
void clear ()
 
void beginJob ()
 
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

double fMinDeltaM32
 minimum value of Delta m^{2}_{32} More...
 
double fMaxDeltaM32
 maximum value of Delta m^{2}_{32} More...
 
double fMinTheta23
 minimum value of theta_{23} More...
 
double fMaxTheta23
 maximum value of theta_{23} More...
 
int fNumDivisions
 number of divisions in each direction of space More...
 

Detailed Description

Definition at line 22 of file FakePointResultMaker_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

fnex::FakePointResultMaker::FakePointResultMaker ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 43 of file FakePointResultMaker_plugin.cc.

References reconfigure().

44  {
45  this->reconfigure(pset);
46 
47  produces<std::vector<fnex::InputPoint> >();
48  produces<std::vector<fnex::PointResult> >();
49 
50  return;
51  }
void reconfigure(const fhicl::ParameterSet &p)
fnex::FakePointResultMaker::~FakePointResultMaker ( )
virtual

Definition at line 54 of file FakePointResultMaker_plugin.cc.

55  {
56 
57  }

Member Function Documentation

void fnex::FakePointResultMaker::beginJob ( )
virtual

Reimplemented from art::ResultsProducer.

Definition at line 72 of file FakePointResultMaker_plugin.cc.

73  {
74  return;
75  }
void fnex::FakePointResultMaker::clear ( )
virtual

Implements art::ResultsProducer.

Definition at line 80 of file FakePointResultMaker_plugin.cc.

81  {
82  return;
83  }
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
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 fnex::FakePointResultMaker::readResults ( art::Results const &  r)
virtual

Reimplemented from art::ResultsProducer.

Definition at line 86 of file FakePointResultMaker_plugin.cc.

87  {
88  return;
89  }
void fnex::FakePointResultMaker::reconfigure ( const fhicl::ParameterSet p)

Definition at line 60 of file FakePointResultMaker_plugin.cc.

References fMaxDeltaM32, fMaxTheta23, fMinDeltaM32, fMinTheta23, fNumDivisions, and fhicl::ParameterSet::get().

Referenced by FakePointResultMaker().

61  {
62  fMinDeltaM32 = pset.get<double>("MinDeltaM32", 2.e-3);
63  fMaxDeltaM32 = pset.get<double>("MaxDeltaM32", 3.e-3);
64  fMinTheta23 = pset.get<double>("MinTheta23", 0.);
65  fMaxTheta23 = pset.get<double>("MaxTheta23", 0.785398);
66  fNumDivisions = pset.get<int >("NumDivisions", 100);
67 
68  return;
69  }
double fMaxDeltaM32
maximum value of Delta m^{2}_{32}
double fMaxTheta23
maximum value of theta_{23}
int fNumDivisions
number of divisions in each direction of space
double fMinTheta23
minimum value of theta_{23}
double fMinDeltaM32
minimum value of Delta m^{2}_{32}
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 fnex::FakePointResultMaker::writeResults ( art::Results r)
virtual

Implements art::ResultsProducer.

Definition at line 92 of file FakePointResultMaker_plugin.cc.

References fnex::cOscParams_Default, fnex::cOscParams_Strings, DEFINE_ART_RESULTS_PLUGIN, fMaxDeltaM32, fMaxTheta23, fMinDeltaM32, fMinTheta23, fNumDivisions, novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, fnex::kNumOscParams, make_pair(), cet::pow(), art::Results::put(), submit_syst::x, and submit_syst::y.

93  {
94  std::unique_ptr<std::vector<fnex::InputPoint > > ipvec(new std::vector<fnex::InputPoint>() );
95  std::unique_ptr<std::vector<fnex::PointResult> > prvec(new std::vector<fnex::PointResult>() );
96 
97  fnex::ParameterDetMap oscMap;
98  for(size_t p = 0; p < fnex::kNumOscParams; ++p){
101  }
102 
103  // loop over the space and set the oscMap values for Delta m^{2}_{32}
104  // and theta_{23} appropriately for the input points.
105 
106  // the results will be faked up to have the lowest chi&2 in the middle
107  // of the space with a quadratic in x and y to specify the chi^2 values
108  double Th23Val = 0.;
109  double Th23Mid = 0.5 * (fMaxTheta23 - fMinTheta23) + fMinTheta23;
110  double Th23Div = (fMaxTheta23 - fMinTheta23) / (1. * fNumDivisions);
111  double deltaMSqrVal = 0.;
112  double deltaMSqrMid = 0.5 * (fMaxDeltaM32 - fMinDeltaM32) + fMinDeltaM32;
113  double deltaMSqrDiv = (fMaxDeltaM32 - fMinDeltaM32) / (1. * fNumDivisions);
114  double chiSqr = 0.;
115 
116  // make an empty map for systematic pulls
117  fnex::ParameterDetMap systMap;
118 
120 
121  for(int x = 0; x < fNumDivisions; ++x){
122 
123  pd.first = "Th23";
124  Th23Val = ((double(x)+0.5) * Th23Div) + fMinTheta23;
125  oscMap[pd] = Th23Val;
126 
127  for(int y = 0; y < fNumDivisions; ++y){
128 
129  pd.first = "Dmsq32";
130  deltaMSqrVal = ((double(y)+0.5) * deltaMSqrDiv) + fMinDeltaM32;
131  oscMap[pd] = deltaMSqrVal;
132 
133  //std::cout << "VAL: " << Th23Val << " , " << deltaMSqrVal << std::endl;
134  ipvec->emplace_back(oscMap);
135 
136  // 2D quadratic centered in the space
137  chiSqr = (std::pow((deltaMSqrVal - deltaMSqrMid) / (10. * deltaMSqrDiv), 2.) +
138  std::pow((Th23Val - Th23Mid ) / (10. * Th23Div ), 2.) );
139 
140  prvec->emplace_back(chiSqr, 0, oscMap, systMap);
141 
142  } // end loop over Y (Delta m^{2}_{23}
143  } // end loop over X (theta_23)
144 
145  r.put(std::move(ipvec));
146  r.put(std::move(prvec));
147 
148  return;
149  } // end writeResults
const double cOscParams_Default[kNumOscParams]
Definition: Constants.h:215
const char * p
Definition: xmltok.h:285
constexpr T pow(T x)
Definition: pow.h:75
art::ProductID put(std::unique_ptr< PROD > &&product)
Definition: Results.h:78
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
Far Detector at Ash River, MN.
double fMaxDeltaM32
maximum value of Delta m^{2}_{32}
Near Detector in the NuMI cavern.
double fMaxTheta23
maximum value of theta_{23}
int fNumDivisions
number of divisions in each direction of space
std::unordered_map< ParameterDet, double, ParameterDetHasher > ParameterDetMap
Definition: Constants.h:63
const std::string cOscParams_Strings[kNumOscParams]
Definition: Constants.h:196
std::pair< std::string, novadaq::cnv::DetId > ParameterDet
Definition: Constants.h:38
double fMinTheta23
minimum value of theta_{23}
double fMinDeltaM32
minimum value of Delta m^{2}_{32}

Member Data Documentation

double fnex::FakePointResultMaker::fMaxDeltaM32
private

maximum value of Delta m^{2}_{32}

Definition at line 36 of file FakePointResultMaker_plugin.cc.

Referenced by reconfigure(), and writeResults().

double fnex::FakePointResultMaker::fMaxTheta23
private

maximum value of theta_{23}

Definition at line 38 of file FakePointResultMaker_plugin.cc.

Referenced by reconfigure(), and writeResults().

double fnex::FakePointResultMaker::fMinDeltaM32
private

minimum value of Delta m^{2}_{32}

Definition at line 35 of file FakePointResultMaker_plugin.cc.

Referenced by reconfigure(), and writeResults().

double fnex::FakePointResultMaker::fMinTheta23
private

minimum value of theta_{23}

Definition at line 37 of file FakePointResultMaker_plugin.cc.

Referenced by reconfigure(), and writeResults().

int fnex::FakePointResultMaker::fNumDivisions
private

number of divisions in each direction of space

Definition at line 39 of file FakePointResultMaker_plugin.cc.

Referenced by reconfigure(), and writeResults().


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