9 #ifndef CheckRecoEnergy_H 10 #define CheckRecoEnergy_H 23 #include "art_root_io/TFileService.h" 25 #include "nugen/NuReweight/art/NuReweight.h" 32 #include "TGraphErrors.h" 169 fLepEnResNue = tfs->make<TH1D>(
"LepEnResNue",
"", 80, -2.0, 2.0);
170 fHadEnResNue = tfs->make<TH1D>(
"HadEnResNue",
"", 40, -2.0, 2.0);
171 fEnergyResNue = tfs->make<TH1D>(
"EnergyResNue",
"", 40, -2.0, 2.0);
175 TH1D *hEnResEnNumuCont = tfs->make<TH1D>(Form(
"hEnResEnNumuCont%d",
h),
"", 40, -2.0, 2.0);
177 TF1 *gausEnResNumuCont = tfs->make<TF1>(Form(
"gausEnResNumuCont%d",
h),
"gaus", -1.0, 1.0);
183 TH1D *hEnResEnNumuExit = tfs->make<TH1D>(Form(
"hEnResEnNumuExit%d",
h),
"", 40, -2.0, 2.0);
185 TF1 *gausEnResNumuExit = tfs->make<TF1>(Form(
"gausEnResNumuExit%d",
h),
"gaus", -1.0, 1.0);
191 TH1D *hEnResEnNue = tfs->make<TH1D>(Form(
"hEnResEnNue%d",
h),
"", 40, -2.0, 2.0);
193 TF1 *gausEnResNue = tfs->make<TF1>(Form(
"gausEnResNue%d",
h),
"gaus", -1.0, 1.0);
217 if (!ereconuein)
return;
220 if (!ereconumuin)
return;
226 fErecoNue = ereconuein->fNuLorentzVector.E();
230 fErecoNumu = ereconumuin->fNuLorentzVector.E();
237 std::vector< art::Ptr<simb::MCTruth> > truth;
238 auto mct = evt.
getHandle< std::vector<simb::MCTruth> >(
"generator");
244 for(
size_t i=0; i<truth.size(); i++){
247 mf::LogWarning(
"CheckRecoEnergy") <<
"Skipping MC truth index " << i;
251 fCCNC = truth[i]->GetNeutrino().CCNC();
252 fNuPDG = truth[i]->GetNeutrino().Nu().PdgCode();
253 fMode = truth[i]->GetNeutrino().Mode();
254 fNuVtxX = truth[i]->GetNeutrino().Nu().Vx();
255 fNuVtxY = truth[i]->GetNeutrino().Nu().Vy();
256 fNuVtxZ = truth[i]->GetNeutrino().Nu().Vz();
257 fEtrue = truth[i]->GetNeutrino().Nu().E();
258 fNuMomX = truth[i]->GetNeutrino().Nu().Momentum().X();
259 fNuMomY = truth[i]->GetNeutrino().Nu().Momentum().Y();
260 fNuMomZ = truth[i]->GetNeutrino().Nu().Momentum().Z();
261 fNuMomT = truth[i]->GetNeutrino().Nu().Momentum().T();
262 fLepPDG = truth[i]->GetNeutrino().Lepton().PdgCode();
263 fLepMomX = truth[i]->GetNeutrino().Lepton().Momentum().X();
264 fLepMomY = truth[i]->GetNeutrino().Lepton().Momentum().Y();
265 fLepMomZ = truth[i]->GetNeutrino().Lepton().Momentum().Z();
266 fLepMomT = truth[i]->GetNeutrino().Lepton().Momentum().T();
267 fLepNuAngle = truth[i]->GetNeutrino().Nu().Momentum().Vect().Angle(truth[i]->GetNeutrino().Lepton().
Momentum().Vect());
361 #endif // CheckRecoEnergy_H
std::vector< TF1 * > fFitEnResNumuExit
std::string fEnergyRecoNumuLabel
std::vector< double > fNumuExitBinEdge
void endSubRun(const art::SubRun &sr) override
Handle< PROD > getHandle(SelectorBase const &) const
TGraphErrors * fGrResEnNue
EDAnalyzer(fhicl::ParameterSet const &pset)
TH1D * fLepMomResNumuExit
TH1D * fEnergyResNumuExit
CheckRecoEnergy(fhicl::ParameterSet const &pset)
std::vector< TF1 * > fFitEnResNue
TGraphErrors * fGrResEnNumuExit
TGraphErrors * fGrSigEnNumuExit
TGraphErrors * fGrSigEnNumuCont
TGraphErrors * fGrSigEnNue
std::vector< TH1D * > fEnResEnNue
#define DEFINE_ART_MODULE(klass)
std::vector< double > fNumuContBinEdge
void analyze(art::Event const &evt) override
T get(std::string const &key) const
TH1D * fLepMomResNumuCont
void beginSubRun(const art::SubRun &sr) override
std::vector< TH1D * > fEnResEnNumuExit
std::string fEnergyRecoNueLabel
TH1D * fEnergyResNumuCont
void reconfigure(fhicl::ParameterSet const &pset)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< TH1D * > fEnResEnNumuCont
std::vector< double > fNueBinEdge
EventNumber_t event() const
TGraphErrors * fGrResEnNumuCont
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
static constexpr double sr
int fLongestTrackContNumu
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
virtual ~CheckRecoEnergy()
SubRunNumber_t subRun() const
std::vector< TF1 * > fFitEnResNumuCont