Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

SKZPWeightCalculator Class Reference

#include <SKZPWeightCalculator.h>

Inheritance diagram for SKZPWeightCalculator:

WeightCalculator List of all members.

Public Types

typedef enum SKZPWeightCalculator::ESKZPConfig SKZPConfig_t
typedef enum SKZPWeightCalculator::EFluxErrEffect FluxErrEffect_t
typedef enum SKZPWeightCalculator::ESampleSelection SampleSelection_t
typedef enum SKZPWeightCalculator::ERunPeriod RunPeriod_t
enum  ESKZPConfig {
  kUnknown = 0, kPRL = 1, kBoston = 2, kPiMinus = 3,
  kDetXs = 4, kDogwood1_Daikon07 = 5, kDogwood1_Daikon07_v2 = 6
}
enum  EFluxErrEffect {
  kHadProdAfterTune = 8, kTotalErrorPreTune = 10, kTotalErrorAfterTune = 11, kTotalFocusing = 12,
  kTarget = 15
}
enum  ESampleSelection { kNotSpecified = 0, kNuMuCC = 1, kAntiNuMu = 2, kNue = 3 }
enum  ERunPeriod {
  kNone = 0, kRunI = 1, kRunII = 2, kRunIII = 3,
  kRunIV = 4, kEndOfList = 5
}

Public Member Functions

RunPeriod_t RunPeriodFromInt (int rpit)
int RunPeriodIntFromValidity (VldContext vc)
 SKZPWeightCalculator (Registry *stdconfig=0)
 SKZPWeightCalculator (std::string cn, bool readfromdb, bool beamonly=false)
virtual ~SKZPWeightCalculator ()
void SetReweightConfigName (std::string cn)
void SetSampleSelection (std::string ss)
virtual void Config ()
void ChangeParameters (std::vector< double > *bs, std::vector< double > *hp, std::vector< double > *det)
void GetParameters (std::vector< double > &bs, std::vector< double > &hp, std::vector< double > &det)
virtual double GetWeight (Registry *eventinfo)
virtual double GetWeight (MCEventInfo *, NuParent *)
double GetWeight (const NtpMCTruth *mc, int det, int Ibeam, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight, RunPeriod_t rp=kRunI, double true_eshw=-1, MCEventInfo *ei=0)
double GetWeight (const NtpMCFluxInfo *fi, int det, int Ibeam, int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight, RunPeriod_t rp=kRunI, double true_eshw=-1, MCEventInfo *ei=0)
double GetWeight (int det, int Ibeam, int tptype, double pt, double pz, int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight, RunPeriod_t rp=kRunI, double true_eshw=-1, MCEventInfo *ei=0)
double GetWeight (const NtpMCTruth *mc, int det, int Ibeam, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight, VldContext vc, double true_eshw=-1, MCEventInfo *ei=0)
double GetWeight (const NtpMCFluxInfo *fi, int det, int Ibeam, int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight, VldContext vc, double true_eshw=-1, MCEventInfo *ei=0)
double GetWeight (int det, int Ibeam, int tptype, double pt, double pz, int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight, VldContext vc, double true_eshw=-1, MCEventInfo *ei=0)
double GetBeamWeight (int det, int Ibeam, int tptype, double pt, double pz, double true_enu, int inu, RunPeriod_t rp=kRunI)
double GetBeamWeight (int det, int Ibeam, int tptype, double pt, double pz, double true_enu, int inu, VldContext vc)
double GetDetWeight (int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double true_eshw=-1, MCEventInfo *ei=0)
double GetFluxError (int det, int Ibeam, int inu, double true_enu, FluxErrEffect_t neffect=kTotalErrorAfterTune, double nsigma=1.)
void SetRunFrac (int Ibeam, RunPeriod_t rp, double pot)
double GetRFWWeight (const NtpMCTruth *mc, int det, int Ibeam, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight)
double GetRFWWeight (const NtpMCFluxInfo *fi, int det, int Ibeam, int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight)
double GetRFWWeight (int det, int Ibeam, int tptype, double pt, double pz, int ccnc, double true_enu, int inu, double reco_emu, double reco_eshw, double &new_reco_emu, double &new_reco_eshw, double &beamweight, double &detweight)
double GetHeliumWeight (int det, int Ibeam, int Ntype, double true_enu)
double GetTargetDecayWeight (int det, int Ibeam, int Ntype, double true_enu, double fin78fraction)
virtual void PrintReweightConfig (ostream &)
ZbeamGetZbeam ()
ZflukGetZfluk ()

Public Attributes

VldTimeStampvtsRunIEnd
VldTimeStampvtsRunIIEnd
VldTimeStampvtsRunIIIEnd

Private Member Functions

void SetConfigNum (std::string c)
double GetRunPeriodWeight (RunPeriod_t rp, int det, int Ibeam, int ntype, double Enu)
double GetRunPeriodWeight (VldContext vc, int det, int Ibeam, int ntype, double Enu)
double GetHeliumWeight_L010z185i_ND_Numu (double enu)
double GetHeliumWeight_L010z185i_ND_Numubar (double enu)
double GetHeliumWeight_L010z185i_ND_Nue (double enu)
double GetHeliumWeight_L010z185i_ND_Nuebar (double enu)
double GetHeliumWeight_L010z185i_FD_Numu (double enu)
double GetHeliumWeight_L010z185i_FD_Numubar (double enu)
double GetHeliumWeight_L010z185i_FD_Nue (double enu)
double GetHeliumWeight_L010z185i_FD_Nuebar (double enu)
double GetHeliumWeight_L010z000i_ND_Numu (double enu)
double GetHeliumWeight_L010z000i_ND_Numubar (double enu)
double GetHeliumWeight_L010z000i_ND_Nue (double enu)
double GetHeliumWeight_L010z000i_ND_Nuebar (double enu)
double GetHeliumWeight_L010z000i_FD_Numu (double enu)
double GetHeliumWeight_L010z000i_FD_Numubar (double enu)
double GetHeliumWeight_L010z000i_FD_Nue (double enu)
double GetHeliumWeight_L010z000i_FD_Nuebar (double enu)
double GetMissingFin78Weight_L010z185i_ND_Numu (double enu)
double GetMissingFin78Weight_L010z185i_ND_Numubar (double enu)
double GetMissingFin78Weight_L010z185i_ND_Nue (double enu)
double GetMissingFin78Weight_L010z185i_ND_Nuebar (double enu)
double GetMissingFin78Weight_L010z185i_FD_Numu (double enu)
double GetMissingFin78Weight_L010z185i_FD_Numubar (double enu)
double GetMissingFin78Weight_L010z185i_FD_Nue (double enu)
double GetMissingFin78Weight_L010z185i_FD_Nuebar (double enu)
double GetMissingFin78Weight_L010z000i_ND_Numu (double enu)
double GetMissingFin78Weight_L010z000i_ND_Numubar (double enu)
double GetMissingFin78Weight_L010z000i_ND_Nue (double enu)
double GetMissingFin78Weight_L010z000i_ND_Nuebar (double enu)
double GetMissingFin78Weight_L010z000i_FD_Numu (double enu)
double GetMissingFin78Weight_L010z000i_FD_Numubar (double enu)
double GetMissingFin78Weight_L010z000i_FD_Nue (double enu)
double GetMissingFin78Weight_L010z000i_FD_Nuebar (double enu)

Private Attributes

int MAXBSPARS
int MAXHPPARS
int MAXDETPARS
bool read_pars_from_db
std::string cfgname
SKZPConfig_t cfgnum
SampleSelection_t sampsel
Zbeamzbeam
Zflukzfluk
MCReweightmcr
NeugenWeightCalculatornwc
std::vector< double > bs_pars
std::vector< double > hp_pars
std::vector< double > det_pars
std::map< int, std::map< RunPeriod_t,
double > > 
runfrac
bool fBeamOnly

Static Private Attributes

const double XP = 25.

Member Typedef Documentation

typedef enum SKZPWeightCalculator::EFluxErrEffect SKZPWeightCalculator::FluxErrEffect_t
 

typedef enum SKZPWeightCalculator::ERunPeriod SKZPWeightCalculator::RunPeriod_t
 

Referenced by GetRFWWeight(), and RunPeriodFromInt().

typedef enum SKZPWeightCalculator::ESampleSelection SKZPWeightCalculator::SampleSelection_t
 

typedef enum SKZPWeightCalculator::ESKZPConfig SKZPWeightCalculator::SKZPConfig_t
 


Member Enumeration Documentation

enum SKZPWeightCalculator::EFluxErrEffect
 

Enumeration values:
kHadProdAfterTune 
kTotalErrorPreTune 
kTotalErrorAfterTune 
kTotalFocusing 
kTarget 

Definition at line 32 of file SKZPWeightCalculator.h.

00032                               {
00033     kHadProdAfterTune=8,
00034     kTotalErrorPreTune=10,
00035     kTotalErrorAfterTune=11,
00036     kTotalFocusing=12,
00037     kTarget=15    
00038   } FluxErrEffect_t;

enum SKZPWeightCalculator::ERunPeriod
 

Enumeration values:
kNone 
kRunI 
kRunII 
kRunIII 
kRunIV 
kEndOfList 

Definition at line 47 of file SKZPWeightCalculator.h.

00047                           {
00048     kNone=0,
00049     kRunI=1,
00050     kRunII=2,
00051     kRunIII=3,
00052     kRunIV=4,
00053     kEndOfList=5
00054   } RunPeriod_t;

enum SKZPWeightCalculator::ESampleSelection
 

Enumeration values:
kNotSpecified 
kNuMuCC 
kAntiNuMu 
kNue 

Definition at line 40 of file SKZPWeightCalculator.h.

00040                                 {
00041     kNotSpecified=0,
00042     kNuMuCC=1,
00043     kAntiNuMu=2,
00044     kNue=3
00045   } SampleSelection_t;

enum SKZPWeightCalculator::ESKZPConfig
 

Enumeration values:
kUnknown 
kPRL 
kBoston 
kPiMinus 
kDetXs 
kDogwood1_Daikon07 
kDogwood1_Daikon07_v2 

Definition at line 21 of file SKZPWeightCalculator.h.

00021                            {
00022     kUnknown = 0,
00023     kPRL = 1,
00024     kBoston = 2,
00025     kPiMinus = 3,
00026     kDetXs = 4,
00027     kDogwood1_Daikon07 = 5,
00028     kDogwood1_Daikon07_v2 = 6
00029   } SKZPConfig_t;


Constructor & Destructor Documentation

SKZPWeightCalculator::SKZPWeightCalculator Registry stdconfig = 0  ) 
 

Definition at line 22 of file SKZPWeightCalculator.cxx.

References Config(), MCReweight::Instance(), mcr, nwc, vtsRunIEnd, vtsRunIIEnd, vtsRunIIIEnd, zbeam, and zfluk.

00022                                                              :
00023   WeightCalculator(stdconfig),
00024   MAXBSPARS(20),
00025   MAXHPPARS(20),
00026   MAXDETPARS(20),
00027   read_pars_from_db(false),
00028   cfgname(""),
00029   cfgnum(kUnknown),
00030   sampsel(kNotSpecified),
00031   runfrac()
00032 {
00033   vtsRunIEnd = new VldTimeStamp(2006,3,1,0,0,0);
00034   vtsRunIIEnd = new VldTimeStamp(2007,8,1,0,0,0);
00035   vtsRunIIIEnd = new VldTimeStamp(2009,8,1,0,0,0);
00036   zbeam = new Zbeam();
00037   zfluk = new Zfluk();
00038   nwc = 0; // hold off until needed // new NeugenWeightCalculator();
00039   mcr = &MCReweight::Instance();
00040   Config();
00041 }

SKZPWeightCalculator::SKZPWeightCalculator std::string  cn,
bool  readfromdb,
bool  beamonly = false
 

Definition at line 43 of file SKZPWeightCalculator.cxx.

References Config(), fBeamOnly, MCReweight::Instance(), mcr, nwc, vtsRunIEnd, vtsRunIIEnd, vtsRunIIIEnd, zbeam, and zfluk.

00043                                                                                    :
00044   WeightCalculator(0),
00045   MAXBSPARS(20),
00046   MAXHPPARS(20),
00047   MAXDETPARS(20),
00048   read_pars_from_db(readfromdb),
00049   cfgname(cn),
00050   cfgnum(kUnknown),
00051   sampsel(kNotSpecified),
00052   runfrac()
00053 {
00054   fBeamOnly = beamonly;
00055 
00056   vtsRunIEnd = new VldTimeStamp(2006,4,1,0,0,0);
00057   vtsRunIIEnd = new VldTimeStamp(2007,8,1,0,0,0);
00058   vtsRunIIIEnd = new VldTimeStamp(2009,8,1,0,0,0);
00059   zbeam = new Zbeam();
00060   zfluk = new Zfluk();
00061   nwc = 0; // hold off until needed // new NeugenWeightCalculator();
00062   mcr = &MCReweight::Instance();
00063   Config();
00064 }

SKZPWeightCalculator::~SKZPWeightCalculator  )  [virtual]
 

Definition at line 66 of file SKZPWeightCalculator.cxx.

References nwc, vtsRunIEnd, vtsRunIIEnd, vtsRunIIIEnd, zbeam, and zfluk.

00067 {
00068 
00069   delete vtsRunIEnd;
00070   vtsRunIEnd=0;
00071   delete vtsRunIIEnd;
00072   vtsRunIIEnd=0;
00073   delete vtsRunIIIEnd;
00074   vtsRunIIIEnd=0;
00075   delete zbeam;
00076   zbeam=0;
00077   delete zfluk;
00078   zfluk=0;
00079   delete nwc;
00080   nwc=0;
00081 
00082 }


Member Function Documentation

void SKZPWeightCalculator::ChangeParameters std::vector< double > *  bs,
std::vector< double > *  hp,
std::vector< double > *  det
 

