1 #ifndef PDSPTHINSLICEFITTER_hh 2 #define PDSPTHINSLICEFITTER_hh 12 #include "Math/Factory.h" 13 #include "Math/Functor.h" 14 #include "Math/Minimizer.h" 16 #include "TGraphAsymmErrors.h" 19 #include "TDecompChol.h" 40 std::string extra_name, TDirectory * xsec_dir, TDirectory * plot_dir,
41 bool post_fit =
false);
54 void DoThrows(
const TH1D & pars,
const TMatrixD * cov);
55 void Do1DShifts(
const TH1D & pars,
bool prefit=
false);
58 std::map<
int, std::vector<TH1*>> & throw_hists,
59 std::map<
int, std::vector<TH1*>> & throw_inc_hists,
60 std::map<
int, std::vector<TH1*>> & throw_xsec_hists);
62 std::map<
int, std::vector<TH1*>> & throw_hists,
63 std::map<
int, std::vector<TH1*>> & truth_throw_hists,
64 std::map<
int, std::vector<TH1*>> & truth_inc_hists,
65 std::map<
int, std::vector<TH1*>> & truth_xsec_hists);
75 std::map<int, std::vector<std::vector<ThinSliceSample>>>
fSamples,
198 I =
pow(10,-6)*10.5*18;
206 gamma = (energy + mass) / mass;
207 beta = sqrt( 1 - 1/
pow(gamma,2));
209 wmax = 2*me*
pow(beta,2)*
pow(gamma,2)/(1+2*gamma*me/mass +
pow(me,2)/
pow(mass,2));
215 dEdX = pitch*(rho*K*Z*
pow(charge,2))/(A*
pow(beta,2))*(0.5*log(2*me*
pow(gamma,2)*
pow(beta,2)*wmax/
pow(I,2)) -
pow(beta,2) -
densityEffect( beta, gamma )/2 );
221 double lar_C = 5.215, lar_x0 = 0.201, lar_x1 = 3, lar_a = 0.196, lar_k = 3;
222 long double x = log10(beta * gamma);
224 if( x >= lar_x1 )
return 2*log(10)*x - lar_C;
226 else if ( lar_x0 <= x && x < lar_x1)
return 2*log(10)*x - lar_C + lar_a *
pow(( lar_x1 - x ) , lar_k );
std::vector< ThinSliceEvent > fEvents
std::vector< int > fMeasurementSamples
std::string fDataFileName
size_t fTotalFluxParameters
std::map< int, TH1 * > fBestFitXSecs
std::map< int, std::vector< std::vector< ThinSliceSample > > > fSamples
double beta(double KE, const simb::MCParticle *part)
std::map< int, TH1 * > fFakeDataXSecs
void Configure(std::string fcl_file)
double CalcChi2SystTerm()
std::vector< double > fTrueIncidentBins
std::map< int, std::vector< int > > fFluxParsToSamples
std::map< std::string, ThinSliceSystematic > fSystParameters
std::vector< double > fBeamEnergyBins
void MakeThrowsTree(TTree &tree, std::vector< double > &branches)
std::map< int, double > fFluxParameters
std::vector< int > fIncidentSamples
TMatrixD * fCovMatrixDisplay
std::vector< std::pair< int, int > > fPlotStyle
void GetCurrentTruthHists(std::map< int, std::vector< TH1 * >> &throw_hists, std::map< int, std::vector< TH1 * >> &throw_inc_hists, std::map< int, std::vector< TH1 * >> &throw_xsec_hists)
std::map< int, TH1D * > fBestFitSelectionHists
std::map< int, TH1 * > fNominalXSecs
std::vector< double > fIncidentRecoBins
std::vector< ThinSliceEvent > fFakeDataEvents
std::vector< double > fParLimitsUp
std::map< std::string, double > fToyValues
std::map< int, double > fBestFitFluxPars
ROOT::Math::Functor fFitFunction
std::map< int, std::vector< std::vector< double > > > fFakeFluxesBySample
std::map< int, double > fFakeFluxes
std::vector< std::string > fSystParameterNames
std::vector< fhicl::ParameterSet > fSampleSets
std::map< int, std::vector< double > > fBestFitTruthVals
std::map< int, TH1 * > fBestFitIncs
double dEdX(double KE, const simb::MCParticle *part)
std::map< int, std::vector< double > > fBestFitSignalPars
std::map< std::string, ThinSliceSystematic > fBestFitSystPars
std::map< int, std::vector< std::string > > fSignalParameterNames
std::unique_ptr< ROOT::Math::Minimizer > fMinimizer
std::map< std::string, size_t > fCovarianceBins
double densityEffect(double beta, double gamma)
std::map< int, std::vector< double > > fSignalParameters
std::string fFakeDataRoutine
size_t fTotalSystParameters
std::map< int, std::vector< std::vector< ThinSliceSample > > > fFakeSamples
std::map< int, TH1 * > fFakeDataIncs
PDSPThinSliceFitter(std::string fcl_file, std::string output_file)
std::map< int, TH1 * > fNominalIncs
std::map< int, std::vector< std::vector< double > > > fFluxesBySample
double gamma(double KE, const simb::MCParticle *part)
double BetheBloch(double energy, double mass)
std::map< int, std::vector< double > > fSignalBins
void PlotThrows(std::map< int, std::vector< TH1 * >> &throw_hists, std::map< int, std::vector< TH1 * >> &truth_throw_hists, std::map< int, std::vector< TH1 * >> &truth_inc_hists, std::map< int, std::vector< TH1 * >> &truth_xsec_hists)
std::vector< double > fMinimizerInitVals
std::map< int, std::string > fFluxParameterNames
bool fFillIncidentInFunction
void InitializeMCSamples()
void CompareDataMC(std::string extra_name, TDirectory *xsec_dir, TDirectory *plot_dir, bool post_fit=false)
std::vector< fhicl::ParameterSet > fSelectionSets
std::vector< double > GetBestFitParsVec()
std::map< int, std::vector< double > > fFakeDataScales
std::map< std::string, double > fSystsToFix
size_t fTotalSignalParameters
std::map< int, bool > fIsSignalSample
std::map< int, std::string > fFluxTypes
void BuildFakeDataXSecs(bool use_scales=true)
std::vector< double > fParLimits
void Do1DShifts(const TH1D &pars, bool prefit=false)
void DoThrows(const TH1D &pars, const TMatrixD *cov)
fhicl::ParameterSet fAnalysisOptions
ThinSliceDataSet fDataSet
ThinSliceDriver * fThinSliceDriver
std::map< int, double > fNominalFluxes