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

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 MIN (fhicl::ParameterSet const &pset)
 
virtual ~MIN ()
 
void produce (art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginSubRun (art::SubRun &sr)
 
void endSubRun (art::SubRun &sr)
 
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 ()
 

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 Attributes

double fMinPOTCut
 
double fMinHornICut
 
double fMaxHornICut
 
double fMaxDeltaTCut
 
double fMinPosXCut
 
double fMaxPosXCut
 
double fMinPosYCut
 
double fMaxPosYCut
 
double fBNBOffset
 
std::string pRawDataLabel
 
art::ServiceHandle< ifbeam_ns::IFBeamifbeam_handle
 
std::unique_ptr< BeamFolderbfp
 
sumdata::POTSumtotpots
 
std::string pPotLabel
 
bool isMC
 
TTree * fOutTree
 
int channel
 
double response
 
simb::Origin_t fMCOrigin
 

Static Private Attributes

static constexpr double PI = 3.14159265
 
static constexpr double z_mw875 = 201.820648
 
static constexpr double z_hp875 = 202.078003
 
static constexpr double z_vp875 = 202.281219
 
static constexpr double z_mw876 = 202.966766
 
static constexpr double z_vptg1 = 204.629608
 
static constexpr double z_hptg1 = 204.833267
 
static constexpr double z_vptg2 = 205.036835
 
static constexpr double z_hptg2 = 205.240662
 
static constexpr double z_mwtgt = 205.867645
 
static constexpr double z_mtgt = 206.870895
 
static constexpr double z_hrndn = 208.317703
 
static constexpr double hptg1station = 2.76
 
static constexpr double hp875station = 0.0
 
static constexpr double vptg1station = 2.55
 
static constexpr double vp875station = 0.20
 
static constexpr double tgtstation = 4.80
 
static constexpr double hptg1offset = 0.46
 
static constexpr double hp875offset = -3.40
 
static constexpr double vptg1offset = 0.39
 
static constexpr double vp875offset = 1.48
 
static constexpr double z_target_le = 0.0*Munits::foot
 
static constexpr double actrn1 = 1.2467192*Munits::foot
 
static constexpr double wirespacing = 0.5*Munits::mm
 

Detailed Description

Definition at line 64 of file BNBInfo_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

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

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

ifdb::MIN::MIN ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 144 of file BNBInfo_module.cc.

References bfp.

144  :
145  fMinPOTCut (pset.get< double >("MinPOTCut") ),
146  fMinHornICut (pset.get< double >("MinHornICut") ),
147  fMaxHornICut (pset.get< double >("MaxHornICut") ),
148  fMaxDeltaTCut (pset.get< double >("MaxDeltaTCut") ),
149  fMinPosXCut (pset.get< double >("MinPosXCut") ),
150  fMaxPosXCut (pset.get< double >("MaxPosXCut") ),
151  fMinPosYCut (pset.get< double >("MinPosYCut") ),
152  fMaxPosYCut (pset.get< double >("MaxPosYCut") ),
153  fBNBOffset (pset.get< double >("BNBOffset") ),
154  pRawDataLabel (pset.get< std::string >("RawDataLabel") ),
155  bfp( ifbeam_handle->getBeamFolder(pset.get< std::string >("Bundle"), pset.get< std::string >("URL"), pset.get< double >("TimeWindow"))),
156  pPotLabel (pset.get< std::string >("PotLabel") ),
157  isMC(false)
158 
159  { bfp->set_epsilon(0.01); // how close in time does the spill time have to be from the DAQ time (in seconds).
160  // bfp->setValidWindow(0.01);
161  // tell the module what it is making as this is a EDProducer
162  produces< sumdata::SpillData >();
163  produces< sumdata::POTSum, art::InSubRun >();
164  // Be noisy to demonstrate what's happening
165  mf::LogInfo("MIN") << "In MIN Constructor\n";
166 
167  }
std::unique_ptr< BeamFolder > bfp
double fMinHornICut
double fMinPOTCut
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::string pRawDataLabel
std::string pPotLabel
double fBNBOffset
double fMinPosYCut
double fMinPosXCut
double fMaxPosXCut
double fMaxDeltaTCut
art::ServiceHandle< ifbeam_ns::IFBeam > ifbeam_handle
double fMaxHornICut
double fMaxPosYCut
std::unique_ptr< BeamFolder > getBeamFolder(std::string bundle_name, std::string url="", double time_width=1200.0)
enum BeamMode string
ifdb::MIN::~MIN ( )
virtual

Definition at line 170 of file BNBInfo_module.cc.

171  {
172  }

Member Function Documentation

void ifdb::MIN::beginSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDProducer.

Definition at line 175 of file BNBInfo_module.cc.

References channel, fOutTree, art::TFileDirectory::make(), response, and totpots.

176  {
177  totpots = new sumdata::POTSum();
178 
180  fOutTree = tfs->make<TTree>("TimingCalib","Timing Calibaration");
181 
182  fOutTree->Branch("channel", &channel, "channel/I");
183  fOutTree->Branch("response", &response, "respone/I");
184 
185  }
double response
sumdata::POTSum * totpots
TTree * fOutTree
T * make(ARGS...args) const
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::EDProducer::currentContext ( ) const
protectedinherited
void ifdb::MIN::endSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDProducer.

Definition at line 188 of file BNBInfo_module.cc.

References fMCOrigin, art::DataViewImpl::getByLabel(), sumdata::POTSum::goodspills, isMC, simb::kBeamNeutrino, pPotLabel, art::SubRun::put(), sumdata::POTSum::totgoodpot, sumdata::POTSum::totpot, totpots, and sumdata::POTSum::totspills.

189  {
192 
193  // If MC, get the old POTSum object that was filled in GENIEGen,
194  // and copy it to my current one
195  sr.getByLabel(pPotLabel,mcpots);
196  totpots->totpot = mcpots->totpot;
197  totpots->totgoodpot = mcpots->totgoodpot;
198  totpots->totspills = mcpots->totspills;
199  totpots->goodspills = mcpots->goodspills;
200  }
201 
202  std::unique_ptr< sumdata::POTSum > p(totpots);
203  sr.put(std::move(p));
204  }
const char * p
Definition: xmltok.h:285
std::string pPotLabel
simb::Origin_t fMCOrigin
sumdata::POTSum * totpots
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
int goodspills
Definition: POTSum.h:31
ProductID put(std::unique_ptr< PROD > &&)
int totspills
Definition: POTSum.h:30
double totgoodpot
normalized by 10^12 POT
Definition: POTSum.h:28
double totpot
normalized by 10^12 POT
Definition: POTSum.h:27
Beam neutrinos.
Definition: MCTruth.h:23
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::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
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 ifdb::MIN::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 226 of file BNBInfo_module.cc.