Definition at line 780 of file SKZPWeightCalculator.cxx.

References bs_pars, cfgnum, det, det_pars, hp_pars, kDetXs, kPiMinus, Zfluk::SetParameters(), and zfluk.

Referenced by NuZBeamReweight::GetSKZPWeightCalculatorCustom().

00781 {
00782   //this function is provided so that a user can compute weights for
00783   //many different szkp parameters.
00784   //it is provided for special studies, and I don't expect
00785   //most people will need this functionality.
00786 
00787   //clear anything that's already stored in the vectors
00788   bs_pars.clear();
00789   hp_pars.clear();
00790   det_pars.clear();
00791 
00792   //copy the function parameters into the private data members
00793   for(unsigned int i=0;i<bs->size();i++){
00794     double b=(*bs)[i];
00795     bs_pars.push_back(b);
00796   }
00797   for(unsigned int i=0;i<hp->size();i++){
00798     double h=(*hp)[i];
00799     hp_pars.push_back(h);
00800   }
00801   for(unsigned int i=0;i<det->size();i++){
00802     double d=(*det)[i];
00803     det_pars.push_back(d);
00804   }
00805 
00806   if(cfgnum==kPiMinus || cfgnum==kDetXs || cfgnum==kDogwood1_Daikon07){
00807     zfluk->SetParameters(hp_pars);
00808   }
00809   
00810 }

void SKZPWeightCalculator::Config  )  [virtual]
 

Reimplemented from WeightCalculator.

Definition at line 84 of file SKZPWeightCalculator.cxx.

References MCReweight::AddWeightCalculator(), bs_pars, cfgname, cfgnum, Registry::Clear(), det_pars, Form(), Registry::Get(), hp_pars, kDetXs, kDogwood1_Daikon07, Registry::LockKeys(), Registry::LockValues(), mcr, MSG, nwc, reg, Registry::Set(), SetConfigNum(), NeugenWeightCalculator::SetOptimization(), Zfluk::SetParameters(), Zbeam::SetReweightConfig(), WeightCalculator::SetReweightConfig(), Registry::UnLockKeys(), Registry::UnLockValues(), zbeam, and zfluk.

Referenced by SKZPWeightCalculator().

00085 {
00086   if(cfgname==""){
00087     cfgname="PRL";
00088     MSG("SKZPWeightCalculator",Msg::kInfo)<<"You did not specify a "
00089                                           <<"SKZPWeight configuration."
00090                                           <<" Setting ConfigName to :"
00091                                           <<cfgname<<endl;
00092     cfgnum=kPRL;
00093   }
00094   SetConfigNum(cfgname);
00095 
00096 
00097   if(!read_pars_from_db){
00098     MSG("SKZPWeightCalculator",Msg::kInfo)<<"You did not select to read in "
00099                                           <<"SKZP Fit parameters from the DB."
00100                                           <<" You must specify your "
00101                                           <<"own parameters"<<endl;
00102     return;
00103   }
00104 
00105   //retrieve appropriate constants from DB
00106   Registry reg;
00107   
00108   //  cout<<"Trying to get parameters from DB"<<endl;
00109   DbiConfigStream stream("SKZPWeights",cfgname.c_str());
00110   if(stream.IsEmpty()){
00111     MSG("SKZPWeightCalculator",Msg::kWarning)
00112       << "Could not find SKZP configuration: "
00113       << cfgname
00114       << " in database.  " << endl
00115       << "If you want to run without database access"
00116       << " construct the weight calculator"
00117       << " with false as second arg." << endl;
00118     MSG("SKZPWeightCalculator",Msg::kFatal) << "Now assert()" << endl;
00119     assert(false);
00120   }
00121   //  cout<<"made dbiconfigstream"<<endl;
00122   stream >> &reg;
00123 
00124   //  cout<<"Read registry from db, and it contains:"<<endl;
00125   //  reg.PrettyPrint(cout);
00126 
00127 
00128 
00129   //load information from registry to private data members
00130   double tmpd;
00131   for(int i=0;i<MAXBSPARS;i++){
00132     if(reg.Get(Form("bs_par_%d",i),tmpd)){
00133       bs_pars.push_back(tmpd);
00134     }
00135   }
00136 
00137   for(int i=0;i<MAXHPPARS;i++){
00138     if(reg.Get(Form("hp_par_%d",i),tmpd)){
00139       hp_pars.push_back(tmpd);
00140     }
00141   }
00142 
00143   for(int i=0;i<MAXDETPARS;i++){
00144     if(reg.Get(Form("det_par_%d",i),tmpd)){
00145       det_pars.push_back(tmpd);
00146     }
00147   }
00148 
00149   if(cfgnum==kPiMinus){
00150     zfluk->SetParameters(hp_pars);
00151   }
00152   if(cfgnum==kDetXs || cfgnum==kDogwood1_Daikon07 || cfgnum==kDogwood1_Daikon07_v2){
00153     zfluk->SetParameters(hp_pars);
00154 
00155     if(!fBeamOnly) {
00156       nwc = new NeugenWeightCalculator();
00157       nwc->SetOptimization(true);
00158       Registry *nwc_reg=new Registry;
00159       nwc_reg->UnLockValues();
00160       nwc_reg->UnLockKeys();
00161       nwc_reg->Clear();
00162       
00163       nwc_reg->Set("neugen:config_name","MODBYRS");
00164       nwc_reg->Set("neugen:config_no",4);
00165       nwc_reg->Set("neugen:use_scale_factors",1);
00166       nwc_reg->Set("neugen:ma_qe",1.1);
00167       nwc_reg->Set("neugen:ma_res",1.1); 
00168       
00169       // This is specific to MODBYRS v4 where we weight them 
00170       // by their 1 sigma error as given in docdb-2989
00171       
00172       double kno1_val=0.1; //for ri12 and ri42
00173       double kno2_val=0.3; //for ri22 and ri32
00174       double kno3_val=1.0; //for rij3 
00175     
00176       double kno1_err=0.1; //for rij2 
00177       double kno2_err=0.2; //for rij3
00178       
00179       double kno_shift=1;
00180       
00181       nwc_reg->Set("neugen:kno_r112",
00182                  (kno1_val+kno_shift*kno1_err)/(kno1_val));
00183       nwc_reg->Set("neugen:kno_r142",
00184                    (kno1_val+kno_shift*kno1_err)/(kno1_val));
00185       nwc_reg->Set("neugen:kno_r122",
00186                    (kno2_val+kno_shift*kno1_err)/(kno2_val));
00187       nwc_reg->Set("neugen:kno_r132",
00188                    (kno2_val+kno_shift*kno1_err)/(kno2_val));
00189       nwc_reg->Set("neugen:kno_r113",
00190                    (kno3_val+kno_shift*kno2_err)/(kno3_val));
00191       nwc_reg->Set("neugen:kno_r123",
00192                    (kno3_val+kno_shift*kno2_err)/(kno3_val));
00193       nwc_reg->Set("neugen:kno_r133",
00194                    (kno3_val+kno_shift*kno2_err)/(kno3_val));
00195       nwc_reg->Set("neugen:kno_r143",
00196                    (kno3_val+kno_shift*kno2_err)/(kno3_val));
00197       
00198       nwc_reg->LockValues();
00199       nwc_reg->LockKeys();
00200       nwc->SetReweightConfig(nwc_reg);
00201       mcr->AddWeightCalculator(nwc);
00202     }
00203   }
00204   string tmpcfgname=cfgname;
00205   if(tmpcfgname.find("PRL_Syst")!=string::npos){
00206     tmpcfgname="PRL";
00207   }
00208   zbeam->SetReweightConfig(tmpcfgname);
00209 }

double SKZPWeightCalculator::GetBeamWeight int  det,
int  Ibeam,
int  tptype,
double  pt,
double  pz,
double  true_enu,
int  inu,
VldContext  vc
[inline]
 

Definition at line 178 of file SKZPWeightCalculator.h.

References det, GetBeamWeight(), RunPeriodFromInt(), and RunPeriodIntFromValidity().

00180                                      {
00181     return GetBeamWeight(det,Ibeam,
00182                          tptype,pt,pz,true_enu,inu,
00183                          RunPeriodFromInt(RunPeriodIntFromValidity(vc)));
00184   }

double SKZPWeightCalculator::GetBeamWeight int  det,
int  Ibeam,
int  tptype,
double  pt,
double  pz,
double  true_enu,
int  inu,
RunPeriod_t  rp = kRunI
 

Definition at line 369 of file SKZPWeightCalculator.cxx.

References Zbeam::ZbeamData::beam, bs_pars, cfgnum, det, Zbeam::ZbeamData::detector, BeamType::FromZarko(), GetRunPeriodWeight(), Zfluk::GetWeight(), Zbeam::GetWeight(), Zfluk::GetWeightBoston(), Zfluk::GetWeightPRL(), hp_pars, kDetXs, Zbeam::ZbeamData::ntype, Zbeam::ZbeamData::true_enu, zbeam, Zbeam::ZbeamData_t, and zfluk.

Referenced by MCTrueAna::ana(), NueFluxWeightsAna::Analyze(), GetBeamWeight(), GetRFWWeight(), NueStandard::GetSKZPBeamWeight(), GetWeight(), NuZBeamReweight::GetWeights(), and ParticleFinder::Reco().

00373 {
00374   //do the flux reweighting
00375 
00376 
00377   double beamsysw=1.;
00378   double hadpw=1.;
00379   if(cfgnum==kPRL){
00380     //to let zbeam know I want the PRL version of 
00381     //of it's weights, I'm passing the beam systematic
00382     //parameters parameters one by one
00383 
00384     //reweight for spot size in me and he
00385     //now done in RunPeriodWeight
00386     //    beamsysw*=zbeam->GetWeight(det,Ibeam,6,0,true_enu);   
00387     //horn 1 offset
00388     beamsysw*=zbeam->GetWeight(det,Ibeam,1,bs_pars[0],true_enu);
00389     //baffle scraping
00390     beamsysw*=zbeam->GetWeight(det,Ibeam,2,bs_pars[1],true_enu);
00391     //pot
00392     beamsysw*=zbeam->GetWeight(det,Ibeam,3,bs_pars[2],true_enu);
00393     //horn current miscalibration
00394     beamsysw*=zbeam->GetWeight(det,Ibeam,4,bs_pars[3],true_enu);
00395     //horn current distribution
00396     beamsysw*=zbeam->GetWeight(det,Ibeam,5,bs_pars[4],true_enu);
00397 
00398     //now change pt and pz
00399     double hp[7]={hp_pars[0],hp_pars[1],hp_pars[2],hp_pars[3],
00400                   hp_pars[4],hp_pars[5],hp_pars[6]};
00401     //to let zfluk know I want the PRL version of it's weights
00402     //I'm passing the hadron production parameters as an array
00403     hadpw = zfluk->GetWeightPRL(tptype,pt,pz,hp);
00404   }  
00405   else if(cfgnum==kBoston){ 
00406     //Boston version of zbeam takes a vector of beam systematic parameters
00407      //first 5 are for numu's
00408      //second 5 are for antinumu's
00409      vector<double> tmp_bs_pars;
00410      if(inu>0){
00411         for(int i=0;i<5;i++){
00412            tmp_bs_pars.push_back(bs_pars[i]);
00413         }
00414      }
00415      else{
00416         for(int i=0;i<5;i++){
00417            tmp_bs_pars.push_back(bs_pars[i+5]);
00418         }
00419      }
00420      beamsysw=zbeam->GetWeight(det,Ibeam,tmp_bs_pars,inu,true_enu);     
00421 
00422      //reweight for spot size in me and he
00423      //now done in RunPeriodWeight
00424      //     beamsysw*=zbeam->GetWeight(det,Ibeam,6,0,true_enu);   
00425      
00426      //updated version of zbeam takes a vector of hadron production parameters
00427      hadpw=zfluk->GetWeightBoston(tptype,pt,pz,hp_pars);
00428   }
00429   else if(cfgnum==kPiMinus){
00430     //updated version of zbeam takes a vector of beam systematic parameters
00431     beamsysw=zbeam->GetWeight(det,Ibeam,bs_pars,inu,true_enu);
00432     //reweight for spot size in me and he
00433     //now done in RunPeriodWeight
00434     //    beamsysw*=zbeam->GetWeight(det,Ibeam,6,0,true_enu);   
00435 
00436     //pi minus version of fit has parameters set one time at the beginning,
00437     //the parameters are not reset each time in getweight
00438     hadpw = zfluk->GetWeight(tptype,pt,pz);
00439   }
00440   else if(cfgnum==kDetXs || cfgnum==kDogwood1_Daikon07){
00441 
00442     // Hadron Production weight
00443     hadpw = zfluk->GetWeight(tptype,pt,pz);
00444  
00445   }
00446   else if(cfgnum==kDogwood1_Daikon07_v2){
00447 
00448     Detector::Detector_t detector;
00449     if(det==1) detector=Detector::kNear;
00450     else if(det==2) detector=Detector::kFar;
00451     else if(det==3) detector=Detector::kUnknown;
00452     
00453     Zbeam::ZbeamData_t zdata;
00454     zdata.ntype    = inu;
00455     zdata.true_enu = true_enu;
00456     zdata.detector = detector;
00457     zdata.beam     =  BeamType::FromZarko(Ibeam);
00458     
00459     // Focusing alignment effects
00460     beamsysw *= zbeam->GetWeight(zdata,BeamSys::kHorn1Offset   ,bs_pars[0]);
00461     beamsysw *= zbeam->GetWeight(zdata,BeamSys::kBaffleScraping,bs_pars[1]);
00462     beamsysw *= zbeam->GetWeight(zdata,BeamSys::kPOT           ,bs_pars[2]);
00463     beamsysw *= zbeam->GetWeight(zdata,BeamSys::kHornIMiscal   ,bs_pars[3]);
00464     beamsysw *= zbeam->GetWeight(zdata,BeamSys::kHornIDist     ,bs_pars[4]);
00465     
00466     // Hadron production weight
00467     hadpw = zfluk->GetWeight(tptype,pt,pz);
00468 
00469   }
00470   else{ 
00471     //updated version of zbeam takes a vector of beam systematic parameters
00472     beamsysw=zbeam->GetWeight(det,Ibeam,bs_pars,inu,true_enu);
00473     //updated version of zbeam takes a vector of hadron production parameters
00474     hadpw=zfluk->GetWeight(tptype,pt,pz);
00475   }
00476 
00477   double rpw = GetRunPeriodWeight(rp,det,Ibeam,inu,true_enu);
00478   //  cout<<"run period "<<rp<<" weight "<<rpw<<endl;
00479   //return the product of beam systematic weights and had. prod. weights
00480   //  cout<<"inu "<<inu<<"hadpw "<<hadpw<<" beamsysw "<<beamsysw<<endl;
00481   return hadpw*beamsysw*rpw;
00482 }

