CorrSpec_SimpleExtrap.cxx
Go to the documentation of this file.
1 #include <bitset>
2 
4 
6 #include "FNEX/core/VarBinning.h"
8 
9 namespace fnex{
10 
11  //----------------------------------------------------------------------------
13  : CorrectedSpectrum(pset)
14  {
15  this->Reconfigure(pset);
16  }
17 
18  //----------------------------------------------------------------------------
20  fVarName = pset.get< std::string >("VarName");
21  fIsConfigured = true;
22  fFarNormalizationType = pset.get< std::string >("FarNormalizationType");
23  fNearNormalizationType = pset.get< std::string >("NearNormalizationType");
24  fDoOscillate[novadaq::cnv::kNEARDET] = pset.get< bool >("OscillateND", false);
25  fDoOscillate[novadaq::cnv::kFARDET] = pset.get< bool >("OscillateFD", true );
26 
27  return;
28  }
29 
30  //----------------------------------------------------------------------------
32  std::string r = "CorrSpec_SimpleExtrap_";
33  r += fVarName;
34  return r;
35  }
36 
37  //----------------------------------------------------------------------------
38  const TH1D & CorrSpec_SimpleExtrap::DataForFit() const{
40  }
41 
42  //----------------------------------------------------------------------------
43  const TH1D & CorrSpec_SimpleExtrap::MCForFit() const{
45  }
46 
47  //----------------------------------------------------------------------------
48  const std::vector<double> & CorrSpec_SimpleExtrap::DataPointsForFit() const{
49  return fDataPointsForFit;
50  }
51 
52  //----------------------------------------------------------------------------
53  const std::vector<double> & CorrSpec_SimpleExtrap::WeightsForFit() const{
54  return fWeightsForFit;
55  }
56 
57  //----------------------------------------------------------------------------
59 
61  throw cet::exception("CorrSpec_SimpleExtrap")
62  << "SpectrumList not generated! Cannot SetPlotStyles.";
63 
64  // Both the Corrected and UnCorrected maps are expected to have
65  // the same MetaData keys present
66  int color = 0;
68  auto uncorritr = fUncorrectedHistMap.begin();
69  for(auto corritr : fCorrectedHistMap){
70  md = corritr.first;
71  uncorritr = fUncorrectedHistMap.find(md);
72 
73  if(uncorritr == fUncorrectedHistMap.end())
74  throw cet::exception("CorrSpec_SimpleExtrap")
75  << "Unable to find metadata "
76  << md.ToString()
77  << " in the uncorrected histogram map";
78 
79  if(md.isMC){
80  if (md.fileType == fnex::kBeam ) color = 9;
81  else if(md.fileType == fnex::kTauSwap) color = 8;
82  else if(md.fileType == fnex::kSwap ) color = 7;
83 
84  corritr.second.SetFillColor(color);
85  corritr.second.SetFillStyle(1001);
86  corritr.second.SetOption("HIST");
87 
88  uncorritr->second.SetFillColor(color);
89  uncorritr->second.SetFillStyle(1001);
90  uncorritr->second.SetOption("HIST");
91  } // end if MC
92  else{
93  corritr.second.SetFillStyle(0);
94  corritr.second.SetMarkerColor(1);
95  corritr.second.SetMarkerStyle(2);
96  corritr.second.SetLineWidth(1);
97  corritr.second.SetOption("E1");
98 
99  uncorritr->second.SetFillStyle(0);
100  uncorritr->second.SetMarkerColor(1);
101  uncorritr->second.SetMarkerStyle(2);
102  uncorritr->second.SetLineWidth(1);
103  uncorritr->second.SetOption("E1");
104  } // end if data
105  } // end loop over spectrum metadata
106 
107 
108  // DetHistMap
109  std::set<novadaq::cnv::DetId> dets({novadaq::cnv::kNEARDET, novadaq::cnv::kFARDET});
110 
111  for(auto const& det : dets){
112 
113  // Corrected
114  fCorrectedHist_All_Data.at(det).SetMarkerColor(1);
115  fCorrectedHist_All_Data.at(det).SetMarkerStyle(2);
116  fCorrectedHist_All_Data.at(det).SetLineWidth(1);
117  fCorrectedHist_All_Data.at(det).SetOption("E1");
118 
119  fCorrectedHist_All_MC.at(det).SetFillStyle(0);
120  fCorrectedHist_All_MC.at(det).SetLineColor(2);
121  fCorrectedHist_All_MC.at(det).SetLineWidth(1);
122  fCorrectedHist_All_MC.at(det).SetOption("HIST");
123 
124  fCorrectedHist_All_Data_Over_MC.at(det).SetMarkerColor(1);
125  fCorrectedHist_All_Data_Over_MC.at(det).SetMarkerStyle(2);
126  fCorrectedHist_All_Data_Over_MC.at(det).SetLineWidth(1);
127  fCorrectedHist_All_Data_Over_MC.at(det).SetOption("E1");
128 
129  // Uncorrected
130  fUncorrectedHist_All_Data.at(det).SetMarkerColor(1);
131  fUncorrectedHist_All_Data.at(det).SetMarkerStyle(2);
132  fUncorrectedHist_All_Data.at(det).SetLineWidth(1);
133  fUncorrectedHist_All_Data.at(det).SetOption("E1");
134 
135  fUncorrectedHist_All_MC.at(det).SetFillStyle(0);
136  fUncorrectedHist_All_MC.at(det).SetLineColor(2);
137  fUncorrectedHist_All_MC.at(det).SetLineWidth(1);
138  fUncorrectedHist_All_MC.at(det).SetOption("HIST");
139 
140  fUncorrectedHist_All_Data_Over_MC.at(det).SetMarkerColor(1);
141  fUncorrectedHist_All_Data_Over_MC.at(det).SetMarkerStyle(2);
142  fUncorrectedHist_All_Data_Over_MC.at(det).SetLineWidth(1);
143  fUncorrectedHist_All_Data_Over_MC.at(det).SetOption("E1");
144 
145  }
146 
147  return;
148  }
149 
150  //----------------------------------------------------------------------------
152 
153  // Clear out existing SpectrumList if it's filled
154  fSpectrumListGenerated = false;
155  fSpectrumList.clear();
156 
157  // Keep a constant reference to the EventListMap
158  fEventListMap = &pEventListMap;
159 
160  fnex::Binning const* binning;
161 
162  // keep track of the types of MetaData which are present, at a minimum
163  // require ND data, ND beam MC, FD data, FD beam MC, FD flux swap MC,
164  // FD tau swap MC, set the bits in that order
165  // the bitset has all locations initialized to 0 by default.
166  std::bitset<6> requiredMD;
167 
168  // Look through pEventListMap, check for basic types required;
169  // if found, assign to class-wide MetaData definition for use as keys
171  size_t bit;
172  for(auto const& eventList : pEventListMap){
173  md = eventList.first;
174  binning = this->SpectrumBinning(md);
175 
176  // only use the numu selected events for this extrapolation
177  if(!md.IsNuMuSelected()) continue;
178 
179  fSpectrumList.emplace(md, Spectrum(eventList.second, binning, md.ToString()));
180 
181  // reset the bit
182  bit = 0;
183 
184  if(md.detector == novadaq::cnv::kFARDET) bit = 2;
185 
186  switch(md.fileType){
187  case fnex::kDataFile:
188  bit += 0;
189  break;
190  case fnex::kBeam:
191  bit += 1;
192  break;
193  case fnex::kSwap:
194  bit += 2;
195  break;
196  case fnex::kTauSwap:
197  bit += 3;
198  break;
200  break;
201  default:
202  throw cet::exception("CorrSpec_SimpleExtrap")
203  << "Unknown FileType: " << md.ToString();
204  }
205 
206  LOG_DEBUG("CorrSpec_SimpleExtrap")
207  << "Debug expected metadata issue: "
208  << md.ToString()
209  << " " << requiredMD.to_string()
210  << " " << bit
211  << " " << md.fileType;
212 
213  requiredMD.set(bit);
214  }
215 
216  // check that the expected metadata are present.
217  if( !requiredMD.all() )
218  throw cet::exception("CorrSpec_SimpleExtrap")
219  << "Some expected metadata are missing: "
220  << requiredMD.to_string() << std::endl;
221 
222  // we got here, so all the spectra are accounted for
223  fSpectrumListGenerated = true;
224 
225  // Now make the corrected histograms
226  LOG_DEBUG("CorrSpec_SimpleExtrap")
227  << "MakingCorrectedHistograms";
228 
230  this->MakeCorrectedHistograms();
231 
232  // We're done here
233  return fSpectrumListGenerated;
234  }
235 
236 
237  //----------------------------------------------------------------------------
239 
240  // Check that spectrum list is generated
242  throw cet::exception("CorrSpec_SimpleExtrap")
243  << "Spectrum list not generated!";
244 
245  // Make histograms, appropriately scaled to data those factors
246  std::string histname;
247  std::string histtitle;
249  std::string yaxisname = "Events";
250 
251  // make the HistMaps (uncombined hists)
252  // use the same binning as in the histograms for each metadata type
253  fnex::Binning const* binning;
254 
255  //auto hist = fSpectrumList.begin()->second.Histogram(fVarName);
256 
258  for(auto & spectrum : fSpectrumList){
259  md = spectrum.first;
260  binning = this->SpectrumBinning(md);
261 
262  histname = md.ToString() + "_Uncorr_SimpleExtrap_" + fVarName;
263  histtitle = md.ToStringLatex() + " (Uncorr::SimpleExtrap) (" + fVarName + ")";
264  histtitle += ";" + xaxisname + ";" + yaxisname;
265  fUncorrectedHistMap.emplace(md, TH1D(histname.c_str(),
266  histtitle.c_str(),
267  binning->nBins(),
268  &(binning->BinLowEdges()[0])) );
269  this->AddSpectrumHistogram(spectrum.second, fUncorrectedHistMap.at(md), fVarName);
270  }
271 
272  return true;
273  }
274 
275  //----------------------------------------------------------------------------
277 
278  // Check that spectrum list is generated
280  throw cet::exception("CorrSpec_SimpleExtrap")
281  << "Spectrum list not generated!";
282 
283  // Make histograms, appropriately scaled to data those factors
284  std::string histname;
285  std::string histtitle;
287  std::string yaxisname = "Events";
288 
289  // make the HistMaps (uncombined hists)
290  // use the same binning as in the histograms for each metadata type
291  //auto hist = fSpectrumList.begin()->second.Histogram(fVarName);
292 
293  fnex::Binning const* binning = nullptr;
294 
295  // First the uncorrected HistMap (uncombined hists)
297  for(auto & spectrum : fSpectrumList){
298  md = spectrum.first;
299  binning = this->SpectrumBinning(md);
300  histname = md.ToString() + "_Corr_SimpleExtrap_" + fVarName;
301  histtitle = md.ToStringLatex() + " (Corr::SimpleExtrap) (" + fVarName + ")";
302  histtitle += ";" + xaxisname + ";" + yaxisname;
303  fCorrectedHistMap.emplace(md, TH1D(histname.c_str(),
304  histtitle.c_str(),
305  binning->nBins(),
306  &(binning->BinLowEdges()[0])) );
307  this->AddSpectrumHistogram(spectrum.second, fCorrectedHistMap.at(md), fVarName);
308  }
309 
310  // Now name and title all of the histograms
311  // (ROOT's the worst; you'll get segfaults and other unpleasantries
312  // without unique names and titles for all TH1D instances)
313  std::set<std::pair<novadaq::cnv::DetId, std::string> > detectors({std::make_pair(novadaq::cnv::kNEARDET, "ND"),
315 
316  for(auto const& det : detectors){
317 
318  histname = det.second + "_Uncorr_SimpleExtrap_Data_" + fVarName;
319  histtitle = det.second + "::Uncorr::SimpleExtrap::Data::" + fVarName;
320  histtitle += ";" + xaxisname + ";" + yaxisname;
321  fUncorrectedHist_All_Data.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(),
322  binning->nBins(),
323  &(binning->BinLowEdges()[0])));
324 
325  fUncorrectedHist_All_Data.at(det.first).Sumw2();
326 
327  histname = det.second + "_Uncorr_SimpleExtrap_MC_" + fVarName;
328  histtitle = det.second + "::Uncorr::SimpleExtrap::MC::" + fVarName;
329  histtitle += ";" + xaxisname + ";" + yaxisname;
330  fUncorrectedHist_All_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(),
331  binning->nBins(),
332  &(binning->BinLowEdges()[0])));
333  fUncorrectedHist_All_MC.at(det.first).Sumw2();
334 
335  histname = det.second + "_Uncorr_SimpleExtrap_Data_Over_MC_" + fVarName;
336  histtitle = det.second + "::Uncorr::SimpleExtrap::Data_Over_MC::" + fVarName;
337  histtitle += ";" + xaxisname + ";" + yaxisname;
338  fUncorrectedHist_All_Data_Over_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(),
339  binning->nBins(),
340  &(binning->BinLowEdges()[0])));
341  fUncorrectedHist_All_Data_Over_MC.at(det.first).Sumw2();
342 
343  histname = det.second + "_Corr_SimpleExtrap_Data_" + fVarName;
344  histtitle = det.second + "::Corr::SimpleExtrap::Data::" + fVarName;
345  histtitle += ";" + xaxisname + ";" + yaxisname;
346  fCorrectedHist_All_Data.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(),
347  binning->nBins(),
348  &(binning->BinLowEdges()[0])));
349  fCorrectedHist_All_Data.at(det.first).Sumw2();
350 
351  histname = det.second + "_Corr_SimpleExtrap_MC_" + fVarName;
352  histtitle = det.second + "::Corr::SimpleExtrap::MC::" + fVarName;
353  histtitle += ";" + xaxisname + ";" + yaxisname;
354  fCorrectedHist_All_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(),
355  binning->nBins(),
356  &(binning->BinLowEdges()[0])));
357  fCorrectedHist_All_MC.at(det.first).Sumw2();
358 
359  histname = det.second + "_Corr_SimpleExtrap_Data_Over_MC_" + fVarName;
360  histtitle = det.second + "::Corr::SimpleExtrap::Data_Over_MC::" + fVarName;
361  histtitle += ";" + xaxisname + ";" + yaxisname;
362  fCorrectedHist_All_Data_Over_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(),
363  binning->nBins(),
364  &(binning->BinLowEdges()[0])));
365 
366  fCorrectedHist_All_Data_Over_MC.at(det.first).Sumw2();
367 
368  }
369 
370  LOG_VERBATIM("CorrSpec_SimpleExtrap")
371  << "Finished making histograms. There are "
372  << "\nUncorrectedHistMap: " << fUncorrectedHistMap.size()
373  << "\nCorrectedHistMap: " << fCorrectedHistMap.size()
374  << "\nUncorrectedAllData: " << fUncorrectedHist_All_Data.size()
375  << "\nUncorrectedAllMC: " << fUncorrectedHist_All_MC.size()
376  << "\nUncorrectedAllData/MC: " << fUncorrectedHist_All_Data_Over_MC.size()
377  << "\nCorrectedAllData: " << fCorrectedHist_All_Data.size()
378  << "\nCorrectedAllMC: " << fCorrectedHist_All_MC.size()
379  << "\nCorrectedAllData/MC: " << fCorrectedHist_All_Data_Over_MC.size();
380 
381  //std::cout << " about to set plot styles" << histname << std::endl;
382  this->SetPlotStyles();
383 
384  // We're done here
385  return true;
386  }
387 
388 
389  //----------------------------------------------------------------------------
391 
392 
393  // KM June 6 2016
394  // Reset fDataPointsForFit/fWeightsForFit. These are used for UBL fits.
395  fDataPointsForFit.resize(0);
396  fWeightsForFit.resize(0);
397 
398  // Check that spectrum list is generated
400  throw cet::exception("CorrSpec_SimpleExtrap")
401  << "Spectrum list not generated!";
402 
403  std::unordered_map<fnex::MetaData,
404  std::pair<double, double>,
405  fnex::MetaDataHasher> mdToEventsPOT;
406 
407  // store the number of events and POT for each detector's data
408  // the key is det * 1e4 + epoch
409  std::map<int, std::pair<double, double> > dataEventsPOT;
410 
411  // The key to fEventListMap and fSpectrumList is a fnex::MetaData,
412  // and both maps should have the same metadata present
413  fnex::MetaData md;
415  auto specItr = fSpectrumList.begin();
416  double events = 0.;
417  double pot = 0.;
418  int epochDetKey = 0;
419 
420  LOG_DEBUG("CorrSpec_SimpleExtrapEventsPerPOT")
421  << "EVENTS/POT:";
422 
423  // loop over the event lists to ensure that we have
424  // a spectrum for each list
425  for(auto evitr : *fEventListMap){
426  md = evitr.first;
427 
428  // we only want numu spectra here
429  if(!md.IsNuMuSelected()) continue;
430 
431  det = md.detector;
432  pot = evitr.second.ListSpillSummary().goodPOT;
433  events = 1. * fUncorrectedHistMap.at(md).GetEntries();
434 
435  mdToEventsPOT[md] = std::make_pair(events, pot);
436 
437  LOG_DEBUG("CorrSpec_SimpleExtrapEventsPerPOT")
438  << std::setw(35) << md.ToString()
439  << " " << std::setw(15) << events
440  << " / " << std::setw(15) << pot
441  << " = " << std::setw(15) << events / pot;
442 
443  if(!md.isMC){
444  epochDetKey = 1e4 * det + md.epoch;
445  dataEventsPOT[epochDetKey] = std::make_pair(events, pot);
446  }
447 
448  specItr = fSpectrumList.find(md);
449  if(specItr == fSpectrumList.end() )
450  throw cet::exception("CorrSpec_SimpleExtrap")
451  << "EventListMap and SpectrumList have different metadata keys: "
452  << md.ToString();
453 
454  // reset the uncorrected and corrected histograms, fill the uncorrected
455  // histograms now
456  fUncorrectedHistMap.at(md).Reset();
457  fCorrectedHistMap .at(md).Reset();
458  // std::cout << "CHECKING " << md.ToString() << std::endl;
459  if(md.isMC){
460  this->AddSpectrumHistogram(specItr->second,
461  fUncorrectedHistMap.at(md),
462  fVarName);
463  }else{
464  //std::cout << " IS DATA \n";
465  if(det == novadaq::cnv::kFARDET){
466  //std::cout << " IS FARDET \n";
467  // KM June 6 2016
468  // Grab FD data points as well as making histogram,
469  // and add to fDataPointsForFit. There will never be
470  // very many FD data events, this should not have
471  // an appreciable effect on speed.
472  this->AddSpectrumHistogram(specItr->second, fUncorrectedHistMap.at(md), fVarName);
473  std::vector<double> thisFDData = specItr->second.BaseVals(fVarName);
474  //std::cout << " CALLING FOR DATAPOINTSFORFIT with "
475  //<< thisFDData.size() << " POINTS\n";
477  thisFDData.begin(),
478  thisFDData.end());
479 
480  // SJB Aug 3 2016 - also grab data weights in order to pass
481  // these to the UBL fit object so that UBL fit value
482  // contributions can be weighted correctly.
483  std::vector<double> thisFDWeights = specItr->second.BaseVals(fnex::KeyToVarName(fnex::kFake_Weight));
484  fWeightsForFit.insert(fWeightsForFit.end(),
485  thisFDWeights.begin(),
486  thisFDWeights.end());
487  }else{
488  this->AddSpectrumHistogram(specItr->second, fUncorrectedHistMap.at(md), fVarName);
489  }
490  }
491  } // end loop over metadata to fill maps
492 
493  // reset the (un)corrected histograms for data and MC in each detector
494  std::set<novadaq::cnv::DetId> detectors({novadaq::cnv::kNEARDET, novadaq::cnv::kFARDET});
495  for(auto const& det : detectors){
496  fUncorrectedHist_All_Data .at(det).Reset();
497  fUncorrectedHist_All_MC .at(det).Reset();
498  fUncorrectedHist_All_Data_Over_MC.at(det).Reset();
499  fCorrectedHist_All_Data .at(det).Reset();
500  fCorrectedHist_All_MC .at(det).Reset();
501  fCorrectedHist_All_Data_Over_MC .at(det).Reset();
502  }
503 
504  // Make scale factors
505  // loop over the event and pot maps to determine the scale factors, we
506  // couldn't do this above because we did not know where the data were
507  std::pair<double, double> eventsPOT;
509  double scale = 0.;
510 
511  for(auto itr : *fEventListMap){
512  md = itr.first;
513 
514  // we only want numu spectra here
515  if(!md.IsNuMuSelected()) continue;
516 
517  det = md.detector;
518  scale = 1.;
519  eventsPOT = mdToEventsPOT.find(md)->second;
520  epochDetKey = 1e4 * det + md.epoch;
521 
522  // no need to normalize data
523  if(md.isMC){
524 
525  // figure out how we are normalizing for each detector
527  else if(det == novadaq::cnv::kFARDET ) norm = fFarNormalizationType;
528 
529  if(norm.compare("POT") == 0){
530  scale = dataEventsPOT.find(epochDetKey)->second.second/eventsPOT.second;
531  LOG_DEBUG("CorrSpec_SimpleExtrapScale")
532  << "POT AND SCALES:"
533  << std::setw(50)
534  << md.ToString()
535  << " "
536  << std::setw(15)
537  << eventsPOT.second
538  << " / "
539  << scale;
540  }
541  else if(norm.compare("AREA") == 0){
542  scale = dataEventsPOT.find(epochDetKey)->second.first/eventsPOT.first;
543  LOG_DEBUG("CorrSpec_SimpleExtrapScale")
544  << "AREA AND SCALES:\n"
545  << std::setw(50)
546  << md.ToString()
547  << " "
548  << std::setw(15)
549  << eventsPOT.first
550  << " / "
551  << scale;
552  }
553  else
554  LOG_VERBATIM("CorrSpec_SimpleExtrap")
555  << std::setw(40) << md.ToString() << " NO KNOWN NEAR NORM TYPE REGISTERED, ALL SCALES SET = 1.0";
556  } // end if MC
557 
558  // scale the histograms for each type of metadata accordingly
559  fUncorrectedHistMap.at(md).Scale(scale);
560 
561  if( md.isMC ){
562  // combine the results for all the metadata for each detector
563  //std::cout << "Adding in PLACE 6 " << md.ToString()<< std::endl;
564  fUncorrectedHist_All_MC.at(det).Add( &(fUncorrectedHistMap.at(md)) );
565  }
566  else{
567  // there is only 1 metadata type for each detector for data, so if we
568  // are not looking at MC events, then md is the only option for this det
569  fUncorrectedHist_All_Data.at(det).Add( &(fUncorrectedHistMap.at(md) ) );
570  }
571  } // end loop over the event lists (ie MetaData) for uncorrected histograms
572 
573  // take the ratio of the data to MC for the uncorrected histograms
576 
579 
580  // Now make the corrected HistMap (uncombined hists)
581  for(auto & itr : *fEventListMap){
582  md = itr.first;
583 
584  // only want to use numu selected events here
585  if(!md.IsNuMuSelected()) continue;
586 
587  det = md.detector;
588 
589  // start off with the corrected histogram being the same as the
590  // uncorrected one
591  fCorrectedHistMap.at(md).Add( &(fUncorrectedHistMap.at(md)) );
592 
593  if(md.isMC){
594 
595  // correct the FD MC histograms for the extrapolation from the ND
598  }
599 
600  // combine the results for all the metadata for each detector
601  fCorrectedHist_All_MC.at(det).Add( &(fCorrectedHistMap.at(md)) );
602 
603  } // end if MC
604  else{
605  // there is only 1 metadata type for each detector for data, so if we
606  // are not looking at MC events, then md is the only option for this det
607  fCorrectedHist_All_Data.at(det).Add( &(fCorrectedHistMap.at(md )) );
608  } // end if data
609 
610  } // end loop over metadata for corrected histograms
611 
612  // make the ratios of data to MC
615 
618 
619  // We're done here
620  return true;
621  }
622 
623  //----------------------------------------------------------------------------
625  TH1D & hist,
626  std::string const& varName)
627  {
628  TH1D* specHist = (TH1D*)spectrum.Histogram(varName);
629 
630  if( specHist ) hist.Add(specHist);
631 
632  return;
633  }
634 
635 
636  //----------------------------------------------------------------------------
638  {
639 
640  // Assign reference input point
641  fRefInputPoint = pInputPoint;
642 
643  // Currently just updates the histograms; no way to pass the
644  // information into the spectrum right now
645  LOG_DEBUG("CorrSpec_SimpleExtrap")
646  << " \n\n\nCORRSPEC_SIMPLEEXTRAP: Calling UpdateCorrectedHistograms : \n\n\n";
648 
649  // Find shift description from the input point; apply shift description
650  // to the linked spectrum objects
651 
652  return;
653  }
654 
655 
656 
657 }
unsigned char VarNameToKey(std::string const &name)
Definition: VarVals.h:279
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const EventListMap * fEventListMap
DetHistMap fUncorrectedHist_All_Data_Over_MC
bool IsNuMuSelected() const
Definition: Structs.cxx:256
const TH1 * Histogram(std::string const &varName)
Prepare a histogram using the fnex::Event objects in the fnex::EventList this Spectrum is using...
Definition: Spectrum.cxx:53
void AddSpectrumHistogram(fnex::Spectrum &spectrum, TH1D &hist, std::string const &varName)
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
std::map< fnex::MetaData, fnex::EventList > EventListMap
Definition: Event.h:186
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
static const unsigned char kFake_Weight
Definition: VarVals.h:39
Create a list of fnex::Events to be used in fits.
Double_t scale
Definition: plot.C:25
std::string const ToString() const
Definition: Structs.cxx:114
Far Detector at Ash River, MN.
virtual std::size_t nBins() const =0
Number of bins always means something, but data is stored differently in derived classes.
const std::vector< double > & DataPointsForFit() const
The Spectrum is the means for interaction with Event collections.
Definition: Spectrum.h:29
std::string KeyToLatex(unsigned char const &varkey)
Definition: VarVals.h:593
T get(std::string const &key) const
Definition: ParameterSet.h:231
DetHistMap fCorrectedHist_All_Data_Over_MC
#define pot
Near Detector in the NuMI cavern.
novadaq::cnv::DetId detector
Definition: Structs.h:50
fnex::FileType_t fileType
Definition: Structs.h:51
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
bool GenerateSpectrumList(EventListMap const &pEventListMap)
Float_t norm
void ApplyPoint(InputPoint const &pInputPoint)
fnex::InteractionType_t interactionType
Definition: Structs.h:53
fnex::Binning const * SpectrumBinning(fnex::MetaData const &md)
const std::string ToString() const
TRandom3 r(0)
CorrSpec_SimpleExtrap(fhicl::ParameterSet const &pset)
std::string KeyToVarName(unsigned char const &key)
Definition: VarVals.h:445
#define LOG_VERBATIM(category)
std::vector< double > fWeightsForFit
Base class for &#39;binning&#39; objects. Pure virtual – you want either a FixedBinning or a VariableBinning...
Definition: Binning.h:20
std::string const ToStringLatex() const
Definition: Structs.cxx:144
virtual std::vector< double > const & BinLowEdges() const =0
void events(int which)
Definition: Cana.C:52
const std::vector< double > & WeightsForFit() const
std::vector< double > fDataPointsForFit
void Reconfigure(fhicl::ParameterSet const &pset)
SpectrumList fSpectrumList
Internal-use function that updates the weight collections for a new set of oscillation parameters...