References std::abs(), bfp, novadaq::timeutils::convertNovaTimeToUnixTime(), DEFINE_ART_MODULE(), release_diff::diff, dx, dy, allTimeWatchdog::endl, art::Handle< T >::failedToGet(), fBNBOffset, fMaxDeltaTCut, fMaxHornICut, fMaxPosXCut, fMaxPosYCut, fMCOrigin, fMinHornICut, fMinPosXCut, fMinPosYCut, fMinPOTCut, rawdata::RawTrigger::fTriggerMask_TriggerType, rawdata::RawTrigger::fTriggerTimingMarker_TimeStart, art::DataViewImpl::getByLabel(), art::DataViewImpl::getValidHandle(), sumdata::POTSum::goodspills, hp875offset, hp875station, hptg1offset, hptg1station, makeTrainCVSamples::int, isMC, art::Event::isRealData(), simb::MCTruth::Origin(), pPotLabel, pRawDataLabel, art::Event::put(), string, tgtstation, msf_helper::timespec, sumdata::POTSum::totgoodpot, sumdata::POTSum::totpot, totpots, sumdata::POTSum::totspills, vp875offset, vp875station, vptg1offset, vptg1station, x1, submit_syst::x2, y1, and submit_syst::y2.

227  {
228  std::unique_ptr<sumdata::SpillData> spilldata(new sumdata::SpillData());
229 
230  //count the total number of spills
231  // totpots->totspills++;
232 
233 
234  if(!evt.isRealData()){
235  // remove empty spill info write from here, move to GENIEGen and fill
236  isMC = true;
237 
238  // Ask MCTruth what I am
239 
240  // TODO: It would be ideal to get this from the Trigger information
241  // but currently it all reads back as TriggerType 0 ...
243  evt.getByLabel(pPotLabel, mcTruths);
244  if(mcTruths.failedToGet() || mcTruths->empty()) return;
245 
246  const simb::MCTruth& mcTruth = (*mcTruths)[0];
247 
248  fMCOrigin = mcTruth.Origin();
249 
250  return;
251  }
252 
253  //this will be the CORRECT UTC time we want ultimately
254  struct timespec unixTime;
255 
256  // Get trigger information to extract trigger time
257  auto trigv = evt.getValidHandle<std::vector<rawdata::RawTrigger> >(pRawDataLabel);
258  if( trigv.failedToGet() )
259  throw cet::exception("MIN") << "failed to get valid trigger handle";
260 
261  const rawdata::RawTrigger& trig = (*trigv)[0];
262 
263  if(trig.fTriggerMask_TriggerType != 1){
264  // This isn't a BNB trigger. Don't try to get beam info
265  return;
266  }
267 
269 
270  unsigned long int uevt_sec = unixTime.tv_sec; //utval >> 32 & 0xFFFFFFFFF;
271  unsigned long int uevt_nsec = unixTime.tv_nsec; //utval & 0xFFFFFFFFF;
272 
273  //DAQ event time
274  double DAQtime = uevt_sec + (0.000000001)*uevt_nsec;
275 
276 
277 
278  //torroid values and timestamps
279  double tor860=0.;
280  double tor875=0.;
281  double tor860time=0.;
282 
283  //for horn current
284  double thcurr=0.;
285 
286 
287  try{
288 
289  bfp->GetNamedData((DAQtime)-fBNBOffset,"E:TOR860@,E:TOR875", &tor860, &tor860time, &tor875);
290 
291  // This checks that the event time is close to the database time
292  // to ensure that we are grabbing the right data
293  double diff = 1e6; // a large number
294  diff = (DAQtime-fBNBOffset) - tor860time;
295 
296  spilldata->deltaspilltimensec = diff*1e9;
297 
298  unsigned long int time_closest_int = (int) tor860time;
299  double time_closest_ns = (tor860time - time_closest_int)*1e9;
300 
301  spilldata->spilltimesec = time_closest_int;
302  spilldata->spilltimensec = time_closest_ns;
303 
304  // If spill meets time requirement, calculate all quantities and
305  // fill appropriate fields
306  if(std::abs(spilldata->deltaspilltimensec) < fMaxDeltaTCut){
307 
308  double temppot = tor860;
309 
310  if(temppot < 0.02) temppot = tor875;
311 
312  // This guarantees that when toroid values go negative, total POT is not reduced
313  if(temppot < 0.0) temppot = 0.0;
314 
315  spilldata->spillpot = temppot;
316 
317  // Total POT
318  totpots->totpot += spilldata->spillpot;
319  totpots->totspills += 1;
320 
321  //These were 0 in old code, so set them to 0 here.
322  spilldata->gpsspilltimesec = 0.;
323  spilldata->gpsspilltimensec = 0.;
324 
325  // Horn current
326  bfp->GetNamedData(DAQtime-fBNBOffset,"E:THCURR", &thcurr);
327 
328  double ihorn = 0.;
329 
330  // Unlike NuMI, BNB gets horn current from a single input
331  ihorn += (thcurr - (+0.01));
332 
333  spilldata->hornI = ihorn;
334 
335 
336  // Horn polarity
337  spilldata->isRHC = false;
338  if(ihorn > 0){
339  spilldata->isRHC = true;
340  }
341 
342 
343 //===========Beam position==================
344 double HPTG1, VPTG1, HP875, VP875;
345 double xp, yp;
346 
347 
348  bfp->GetNamedData((DAQtime)-fBNBOffset,"E:HPTG1,E:VPTG1,E:HP875,E:VP875", &HPTG1, &VPTG1, &HP875, &VP875);
349 
350 
351  double x2 = HPTG1-hptg1offset;
352  double x1 = HP875-hp875offset;
353  double dx = x2-x1;
355  double y2 = VPTG1-vptg1offset;
356  double y1 = VP875-vp875offset;
357  double dy= y2-y1;
359 
360 
361 
362 
363  spilldata->posx = xp; //make it in mm
364  spilldata->posy = yp; //make it in mm
365 
366 
367 
368 
369 //==========================================
370 
371  spilldata->goodbeam = 0;
372 
373  // Apply good beam cuts
374  if((spilldata->spillpot > fMinPOTCut) // POT
375  && (spilldata->hornI > fMinHornICut
376  && spilldata->hornI < fMaxHornICut) // Horn I
377  && (spilldata->posx > fMinPosXCut
378  && spilldata->posx < fMaxPosXCut) // x position
379  && (spilldata->posy > fMinPosYCut
380  && spilldata->posy < fMaxPosYCut) // y position
381  && (std::abs(spilldata->deltaspilltimensec) < fMaxDeltaTCut)) // delta t
382  {
383  spilldata->goodbeam = 1;
384  } // Good beam cuts
385 
386 
387  // Total good POT
388  if(spilldata->goodbeam == 1){
389  totpots->totgoodpot += spilldata->spillpot;
390  totpots->goodspills += 1;
391  }
392 
393 
394  /* if(!(spilldata->spillpot>fMinPOTCut)){
395  mf::LogInfo("MIN") << "Failed POT cut" << std::endl;
396  }
397  if(!(spilldata->hornI>fMinHornICut && spilldata->hornI<fMaxHornICut)){
398  mf::LogInfo("MIN") << "Failed horn I cut" << std::endl;
399  }
400 
401  if(!(std::abs(spilldata->deltaspilltimensec)<1e9)){
402  mf::LogInfo("MIN") << "Failed time cut" << std::endl;
403  }
404  */
405 
406  } // if deltaspilltimensec < fMaxDeltaTCut
407 
408  else mf::LogInfo("MIN") << "Spill did not meet MaxDeltaT cut\n";
409 
410  }
411  catch (WebAPIException we){
412  // Eventually put in better error catching. What if each device isn't filled?
413  mf::LogError("MIN") << "Exception: " << we.what() << "\n";
414 
415 
416  //There are at least two types of exceptions. One, relatively infrequent case, which is
417  //from database flakes. This should be aborted on and retried. However, much more frequently,
418  //some of the variable information is missing from the record. This is unfortunate.
419  //We have implemented a nasty way to try to tell the difference between the two; it isn't
420  //super robust and there should be a better method. If you ever find one,
421  //please implement it.
422 
423  std::string exceptionString(we.what());
424 
425  std::size_t missVar = exceptionString.find("variable not found");
426  if(missVar != std::string::npos){
427  mf::LogInfo("MIN") << "***************We have a case of missing data\n"<<
428  "in the beam database! This isn't awesome, but \n"<<
429  "is probably ok and we have decided to not abort. \n"<<
430  "This decision was made on string comparisions and \n"<<
431  "is a bad hack.In the future, we should actually \n"<<
432  "throw different types of exceptions for different \n"<<
433  "types of problems!\n"<<
434  "***************"<<std::endl;
435  }
436  else{
437  std::abort();
438  }
439 
440  } // end try/catch
441 
442  evt.put(std::move(spilldata));
443 
444  } //end event loop
static constexpr double vp875station
std::unique_ptr< BeamFolder > bfp
double fMinHornICut
Float_t y1[n_points_granero]
Definition: compare.C:5
double fMinPOTCut
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
static constexpr double hp875station
Float_t x1[n_points_granero]
Definition: compare.C:5
std::string pRawDataLabel
simb::Origin_t Origin() const
Definition: MCTruth.h:73
std::string pPotLabel
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
double fBNBOffset
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool isRealData() const
Definition: Event.h:83
static constexpr double hptg1station
bool convertNovaTimeToUnixTime(uint64_t const &inputNovaTime, struct timespec &outputUnixTime)
float abs(float number)
Definition: d0nt_math.hpp:39
static constexpr double vp875offset
uint8_t fTriggerMask_TriggerType
Definition: RawTrigger.h:43
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
double dy[NP][NC]
double dx[NP][NC]
double fMinPosYCut
double fMinPosXCut
double fMaxPosXCut
simb::Origin_t fMCOrigin
sumdata::POTSum * totpots
static constexpr double hptg1offset
static constexpr double vptg1offset
double fMaxDeltaTCut
double fMaxHornICut
double fMaxPosYCut
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
unsigned long long fTriggerTimingMarker_TimeStart
Definition: RawTrigger.h:38
int goodspills
Definition: POTSum.h:31
static constexpr double hp875offset
int totspills
Definition: POTSum.h:30
static constexpr double tgtstation
static constexpr double vptg1station
Event generator information.
Definition: MCTruth.h:32
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
double totgoodpot
normalized by 10^12 POT
Definition: POTSum.h:28
double totpot
normalized by 10^12 POT
Definition: POTSum.h:27
bool failedToGet() const
Definition: Handle.h:196
enum BeamMode string
void ifdb::MIN::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 207 of file BNBInfo_module.cc.