double SKZPWeightCalculator::GetDetWeight int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double  true_eshw = -1,
MCEventInfo ei = 0
 

Definition at line 484 of file SKZPWeightCalculator.cxx.

References cfgnum, MCReweight::ComputeWeight(), det_pars, fBeamOnly, MCEventInfo::iaction, MCEventInfo::iresonance, kDetXs, mcr, MSG, sampsel, and XP.

Referenced by NueFluxWeightsAna::Analyze(), GetRFWWeight(), and GetWeight().

00488 {
00489 
00490   //computes the effect of the changing the detector parameters in the skzp fit
00491   //this function changes the reconstructed values of muon and shower energy,
00492   //so the new values are passed back to the calling function by reference as
00493   //part of the function parameter list
00494   double dw = 1.;
00495   new_reco_emu=reco_emu;
00496   new_reco_eshw=reco_eshw;
00497 
00498 
00499   if(cfgnum==kPRL){
00500     //right now this is the only version of detector weighting,
00501     //but this may evolve in the future
00502 
00503     //prl version of weights weights the NC component up or down by 1-fitparam
00504     if(ccnc==0){
00505       dw = 1.-det_pars[2];
00506     }
00507     
00508     //prl version of skzp changes the shower energy by an offset,
00509     //then changes the total neutrino energy (eshw+emu) by 
00510     //a multiplicative constant that is 1-fit parameter
00511     if(reco_eshw>0){
00512       new_reco_eshw = reco_eshw+det_pars[1];
00513     }
00514     if(new_reco_eshw<0){
00515       new_reco_eshw=0.;
00516     }
00517     
00518     new_reco_eshw*=(1-det_pars[0]);
00519     new_reco_emu=reco_emu*(1-det_pars[0]);
00520   }
00521   else if(cfgnum==kBoston){
00522     //boston version of weights weights the numu's and anumus separately
00523     if(ccnc==0){
00524        if(inu>0){
00525           dw = 1.-det_pars[2];
00526        }
00527        else{
00528           dw = 1.-det_pars[5];
00529        }
00530     }
00531     
00532     //boston version of skzp changes the shower energy by an offset,
00533     //then changes the total neutrino energy (eshw+emu) by 
00534     //a multiplicative constant that is 1-fit parameter
00535     if(reco_eshw>0){
00536        if(inu>0){
00537           new_reco_eshw = reco_eshw+det_pars[1];
00538        }
00539        else{
00540           new_reco_eshw = reco_eshw+det_pars[4];
00541        }
00542     }
00543     if(new_reco_eshw<0){
00544        new_reco_eshw=0.;
00545     }
00546     
00547     if(inu>0){
00548        new_reco_eshw*=(1-det_pars[0]);
00549        new_reco_emu=reco_emu*(1-det_pars[0]);
00550     }
00551     else{
00552        new_reco_eshw*=(1-det_pars[3]);
00553        new_reco_emu=reco_emu*(1-det_pars[3]);
00554     }
00555   }
00556   else if(cfgnum==kPiMinus){
00557     //Piminus version of weights weights the numu's and anumus separately
00558     if(ccnc==0){
00559       if(sampsel==kNuMuCC){
00560         //      cout<<"Found an NC, and I'm using the CC parameter"<<endl;
00561         dw = 1-det_pars[2];
00562       }
00563       else if(sampsel==kAntiNuMu){
00564         //      cout<<"Found an NC, and I'm using the Anti parameter"<<endl;
00565         dw = 1-det_pars[3];
00566       }
00567       else{//if a sample isn't specified, 
00568            //do it like I think you should.
00569        if(inu>0){
00570          dw = 1.-det_pars[2];
00571        }
00572        else{
00573          dw = 1.-det_pars[3];
00574        }
00575       }
00576     }
00577     
00578     //Piminus version of skzp changes the shower energy by an offset,
00579     //then changes the total neutrino energy (eshw+emu) by 
00580     //a multiplicative constant that is 1-fit parameter
00581     //it also treats nu's and anu's in the same way
00582     new_reco_eshw=reco_eshw;
00583     if(reco_eshw>0){
00584       new_reco_eshw = reco_eshw+det_pars[1];
00585     }
00586     if(new_reco_eshw<0){
00587       new_reco_eshw=0.;
00588     }
00589     
00590     if(inu==14||inu==-14){
00591       new_reco_eshw*=(1-det_pars[0]);
00592       new_reco_emu=reco_emu*(1-det_pars[0]);
00593     }
00594     else if(inu==12||inu==-12){
00595       new_reco_eshw*=(1-0.);
00596       new_reco_emu=reco_emu*(1-0.);
00597     }
00598     else{
00599       new_reco_eshw*=(1-0.);
00600       new_reco_emu=reco_emu*(1-0.);
00601     }
00602 
00603     //Piminus version of the fit has a scale for numubar xsec
00604     if(inu==-14){
00605       double xsw=1.;
00606       if(true_enu<XP){
00607         xsw = det_pars[4]+2.*(1.-det_pars[4])*true_enu/XP
00608           +(det_pars[4]-1.)*true_enu*true_enu/(XP*XP);
00609       }
00610       dw*=xsw;
00611     }
00612   }
00613   else if(cfgnum==kDetXs || cfgnum==kDogwood1_Daikon07){
00614 
00615     // You must give an MCEventInfo object to get the
00616     // correct detector weight
00617     if(fBeamOnly||ei==0) return dw;
00618 
00619     // Shower offset
00620     if(reco_eshw>0.) {
00621       new_reco_eshw = reco_eshw+det_pars[0];
00622     }
00623     if(new_reco_eshw<0){
00624       new_reco_eshw=0.;
00625     }
00626 
00627     // Shower energy scale from functional form
00628     double x0=10;
00629     double x = TMath::Min((double)true_eshw,x0);
00630     double err_a = 1.04/1.0 - 1.0;
00631     double err_b = (1.1+2.*(1-1.1)*(x/x0)+(1.1-1)*(x/x0)*(x/x0))/(1.0) - 1.0;
00632     double err_c = 0.057;
00633     double shw_scale=sqrt(pow(err_a,2)+pow(err_b,2)+pow(err_c,2));
00634     
00635     new_reco_eshw*=(1-det_pars[4]*shw_scale);
00636 
00637     // Scale muon energy 
00638     new_reco_emu=reco_emu*(1.-det_pars[5]);
00639     
00640     // NC parameters
00641     if(ei->iaction==0){
00642       if(sampsel==kNuMuCC)         dw*=(1-det_pars[1]);
00643       else if(sampsel==kAntiNuMu)  dw*=(1-det_pars[2]);
00644       else{
00645         if(inu==14)  dw = 1.-det_pars[1];
00646         if(inu==-14) dw = 1.-det_pars[2];
00647       }
00648     }
00649     else {
00650       // Cross Section Parameters
00651       if(ei!=0) {
00652         double gw=1;
00653         if(ei->iresonance!=1005) gw=mcr->ComputeWeight(ei)-1.0;
00654         
00655         if(ei->iresonance==1001) dw*=(1+det_pars[6]*gw);
00656         if(ei->iresonance==1002) dw*=(1+det_pars[7]*gw);
00657         //if(ei->iresonance==1003) dw*=(1+det_pars[8]*gw);
00658       }
00659     }
00660         
00661     //numubar xsec
00662     if(inu==-14){
00663       double xsw=1.;
00664       if(true_enu<XP){
00665         xsw = det_pars[3]+2.*(1.-det_pars[3])*true_enu/XP
00666           +(det_pars[3]-1.)*true_enu*true_enu/(XP*XP);
00667       }
00668       dw*=xsw;
00669     }
00670    
00671   }
00672   else if(cfgnum==kDogwood1_Daikon07_v2){
00673 
00674     // Similar to kDetXs but with parameters incremented
00675     // by 1 as new parameter 0 is the overall neutrino 
00676     // energy scale.
00677 
00678     // You must give an MCEventInfo object to get the
00679     // correct detector weight
00680     if(fBeamOnly||ei==0) return dw;
00681 
00682     // Shower offset
00683     if(reco_eshw>0.) {
00684       new_reco_eshw = reco_eshw+det_pars[1];
00685     }
00686     if(new_reco_eshw<0){
00687       new_reco_eshw=0.;
00688     }
00689 
00690     // Shower energy scale from functional form
00691     double x0=10;
00692     double x = TMath::Min((double)true_eshw,x0);
00693     double err_a = 1.04/1.0 - 1.0;
00694     double err_b = (1.1+2.*(1-1.1)*(x/x0)+(1.1-1)*(x/x0)*(x/x0))/(1.0) - 1.0;
00695     double err_c = 0.057;
00696     double shw_scale=sqrt(pow(err_a,2)+pow(err_b,2)+pow(err_c,2));
00697     
00698     new_reco_eshw*=(1-det_pars[5]*shw_scale);
00699 
00700     // Scale muon energy 
00701     new_reco_emu=reco_emu*(1.-det_pars[6]);
00702     
00703     // Now need to scale the overall neutrino energy BUT the current
00704     // weighting functions don't allow me to pass back a new value 
00705     // for the neutrino energy, just the muon and shower separately.
00706     // So I'm going to assume everyone will just add these two to
00707     // get the new neutrino energy and hence implement the neutrino
00708     // energy scale parameter by applying it to both the muon and
00709     // shower energy seperately:
00710 
00711     new_reco_eshw*=(1.-det_pars[0]);
00712     new_reco_emu*=(1.-det_pars[0]);
00713 
00714     // NC parameters
00715     if(ei->iaction==0){
00716       if(sampsel==kNuMuCC)         dw*=(1-det_pars[2]);
00717       else if(sampsel==kAntiNuMu)  dw*=(1-det_pars[3]);
00718       else{
00719         if(inu==14)  dw = 1.-det_pars[2];
00720         if(inu==-14) dw = 1.-det_pars[3];
00721       }
00722     }
00723     else {
00724       // Cross Section Parameters
00725       if(ei!=0) {
00726         double gw=1;
00727         if(ei->iresonance!=1005) gw=mcr->ComputeWeight(ei)-1.0;
00728         
00729         if(ei->iresonance==1001) dw*=(1+det_pars[7]*gw);
00730         if(ei->iresonance==1002) dw*=(1+det_pars[8]*gw);
00731       }
00732     }
00733         
00734     //numubar xsec
00735     if(inu==-14){
00736       double xsw=1.;
00737       if(true_enu<XP){
00738         xsw = det_pars[4]+2.*(1.-det_pars[4])*true_enu/XP
00739           +(det_pars[4]-1.)*true_enu*true_enu/(XP*XP);
00740       }
00741       dw*=xsw;
00742     }
00743 
00744   }
00745   else{
00746     //this does nothing for now, and 
00747     //should never be called,
00748     //but I want the structure
00749     MSG("SKZPWeightCalculator",Msg::kError)<<"You are in the else of DetWeighting!"
00750                                            <<"this should never happen!"
00751                                            <<"How did you get here?"<<endl;
00752   }
00753 
00754   /*
00755   if(new_reco_eshw+new_reco_emu<1.5){
00756     cout<<"Detetor weight "<<inu<<" ccnc "<<ccnc<<"true enu "<<true_enu<<" reco emu "<<reco_emu<<" new_reco_emu "<<new_reco_emu<<" reco eshw "<<reco_eshw<<" new_reco_eshw "<<new_reco_eshw<<" weight "<<dw<<endl;
00757   }
00758   */
00759   return dw;
00760 
00761 }

double SKZPWeightCalculator::GetFluxError int  det,
int  Ibeam,
int  inu,
double  true_enu,
FluxErrEffect_t  neffect = kTotalErrorAfterTune,
double  nsigma = 1.
 

Definition at line 850 of file SKZPWeightCalculator.cxx.

References bs_pars, cfgname, det, Zbeam::GetWeight(), Zbeam::SetReweightConfig(), and zbeam.

Referenced by MiniPlotMaker::ApplySystematic(), NueSystematic::DoSKZPCalc(), NCEventInfo::FindMEGAFitWeightUncertainty(), NuZBeamReweight::GetRFWeights(), and NuZBeamReweight::GetWeights().

