CorrSpec_NoExtrapNuMu.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_NoExtrapNuMu_";
33  r += fVarName;
34  return r;
35  }
36 
37  //----------------------------------------------------------------------------
38  const TH1D & CorrSpec_NoExtrapNuMu::DataForFit() const{
40  }
41 
42  //----------------------------------------------------------------------------
43  const TH1D & CorrSpec_NoExtrapNuMu::MCForFit() const{
45  }
46 
47  //----------------------------------------------------------------------------
48  const std::vector<double> & CorrSpec_NoExtrapNuMu::DataPointsForFit() const{
49  return fDataPointsForFit;
50  }
51 
52  //----------------------------------------------------------------------------
53  const std::vector<double> & CorrSpec_NoExtrapNuMu::WeightsForFit() const{
54  return fWeightsForFit;
55  }
56 
57  //----------------------------------------------------------------------------
59 
61  throw cet::exception("CorrSpec_NoExtrapNuMu")
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_NoExtrapNuMu")
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_NoExtrapNuMu")
203  << "Unknown FileType: " << md.ToString();
204  }
205 
206  LOG_DEBUG("CorrSpec_NoExtrapNuMu")
207  << md.ToString()
208  << " " << requiredMD.to_string()
209  << " " << bit
210  << " " << md.fileType;
211 
212  requiredMD.set(bit);
213  }
214 
215  // check that the expected metadata are present.
216  if( !requiredMD.all() )
217  throw cet::exception("CorrSpec_NoExtrapNuMu")
218  << "Some expected metadata are missing: "
219  << requiredMD.to_string() << std::endl;
220 
221  // we got here, so all the spectra are accounted for
222  fSpectrumListGenerated = true;
223 
224  // Now make the corrected histograms
225  LOG_DEBUG("CorrSpec_NoExtrapNuMu")
226  << "MakingCorrectedHistograms";
227 
229  this->MakeCorrectedHistograms();
230 
231  // We're done here
232  return fSpectrumListGenerated;
233  }
234 
235 
236  //----------------------------------------------------------------------------
238 
239  // Check that spectrum list is generated
241  throw cet::exception("CorrSpec_NoExtrapNuMu")
242  << "Spectrum list not generated!";
243 
244  // Make histograms, appropriately scaled to data those factors
245  std::string histname;
246  std::string histtitle;
248  std::string yaxisname = "Events";
249 
250  // make the HistMaps (uncombined hists)
251  // use the same binning as in the histograms for each metadata type
252  //auto hist = fSpectrumList.begin()->second.Histogram(fVarName);
253 
254  fnex::Binning const* binning;
255 
257  for(auto & spectrum : fSpectrumList){
258  md = spectrum.first;
259  binning = this->SpectrumBinning(md);
260  histname = md.ToString() + "_Uncorr_NoExtrapNuMu_" + fVarName;
261  histtitle = md.ToStringLatex() + " (Uncorr::NoExtrapNuMu) (" + fVarName + ")";
262  histtitle += ";" + xaxisname + ";" + yaxisname;
263  fUncorrectedHistMap.emplace(md, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
264  this->AddSpectrumHistogram(spectrum.second, fUncorrectedHistMap.at(md), fVarName);
265  }
266 
267  return true;
268  }
269 
270  //----------------------------------------------------------------------------
272 
273  // Check that spectrum list is generated
275  throw cet::exception("CorrSpec_NoExtrapNuMu")
276  << "Spectrum list not generated!";
277 
278  // Make histograms, appropriately scaled to data those factors
279  std::string histname;
280  std::string histtitle;
282  std::string yaxisname = "Events";
283 
284  // make the HistMaps (uncombined hists)
285  // use the same binning as in the histograms for each metadata type
286  //auto hist = fSpectrumList.begin()->second.Histogram(fVarName);
287 
288  fnex::Binning const* binning = nullptr;
289 
290  // First the uncorrected HistMap (uncombined hists)
292  for(auto & spectrum : fSpectrumList){
293  md = spectrum.first;
294  binning = this->SpectrumBinning(md);
295  histname = md.ToString() + "_Corr_NoExtrapNuMu_" + fVarName;
296  histtitle = md.ToStringLatex() + " (Corr::NoExtrapNuMu) (" + fVarName + ")";
297  histtitle += ";" + xaxisname + ";" + yaxisname;
298  fCorrectedHistMap.emplace(md, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
299  this->AddSpectrumHistogram(spectrum.second, fCorrectedHistMap.at(md), fVarName);
300  }
301 
302  // Now name and title all of the histograms
303  // (ROOT's the worst; you'll get segfaults and other unpleasantries
304  // without unique names and titles for all TH1D instances)
305  std::set<std::pair<novadaq::cnv::DetId, std::string> > detectors({std::make_pair(novadaq::cnv::kNEARDET, "ND"),
307 
308  for(auto const& det : detectors){
309 
310  histname = det.second + "_Uncorr_NoExtrapNuMu_Data_" + fVarName;
311  histtitle = det.second + "::Uncorr::NoExtrapNuMu::Data::" + fVarName;
312  histtitle += ";" + xaxisname + ";" + yaxisname;
313  fUncorrectedHist_All_Data.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
314 
315  fUncorrectedHist_All_Data.at(det.first).Sumw2();
316 
317  histname = det.second + "_Uncorr_NoExtrapNuMu_MC_" + fVarName;
318  histtitle = det.second + "::Uncorr::NoExtrapNuMu::MC::" + fVarName;
319  histtitle += ";" + xaxisname + ";" + yaxisname;
320  fUncorrectedHist_All_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
321  fUncorrectedHist_All_MC.at(det.first).Sumw2();
322 
323  histname = det.second + "_Uncorr_NoExtrapNuMu_Data_Over_MC_" + fVarName;
324  histtitle = det.second + "::Uncorr::NoExtrapNuMu::Data_Over_MC::" + fVarName;
325  histtitle += ";" + xaxisname + ";" + yaxisname;
326  fUncorrectedHist_All_Data_Over_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
327  fUncorrectedHist_All_Data_Over_MC.at(det.first).Sumw2();
328 
329  histname = det.second + "_Uncorr_NoExtrapNuMu_Data_" + fVarName;
330  histtitle = det.second + "::Uncorr::NoExtrapNuMu::Data::" + fVarName;
331  histtitle += ";" + xaxisname + ";" + yaxisname;
332  fCorrectedHist_All_Data.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
333  fCorrectedHist_All_Data.at(det.first).Sumw2();
334 
335  histname = det.second + "_Uncorr_NoExtrapNuMu_MC_" + fVarName;
336  histtitle = det.second + "::Uncorr::NoExtrapNuMu::MC::" + fVarName;
337  histtitle += ";" + xaxisname + ";" + yaxisname;
338  fCorrectedHist_All_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
339  fCorrectedHist_All_MC.at(det.first).Sumw2();
340 
341  histname = det.second + "_Uncorr_NoExtrapNuMu_Data_Over_MC_" + fVarName;
342  histtitle = det.second + "::Uncorr::NoExtrapNuMu::Data_Over_MC::" + fVarName;
343  histtitle += ";" + xaxisname + ";" + yaxisname;
344  fCorrectedHist_All_Data_Over_MC.emplace(det.first, TH1D(histname.c_str(), histtitle.c_str(), binning->nBins(), &(binning->BinLowEdges()[0])));
345 
346  fCorrectedHist_All_Data_Over_MC.at(det.first).Sumw2();
347 
348  }
349 
350  LOG_VERBATIM("CorrSpec_NoExtrapNuMu")
351  << "Finished making histograms. There are "
352  << "\nUncorrectedHistMap: " << fUncorrectedHistMap.size()
353  << "\nCorrectedHistMap: " << fCorrectedHistMap.size()
354  << "\nUncorrectedAllData: " << fUncorrectedHist_All_Data.size()
355  << "\nUncorrectedAllMC: " << fUncorrectedHist_All_MC.size()
356  << "\nUncorrectedAllData/MC: " << fUncorrectedHist_All_Data_Over_MC.size()
357  << "\nCorrectedAllData: " << fCorrectedHist_All_Data.size()
358  << "\nCorrectedAllMC: " << fCorrectedHist_All_MC.size()
359  << "\nCorrectedAllData/MC: " << fCorrectedHist_All_Data_Over_MC.size();
360 
361  //std::cout << " about to set plot styles" << histname << std::endl;
362  this->SetPlotStyles();
363 
364  // We're done here
365  return true;
366  }
367 
368 
369  //----------------------------------------------------------------------------
371 
372 
373  // KM June 6 2016
374  // Reset fDataPointsForFit/fWeightsForFit. These are used for UBL fits.
375  fDataPointsForFit.resize(0);
376  fWeightsForFit.resize(0);
377 
378  // Check that spectrum list is generated
380  throw cet::exception("CorrSpec_NoExtrapNuMu")
381  << "Spectrum list not generated!";
382 
383  std::unordered_map<fnex::MetaData,
384  std::pair<double, double>,
385  fnex::MetaDataHasher> mdToEventsPOT;
386 
387  // store the number of events and POT for each detector's data
388  // the key is det * 1e4 + epoch
389  std::map<int, std::pair<double, double> > dataEventsPOT;
390 
391  // The key to fEventListMap and fSpectrumList is a fnex::MetaData,
392  // and both maps should have the same metadata present
393  fnex::MetaData md;
395  auto specItr = fSpectrumList.begin();
396  double events = 0.;
397  double pot = 0.;
398  int epochDetKey = 0;
399 
400  LOG_DEBUG("CorrSpec_NoExtrapNuMuEventsPerPOT")
401  << "EVENTS/POT:";
402 
403  // loop over the event lists to ensure that we have
404  // a spectrum for each list
405  for(auto evitr : *fEventListMap){
406  md = evitr.first;
407 
408  // we only want numu spectra here
409  if(!md.IsNuMuSelected()) continue;
410 
411  det = md.detector;
412  pot = evitr.second.ListSpillSummary().goodPOT;
413  events = 1. * fUncorrectedHistMap.at(md).GetEntries();
414 
415  mdToEventsPOT[md] = std::make_pair(events, pot);
416 
417  LOG_DEBUG("CorrSpec_NoExtrapNuMuEventsPerPOT")
418  << std::setw(35) << md.ToString()
419  << " " << std::setw(15) << events
420  << " / " << std::setw(15) << pot
421  << " = " << std::setw(15) << events / pot;
422 
423  if(!md.isMC){
424  epochDetKey = 1e4 * det + md.epoch;
425  dataEventsPOT[epochDetKey] = std::make_pair(events, pot);
426  }
427 
428  specItr = fSpectrumList.find(md);
429  if(specItr == fSpectrumList.end() )
430  throw cet::exception("CorrSpec_NoExtrapNuMu")
431  << "EventListMap and SpectrumList have different metadata keys: "
432  << md.ToString();
433 
434  // reset the uncorrected and corrected histograms, fill the uncorrected
435  // histograms now
436  fUncorrectedHistMap.at(md).Reset();
437  fCorrectedHistMap .at(md).Reset();
438  // std::cout << "CHECKING " << md.ToString() << std::endl;
439  if(md.isMC){
440  this->AddSpectrumHistogram(specItr->second,
441  fUncorrectedHistMap.at(md),
442  fVarName);
443  }else{
444  //std::cout << " IS DATA \n";
445  if(det == novadaq::cnv::kFARDET){
446  //std::cout << " IS FARDET \n";
447  // KM June 6 2016
448  // Grab FD data points as well as making histogram,
449  // and add to fDataPointsForFit. There will never be
450  // very many FD data events, this should not have
451  // an appreciable effect on speed.
452  this->AddSpectrumHistogram(specItr->second, fUncorrectedHistMap.at(md), fVarName);
453  std::vector<double> thisFDData = specItr->second.BaseVals(fVarName);
454  //std::cout << " CALLING FOR DATAPOINTSFORFIT with "
455  //<< thisFDData.size() << " POINTS\n";
457  thisFDData.begin(),
458  thisFDData.end());
459 
460  // SJB Aug 3 2016 - also grab data weights in order to pass
461  // these to the UBL fit object so that UBL fit value
462  // contributions can be weighted correctly.
463  std::vector<double> thisFDWeights = specItr->second.BaseVals(fnex::KeyToVarName(fnex::kFake_Weight));
464  fWeightsForFit.insert(fWeightsForFit.end(),
465  thisFDWeights.begin(),
466  thisFDWeights.end());
467  }else{
468  this->AddSpectrumHistogram(specItr->second, fUncorrectedHistMap.at(md), fVarName);
469  }
470  }
471  } // end loop over metadata to fill maps
472 
473  // reset the (un)corrected histograms for data and MC in each detector
474  std::set<novadaq::cnv::DetId> detectors({novadaq::cnv::kNEARDET, novadaq::cnv::kFARDET});
475  for(auto const& det : detectors){
476  fUncorrectedHist_All_Data .at(det).Reset();
477  fUncorrectedHist_All_MC .at(det).Reset();
478  fUncorrectedHist_All_Data_Over_MC.at(det).Reset();
479  fCorrectedHist_All_Data .at(det).Reset();
480  fCorrectedHist_All_MC .at(det).Reset();
481  fCorrectedHist_All_Data_Over_MC .at(det).Reset();
482  }
483 
484  // Make scale factors
485  // loop over the event and pot maps to determine the scale factors, we
486  // couldn't do this above because we did not know where the data were
487  std::pair<double, double> eventsPOT;
489  double scale = 0.;
490 
491  for(auto itr : *fEventListMap){
492  md = itr.first;
493 
494  // we only want numu spectra here
495  if(!md.IsNuMuSelected()) continue;
496 
497  det = md.detector;
498  scale = 1.;
499  eventsPOT = mdToEventsPOT.find(md)->second;
500  epochDetKey = 1e4 * det + md.epoch;
501 
502  // no need to normalize data
503  if(md.isMC){
504 
505  // figure out how we are normalizing for each detector
507  else if(det == novadaq::cnv::kFARDET ) norm = fFarNormalizationType;
508 
509  if(norm.compare("POT") == 0){
510  scale = dataEventsPOT.find(epochDetKey)->second.second/eventsPOT.second;
511  LOG_DEBUG("CorrSpec_NoExtrapNuMuScale")
512  << "POT AND SCALES:"
513  << std::setw(50)
514  << md.ToString()
515  << " "
516  << std::setw(15)
517  << eventsPOT.second
518  << " / "
519  << scale;
520  }
521  else if(norm.compare("AREA") == 0){
522  scale = dataEventsPOT.find(epochDetKey)->second.first/eventsPOT.first;
523  LOG_DEBUG("CorrSpec_NoExtrapNuMuScale")
524  << "AREA AND SCALES:\n"
525  << std::setw(50)
526  << md.ToString()
527  << " "
528  << std::setw(15)
529  << eventsPOT.first
530  << " / "
531  << scale;
532  }
533  else
534  LOG_VERBATIM("CorrSpec_NoExtrapNuMu")
535  << std::setw(40) << md.ToString() << " NO KNOWN NEAR NORM TYPE REGISTERED, ALL SCALES SET = 1.0";
536  } // end if MC
537 
538  // scale the histograms for each type of metadata accordingly
539  fUncorrectedHistMap.at(md).Scale(scale);
540 
541  if( md.isMC ){
542  // combine the results for all the metadata for each detector
543  //std::cout << "Adding in PLACE 6 " << md.ToString()<< std::endl;
544  fUncorrectedHist_All_MC.at(det).Add( &(fUncorrectedHistMap.at(md)) );
545  }
546  else{
547  // there is only 1 metadata type for each detector for data, so if we
548  // are not looking at MC events, then md is the only option for this det
549  fUncorrectedHist_All_Data.at(det).Add( &(fUncorrectedHistMap.at(md) ) );
550  }
551  } // end loop over the event lists (ie MetaData) for uncorrected histograms
552 
553  // take the ratio of the data to MC for the uncorrected histograms
556 
559 
560  // Now make the corrected HistMap (uncombined hists)
561  for(auto & itr : *fEventListMap){
562  md = itr.first;
563 
564  // only want to use numu selected events here
565  if(!md.IsNuMuSelected()) continue;
566 
567  det = md.detector;
568 
569  // start off with the corrected histogram being the same as the
570  // uncorrected one
571  fCorrectedHistMap.at(md).Add( &(fUncorrectedHistMap.at(md)) );
572 
573  if(md.isMC){
574 
575  // combine the results for all the metadata for each detector
576  fCorrectedHist_All_MC.at(det).Add( &(fCorrectedHistMap.at(md)) );
577 
578  } // end if MC
579  else{
580  // there is only 1 metadata type for each detector for data, so if we
581  // are not looking at MC events, then md is the only option for this det
582  fCorrectedHist_All_Data.at(det).Add( &(fCorrectedHistMap.at(md )) );
583  } // end if data
584 
585  } // end loop over metadata for corrected histograms
586 
587  // make the ratios of data to MC
590 
593 
594  // We're done here
595  return true;
596  }
597 
598  //----------------------------------------------------------------------------
600  TH1D & hist,
601  std::string const& varName)
602  {
603  TH1D* specHist = (TH1D*)spectrum.Histogram(varName);
604 
605  if( specHist ) hist.Add(specHist);
606 
607  return;
608  }
609 
610 
611  //----------------------------------------------------------------------------
613  {
614 
615  // Assign reference input point
616  fRefInputPoint = pInputPoint;
617 
618  // Currently just updates the histograms; no way to pass the
619  // information into the spectrum right now
620  LOG_DEBUG("CorrSpec_NoExtrapNuMu")
621  << " \n\n\nCORRSPEC_SIMPLEEXTRAP: Calling UpdateCorrectedHistograms : \n\n\n";
623 
624  // Find shift description from the input point; apply shift description
625  // to the linked spectrum objects
626 
627  return;
628  }
629 
630 
631 
632 }
unsigned char VarNameToKey(std::string const &name)
Definition: VarVals.h:279
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const std::vector< double > & WeightsForFit() const
const EventListMap * fEventListMap
DetHistMap fUncorrectedHist_All_Data_Over_MC
bool IsNuMuSelected() const
Definition: Structs.cxx:256
void AddSpectrumHistogram(fnex::Spectrum &spectrum, TH1D &hist, std::string const &varName)
void Reconfigure(fhicl::ParameterSet const &pset)
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
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
std::map< fnex::MetaData, fnex::EventList > EventListMap
Definition: Event.h:186
std::vector< double > fDataPointsForFit
const std::vector< double > & DataPointsForFit() const
bool GenerateSpectrumList(EventListMap const &pEventListMap)
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.
CorrSpec_NoExtrapNuMu(fhicl::ParameterSet const &pset)
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.
SpectrumList fSpectrumList
Internal-use function that updates the weight collections for a new set of oscillation parameters...
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
const std::string ToString() const
fnex::FileType_t fileType
Definition: Structs.h:51
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
Float_t norm
fnex::Binning const * SpectrumBinning(fnex::MetaData const &md)
TRandom3 r(0)
void ApplyPoint(InputPoint const &pInputPoint)
std::vector< double > fWeightsForFit
std::string KeyToVarName(unsigned char const &key)
Definition: VarVals.h:445
#define LOG_VERBATIM(category)
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