References fBNBOffset, fMaxDeltaTCut, fMaxHornICut, fMaxPosXCut, fMaxPosYCut, fMinHornICut, fMinPosXCut, fMinPosYCut, fMinPOTCut, and fhicl::ParameterSet::get().

208  {
209  fMinPOTCut = pset.get< double >("MinPOTCut" );
210  fMinHornICut = pset.get< double >("MinHornICut" );
211  fMaxHornICut = pset.get< double >("MaxHornICut" );
212  fMinPosXCut = pset.get< double >("MinPosXCut" );
213  fMaxPosXCut = pset.get< double >("MaxPosXCut" );
214  fMinPosYCut = pset.get< double >("MinPosYCut" );
215  fMaxPosYCut = pset.get< double >("MaxPosYCut" );
216  fMaxDeltaTCut = pset.get< double >("MaxDeltaTCut" );
217  fBNBOffset = pset.get< double >("BNBOffset" );
218  }
double fMinHornICut
double fMinPOTCut
double fBNBOffset
double fMinPosYCut
double fMinPosXCut
T get(std::string const &key) const
Definition: ParameterSet.h:231
double fMaxPosXCut
double fMaxDeltaTCut
double fMaxHornICut
double fMaxPosYCut
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 double ifdb::MIN::actrn1 = 1.2467192*Munits::foot
staticprivate