00853 {
00854  zbeam->SetReweightConfig(cfgname);
00855   
00856   // Add target z with different than nsigma weight
00857   if(cfgname=="DetXs" && neffect==kTotalErrorAfterTune) {
00858   
00859     double e=0;
00860  
00861     double weight=zbeam->GetWeight(det,Ibeam,BeamSys::kHorn1Offset,nsigma,inu,true_enu)-1;
00862     e+=weight*weight;
00863     weight=zbeam->GetWeight(det,Ibeam,BeamSys::kBaffleScraping,nsigma,inu,true_enu)-1;
00864     e+=weight*weight;
00865     weight=zbeam->GetWeight(det,Ibeam,BeamSys::kPOT,nsigma,inu,true_enu)-1;
00866     e+=weight*weight;
00867     weight=zbeam->GetWeight(det,Ibeam,BeamSys::kHornIMiscal,nsigma,inu,true_enu)-1;
00868     e+=weight*weight;
00869     weight=zbeam->GetWeight(det,Ibeam,BeamSys::kHornIDist,nsigma,inu,true_enu)-1;
00870     e+=weight*weight;
00871     weight=zbeam->GetWeight(det,Ibeam,BeamSys::kBeamWidth,nsigma,inu,true_enu)-1;
00872     e+=weight*weight;
00873     weight=zbeam->GetWeight(det,Ibeam,BeamSys::kHadProdAfter,nsigma,inu,true_enu)-1;
00874     e+=weight*weight;
00875         
00876     // add error from best fit for target z
00877 
00878     // le010 configurations
00879     if(Ibeam==2 || Ibeam==6 || Ibeam==7) {
00880       double targetz=TMath::Max(TMath::Abs(bs_pars[0]),TMath::Abs(bs_pars[4]));
00881       weight=zbeam->GetWeight(det,Ibeam,BeamSys::kTargetZ,targetz*nsigma,inu,true_enu)-1;
00882       e+=weight*weight;
00883     }
00884     // le100
00885     else if(Ibeam==3) {
00886       double targetz=TMath::Abs(bs_pars[1]);
00887       weight=zbeam->GetWeight(det,Ibeam,BeamSys::kTargetZ,targetz*nsigma,inu,true_enu)-1;
00888       e+=weight*weight;
00889     }
00890     // le250
00891     else if(Ibeam==4) {
00892       double targetz=TMath::Max(TMath::Abs(bs_pars[3]),TMath::Abs(bs_pars[5]));
00893       weight=zbeam->GetWeight(det,Ibeam,BeamSys::kTargetZ,targetz*nsigma,inu,true_enu)-1;
00894       e+=weight*weight;
00895     }
00896     // le150
00897     else if(Ibeam==9) {
00898       double targetz=TMath::Abs(bs_pars[2]);
00899       weight=zbeam->GetWeight(det,Ibeam,BeamSys::kTargetZ,targetz*nsigma,inu,true_enu)-1;
00900       e+=weight*weight;
00901     }
00902 
00903     return 1+sqrt(e);
00904   }
00905   else return zbeam->GetWeight(det,Ibeam,neffect,nsigma,inu,true_enu);
00906 
00907 }

double SKZPWeightCalculator::GetHeliumWeight int  det,
int  Ibeam,
int  Ntype,
double  true_enu
 

Definition at line 1305 of file SKZPWeightCalculator.cxx.

References det, GetHeliumWeight_L010z000i_FD_Nue(), GetHeliumWeight_L010z000i_FD_Nuebar(), GetHeliumWeight_L010z000i_FD_Numu(), GetHeliumWeight_L010z000i_FD_Numubar(), GetHeliumWeight_L010z000i_ND_Nue(), GetHeliumWeight_L010z000i_ND_Nuebar(), GetHeliumWeight_L010z000i_ND_Numu(), GetHeliumWeight_L010z000i_ND_Numubar(), GetHeliumWeight_L010z185i_FD_Nue(), GetHeliumWeight_L010z185i_FD_Nuebar(), GetHeliumWeight_L010z185i_FD_Numu(), GetHeliumWeight_L010z185i_FD_Numubar(), GetHeliumWeight_L010z185i_ND_Nue(), GetHeliumWeight_L010z185i_ND_Nuebar(), GetHeliumWeight_L010z185i_ND_Numu(), and GetHeliumWeight_L010z185i_ND_Numubar().

Referenced by GetRunPeriodWeight(), and NuZBeamReweight::GetWeightHelium().

01306 {
01307   if(det==1){ // ND
01308     if(Ibeam==2){ // L010z185i
01309       if(Ntype==56 || Ntype==14) return GetHeliumWeight_L010z185i_ND_Numu(true_enu);
01310       else if(Ntype==55 || Ntype==-14) return GetHeliumWeight_L010z185i_ND_Numubar(true_enu);
01311       else if(Ntype==53 || Ntype==12) return GetHeliumWeight_L010z185i_ND_Nue(true_enu);
01312       else if(Ntype==52 || Ntype==-12) return GetHeliumWeight_L010z185i_ND_Nuebar(true_enu);
01313       else return 1.0;
01314     }
01315     else if(Ibeam==8){ // L010z000i
01316       if(Ntype==56 || Ntype==14) return GetHeliumWeight_L010z000i_ND_Numu(true_enu);
01317       else if(Ntype==55 || Ntype==-14) return GetHeliumWeight_L010z000i_ND_Numubar(true_enu);
01318       else if(Ntype==53 || Ntype==12) return GetHeliumWeight_L010z000i_ND_Nue(true_enu);
01319       else if(Ntype==52 || Ntype==-12) return GetHeliumWeight_L010z000i_ND_Nuebar(true_enu);
01320       else return 1.0;
01321     }
01322     else return 1.0;
01323   }
01324   else if(det==2){ // FD
01325     if(Ibeam==2){ // L010z185i
01326       if(Ntype==56 || Ntype==14) return GetHeliumWeight_L010z185i_FD_Numu(true_enu);
01327       else if(Ntype==55 || Ntype==-14) return GetHeliumWeight_L010z185i_FD_Numubar(true_enu);
01328       else if(Ntype==53 || Ntype==12) return GetHeliumWeight_L010z185i_FD_Nue(true_enu);
01329       else if(Ntype==52 || Ntype==-12) return GetHeliumWeight_L010z185i_FD_Nuebar(true_enu);
01330       else return 1.0;
01331     }
01332     else if(Ibeam==8){ // L010z000i
01333       if(Ntype==56 || Ntype==14) return GetHeliumWeight_L010z000i_FD_Numu(true_enu);
01334       else if(Ntype==55 || Ntype==-14) return GetHeliumWeight_L010z000i_FD_Numubar(true_enu);
01335       else if(Ntype==53 || Ntype==12) return GetHeliumWeight_L010z000i_FD_Nue(true_enu);
01336       else if(Ntype==52 || Ntype==-12) return GetHeliumWeight_L010z000i_FD_Nuebar(true_enu);
01337       else return 1.0;
01338     }
01339     else return 1.0;
01340   }
01341   else return 1.0;
01342 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_FD_Nue double  enu  )  [private]
 

Definition at line 1607 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01608 {
01609   double weight = 1.;
01610   double par[7] = {
01611     1.02653,-0.00287051,0.000666625,-4.19876e-05,7.69875e-07,0.99805,10
01612   };
01613   if(enu<20.0){
01614     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01615   }
01616   else{
01617     weight = par[5]+(par[6]/(enu*enu));
01618   }
01619   return weight;
01620 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_FD_Nuebar double  enu  )  [private]
 

Definition at line 1622 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01623 {
01624   double weight = 1.;
01625   double par[7] = {
01626     1.02206,0.00932646,-0.00100526,2.37525e-05,-4.71822e-08,1.2,-180
01627   };
01628   if(enu<33.45){
01629     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01630   }
01631   else{
01632     weight = par[5]+(par[6]/(enu*enu));
01633   }
01634   return weight;
01635 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_FD_Numu double  enu  )  [private]
 

Definition at line 1569 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01570 {
01571   double weight = 1.;
01572   double par[10] = {
01573     1.04313,-0.00624758,0.000104616,0.00872899,1.12567,
01574     -0.0171559,0.000639488,-6.72704e-06,1.0197,1500
01575   };
01576   if(enu<10.0){
01577     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*TMath::Log(enu);
01578   }
01579   else if(enu<46.0){
01580     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu;
01581   }
01582   else{
01583     weight = par[8]+(par[9]/(enu*enu*enu));
01584   }
01585   return weight;
01586 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_FD_Numubar double  enu  )  [private]
 

Definition at line 1588 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01589 {
01590   double weight = 1.;
01591   double par[11] = {
01592     1.0378,-0.000996055,-0.000280837,0.00197533,1.25837,-0.0519768,
01593     0.00349608,-9.25331e-05,8.19759e-07,1,-1.5e+07
01594   };
01595   if(enu<9.5){
01596     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*TMath::Log(enu);
01597   }
01598   else if(enu<49.3){
01599     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu+par[8]*enu*enu*enu*enu;
01600   }
01601   else{
01602     weight = par[9]+(par[10]/(enu*enu*enu*enu*enu));
01603   }
01604   return weight;
01605 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_ND_Nue double  enu  )  [private]
 

Definition at line 1539 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01540 {
01541   double weight = 1.;
01542   double par[7] = {
01543     1.02614,0.0135056,-0.00151707,5.53927e-05,-6.55825e-07,0.978,1.
01544   };
01545   if(enu<20.45){
01546     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01547   }
01548   else{
01549     weight = par[5]+(par[6]/(enu));
01550   }
01551   return weight;
01552 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_ND_Nuebar double  enu  )  [private]
 

Definition at line 1554 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01555 {
01556   double weight = 1.;
01557   double par[7] = {
01558     1.02609,0.0255862,-0.00296928,9.18715e-05,-7.22365e-07,1.101,-2500
01559   };
01560   if(enu<28.0){
01561     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01562   }
01563   else{
01564     weight = par[5]+(par[6]/(enu*enu*enu));
01565   }
01566   return weight;
01567 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_ND_Numu double  enu  )  [private]
 

Definition at line 1498 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01499 {
01500   double weight = 1.;
01501   double par[10] = {
01502     1.08341,-0.00598166,-0.000644125,0.0153799,1.16251,
01503     -0.0259465,0.00130708,-1.8318e-05,1.03,1500
01504   };
01505   if(enu<7.4){
01506     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*TMath::Log(enu);
01507   }
01508   else if(enu<38.4){
01509     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu;
01510   }
01511   else{
01512     weight = par[8]+(par[9]/(enu*enu*enu));
01513   }
01514   return weight;
01515 }

double SKZPWeightCalculator::GetHeliumWeight_L010z000i_ND_Numubar double  enu  )  [private]
 

Definition at line 1517 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01518 {
01519   double weight = 1.;
01520   double par[15] = {
01521     1.06489,0.0137669,-0.00415539,0.000218168,0.923382,0.0108634,-0.000376271,
01522     3.86015e-06,0.8,0.01,-0.0005,1e-06,1.03,0.00883329,0.000347229
01523   };
01524   if(enu<11.0){
01525     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu;
01526   }
01527   else if(enu<21.4){
01528     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu+0.0014;
01529   }
01530   else if(enu<37.){
01531     weight = par[8]+par[9]*enu+par[10]*(enu-20.)*(enu-20.)+par[11]*(enu-20.)*(enu-20.)*(enu-20.)+0.0097;
01532   }
01533   else{
01534     weight = par[12]-par[13]*(enu-37.)+par[14]*(enu-37.)*(enu-37.)+0.0097;
01535   }
01536   return weight;
01537 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_FD_Nue double  enu  )  [private]
 

Definition at line 1468 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01469 {
01470   double weight = 1.;
01471   double par[8] = {
01472     1.00099,0.022962,-0.0106913,0.00153978,-6.74999e-05,1.021,-0.0018,1.5e-05
01473   };
01474   if(enu<11.0){
01475     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01476   }
01477   else{
01478     weight = par[5]+(par[6]*(enu-11.))+(par[7]*(enu-11.)*(enu-11.));
01479   }
01480   return weight;
01481 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_FD_Nuebar double  enu  )  [private]
 

Definition at line 1483 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01484 {
01485   double weight = 1.;
01486   double par[7] = {
01487     1.02439,-0.000679498,0.000218119,-6.49776e-06,4.58303e-08,0.997,3300
01488   };
01489   if(enu<43.1){
01490     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01491   }
01492   else{
01493     weight = par[5]+(par[6]/(enu*enu*enu));
01494   }
01495   return weight;
01496 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_FD_Numu double  enu  )  [private]
 

Definition at line 1427 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01428 {
01429   double weight = 1.;
01430   double par[14] = {
01431     1.04327,-0.0352661,0.0047907,0.00388763,0.88061,0.0321005,-0.00164144,
01432     -4.5869e-05,1.05352,-0.00869623,0.000390208,-4.45885e-06,0.997,5000
01433   };
01434   if(enu<4.4){
01435     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*TMath::Log(enu);
01436   }
01437   else if(enu<8.9){
01438     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu;
01439   }
01440   else if(enu<48.0){
01441     weight = par[8]+par[9]*enu+par[10]*enu*enu+par[11]*enu*enu*enu;
01442   }
01443   else{
01444     weight = par[12]+(par[13]/(enu*enu*enu));
01445   }
01446   return weight;
01447 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_FD_Numubar double  enu  )  [private]
 

Definition at line 1449 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01450 {
01451   double weight = 1.;
01452   double par[10] = {
01453     1.04689,0.00226136,-0.000790701,2.61669e-05,-0.0744887,
01454     0.0847917,-0.00190558,1.21492e-05,0.99,4000
01455   };
01456   if(enu<21.9){
01457     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu;
01458   }
01459   else if(enu<38.0){
01460     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu;
01461   }
01462   else{
01463     weight = par[8]+(par[9]/(enu*enu*enu));
01464   }
01465   return weight;
01466 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_ND_Nue double  enu  )  [private]
 

Definition at line 1392 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01393 {
01394   double weight = 1.;
01395   double par[11] = {
01396     0.97709,0.0939192,-0.0536218,0.00805987,1.03,-0.0163451,0.00263497,
01397     -0.000118506,1.57655e-06,0.998,600
01398   };
01399   if(enu<2.43){
01400     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu;
01401   }
01402   else if(enu<23.0){
01403     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu+par[8]*enu*enu*enu*enu;
01404   }
01405   else{
01406     weight = par[9]+(par[10]/(enu*enu*enu));
01407   }
01408   return weight;
01409 
01410 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_ND_Nuebar double  enu  )  [private]
 

