SystematicUncertaintyScaleAna_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file SystematicUncertaintyScaleAna_module.cc
3 // \brief
4 // \author Brian Rebel brebel@fnal.gov
5 ////////////////////////////////////////////////////////////////////////
6 
7 // Framework includes
10 #include "art_root_io/TFileService.h"
13 
14 #include "Calibrator/Calibrator.h"
15 
16 #include "TH1.h"
17 
18 namespace calib
19 {
20 
22  {
23  public:
26 
27  void analyze(art::Event const& evt);
28 
29  void reconfigure(fhicl::ParameterSet const& pset);
30 
31  void endJob();
32 
33  private:
34 
35  TH1F *fMuCXViewW; ///< W for the X view Muon Catcher
36  TH1F *fXViewW; ///< W for the X view
37  TH1F *fYViewW; ///< W for the Y view
38 
39  };
40 
41  //......................................................................
43  : EDAnalyzer(pset)
44  {
45  this->reconfigure(pset);
46 
47  return;
48  }
49 
50  //......................................................................
52  {
53  }
54 
55  //......................................................................
57  {
58  }
59 
60  //......................................................................
62  {
64 
66 
67  float halfWidth = geo->DetHalfWidth();
68  int numBins = 200;
69 
70  fMuCXViewW = tfs->make<TH1F>("MuCxViewW", ";w (cm);Systematic Scale Factor", numBins, -1.*halfWidth, halfWidth);
71  fXViewW = tfs->make<TH1F>("xViewW", ";w (cm);Systematic Scale Factor", numBins, -1.*halfWidth, halfWidth);
72  fYViewW = tfs->make<TH1F>("yViewW", ";w (cm);Systematic Scale Factor", numBins, -1.*halfWidth, halfWidth);
73 
74  // this module tests the calibrator as configured for the current job
75  // one could create new parameter sets to do multiple different tests
76  // of the calibrator by calling the Calibrator::reconfigure() method
77  // for each new parameter set
79 
80  for(int b = 1; b < fXViewW->GetNbinsX(); ++b){
81  const double w = fXViewW->GetBinCenter(b);
82  if( geo->DetId() == novadaq::cnv::kNEARDET )
83  fMuCXViewW->Fill(w, cal->SystematicUncertaintyScale(geo::kX, geo->FirstPlaneInMuonCatcher()+1, w));
84  fXViewW ->Fill(w, cal->SystematicUncertaintyScale(geo::kX, 0, w)); // plane moot
85  fYViewW ->Fill(w, cal->SystematicUncertaintyScale(geo::kY, 0, w)); // plane moot
86  }
87 
88 
89  return;
90  }
91 
92  //......................................................................
94  {
95  return;
96  }
97 
99 
100 } // end namespace
TH1F * fMuCXViewW
W for the X view Muon Catcher.
void reconfigure(fhicl::ParameterSet const &pset)
Vertical planes which measure X.
Definition: PlaneGeo.h:28
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
DEFINE_ART_MODULE(TestTMapFile)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
CDPStorage service.
SystematicUncertaintyScaleAna(fhicl::ParameterSet const &pset)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
int evt
Near Detector in the NuMI cavern.
double DetHalfWidth() const
const hit & b
Definition: hits.cxx:21
Helper for AttenCurve.
Definition: Path.h:10
Float_t w
Definition: plot.C:20
const unsigned int FirstPlaneInMuonCatcher() const
Returns the index of the first plane contained in the muon catcher.