Definition at line 133 of file BNBInfo_module.cc.

std::unique_ptr<BeamFolder> ifdb::MIN::bfp
private

Definition at line 91 of file BNBInfo_module.cc.

Referenced by MIN(), and produce().

int ifdb::MIN::channel
private

Definition at line 100 of file BNBInfo_module.cc.

Referenced by beginSubRun().

double ifdb::MIN::fBNBOffset
private

Definition at line 87 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMaxDeltaTCut
private

Definition at line 82 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMaxHornICut
private

Definition at line 81 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMaxPosXCut
private

Definition at line 84 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMaxPosYCut
private

Definition at line 86 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

simb::Origin_t ifdb::MIN::fMCOrigin
private

Definition at line 104 of file BNBInfo_module.cc.

Referenced by endSubRun(), and produce().

double ifdb::MIN::fMinHornICut
private

Definition at line 80 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMinPosXCut
private

Definition at line 83 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMinPosYCut
private

Definition at line 85 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

double ifdb::MIN::fMinPOTCut
private

Definition at line 79 of file BNBInfo_module.cc.

Referenced by produce(), and reconfigure().

TTree* ifdb::MIN::fOutTree
private

Definition at line 99 of file BNBInfo_module.cc.

Referenced by beginSubRun().

constexpr double ifdb::MIN::hp875offset = -3.40
staticprivate