Definition at line 1412 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01413 {
01414   double weight = 1.;
01415   double par[7] = {
01416     1.02113,0.0140663,-0.000791038,1.37577e-05,-7.48181e-08,0.9995,1150
01417   };
01418   if(enu<30.0){
01419     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01420   }
01421   else{
01422     weight = par[5]+(par[6]/(enu*enu*enu));
01423   }
01424   return weight;
01425 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_ND_Numu double  enu  )  [private]
 

Definition at line 1344 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01345 {
01346   double weight = 1.;
01347   double par[19] = {
01348     1.10472,-0.0861419,0.0116673,0.0193203,0.230526,0.323048,-0.0434165,0.00189932,1.1483,
01349     -0.0322421,0.00224179,-4.51111e-05,0.818716,0.0177147,-0.000366594,2.1493e-06,1.20406,
01350     -0.00411679,2.18602e-05
01351   };
01352   if(enu<5.15){
01353     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*TMath::Log(enu);
01354   }
01355   else if(enu<7.25){
01356     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu;
01357   }
01358   else if(enu<18.0){
01359     weight = par[8]+par[9]*enu+par[10]*enu*enu+par[11]*enu*enu*enu;
01360   }
01361   else if(enu<53.5){
01362     weight = par[12]+par[13]*enu+par[14]*enu*enu+par[15]*enu*enu*enu;
01363   }
01364   else{
01365     weight = par[16]+par[17]*enu+par[18]*enu*enu;
01366   }
01367   return weight;
01368 }

double SKZPWeightCalculator::GetHeliumWeight_L010z185i_ND_Numubar double  enu  )  [private]
 

Definition at line 1370 of file SKZPWeightCalculator.cxx.

Referenced by GetHeliumWeight().

01371 {
01372   double weight = 1.;
01373   double par[15] = {
01374     1.06239,0.0342807,-0.00879299,0.000479629,-0.346922,0.267095,-0.016762,0.00033883,
01375     0.8,0.01,-0.0005,1e-06,1.03,0.0042195,0.000108851
01376   };
01377   if(enu<11.0){
01378     weight = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu;
01379   }
01380   else if(enu<21.4){
01381     weight = par[4]+par[5]*enu+par[6]*enu*enu+par[7]*enu*enu*enu;
01382   }
01383   else if(enu<37.){
01384     weight = par[8]+par[9]*enu+par[10]*(enu-20.)*(enu-20.)+par[11]*(enu-20.)*(enu-20.)*(enu-20.);
01385   }
01386   else{
01387     weight = par[12]-par[13]*(enu-37.)+par[14]*(enu-37.)*(enu-37.);
01388   }
01389   return weight;
01390 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_FD_Nue double  enu  )  [private]
 

Definition at line 2049 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

02050 {
02051   double y;
02052 
02053   double par[8];
02054 
02055   par[0] = 1.05046;
02056   par[1] = -0.0197051;
02057   par[2] = -0.000709986;
02058   par[3] = 0.000580179;
02059   par[4] = -0.0000443486;
02060   par[5] = 0.000000962613;
02061   par[6] = 0.92;
02062   par[7] = 0.6;
02063 
02064   if(enu<19.5){
02065     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
02066   }
02067   else {
02068     y = par[6]+par[7]*(1./(enu-12.));
02069   }
02070 
02071   return y;
02072 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_FD_Nuebar double  enu  )  [private]
 

Definition at line 2074 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

02075 {
02076   double y;
02077 
02078   double par[8];
02079 
02080   par[0] = 1.03867;
02081   par[1] = 0.0130506;
02082   par[2] = -0.00751797;
02083   par[3] = 0.00109883;
02084   par[4] = -0.0000639034;
02085   par[5] = 0.00000130481;
02086   par[6] = 1.04;
02087   par[7] = -0.2;
02088 
02089   if(enu<18.9){
02090     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
02091   }
02092   else {
02093     y = par[6]+par[7]*(1./(enu-12.));
02094   }
02095 
02096   return y;
02097 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_FD_Numu double  enu  )  [private]
 

Definition at line 1841 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01842 {
01843   double y;
01844 
01845   double par[7];
01846 
01847   par[0] = 0.991629;
01848   par[1] = 0.0150514;
01849   par[2] = -0.00358913;
01850   par[3] = 0.000384422;
01851   par[4] = -0.0000136394;
01852   par[5] = 1.008;
01853   par[6] = 0.35;
01854 
01855   if(enu<13.38){
01856     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01857   }
01858   else {
01859     y = par[5]+par[6]*(1./enu);
01860   }
01861 
01862   return y;
01863 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_FD_Numubar double  enu  )  [private]
 

Definition at line 1865 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01866 {
01867   double y;
01868 
01869   double par[7];
01870 
01871   par[0] = 0.991063;
01872   par[1] = 0.0114890;
01873   par[2] = -0.00123288;
01874   par[3] = 0.0000558658;
01875   par[4] = -0.000000834802;
01876   par[5] = 1.056;
01877   par[6] = -0.35;
01878 
01879   if(enu<17.925){
01880     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01881   }
01882   else {
01883     y = par[5]+par[6]*(1./enu);
01884   }
01885 
01886   return y;
01887 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_ND_Nue double  enu  )  [private]
 

Definition at line 1948 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01949 {
01950   double y;
01951 
01952   double par[8];
01953 
01954   par[0] = 1.09927;
01955   par[1] = -0.0580560;
01956   par[2] = 0.00847919;
01957   par[3] = -0.000341542;
01958   par[4] = -0.00000545052;
01959   par[5] = 0.000000394652;
01960   par[6] = 1.15;
01961   par[7] = -1.0;
01962 
01963   if(enu<20.8){
01964     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
01965   }
01966   else {
01967     y = par[6]+par[7]*(1./(enu-14.));
01968   }
01969 
01970   return y;
01971 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_ND_Nuebar double  enu  )  [private]
 

Definition at line 1973 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01974 {
01975   double y;
01976 
01977   double par[8];
01978 
01979   par[0] = 0.960938;
01980   par[1] = 0.169592;
01981   par[2] = -0.0611788;
01982   par[3] = 0.00782170;
01983   par[4] = -0.000416337;
01984   par[5] = 0.00000785160;
01985   par[6] = 1.12;
01986   par[7] = -1.0;
01987 
01988   if(enu<19.775){
01989     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
01990   }
01991   else {
01992     y = par[6]+par[7]*(1./(enu-13.8));
01993   }
01994 
01995   return y;
01996 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_ND_Numu double  enu  )  [private]
 

Definition at line 1716 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01717 {
01718   double y;
01719 
01720   double par[7];
01721 
01722   par[0] = 1.01052;
01723   par[1] = 0.00135492;
01724   par[2] = 0.000352042;
01725   par[3] = -0.0000281668;
01726   par[4] = 0.000000465827;
01727   par[5] = 1.018;
01728   par[6] = 0.3;
01729 
01730   if(enu<17.2){
01731     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01732   }
01733   else {
01734     y = par[5]+par[6]*(1./enu);
01735   }
01736 
01737   return y;
01738 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z000i_ND_Numubar double  enu  )  [private]
 

Definition at line 1740 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01741 {
01742   double y;
01743 
01744   double par[7];
01745 
01746   par[0] = 1.00806;
01747   par[1] = 0.00509031;
01748   par[2] = -0.000422559;
01749   par[3] = 0.0000180352;
01750   par[4] = -0.000000272726;
01751   par[5] = 1.018;
01752   par[6] = 0.85;
01753 
01754   if(enu<30.5){
01755     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01756   }
01757   else {
01758     y = par[5]+par[6]*(1./enu);
01759   }
01760 
01761   return y;
01762 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_FD_Nue double  enu  )  [private]
 

Definition at line 1998 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01999 {
02000   double y;
02001 
02002   double par[8];
02003 
02004   par[0] = 0.976334;
02005   par[1] = 0.0146822;
02006   par[2] = -0.00805149;
02007   par[3] = 0.00132456;
02008   par[4] = -0.0000810696;
02009   par[5] = 0.00000166323;
02010   par[6] = 1.0851;
02011   par[7] = -1.0;
02012 
02013   if(enu<19.45){
02014     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
02015   }
02016   else{
02017     y = par[6]+par[7]*(1./(enu-9.));
02018   }
02019 
02020   return y;
02021 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_FD_Nuebar double  enu  )  [private]
 

Definition at line 2023 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

02024 {
02025   double y;
02026 
02027   double par[9];
02028 
02029   par[0] = 0.912223;
02030   par[1] = 0.106252;
02031   par[2] = -0.0341165;
02032   par[3] = 0.00490576;
02033   par[4] = -0.000344942;
02034   par[5] = 0.0000114327;
02035   par[6] = -0.000000142208;
02036   par[7] = 0.9;
02037   par[8] = 1.0;
02038 
02039   if(enu<27.55){
02040     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu+par[6]*enu*enu*enu*enu*enu*enu;
02041   }
02042   else {
02043     y = par[7]+par[8]*(1./(enu-22.));
02044   }
02045 
02046   return y;
02047 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_FD_Numu double  enu  )  [private]
 

Definition at line 1764 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01765 {
01766   double y;
01767 
01768   double par[20];
01769 
01770   par[0] =   9.79176e-01;
01771   par[1] =   5.94877e-02;
01772   par[2] =  -6.33591e-02;
01773   par[3] =   1.24537e-02;
01774   par[4] =   6.85855e-03;
01775   par[5] =  -2.08938e-03;
01776   par[6] =   2.56824e+00;
01777   par[7] =  -5.16706e-01;
01778   par[8] =   5.21584e-02;
01779   par[9] =  -1.52990e+00;
01780   par[10] =   7.10491e-01;
01781   par[11] =   7.95342e-02;
01782   par[12] =  -5.11905e-03;
01783   par[13] =  -4.11699e+00;
01784   par[14] =  -1.27508e-01;
01785   par[15] =   1.08948e-03;
01786   par[16] =   2.22361e+00;
01787   par[17] =   1.17195e+01;
01788   par[18] = 1.018;
01789   par[19] = 0.005;
01790 
01791   if(enu<2.83){
01792     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
01793   }
01794   else if(enu<4.925){
01795     y = par[6]+par[7]*enu+par[8]*enu*enu+par[9]*(1./enu);
01796   }
01797   else if(enu<9.0){
01798     y = par[10]+par[11]*enu+par[12]*enu*enu;
01799   }
01800   else if(enu<17.6){
01801     y = par[13]+par[14]*enu+par[15]*enu*enu+par[16]*TMath::Log(enu)+par[17]*(1./enu);
01802   }
01803   else{
01804     y = par[18]+par[19]*(1./(enu-13.8));
01805   }
01806 
01807   return y;
01808 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_FD_Numubar double  enu  )  [private]
 

Definition at line 1810 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01811 {
01812   double y;
01813 
01814   double par[11];
01815 
01816   par[0] = 0.992562;
01817   par[1] = 0.0301506;
01818   par[2] = -0.0129656;
01819   par[3] = 0.00215436;
01820   par[4] = -0.000115552;
01821   par[5] = 0.958894;
01822   par[6] = 0.00228454;
01823   par[7] = -0.0000164352;
01824   par[8] = 0.468619;
01825   par[9] = 1.04;
01826   par[10] = -0.2;
01827 
01828   if(enu<8.35){
01829     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01830   }
01831   else if(enu<38.75){
01832     y = par[5]+par[6]*enu+par[7]*enu*enu+par[8]*(1./enu);
01833   }
01834   else {
01835     y = par[9]+par[10]*(1./enu);
01836   }
01837 
01838   return y;
01839 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_ND_Nue double  enu  )  [private]
 

Definition at line 1891 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01892 {
01893   double y;
01894 
01895   double par[12];
01896 
01897   par[0] = 0.964536;
01898   par[1] = 0.0341348;
01899   par[2] = -0.0167779;
01900   par[3] = 0.00275733;
01901   par[4] = -0.000173092;
01902   par[5] = 0.00000364374;
01903   par[6] = 65.6200;
01904   par[7] = 1.55324;
01905   par[8] = -0.0132149;
01906   par[9] = -27.7156;
01907   par[10] = -147.925;
01908   par[11] = 1.11675;
01909 
01910   if(enu<15.70){
01911     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
01912   }
01913   else if(enu<29.8){
01914     y = -0.012+par[6]+par[7]*enu+par[8]*enu*enu+par[9]*TMath::Log(enu)+par[10]*(1./enu);
01915   }
01916   else{
01917     y = par[11];
01918   }
01919 
01920   return y;
01921 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_ND_Nuebar double  enu  )  [private]
 

Definition at line 1923 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01924 {
01925   double y;
01926 
01927   double par[8];
01928 
01929   par[0] = 1.01535;
01930   par[1] = -0.0167946;
01931   par[2] = 0.00921187;
01932   par[3] = -0.00133391;
01933   par[4] = 0.0000684085;
01934   par[5] = -0.00000113447;
01935   par[6] = 0.9;
01936   par[7] = 1.0;
01937 
01938   if(enu<26.95){
01939     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
01940   }
01941   else {
01942     y = par[6]+par[7]*(1./(enu-22.));
01943   }
01944 
01945   return y;
01946 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_ND_Numu double  enu  )  [private]
 

Definition at line 1639 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01640 {
01641   double y;
01642 
01643   double par[20];
01644 
01645   par[0] =  9.91823e-01;
01646   par[1] =  8.14956e-02;
01647   par[2] = -1.44191e-01;
01648   par[3] =  7.80651e-02;
01649   par[4] = -1.29277e-02;
01650   par[5] = -1.41734e-04;
01651   par[6] =  3.62036e+00;
01652   par[7] = -8.98865e-01;
01653   par[8] =  9.61367e-02;
01654   par[9] = -2.44885e+00;
01655   par[10] =  6.81085e-01;
01656   par[11] =  9.40087e-02;
01657   par[12] = -6.50227e-03;
01658   par[13] = -2.86720e+00;
01659   par[14] = -1.14010e-01;
01660   par[15] =  1.06866e-03;
01661   par[16] =  1.77433e+00;
01662   par[17] =  8.30457e+00;
01663   par[18] =  1.018;
01664   par[19] =  0.005;
01665 
01666   if(enu<2.875){
01667     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu+par[5]*enu*enu*enu*enu*enu;
01668   }
01669   else if(enu<4.375){
01670     y = par[6]+par[7]*enu+par[8]*enu*enu+par[9]*(1./enu);
01671   }
01672   else if(enu<7.460){
01673     y = par[10]+par[11]*enu+par[12]*enu*enu;
01674   }
01675   else if(enu<15.15){
01676     y = par[13]+par[14]*enu+par[15]*enu*enu+par[16]*TMath::Log(enu)+par[17]*(1./enu);
01677   }
01678   else{
01679     y = par[18]+par[19]*(1./(enu-13.8));
01680   }
01681 
01682   return y;
01683 }

double SKZPWeightCalculator::GetMissingFin78Weight_L010z185i_ND_Numubar double  enu  )  [private]
 

Definition at line 1685 of file SKZPWeightCalculator.cxx.

Referenced by GetTargetDecayWeight().

01686 {
01687   double y;
01688 
01689   double par[11];
01690 
01691   par[0] = 1.01079;
01692   par[1] = 0.0163014;
01693   par[2] = -0.00951575;
01694   par[3] = 0.00189497;
01695   par[4] = -0.000114420;
01696   par[5] = 0.745891;
01697   par[6] = 0.0198691;
01698   par[7] = -0.000440386;
01699   par[8] = 1.22518;
01700   par[9] = 1.04;
01701   par[10] = -0.2;
01702 
01703   if(enu<8.6){
01704     y = par[0]+par[1]*enu+par[2]*enu*enu+par[3]*enu*enu*enu+par[4]*enu*enu*enu*enu;
01705   }
01706   else if(enu<15.5){
01707     y = par[5]+par[6]*enu+par[7]*enu*enu+par[8]*(1./enu);
01708   }
01709   else {
01710     y = par[9]+par[10]*(1./enu);
01711   }
01712 
01713   return y;
01714 }

void SKZPWeightCalculator::GetParameters std::vector< double > &  bs,
std::vector< double > &  hp,
std::vector< double > &  det
 

Definition at line 812 of file SKZPWeightCalculator.cxx.

References bs_pars, det, det_pars, and hp_pars.

00813 {
00814   //this function is provided so that a user can compute weights for
00815   //many different szkp parameters.
00816   //it is provided for special studies, and I don't expect
00817   //most people will need this functionality.
00818 
00819   //clear anything that's already stored in the vectors
00820   bs.clear();
00821   hp.clear();
00822   det.clear();
00823 
00824   //copy the private data members into the function parameters
00825   for(unsigned int i=0;i<bs_pars.size();i++){
00826     bs.push_back(bs_pars[i]);
00827   }
00828   for(unsigned int i=0;i<hp_pars.size();i++){
00829     hp.push_back(hp_pars[i]);
00830   }
00831   for(unsigned int i=0;i<det_pars.size();i++){
00832     det.push_back(det_pars[i]);
00833   }
00834 }

double SKZPWeightCalculator::GetRFWWeight int  det,
int  Ibeam,
int  tptype,
double  pt,
double  pz,
int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight
 

Definition at line 1147 of file SKZPWeightCalculator.cxx.

References det, GetBeamWeight(), GetDetWeight(), MSG, runfrac, and RunPeriod_t.

01153 {
01154 
01155   //do the detector weighting
01156   detweight=GetDetWeight(ccnc,true_enu,inu,
01157                          reco_emu,reco_eshw,new_reco_emu,new_reco_eshw);
01158   beamweight=1.;
01159   if(runfrac.size()==0){
01160     MSG("SKZPWeightCalculator",Msg::kError)<<"You did not set the "
01161                                            <<"Run Period exposures."<<endl
01162                                            <<"I can not compute a "
01163                                            <<" fractional weight without "
01164                                            <<"knowing the relative exposures"<<endl;
01165     return 1.;
01166   }
01167     
01168 
01169   map<RunPeriod_t,double> beamc(runfrac.find(Ibeam)->second);
01170   map<RunPeriod_t,double>::iterator bcit(beamc.begin());
01171   double num=0.;
01172   double denom=0.;
01173   int i=0;
01174   while(bcit!=beamc.end()){
01175     RunPeriod_t rp = bcit->first;
01176     double pot = bcit->second;
01177     double w=GetBeamWeight(det,Ibeam,tptype,pt,pz,true_enu,inu,rp);
01178     num+=w*pot;
01179     denom+=pot;
01180     bcit++;
01181     //        cout<<"bcit->first "<<bcit->first<<endl;
01182     //    cout<<"bcit->second "<<bcit->second<<endl;
01183 
01184     //    cout<<"i "<<i<<" w "<<w<<" pot "<<pot<<" w*pot "<<w*pot<<" num "<<num<<" denom "<<denom<<endl;
01185     i++;
01186   }
01187     
01188     
01189   if(denom!=0){
01190     beamweight*=num/denom;
01191   }
01192 
01193 
01194   //return just the beam weight, as this is what 
01195   //most people will want
01196   //the value of the detweight is passed by reference
01197   //do not use the new values of new_reco_emu and new_reco_eshw
01198   //in the case of beam weighting only!!!!!
01199   return beamweight;
01200 }

double SKZPWeightCalculator::GetRFWWeight const NtpMCFluxInfo fi,
int  det,
int  Ibeam,
int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight
 

Definition at line 1122 of file SKZPWeightCalculator.cxx.

References det, GetRFWWeight(), NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, and NtpMCFluxInfo::tpz.

01127 {
01128   int parenttype=-1;
01129   double parentpz=0.;
01130   double parentpx=0.;
01131   double parentpy=0.;
01132 
01133   parenttype = fi->tptype;
01134   parentpz = 1.*fi->tpz;
01135   parentpy = 1.*fi->tpy;
01136   parentpx = 1.*fi->tpx;
01137 
01138   double pt = sqrt(parentpy*parentpy+parentpx*parentpx);
01139 
01140   //pass the variables on to the next version of GetWeight
01141   return GetRFWWeight(det,Ibeam,parenttype,pt,parentpz,ccnc,true_enu,inu,
01142                       reco_emu,reco_eshw,new_reco_emu,
01143                       new_reco_eshw,beamweight,detweight);
01144 
01145 }

double SKZPWeightCalculator::GetRFWWeight const NtpMCTruth mc,
int  det,
int  Ibeam,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight
 

Definition at line 1101 of file SKZPWeightCalculator.cxx.

References det, NtpMCTruth::flux, NtpMCTruth::iaction, NtpMCTruth::inu, and NtpMCTruth::p4neu.

Referenced by NuZBeamReweight::GetRFWeights(), and GetRFWWeight().

01105 {
01106   //retrieve truth information on the neutrino interaction from
01107   //the NtpMCTruth object
01108   int ccnc = mc->iaction;
01109   double true_enu = 1.*mc->p4neu[3];
01110   int inu = mc->inu;
01111 
01112   //pass the truth info and the fluxinfo object to the next
01113   //form of GetWeight
01114   return GetRFWWeight(&(mc->flux),det,Ibeam,
01115                       ccnc,true_enu,inu,
01116                       reco_emu,reco_eshw,
01117                       new_reco_emu,new_reco_eshw,
01118                       beamweight, detweight);
01119   
01120 }

double SKZPWeightCalculator::GetRunPeriodWeight VldContext  vc,
int  det,
int  Ibeam,
int  ntype,
double  Enu
[inline, private]
 

Definition at line 243 of file SKZPWeightCalculator.h.

References det, GetRunPeriodWeight(), RunPeriodFromInt(), and RunPeriodIntFromValidity().

00243                                                                                      {
00244     return GetRunPeriodWeight((RunPeriodFromInt(RunPeriodIntFromValidity(vc))),det,Ibeam,ntype,Enu);}

double SKZPWeightCalculator::GetRunPeriodWeight RunPeriod_t  rp,
int  det,
int  Ibeam,
int  ntype,
double  Enu
[private]
 

Definition at line 920 of file SKZPWeightCalculator.cxx.

References Zbeam::ZbeamData::beam, bs_pars, cfgnum, det, Zbeam::ZbeamData::detector, BeamType::FromZarko(), GetHeliumWeight(), GetTargetDecayWeight(), Zbeam::GetWeight(), kDetXs, kRunII, kRunIII, Zbeam::ZbeamData::ntype, Zbeam::ZbeamData::true_enu, zbeam, and Zbeam::ZbeamData_t.

Referenced by GetBeamWeight(), and GetRunPeriodWeight().

00925 {
00926   double weight=1.;
00927 
00928   if(cfgnum==kDetXs || cfgnum==kDogwood1_Daikon07){
00929 
00930     // Target z weighting comes from the fit parameters
00931     Detector::Detector_t detector = Detector::kUnknown;
00932     if      (det==1) detector=Detector::kNear;
00933     else if (det==2) detector=Detector::kFar;
00934     
00935     Zbeam::ZbeamData_t zdata;
00936     zdata.ntype    = ntype;
00937     zdata.true_enu = Enu;
00938     zdata.detector = detector;
00939     zdata.beam     = BeamType::FromZarko(Ibeam);
00940     
00941 
00942     if(rp==kRunI){ // both weighting schemes have same parameters
00943       
00944       // target z effects
00945       if ( zdata.beam == BeamType::kL010z170i || 
00946            zdata.beam == BeamType::kL010z185i || 
00947            zdata.beam == BeamType::kL010z200i) {
00948         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[0]);
00949       } else if (zdata.beam == BeamType::kL100z200i) {
00950         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[1]);
00951       } else if (zdata.beam == BeamType::kL150z200i) {
00952         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[2]);
00953       } else if (zdata.beam == BeamType::kL250z200i) {
00954         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[3]);
00955       }
00956       
00957       // spot size
00958       if (zdata.beam == BeamType::kL250z200i ||
00959           zdata.beam == BeamType::kL100z200i) {
00960         weight *= zbeam->GetWeight(zdata,BeamSys::kBeamWidth,0.);
00961       }
00962     }
00963     else if(rp==kRunII) {
00964       
00965       if (zdata.beam == BeamType::kL010z185i) {
00966         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[4]);
00967       }
00968       else if (zdata.beam == BeamType::kL250z200i) {
00969         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[5]);
00970       }
00971 
00972       if(cfgnum==kDogwood1_Daikon07){ // apply target decay weight
00973         weight *= GetTargetDecayWeight(det,Ibeam,ntype,Enu,bs_pars[7]);
00974       }
00975 
00976     }
00977 
00978     else if(rp==kRunIII && cfgnum==kDetXs) { // use Run II beam position and Helium weight
00979 
00980       if (zdata.beam == BeamType::kL010z185i) {
00981         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[4]);
00982       }
00983       weight *= GetHeliumWeight(det,Ibeam,ntype,Enu);
00984 
00985       // DetXs target decay weight to be added when finalised
00986 
00987     }
00988 
00989     else if(rp==kRunIII && cfgnum==kDogwood1_Daikon07){
00990 
00991       if (zdata.beam == BeamType::kL010z185i) {
00992         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[6]);
00993       }
00994       weight *= GetTargetDecayWeight(det,Ibeam,ntype,Enu,bs_pars[8]);
00995       // Don't need Helium weight for Daikon07
00996 
00997     }
00998 
00999   } // end if(DetXs or Dogwood1_Daikon07)
01000   else if(cfgnum==kDogwood1_Daikon07_v2){
01001 
01002     // Target z weighting comes from the fit parameters
01003     Detector::Detector_t detector = Detector::kUnknown;
01004     if      (det==1) detector=Detector::kNear;
01005     else if (det==2) detector=Detector::kFar;
01006     
01007     Zbeam::ZbeamData_t zdata;
01008     zdata.ntype    = ntype;
01009     zdata.true_enu = Enu;
01010     zdata.detector = detector;
01011     zdata.beam     = BeamType::FromZarko(Ibeam);
01012     
01013     if(rp==kRunI){
01014       
01015       // target z effects
01016       if ( zdata.beam == BeamType::kL010z170i || 
01017            zdata.beam == BeamType::kL010z185i || 
01018            zdata.beam == BeamType::kL010z200i) {
01019         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[5]);
01020       } else if (zdata.beam == BeamType::kL100z200i) {
01021         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[6]);
01022       } else if (zdata.beam == BeamType::kL150z200i) {
01023         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[7]);
01024       } else if (zdata.beam == BeamType::kL250z200i) {
01025         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[8]);
01026       }
01027       
01028       // spot size
01029       if (zdata.beam == BeamType::kL250z200i ||
01030           zdata.beam == BeamType::kL100z200i) {
01031         weight *= zbeam->GetWeight(zdata,BeamSys::kBeamWidth,0.);
01032       }
01033     }
01034     else if(rp==kRunII) {
01035       
01036       if (zdata.beam == BeamType::kL010z185i) {
01037         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[9]);
01038       }
01039       else if (zdata.beam == BeamType::kL250z200i) {
01040         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[10]);
01041       }
01042 
01043       // apply target decay weight
01044       weight *= GetTargetDecayWeight(det,Ibeam,ntype,Enu,bs_pars[12]);
01045 
01046     }
01047 
01048     else if(rp==kRunIII){
01049 
01050       if (zdata.beam == BeamType::kL010z185i) {
01051         weight *= zbeam->GetWeight(zdata,BeamSys::kTargetZ ,bs_pars[11]);
01052       }
01053 
01054       // apply target decay weight
01055       weight *= GetTargetDecayWeight(det,Ibeam,ntype,Enu,bs_pars[13]);
01056 
01057       // Don't need Helium weight for Daikon07
01058 
01059     }
01060 
01061   }
01062   else {
01063     if(rp==kRunI){
01064       // cout<<"on run I"<<endl;
01065       //RUN I
01066       //ME and HE runs were lower intensity, smaller spot size,  
01067       if(BeamType::FromZarko(Ibeam)==BeamType::kL100z200i||
01068          BeamType::FromZarko(Ibeam)==BeamType::kL250z200i){
01069         //GetWeight with effect 6 already takes care of the beam type "if's"
01070         //but I thought I should just make them explicit here too
01071         weight=zbeam->GetWeight(det,Ibeam,6,0,ntype,Enu);
01072         //      cout<<"in run I weight"<<endl;
01073       }
01074     }
01075     else if(rp==kRunII || rp==kRunIII){
01076       //RUN II
01077       //reweight le10 beam to le09 beam
01078       //    cout<<"in run II weight "<<endl;
01079       if(BeamType::FromZarko(Ibeam)==BeamType::kL010z185i||
01080          BeamType::FromZarko(Ibeam)==BeamType::kL010z000i){
01081         weight=zbeam->GetWeight(det,Ibeam,15,-1.,ntype,Enu);
01082         //      cout<<"in run II weight "<<endl;
01083       }
01084 
01085       if(rp==kRunII){
01086         // target decay weight to be added when finalised, 0.6 should give ~average effect
01087         weight *= GetTargetDecayWeight(det,Ibeam,ntype,Enu,0.6);
01088       }
01089       if(rp==kRunIII){
01090         weight *= GetHeliumWeight(det,Ibeam,ntype,Enu);
01091         // target decay weight to be added when finalised, 1.25 should give ~average effect
01092         weight *= GetTargetDecayWeight(det,Ibeam,ntype,Enu,1.25);
01093       }
01094 
01095     }
01096     //  cout<<"run perioud weight "<<weight<<endl;
01097   }
01098   return weight;
01099 }