Definition at line 128 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::hp875station = 0.0
staticprivate

Definition at line 122 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::hptg1offset = 0.46
staticprivate

Definition at line 127 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::hptg1station = 2.76
staticprivate

Definition at line 121 of file BNBInfo_module.cc.

Referenced by produce().

art::ServiceHandle<ifbeam_ns::IFBeam> ifdb::MIN::ifbeam_handle
private

Definition at line 90 of file BNBInfo_module.cc.

bool ifdb::MIN::isMC
private

Definition at line 96 of file BNBInfo_module.cc.

Referenced by endSubRun(), and produce().

constexpr double ifdb::MIN::PI = 3.14159265
staticprivate

Definition at line 107 of file BNBInfo_module.cc.

std::string ifdb::MIN::pPotLabel
private

Definition at line 93 of file BNBInfo_module.cc.

Referenced by endSubRun(), and produce().

std::string ifdb::MIN::pRawDataLabel
private

Definition at line 88 of file BNBInfo_module.cc.

Referenced by produce().

double ifdb::MIN::response
private

Definition at line 101 of file BNBInfo_module.cc.

Referenced by beginSubRun().

constexpr double ifdb::MIN::tgtstation = 4.80
staticprivate

Definition at line 125 of file BNBInfo_module.cc.

Referenced by produce().