double SKZPWeightCalculator::GetTargetDecayWeight int  det,
int  Ibeam,
int  Ntype,
double  true_enu,
double  fin78fraction
 

Definition at line 1244 of file SKZPWeightCalculator.cxx.

References det, GetMissingFin78Weight_L010z000i_FD_Nue(), GetMissingFin78Weight_L010z000i_FD_Nuebar(), GetMissingFin78Weight_L010z000i_FD_Numu(), GetMissingFin78Weight_L010z000i_FD_Numubar(), GetMissingFin78Weight_L010z000i_ND_Nue(), GetMissingFin78Weight_L010z000i_ND_Nuebar(), GetMissingFin78Weight_L010z000i_ND_Numu(), GetMissingFin78Weight_L010z000i_ND_Numubar(), GetMissingFin78Weight_L010z185i_FD_Nue(), GetMissingFin78Weight_L010z185i_FD_Nuebar(), GetMissingFin78Weight_L010z185i_FD_Numu(), GetMissingFin78Weight_L010z185i_FD_Numubar(), GetMissingFin78Weight_L010z185i_ND_Nue(), GetMissingFin78Weight_L010z185i_ND_Nuebar(), GetMissingFin78Weight_L010z185i_ND_Numu(), and GetMissingFin78Weight_L010z185i_ND_Numubar().

Referenced by GetRunPeriodWeight().

01245 {
01246 
01247   double weight78 = 1.0;
01248 
01249   if(det==1){ // ND
01250     if(Ibeam==2){ // L010z185i
01251       if(Ntype==56 || Ntype==14) weight78 = GetMissingFin78Weight_L010z185i_ND_Numu(true_enu);
01252       else if(Ntype==55 || Ntype==-14) weight78 = GetMissingFin78Weight_L010z185i_ND_Numubar(true_enu);
01253       else if(Ntype==53 || Ntype==12) weight78 = GetMissingFin78Weight_L010z185i_ND_Nue(true_enu);
01254       else if(Ntype==52 || Ntype==-12) weight78 = GetMissingFin78Weight_L010z185i_ND_Nuebar(true_enu);
01255       else weight78 = 1.0;
01256     }
01257     else if(Ibeam==8){ // L010z000i
01258       if(Ntype==56 || Ntype==14) weight78 = GetMissingFin78Weight_L010z000i_ND_Numu(true_enu);
01259       else if(Ntype==55 || Ntype==-14) weight78 = GetMissingFin78Weight_L010z000i_ND_Numubar(true_enu);
01260       else if(Ntype==53 || Ntype==12) weight78 = GetMissingFin78Weight_L010z000i_ND_Nue(true_enu);
01261       else if(Ntype==52 || Ntype==-12) weight78 = GetMissingFin78Weight_L010z000i_ND_Nuebar(true_enu);
01262       else weight78 = 1.0;
01263     }
01264     else weight78 = 1.0;
01265   }
01266   else if(det==2){ // FD
01267     if(Ibeam==2){ // L010z185i
01268       if(Ntype==56 || Ntype==14) weight78 = GetMissingFin78Weight_L010z185i_FD_Numu(true_enu);
01269       else if(Ntype==55 || Ntype==-14) weight78 = GetMissingFin78Weight_L010z185i_FD_Numubar(true_enu);
01270       else if(Ntype==53 || Ntype==12) weight78 = GetMissingFin78Weight_L010z185i_FD_Nue(true_enu);
01271       else if(Ntype==52 || Ntype==-12) weight78 = GetMissingFin78Weight_L010z185i_FD_Nuebar(true_enu);
01272       else weight78 = 1.0;
01273     }
01274     else if(Ibeam==8){ // L010z000i
01275       if(Ntype==56 || Ntype==14) weight78 = GetMissingFin78Weight_L010z000i_FD_Numu(true_enu);
01276       else if(Ntype==55 || Ntype==-14) weight78 = GetMissingFin78Weight_L010z000i_FD_Numubar(true_enu);
01277       else if(Ntype==53 || Ntype==12) weight78 = GetMissingFin78Weight_L010z000i_FD_Nue(true_enu);
01278       else if(Ntype==52 || Ntype==-12) weight78 = GetMissingFin78Weight_L010z000i_FD_Nuebar(true_enu);
01279       else weight78 = 1.0;
01280     }
01281     else weight78 = 1.0;
01282   }
01283   else weight78 = 1.0;
01284 
01285   // Now convert to fractional weight
01286   // eg: if want to remove 4 fins then double the distance from unity for the weight
01287 
01288   double weight = 1.;
01289 
01290   if(weight78<0.){
01291     weight = 1.0-(fin78fraction*(1.0-weight78));
01292   }
01293   else if(weight78>0.){
01294     weight = 1.0+(fin78fraction*(weight78-1.0));
01295   }
01296 
01297   return weight;
01298 
01299 }

double SKZPWeightCalculator::GetWeight int  det,
int  Ibeam,
int  tptype,
double  pt,
double  pz,
int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight,
VldContext  vc,
double  true_eshw = -1,
MCEventInfo ei = 0
[inline]
 

Definition at line 155 of file SKZPWeightCalculator.h.

References det, GetWeight(), RunPeriodFromInt(), and RunPeriodIntFromValidity().

00161                                                                        {
00162     return GetWeight(det,Ibeam,
00163                      tptype,pt,pz,
00164                      ccnc,true_enu,inu,
00165                      reco_emu,reco_eshw,
00166                      new_reco_emu,new_reco_eshw,
00167                      beamweight,detweight,
00168                      RunPeriodFromInt(RunPeriodIntFromValidity(vc)),
00169                      true_eshw,ei);
00170   }

double SKZPWeightCalculator::GetWeight const NtpMCFluxInfo fi,
int  det,
int  Ibeam,
int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight,
VldContext  vc,
double  true_eshw = -1,
MCEventInfo ei = 0
[inline]
 

Definition at line 140 of file SKZPWeightCalculator.h.

References det, GetWeight(), RunPeriodFromInt(), and RunPeriodIntFromValidity().

00145                                                                        {
00146     return GetWeight(fi,det,Ibeam,
00147                      ccnc,true_enu,inu,
00148                      reco_emu,reco_eshw,
00149                      new_reco_emu,new_reco_eshw,
00150                      beamweight,detweight,
00151                      RunPeriodFromInt(RunPeriodIntFromValidity(vc)),
00152                      true_eshw,ei);
00153   }

double SKZPWeightCalculator::GetWeight const NtpMCTruth mc,
int  det,
int  Ibeam,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight,
VldContext  vc,
double  true_eshw = -1,
MCEventInfo ei = 0
[inline]
 

Definition at line 127 of file SKZPWeightCalculator.h.

References det, GetWeight(), RunPeriodFromInt(), and RunPeriodIntFromValidity().

00131                                                                        {
00132     return GetWeight(mc,det,Ibeam,
00133                      reco_emu,reco_eshw,
00134                      new_reco_emu,new_reco_eshw,
00135                      beamweight,detweight,
00136                      RunPeriodFromInt(RunPeriodIntFromValidity(vc)),
00137                      true_eshw,ei);
00138   }

double SKZPWeightCalculator::GetWeight int  det,
int  Ibeam,
int  tptype,
double  pt,
double  pz,
int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight,
RunPeriod_t  rp = kRunI,
double  true_eshw = -1,
MCEventInfo ei = 0
 

Definition at line 344 of file SKZPWeightCalculator.cxx.

References det, GetBeamWeight(), and GetDetWeight().

00352 {
00353   
00354   //do the beam weighting
00355   beamweight=GetBeamWeight(det,Ibeam,tptype,pt,pz,true_enu,inu,rp);
00356   //do the detector weighting
00357   detweight=GetDetWeight(ccnc,true_enu,inu,
00358                          reco_emu,reco_eshw,new_reco_emu,new_reco_eshw,true_eshw,ei);
00359 
00360   //return just the beam weight, as this is what 
00361   //most people will want
00362   //the value of the detweight is passed by reference
00363   //do not use the new values of new_reco_emu and new_reco_eshw
00364   //in the case of beam weighting only!!!!!
00365   return beamweight;
00366 
00367 }

double SKZPWeightCalculator::GetWeight const NtpMCFluxInfo fi,
int  det,
int  Ibeam,
int  ccnc,
double  true_enu,
int  inu,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight,
RunPeriod_t  rp = kRunI,
double  true_eshw = -1,
MCEventInfo ei = 0
 

Definition at line 299 of file SKZPWeightCalculator.cxx.

References cfgname, det, GetWeight(), NtpMCFluxInfo::ppdxdz, NtpMCFluxInfo::ppdydz, NtpMCFluxInfo::pppz, NtpMCFluxInfo::ptype, NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, and NtpMCFluxInfo::tpz.

00306 {
00307   int parenttype=-1;
00308   double parentpz=0.;
00309   double parentpx=0.;
00310   double parentpy=0.;
00311 
00312   //extract the flux weighting variables from the fluxinfo object
00313   //due to bug in v18 flux files, the tp* variables
00314   //(i.e. info pertaining to the particle created in the target)
00315   //are the same as the pp* variables
00316   //(i.e. the info pertaining to the particle leaving the target)
00317   //in v19 flux and beyond, this has been fixed.
00318   //In the future, we will probably want to weight based on the tp variables,
00319   //but to compare with what was done before, I want the option to 
00320   //use the pp* variables, which is why this if statement is here.
00321 
00322   if(cfgname=="v19fit"){  //this isn't a real config yet
00323     parenttype = fi->ptype;
00324     parentpz = 1.*fi->pppz;
00325     parentpy = 1.*fi->ppdydz*parentpz;
00326     parentpx = 1.*fi->ppdxdz*parentpz;
00327   }
00328   else{
00329     parenttype = fi->tptype;
00330     parentpz = 1.*fi->tpz;
00331     parentpy = 1.*fi->tpy;
00332     parentpx = 1.*fi->tpx;
00333   }
00334 
00335   double pt = sqrt(parentpy*parentpy+parentpx*parentpx);
00336 
00337   //pass the variables on to the next version of GetWeight
00338   return GetWeight(det,Ibeam,parenttype,pt,parentpz,ccnc,true_enu,inu,
00339                    reco_emu,reco_eshw,new_reco_emu,new_reco_eshw,beamweight,detweight,
00340                    rp,true_eshw,ei);
00341 
00342 }

double SKZPWeightCalculator::GetWeight const NtpMCTruth mc,
int  det,
int  Ibeam,
double  reco_emu,
double  reco_eshw,
double &  new_reco_emu,
double &  new_reco_eshw,
double &  beamweight,
double &  detweight,
RunPeriod_t  rp = kRunI,
double  true_eshw = -1,
MCEventInfo ei = 0
 

Definition at line 273 of file SKZPWeightCalculator.cxx.

References det, NtpMCTruth::flux, GetWeight(), NtpMCTruth::iaction, NtpMCTruth::inu, and NtpMCTruth::p4neu.

00279 {
00280 
00281 
00282   //retrieve truth information on the neutrino interaction from
00283   //the NtpMCTruth object
00284   int ccnc = mc->iaction;
00285   double true_enu = 1.*mc->p4neu[3];
00286   int inu = mc->inu;
00287 
00288 
00289   //pass the truth info and the fluxinfo object to the next
00290   //form of GetWeight
00291   return GetWeight(&(mc->flux),det,Ibeam,
00292                    ccnc,true_enu,inu,
00293                    reco_emu,reco_eshw,
00294                    new_reco_emu,new_reco_eshw,
00295                    beamweight, detweight,rp,true_eshw,ei);
00296 
00297 }

virtual double SKZPWeightCalculator::GetWeight MCEventInfo ,
NuParent
[inline, virtual]
 

Reimplemented from WeightCalculator.

Definition at line 102 of file SKZPWeightCalculator.h.

00102 {return 1.;}

double SKZPWeightCalculator::GetWeight Registry eventinfo  )  [virtual]
 

Reimplemented from WeightCalculator.

Definition at line 225 of file SKZPWeightCalculator.cxx.

References det, Registry::Get(), Registry::LockKeys(), MSG, Registry::Set(), and Registry::UnLockKeys().

Referenced by NCEventInfo::FindMEGAFitWeight(), GetWeight(), and NuZBeamReweight::GetWeights().

00226 {
00227   //don't use me I'm slow.
00228   //the GetWeight function this version calls has been tested,
00229   //but reading the event info from the registry has not 
00230   //been tested (it should work, I just haven't tried it yet)
00231   bool gotallinfo=true;
00232   int det,ibeam,tptype,ccnc,inu;
00233   double pt, pz, true_enu, reco_emu, reco_eshw;
00234   double new_reco_emu, new_reco_eshw, beamweight, detweight;
00235   
00236   if(!eventinfo->Get("evt:det",det)) gotallinfo=false;
00237   if(!eventinfo->Get("evt:ibeam",ibeam)) gotallinfo=false;
00238   if(!eventinfo->Get("evt:tptype",tptype)) gotallinfo=false;
00239   if(!eventinfo->Get("evt:ccnc",ccnc)) gotallinfo=false;
00240   if(!eventinfo->Get("evt:inu",inu)) gotallinfo=false;
00241   if(!eventinfo->Get("evt:pt",pt)) gotallinfo=false;
00242   if(!eventinfo->Get("evt:pz",pz)) gotallinfo=false; 
00243   if(!eventinfo->Get("evt:true_enu",true_enu)) gotallinfo=false;  
00244   if(!eventinfo->Get("evt:reco_emu",reco_emu)) gotallinfo=false;  
00245   if(!eventinfo->Get("evt:reco_eshw",reco_eshw)) gotallinfo=false;
00246 
00247   if(!gotallinfo){
00248     MSG("SKZPWeightCalculator",Msg::kError)<<"Could not retrieve all necessary"
00249                                            <<" event information from "
00250                                            <<"eventinfo registry, returning 1."
00251                                            <<endl;
00252     return 1.;
00253   }
00254 
00255   GetWeight(det,ibeam,tptype,pt,pz,ccnc,
00256             true_enu,inu,reco_emu,reco_eshw,
00257             new_reco_emu,new_reco_eshw,beamweight,detweight);
00258 
00259   //put new reco energies and weights into registry;
00260   eventinfo->UnLockKeys();
00261   eventinfo->Set("evt:new_reco_emu",new_reco_emu);
00262   eventinfo->Set("evt:new_reco_eshw",new_reco_eshw);
00263   eventinfo->Set("evt:beamweight",beamweight);
00264   eventinfo->Set("evt:detweight",detweight);
00265   eventinfo->LockKeys();
00266 
00267   // this function returns only the beam weight, as that is 
00268   //what most people are encouraged to use, the detweight is
00269   //returned through the registry
00270   return beamweight;
00271 }

Zbeam * SKZPWeightCalculator::GetZbeam  ) 
 

Definition at line 1229 of file SKZPWeightCalculator.cxx.

01230 {
01231    return zbeam;
01232 }

Zfluk * SKZPWeightCalculator::GetZfluk  ) 
 

Definition at line 1235 of file SKZPWeightCalculator.cxx.

01236 {
01237    return zfluk;
01238 }

void SKZPWeightCalculator::PrintReweightConfig ostream &   )  [virtual]
 

Reimplemented from WeightCalculator.

Definition at line 765 of file SKZPWeightCalculator.cxx.

References bs_pars, cfgname, det_pars, and hp_pars.

Referenced by NueStandard::GetSKZPBeamWeight(), NuZBeamReweight::GetSKZPWeightCalculator(), and NuZBeamReweight::GetSKZPWeightCalculatorCustom().

00766 {
00767   o<<"Reweighting to : "<<cfgname<<endl;
00768   for(unsigned int i=0;i<bs_pars.size();i++){
00769     o<<"Beam Sys par "<<i<<" "<<bs_pars[i]<<endl;
00770   }
00771   for(unsigned int i=0;i<hp_pars.size();i++){
00772     o<<"Had. Prod par "<<i<<" "<<hp_pars[i]<<endl;
00773   }
00774   for(unsigned int i=0;i<det_pars.size();i++){
00775     o<<"Det par "<<i<<" "<<det_pars[i]<<endl;
00776   }
00777 }

RunPeriod_t SKZPWeightCalculator::RunPeriodFromInt int  rpit  )  [inline]
 

Definition at line 56 of file SKZPWeightCalculator.h.

References RunPeriod_t.

Referenced by NueFluxWeightsAna::Analyze(), GetBeamWeight(), GetRunPeriodWeight(), and GetWeight().

00056                                         {
00057     switch (rpit){
00058     case 1:
00059       return kRunI;
00060     case 2:
00061       return kRunII;
00062     case 3:
00063       return kRunIII;
00064     case 4:
00065       return kRunIV;
00066     default:
00067       return kNone;
00068     }
00069   }

int SKZPWeightCalculator::RunPeriodIntFromValidity VldContext  vc  ) 
 

Definition at line 909 of file SKZPWeightCalculator.cxx.

References VldTimeStamp::GetDate(), and VldContext::GetTimeStamp().

Referenced by GetBeamWeight(), GetRunPeriodWeight(), and GetWeight().

00910 {
00911   int rp = 1; // default Run I
00912   VldTimeStamp ts = vc.GetTimeStamp();
00913   if(ts.GetDate()<(*vtsRunIEnd).GetDate()) rp = 1;
00914   else if(ts.GetDate()<(*vtsRunIIEnd).GetDate()) rp = 2;
00915   else if(ts.GetDate()<(*vtsRunIIIEnd).GetDate()) rp = 3;
00916   else rp = 4;
00917   return rp;
00918 }

void SKZPWeightCalculator::SetConfigNum std::string  c  )  [private]
 

Definition at line 836 of file SKZPWeightCalculator.cxx.

References cfgnum.

Referenced by Config(), and SetReweightConfigName().

00837 {
00838   if(c=="PRL") cfgnum = kPRL;
00839   else if(c.find("PRL_Syst")!=string::npos) cfgnum = kPRL;
00840   else if(c=="Boston") cfgnum = kBoston;
00841   else if(c=="PiMinus") cfgnum = kPiMinus;
00842   else if(c=="PiMinus_CedarDaikon") cfgnum = kPiMinus;
00843   else if(c=="DetXs") cfgnum = kDetXs;
00844   else if(c=="Dogwood1_Daikon07") cfgnum = kDogwood1_Daikon07;
00845   else if(c=="Dogwood1_Daikon07_v2") cfgnum = kDogwood1_Daikon07_v2;
00846   else cfgnum = kUnknown;
00847 
00848 }

void SKZPWeightCalculator::SetReweightConfigName std::string  cn  )  [inline]
 

Definition at line 79 of file SKZPWeightCalculator.h.

References cfgname, and SetConfigNum().

00079 {cfgname=cn; SetConfigNum(cn);}

void SKZPWeightCalculator::SetRunFrac int  Ibeam,
RunPeriod_t  rp,
double  pot
 

Definition at line 1202 of file SKZPWeightCalculator.cxx.

References BeamType::AsString(), MSG, and runfrac.

Referenced by NuZBeamReweight::GetSKZPWeightCalculator(), and NuZBeamReweight::GetSKZPWeightCalculatorCustom().

01203 {
01204 
01205   map<int, map<RunPeriod_t,double> >::iterator it(runfrac.find(Ibeam));
01206   if(it!=runfrac.end()){
01207     //already have an entry for this beam type, just insert (runnum,pot)
01208     if((it->second).find(rp)==it->second.end()){
01209       (it->second)[rp]=pot;
01210     }
01211     else{
01212       MSG("SKZPWeightCalculator",Msg::kError)<<"You already specified pot for "
01213                                              <<BeamType::AsString(BeamType::FromZarko(Ibeam))
01214                                              <<" beam, with run period "<<rp<<endl
01215                                              <<"I will not overwrite!!!"<<endl;
01216     } 
01217   }
01218   else{
01219     //don't have this Ibeam yet, make a new map
01220     map<RunPeriod_t, double> m;
01221     m[rp]=pot;
01222     runfrac[Ibeam]=m;
01223   }
01224 
01225 
01226 }

void SKZPWeightCalculator::SetSampleSelection std::string  ss  ) 
 

Definition at line 211 of file SKZPWeightCalculator.cxx.

References sampsel.

Referenced by NuZBeamReweight::GetRFWeights(), and NuZBeamReweight::GetWeights().

00212 {
00213   if(ss=="numu"||ss=="NuMu"||ss=="CC"){
00214     sampsel=kNuMuCC;
00215   }
00216   else if(ss=="anumu"||ss=="antinumu"||ss=="numubar"||ss=="AntiNuMu"||ss=="NuMuBar"){
00217     sampsel=kAntiNuMu;
00218   }
00219   else if(ss=="nue"||ss=="Nue"){
00220     sampsel=kNue;
00221   }
00222 
00223 }


Member Data Documentation

std::vector<double> SKZPWeightCalculator::bs_pars [private]
 

Definition at line 270 of file SKZPWeightCalculator.h.

Referenced by ChangeParameters(), Config(), GetBeamWeight(), GetFluxError(), GetParameters(), GetRunPeriodWeight(), and PrintReweightConfig().

std::string SKZPWeightCalculator::cfgname [private]
 

Definition at line 258 of file SKZPWeightCalculator.h.

Referenced by Config(), GetFluxError(), GetWeight(), PrintReweightConfig(), and SetReweightConfigName().

SKZPConfig_t SKZPWeightCalculator::cfgnum [private]
 

Definition at line 259 of file SKZPWeightCalculator.h.

Referenced by ChangeParameters(), Config(), GetBeamWeight(), GetDetWeight(), GetRunPeriodWeight(), and SetConfigNum().

std::vector<double> SKZPWeightCalculator::det_pars [private]
 

Definition at line 272 of file SKZPWeightCalculator.h.

Referenced by ChangeParameters(), Config(), GetDetWeight(), GetParameters(), and PrintReweightConfig().

bool SKZPWeightCalculator::fBeamOnly [private]
 

Definition at line 297 of file SKZPWeightCalculator.h.

Referenced by GetDetWeight(), and SKZPWeightCalculator().

std::vector<double> SKZPWeightCalculator::hp_pars [private]
 

Definition at line 271 of file SKZPWeightCalculator.h.

Referenced by ChangeParameters(), Config(), GetBeamWeight(), GetParameters(), and PrintReweightConfig().

int SKZPWeightCalculator::MAXBSPARS [private]
 

Definition at line 248 of file SKZPWeightCalculator.h.

int SKZPWeightCalculator::MAXDETPARS [private]
 

Definition at line 250 of file SKZPWeightCalculator.h.

int SKZPWeightCalculator::MAXHPPARS [private]
 

Definition at line 249 of file SKZPWeightCalculator.h.

MCReweight* SKZPWeightCalculator::mcr [private]
 

Definition at line 267 of file SKZPWeightCalculator.h.

Referenced by Config(), GetDetWeight(), and SKZPWeightCalculator().

NeugenWeightCalculator* SKZPWeightCalculator::nwc [private]
 

Definition at line 268 of file SKZPWeightCalculator.h.

Referenced by Config(), SKZPWeightCalculator(), and ~SKZPWeightCalculator().

bool SKZPWeightCalculator::read_pars_from_db [private]
 

Definition at line 252 of file SKZPWeightCalculator.h.

std::map<int, std::map<RunPeriod_t,double> > SKZPWeightCalculator::runfrac [private]
 

Definition at line 278 of file SKZPWeightCalculator.h.

Referenced by GetRFWWeight(), and SetRunFrac().

SampleSelection_t SKZPWeightCalculator::sampsel [private]
 

Definition at line 260 of file SKZPWeightCalculator.h.

Referenced by GetDetWeight(), and SetSampleSelection().

VldTimeStamp* SKZPWeightCalculator::vtsRunIEnd
 

Definition at line 71 of file SKZPWeightCalculator.h.

Referenced by SKZPWeightCalculator(), and ~SKZPWeightCalculator().

VldTimeStamp* SKZPWeightCalculator::vtsRunIIEnd
 

Definition at line 72 of file SKZPWeightCalculator.h.

Referenced by SKZPWeightCalculator(), and ~SKZPWeightCalculator().

VldTimeStamp* SKZPWeightCalculator::vtsRunIIIEnd
 

Definition at line 73 of file SKZPWeightCalculator.h.

Referenced by SKZPWeightCalculator(), and ~SKZPWeightCalculator().

const double SKZPWeightCalculator::XP = 25. [static, private]
 

Definition at line 20 of file SKZPWeightCalculator.cxx.

Referenced by GetDetWeight().

Zbeam* SKZPWeightCalculator::zbeam [private]
 

Definition at line 263 of file SKZPWeightCalculator.h.

Referenced by Config(), GetBeamWeight(), GetFluxError(), GetRunPeriodWeight(), SKZPWeightCalculator(), and ~SKZPWeightCalculator().

Zfluk* SKZPWeightCalculator::zfluk [private]
 

Definition at line 264 of file SKZPWeightCalculator.h.

Referenced by ChangeParameters(), Config(), GetBeamWeight(), SKZPWeightCalculator(), and ~SKZPWeightCalculator().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:19 2010 for loon by  doxygen 1.3.9.1