sumdata::POTSum* ifdb::MIN::totpots
private

Definition at line 92 of file BNBInfo_module.cc.

Referenced by beginSubRun(), endSubRun(), and produce().

constexpr double ifdb::MIN::vp875offset = 1.48
staticprivate

Definition at line 130 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::vp875station = 0.20
staticprivate

Definition at line 124 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::vptg1offset = 0.39
staticprivate

Definition at line 129 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::vptg1station = 2.55
staticprivate

Definition at line 123 of file BNBInfo_module.cc.

Referenced by produce().

constexpr double ifdb::MIN::wirespacing = 0.5*Munits::mm
staticprivate

Definition at line 134 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_hp875 = 202.078003
staticprivate

Definition at line 110 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_hptg1 = 204.833267
staticprivate

Definition at line 115 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_hptg2 = 205.240662
staticprivate

Definition at line 117 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_hrndn = 208.317703
staticprivate

Definition at line 120 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_mtgt = 206.870895
staticprivate

Definition at line 119 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_mw875 = 201.820648
staticprivate

Definition at line 109 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_mw876 = 202.966766
staticprivate

Definition at line 112 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_mwtgt = 205.867645
staticprivate

Definition at line 118 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_target_le = 0.0*Munits::foot
staticprivate

Definition at line 132 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_vp875 = 202.281219
staticprivate

Definition at line 111 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_vptg1 = 204.629608
staticprivate

Definition at line 114 of file BNBInfo_module.cc.

constexpr double ifdb::MIN::z_vptg2 = 205.036835
staticprivate

Definition at line 116 of file BNBInfo_module.cc.


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