NuSystematic Class Reference

#include <NuSystematic.h>

List of all members.

Public Member Functions

 NuSystematic ()
 NuSystematic (const NuXMLConfig &xmlConfig)
virtual ~NuSystematic ()
virtual void ConfigureDefaultSystematics ()
virtual void InitializeSystematics ()
virtual void EverythingOff ()
virtual void ConfigureNeugenDefaults ()
virtual void ReadXML (const NuXMLConfig &xmlConfig)
virtual void SetShiftsAsValues (map< NuSyst::NuSystematic_t, double > input)
virtual void SetShiftsAsValues (map< TString, double > input)
virtual void SetShiftsAsSigmas (map< NuSyst::NuSystematic_t, double > input)
virtual void SetShiftsAsSigmas (map< TString, double > input)
virtual void SetSigmas (map< NuSyst::NuSystematic_t, double > input)
virtual void SetSigmas (map< TString, double > input)
virtual void PrintState (bool verbose=false) const
virtual TString NameFromSyst (const NuSyst::NuSystematic_t syst) const
virtual NuSyst::NuSystematic_t SystFromName (TString systName) const
virtual double OneSigma (NuSyst::NuSystematic_t syst) const
virtual double CurrentSigma (NuSyst::NuSystematic_t syst) const
virtual Int_t SystMode (NuSyst::NuSystematic_t syst) const
virtual const TString SystNames (NuSyst::NuSystematic_t syst) const
virtual void SetCCSelector (NuCut *input)
virtual void SetNCSelector (NuCut *input)
virtual void SetNuBarSelector (NuCut *input)
virtual void SetRockSelector (NuCut *input)
virtual void Shift (NuEvent &event) const
virtual Float_t ConvertSigmaToValue (const Float_t sigma, NuSyst::NuSystematic_t fSys) const
 !Changes contents of event!!
virtual Float_t ConvertValueToSigma (const Float_t shift, NuSyst::NuSystematic_t fSys) const
virtual Float_t ShiftAsValue (NuSyst::NuSystematic_t fSys) const
virtual Float_t ShiftAsSigma (NuSyst::NuSystematic_t fSys) const
virtual void Randomize ()
virtual double CalculateAbsoluteHadronicShiftScale (double trueShowerEnergy, double sigma) const
TH1D * accepthisto (void) const
TH1D * horncurrenthisto (int i, int j) const
virtual void AllBackgroundsScaleBothShift (NuEvent &event) const
virtual void BeamShift (NuEvent &event) const
virtual void BFieldShift (NuEvent &event) const
virtual void JitterVDPIDShift (NuEvent &event) const
virtual void NCBackgroundShift (NuEvent &event) const
virtual void NCNuBarBackgroundShift (NuEvent &event) const
virtual void WSNuBarBackgroundShift (NuEvent &event) const
virtual void CCBackgroundShift (NuEvent &event) const
virtual void NDCleaningShift (NuEvent &event) const
virtual void FDCleaningShift (NuEvent &event) const
virtual void FDCleaningCosmicsShift (NuEvent &event) const
virtual void NeugenXSecShift (NuEvent &event) const
virtual void NormalisationShift (NuEvent &event) const
virtual void AcceptanceShift (NuEvent &event) const
virtual void HornCurrentShift (NuEvent &event) const
virtual void NuMuBarSumXSecShift (NuEvent &event) const
virtual void OverallXSecShift (NuEvent &event) const
virtual void NuMuBarQELXSecShift (NuEvent &event) const
virtual void NuMuBarResXSecShift (NuEvent &event) const
virtual void RockXSecShift (NuEvent &event) const
virtual void RockZAShift (NuEvent &event) const
virtual void RockSelectionShift (NuEvent &event) const
virtual void ScrapingShift (NuEvent &event) const
virtual void ShowerEnergyOffset (NuEvent &event) const
virtual void ShowerEnergyScale (NuEvent &event) const
virtual void ShowerEnergyFunction (NuEvent &event) const
virtual void TauQELResShift (NuEvent &event) const
virtual void TargetHoleShift (NuEvent &event) const
virtual void TFProbShift (NuEvent &event) const
virtual void TrackEnergyScale (NuEvent &event) const
virtual void TrackEnergyOffset (NuEvent &event) const
virtual void TrackEnergyOverall (NuEvent &event) const
virtual void TrackEnergyNeutrinoQE (NuEvent &event) const
virtual void NDCoilHole (NuEvent &event) const
virtual void EnergyResolutionEvent (NuEvent &event) const
virtual void EnergyResolutionShower (NuEvent &event) const
virtual void EnergyResolutionTrackRange (NuEvent &event) const
virtual void EnergyResolutionTrackCurve (NuEvent &event) const
virtual void CCWSBackground (NuEvent &event) const
virtual void NormalisationShiftSterile (NuEvent &event) const
virtual void CCBackgroundShiftSterile (NuEvent &event) const
virtual void NDCleaningShiftSterile (NuEvent &event) const
virtual void FDCleaningShiftSterile (NuEvent &event) const
virtual void FDCleaningCosmicsShiftSterile (NuEvent &event) const
virtual void RelativeHadronicCalibrationSterile (NuEvent &event) const
virtual void AbsoluteHadronicCalibrationSterile (NuEvent &event) const
virtual Double_t XSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const

Static Public Member Functions

static bool FluxSyst (const NuXMLConfig &xmlConfig)

Static Public Attributes

static Int_t kMinusPlus = 1
static Int_t kAsIs = 2
static Int_t kSigma = 3

Private Member Functions

virtual const MCEventInfo CreateMCEventInfo (const NuEvent &nuEvent) const
virtual void SetNeugenDefaults (Registry &registry) const
virtual void SetShiftedNeugenParameters (Registry &registry, const NuEvent event) const
virtual void SetShiftedNeugenParameters (neugen_config &config, const NuEvent event) const
virtual Float_t MA_QEDefault () const
virtual Float_t MA_ResDefault () const
virtual Float_t KNO112Default () const
virtual Float_t KNO122Default () const
virtual Float_t KNO132Default () const
virtual Float_t KNO142Default () const
virtual Float_t KNO113Default () const
virtual Float_t KNO123Default () const
virtual Float_t KNO133Default () const
virtual Float_t KNO143Default () const
virtual Float_t KNO212Default () const
virtual Float_t KNO222Default () const
virtual Float_t KNO232Default () const
virtual Float_t KNO242Default () const
virtual Float_t KNO213Default () const
virtual Float_t KNO223Default () const
virtual Float_t KNO233Default () const
virtual Float_t KNO243Default () const
virtual Double_t NeugenXSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const
virtual Double_t QELXSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const
virtual Double_t ResXSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const
 ClassDef (NuSystematic, 8)

Private Attributes

map< NuSyst::NuSystematic_t,
double > 
oneSigma
map< NuSyst::NuSystematic_t,
double > 
currentSigma
map< NuSyst::NuSystematic_t,
Int_t > 
systMode
map< NuSyst::NuSystematic_t,
TString > 
systNames
NuCutfCCSelector
NuCutfNCSelector
NuCutfNuBarSelector
NuCutfRockSelector
TRandom3 * fRandom
Float_t fkno_r112Default
Float_t fkno_r122Default
Float_t fkno_r132Default
Float_t fkno_r142Default
Float_t fkno_r113Default
Float_t fkno_r123Default
Float_t fkno_r133Default
Float_t fkno_r143Default
Float_t fkno_r212Default
Float_t fkno_r222Default
Float_t fkno_r232Default
Float_t fkno_r242Default
Float_t fkno_r213Default
Float_t fkno_r223Default
Float_t fkno_r233Default
Float_t fkno_r243Default
Float_t fma_qeDefault
Float_t fma_resDefault

Static Private Attributes

static Bool_t firstMCReweight = true

Detailed Description

Definition at line 192 of file NuSystematic.h.


Constructor & Destructor Documentation

NuSystematic::NuSystematic (  )  [explicit]

Definition at line 81 of file NuSystematic.cxx.

References Msg::kInfo, and MSG.

00082 {
00083   MSG("NuSystematic",Msg::kInfo)
00084     << "Constructing default NuSystematic object" << endl;
00085 
00086   this->ConfigureDefaultSystematics();
00087   this->ConfigureNeugenDefaults();
00088   this->InitializeSystematics();
00089   this->EverythingOff();
00090 
00091   fCCSelector = 0;
00092   fNCSelector = 0;
00093   fNuBarSelector = 0;
00094   fRockSelector = 0;
00095 
00096   fRandom = new TRandom3(0);
00097   //fFluctuator = new NuFluctuator();
00098 }

NuSystematic::NuSystematic ( const NuXMLConfig xmlConfig  )  [explicit]

Definition at line 101 of file NuSystematic.cxx.

References ConfigureDefaultSystematics(), ConfigureNeugenDefaults(), EverythingOff(), fCCSelector, fNCSelector, fNuBarSelector, fRandom, fRockSelector, InitializeSystematics(), and ReadXML().

00102 {
00103   this->ConfigureDefaultSystematics();
00104   this->ConfigureNeugenDefaults();
00105   this->InitializeSystematics();
00106   this->EverythingOff();
00107 
00108   fCCSelector = 0;
00109   fNCSelector = 0;
00110   fNuBarSelector = 0;
00111   fRockSelector = 0;
00112 
00113   fRandom = new TRandom3(0);
00114   //fFluctuator = new NuFluctuator();
00115 
00116   this->ReadXML(xmlConfig);
00117 }

NuSystematic::~NuSystematic (  )  [virtual]

Definition at line 120 of file NuSystematic.cxx.

References fRandom.

00121 {
00122   //if (fFluctuator)    {delete fFluctuator;    fFluctuator = 0;}
00123   if (fRandom)        {delete fRandom;        fRandom = 0;}
00124 }


Member Function Documentation

void NuSystematic::AbsoluteHadronicCalibrationSterile ( NuEvent event  )  const [virtual]

Definition at line 1754 of file NuSystematic.cxx.

References CalculateAbsoluteHadronicShiftScale(), fNCSelector, NuSyst::kAbsoluteHadronicCalibrationSterile, SimFlag::kMC, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), and NuEvent::simFlag.

Referenced by FitTree::FillNCVector(), and Shift().

01755 {       
01756         fNCSelector->MakeCuts(event);
01757         if(SimFlag::kMC == event.simFlag && fNCSelector->Passed())
01758         {
01759                 const double trueShowerEnergy = event.shwEnMC;
01760                 const double sigma            = ShiftAsValue(NuSyst::kAbsoluteHadronicCalibrationSterile);
01761                 const double scale            = CalculateAbsoluteHadronicShiftScale(trueShowerEnergy, sigma);
01762 
01763                 event.shwEnLinNCCor *= scale;
01764                 event.shwEnCC *= scale;
01765         }
01766 }

void NuSystematic::AcceptanceShift ( NuEvent event  )  const [virtual]

Definition at line 963 of file NuSystematic.cxx.

References accepthisto(), NuEvent::detector, NuEvent::energy, NuSyst::kAcceptance, Detector::kFar, Msg::kInfo, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

00964 {
00965 
00966   double accwt = 0.0; // default value means no shift
00967   double reweight = 1;
00968   
00969   if(event.detector ==Detector::kFar){
00970     TH1D *result=accepthisto();
00971     result->GetXaxis()->SetRangeUser(0, 200);
00972     accwt=result->GetBinContent(result->GetXaxis()->FindFixBin(event.energy));
00973     reweight = 1 + (ShiftAsValue(NuSyst::kAcceptance) * (1-accwt));
00974   }
00975   
00976   event.rw *= reweight;
00977 
00978   MAXMSG("NuSystematic",Msg::kInfo,500)
00979    << "Performing acceptance shift = " << ShiftAsSigma(NuSyst::kAcceptance) << "s = " << reweight<< endl;
00980 
00981   return;
00982 }

TH1D* NuSystematic::accepthisto ( void   )  const [inline]

Definition at line 254 of file NuSystematic.h.

Referenced by AcceptanceShift().

00254                                {
00255       // Get a pointer to the current directory so we can put it back later: 
00256       TDirectory* restore = gDirectory;
00257       //Open your new file                 
00258       TFile myFile("/minos/data/users/radovic/CC2012/systematic_ref/Final_RHC_plus_minus_ratio.root", "READ");
00259       TH1D *accref=(TH1D*)myFile.Get("fdPred");
00260       accref->SetDirectory(0);
00261       //Now put the directory back where you found it:                                                                                   
00262       restore->cd();
00263       return accref;
00264     }

void NuSystematic::AllBackgroundsScaleBothShift ( NuEvent event  )  const [virtual]

Definition at line 1396 of file NuSystematic.cxx.

References NuEvent::charge, fNuBarSelector, NuSyst::kAllBackgroundsScaleBoth, Msg::kError, Msg::kInfo, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01397 {
01398   if (!fNuBarSelector) {
01399     MSG("NuSystematic",Msg::kError) << "Cannot apply AllBackgroundsScaleBoth without doing SetNuBarSelector()" << endl;
01400     assert(false);
01401   }
01402 
01403   fNuBarSelector->MakeCuts(event);
01404   if (1==event.charge && fNuBarSelector->Passed()
01405       && (14 == event.inu || 0 == event.iaction)) {
01406 
01407     MAXMSG("NuSystematic",Msg::kInfo,1)
01408     << "Performing AllBackgroundsScaleBoth shift ="
01409     << ShiftAsSigma(NuSyst::kAllBackgroundsScaleBoth) << "s" << endl;
01410 
01411     event.rw *= ShiftAsValue(NuSyst::kAllBackgroundsScaleBoth);
01412   }
01413   return;
01414 }

void NuSystematic::BeamShift ( NuEvent event  )  const [virtual]

Definition at line 953 of file NuSystematic.cxx.

References NuSyst::kBeam, Msg::kInfo, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

00954 {
00955   double weight = 1.0 + ShiftAsValue(NuSyst::kBeam) * (event.fluxErr-1.0);
00956   MAXMSG("NuSystematic",Msg::kInfo,500)
00957     << "Performing beam shift = " << ShiftAsSigma(NuSyst::kBeam) << "s = " << weight << endl;
00958   event.rw *= weight;
00959   return;
00960 }

void NuSystematic::BFieldShift ( NuEvent event  )  const [virtual]

Definition at line 1417 of file NuSystematic.cxx.

References NuEvent::charge, NuEvent::detector, NuEvent::iaction, NuEvent::inu, NuSyst::kBFieldBoth, NuSyst::kBFieldFar, NuSyst::kBFieldNear, Detector::kFar, Msg::kInfo, Detector::kNear, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01418 {
01419   MAXMSG("NuSystematic",Msg::kInfo,1)
01420     << "Performing BField shift both = " << ShiftAsSigma(NuSyst::kBFieldBoth)
01421     << "s, near = " << ShiftAsSigma(NuSyst::kBFieldNear)
01422     << "s, far = " << ShiftAsSigma(NuSyst::kBFieldFar) << endl;
01423   if (1==event.charge && 14 == event.inu && 1 == event.iaction){
01424     event.rw *= ShiftAsValue(NuSyst::kBFieldBoth);
01425     if (Detector::kNear==event.detector)
01426       event.rw *= ShiftAsValue(NuSyst::kBFieldNear);
01427     if (Detector::kFar==event.detector)
01428       event.rw *= ShiftAsValue(NuSyst::kBFieldFar);
01429   }
01430   return;
01431 }

double NuSystematic::CalculateAbsoluteHadronicShiftScale ( double  trueShowerEnergy,
double  sigma 
) const [virtual]

Definition at line 1770 of file NuSystematic.cxx.

Referenced by AbsoluteHadronicCalibrationSterile().

01771 {
01772         const double calibrationError = 5.7;
01773 //      assert(trueShowerEnergy >= 0);
01774 
01775         double modellingError = -1.0;
01776         if(trueShowerEnergy < 0.5) modellingError = 8.2;
01777         else if(trueShowerEnergy < 10)  modellingError = 2.7+3.7*TMath::Exp(-0.25*trueShowerEnergy);
01778         else modellingError = 3;
01779         
01780         assert(modellingError > 0);
01781 
01782         const double totalError = TMath::Sqrt(calibrationError*calibrationError + modellingError*modellingError);
01783 
01784         return 1.0+0.01*totalError*sigma;
01785 }

void NuSystematic::CCBackgroundShift ( NuEvent event  )  const [virtual]

Definition at line 1484 of file NuSystematic.cxx.

References fNCSelector, NuEvent::iaction, NuSyst::kCCBackground, Msg::kError, Msg::kInfo, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01485 {
01486   if (!fNCSelector) {
01487     MSG("NuSystematic",Msg::kError) << "Cannot apply CCBackground without doing SetNCSelector()" << endl;
01488     assert(false);
01489   }
01490 
01491   MAXMSG("NuSystematic",Msg::kInfo,1)
01492   << "Performing CC background shift " << ShiftAsSigma(NuSyst::kCCBackground) << "s" << endl;
01493 
01494   fNCSelector->MakeCuts(event);
01495   if (1 == event.iaction && fNCSelector->Passed())
01496     event.rw *= ShiftAsValue(NuSyst::kCCBackground);
01497 }

void NuSystematic::CCBackgroundShiftSterile ( NuEvent event  )  const [virtual]

Definition at line 1646 of file NuSystematic.cxx.

References fNCSelector, NuEvent::iaction, NuEvent::inu, NuSyst::kCCBackgroundSterile, SimFlag::kMC, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), and NuEvent::simFlag.

Referenced by Shift().

01647 {
01648         fNCSelector->MakeCuts(event);
01649         if(SimFlag::kMC == event.simFlag && 1 == event.iaction && fNCSelector->Passed() && TMath::Abs(event.inu) == 14)
01650         {
01651                 event.rw *= ShiftAsValue(NuSyst::kCCBackgroundSterile);
01652         }
01653 }

void NuSystematic::CCWSBackground ( NuEvent event  )  const [virtual]

Definition at line 2114 of file NuSystematic.cxx.

References fCCSelector, NuEvent::inu, NuSyst::kCCWSBackground, Msg::kError, Msg::kInfo, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::qp, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

02115 {
02116   if (!fCCSelector) {
02117     MSG("NuSystematic",Msg::kError) << "Cannot apply WSBackground without doing SetCCSelector()" << endl;
02118     assert(false);
02119   }
02120 
02121   MAXMSG("NuSystematic",Msg::kInfo,1)
02122     << "Performing WS background (NQ bknd in PQ) shift " << ShiftAsSigma(NuSyst::kCCWSBackground) << "s" << endl;
02123   //We're scaling up events that could be numu's ID'd as numubars by charge sign
02124   //since their charge sign disagrees with relative angle (See docDB-6203)
02125   fCCSelector->MakeCuts(event);
02126   if (event.qp>0 && event.inu==14 && fCCSelector->Passed())
02127     event.rw *= ShiftAsValue(NuSyst::kCCWSBackground);
02128   return;
02129 }

NuSystematic::ClassDef ( NuSystematic  ,
 
) [private]
void NuSystematic::ConfigureDefaultSystematics (  )  [virtual]

Definition at line 133 of file NuSystematic.cxx.

References NuSyst::kAbsoluteHadronicCalibrationSterile, NuSyst::kAcceptance, NuSyst::kAlignment, NuSyst::kAllBackgroundsScaleBoth, NuSyst::kBeam, NuSyst::kBFieldBoth, NuSyst::kBFieldFar, NuSyst::kBFieldNear, NuSyst::kCCBackground, NuSyst::kCCBackgroundSterile, NuSyst::kCCWSBackground, NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecMaQE, NuSyst::kCombinedXSecMaRes, NuSyst::kCombinedXSecOverall, NuSyst::kDPID, NuSyst::kEnergyResolutionEventBoth, NuSyst::kEnergyResolutionEventNear, NuSyst::kEnergyResolutionShowerBoth, NuSyst::kEnergyResolutionShowerNear, NuSyst::kEnergyResolutionTrackCurveBoth, NuSyst::kEnergyResolutionTrackCurveNear, NuSyst::kEnergyResolutionTrackRangeBoth, NuSyst::kEnergyResolutionTrackRangeNear, NuSyst::kFDCleaning, NuSyst::kFDCleaningCosmics, NuSyst::kFDCleaningCosmicsSterile, NuSyst::kFDCleaningSterile, NuSyst::kHornCurrent, NuSyst::kJitter, NuSyst::kJitterVDPID, NuSyst::kNCBackground, NuSyst::kNCNuBarBackground, NuSyst::kNDCleaning, NuSyst::kNDCleaningSterile, NuSyst::kNDCoilHole, NuSyst::kNormalisationBoth, NuSyst::kNormalisationFar, NuSyst::kNormalisationNC, NuSyst::kNormalisationNear, NuSyst::kNormalisationSterile, NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, NuSyst::kNuMuBarXSecOverall, NuSyst::kNuMuBarXSecQEL, NuSyst::kNuMuBarXSecRes, NuSyst::kNuMuBarXSecSum, NuSyst::kRelativeHadronicCalibrationSterile, NuSyst::kRockSelection, NuSyst::kRockXSec, NuSyst::kRockZA, NuSyst::kScraping, NuSyst::kShowerEnergyFunction, NuSyst::kShowerEnergyOffset, NuSyst::kShowerEnergyScale, NuSyst::kShowerEnergyScaleFar, NuSyst::kShowerEnergyScaleNear, NuSyst::kShowerEnergyScaleRelative, NuSyst::kTargetHole, NuSyst::kTauQELRes, NuSyst::kTFProb, NuSyst::kTrackEnergyCurvatureBoth, NuSyst::kTrackEnergyCurvatureFar, NuSyst::kTrackEnergyCurvatureNear, NuSyst::kTrackEnergyNeutrinoQE, NuSyst::kTrackEnergyOffset, NuSyst::kTrackEnergyOverall, NuSyst::kTrackEnergyRange, NuSyst::kTrackEnergyScale, NuSyst::kWSNuBarBackground, Munits::MeV, and oneSigma.

Referenced by NuSystematic().

00134 {
00135   oneSigma[NuSyst::kShowerEnergyOffset] = 100*Munits::MeV;
00136   oneSigma[NuSyst::kShowerEnergyScale] = 1.10;
00137   oneSigma[NuSyst::kShowerEnergyFunction] = 1.0;
00138   oneSigma[NuSyst::kShowerEnergyScaleFar] = 1.023;
00139   oneSigma[NuSyst::kShowerEnergyScaleNear] = 1.031;
00140   oneSigma[NuSyst::kShowerEnergyScaleRelative] = 1.039;
00141 
00142   oneSigma[NuSyst::kTrackEnergyCurvatureBoth] = 1.03;
00143   oneSigma[NuSyst::kTrackEnergyCurvatureFar] = 1.03;
00144   oneSigma[NuSyst::kTrackEnergyCurvatureNear] = 1.03;
00145   oneSigma[NuSyst::kTrackEnergyRange] = 1.02;
00146   oneSigma[NuSyst::kTrackEnergyScale] = 1.02;
00147   oneSigma[NuSyst::kTrackEnergyOffset] = 100 * Munits::MeV;
00148   oneSigma[NuSyst::kTrackEnergyOverall] = -999;
00149   oneSigma[NuSyst::kTrackEnergyNeutrinoQE] = 100 * Munits::MeV;
00150   oneSigma[NuSyst::kNDCoilHole] = 1.015;
00151 
00152   oneSigma[NuSyst::kBFieldBoth] = 2.0;
00153   oneSigma[NuSyst::kBFieldNear] = 2.0;
00154   oneSigma[NuSyst::kBFieldFar] = 2.0;
00155   oneSigma[NuSyst::kAlignment] = -999;
00156   oneSigma[NuSyst::kBeam] = 1.0;
00157   oneSigma[NuSyst::kAcceptance] = 1.0;
00158   oneSigma[NuSyst::kHornCurrent] = 1.0;
00159 
00160   oneSigma[NuSyst::kCombinedXSecOverall] = 1.035;
00161   oneSigma[NuSyst::kCombinedXSecCCMA] = 1.15;
00162   oneSigma[NuSyst::kCombinedXSecMaRes] = 1.15;
00163   oneSigma[NuSyst::kCombinedXSecMaQE] = 1.15;
00164   oneSigma[NuSyst::kCombinedXSecDISMultip2] = 0.1;
00165   oneSigma[NuSyst::kCombinedXSecDISMultip3] = 0.2;
00166 
00167   oneSigma[NuSyst::kNuMuBarXSecSum] = 1.0;
00168   oneSigma[NuSyst::kNuMuBarXSecOverall] = 1.04;
00169   oneSigma[NuSyst::kNuMuBarXSecCCMA] = 1.08;
00170   oneSigma[NuSyst::kNuMuBarXSecDISMultip2] = 0.2;
00171   oneSigma[NuSyst::kNuMuBarXSecQEL] = 1.08;
00172   oneSigma[NuSyst::kNuMuBarXSecRes] = 1.08;
00173 
00174   oneSigma[NuSyst::kRockXSec] = 1.0;
00175   oneSigma[NuSyst::kRockZA] = 1.0;
00176   oneSigma[NuSyst::kRockSelection] = 1.0;
00177 
00178   oneSigma[NuSyst::kNormalisationBoth] = 1.0154;
00179   oneSigma[NuSyst::kNormalisationNear] = 1.0154;
00180   oneSigma[NuSyst::kNormalisationFar] = 1.0154;
00181 
00182   oneSigma[NuSyst::kNormalisationNC] = 1.022;
00183   oneSigma[NuSyst::kNCBackground] = 1.20;
00184   oneSigma[NuSyst::kNCNuBarBackground] = 1.20;
00185   oneSigma[NuSyst::kWSNuBarBackground] = 1.30;
00186   oneSigma[NuSyst::kCCBackground] = 1.15;  // Value used in the NC analysis
00187   oneSigma[NuSyst::kNDCleaning] = 1.0;
00188   oneSigma[NuSyst::kFDCleaning] = 1.0;
00189   oneSigma[NuSyst::kFDCleaningCosmics] = 1.0;
00190   oneSigma[NuSyst::kAllBackgroundsScaleBoth] = 1.5;//50% scale
00191   oneSigma[NuSyst::kScraping] = 1.37;
00192 
00193   oneSigma[NuSyst::kJitterVDPID] = -999;
00194   oneSigma[NuSyst::kJitter]= 0.01;
00195   oneSigma[NuSyst::kDPID] = 0.03;
00196   oneSigma[NuSyst::kTFProb] = 0.005;//Complete guess.
00197   oneSigma[NuSyst::kTargetHole] = 4.0;//cm: length of the hole
00198   oneSigma[NuSyst::kTauQELRes] = 1.15;//15% scale
00199 
00200   oneSigma[NuSyst::kEnergyResolutionEventBoth] = 1.1;
00201   oneSigma[NuSyst::kEnergyResolutionEventNear] = 1.1;
00202   oneSigma[NuSyst::kEnergyResolutionShowerBoth] = 1.1;
00203   oneSigma[NuSyst::kEnergyResolutionShowerNear] = 1.1;
00204   oneSigma[NuSyst::kEnergyResolutionTrackRangeBoth] = 1.1;
00205   oneSigma[NuSyst::kEnergyResolutionTrackRangeNear] = 1.1;
00206   oneSigma[NuSyst::kEnergyResolutionTrackCurveBoth] = 1.1;
00207   oneSigma[NuSyst::kEnergyResolutionTrackCurveNear] = 1.1;
00208   oneSigma[NuSyst::kCCWSBackground] = 1.40;
00209 
00210   //systematic shifts needed for NC analysis; values from NCUtils/NCType.h --> A.Gavrilenko 4/13/2012
00211   oneSigma[NuSyst::kAbsoluteHadronicCalibrationSterile] = 1.0;
00212   oneSigma[NuSyst::kRelativeHadronicCalibrationSterile] = 0.021; 
00213   oneSigma[NuSyst::kFDCleaningCosmicsSterile]           = 1.0;
00214   oneSigma[NuSyst::kFDCleaningSterile]                  = 1.0;
00215   oneSigma[NuSyst::kNDCleaningSterile]                  = 1.0;
00216   oneSigma[NuSyst::kCCBackgroundSterile]                = 1.15;
00217   oneSigma[NuSyst::kNormalisationSterile]               = 1.022;
00218 }

void NuSystematic::ConfigureNeugenDefaults (  )  [virtual]
Float_t NuSystematic::ConvertSigmaToValue ( const Float_t  sigma,
NuSyst::NuSystematic_t  fSys 
) const [virtual]

!Changes contents of event!!

Definition at line 889 of file NuSystematic.cxx.

References CurrentSigma(), kAsIs, Msg::kError, kMinusPlus, kSigma, MSG, NameFromSyst(), OneSigma(), and SystMode().

Referenced by JitterVDPIDShift(), NormalisationShift(), and ShiftAsValue().

00890 {
00891   if (sigma == -999) sigma = CurrentSigma(fSys);
00892 
00893   if (SystMode(fSys) == kMinusPlus) {
00894     return sigma*(OneSigma(fSys) - 1.0) + 1.0;
00895   }
00896   else if (SystMode(fSys) == kAsIs) {
00897     return sigma*OneSigma(fSys);
00898   }
00899   else if (SystMode(fSys) == kSigma) {
00900     return sigma;
00901   }
00902   else {
00903     MSG("NuSystematic",Msg::kError) << "Didn't recognize syst mode " << SystMode(fSys) << " for systematic "
00904     << NameFromSyst(fSys) << "(" << fSys << ")" << endl;
00905     return 0;
00906   }
00907 }

Float_t NuSystematic::ConvertValueToSigma ( const Float_t  shift,
NuSyst::NuSystematic_t  fSys 
) const [virtual]

Definition at line 910 of file NuSystematic.cxx.

References kAsIs, Msg::kError, kMinusPlus, kSigma, MSG, NameFromSyst(), OneSigma(), and SystMode().

Referenced by ReadXML(), and SetShiftsAsValues().

00911 {
00912   if (SystMode(fSys) == kMinusPlus) {
00913     return (shift-1.0)/(OneSigma(fSys)-1.0);
00914   }
00915   else if (SystMode(fSys) == kAsIs) {
00916     return shift/OneSigma(fSys);
00917   }
00918   else if (SystMode(fSys) == kSigma) {
00919     return shift;
00920   }
00921   else {
00922     MSG("NuSystematic",Msg::kError) << "Didn't recognize syst mode " << SystMode(fSys) << " for systematic "
00923     << NameFromSyst(fSys) << "(" << fSys << ")" << endl;
00924     return 0;
00925   }
00926 }

const MCEventInfo NuSystematic::CreateMCEventInfo ( const NuEvent nuEvent  )  const [private, virtual]

Definition at line 2139 of file NuSystematic.cxx.

References MCEventInfo::had_fs, NuEvent::hadronicFinalStateMC, NuEvent::iaction, MCEventInfo::iaction, MCEventInfo::initial_state, NuEvent::initialStateMC, MCEventInfo::inu, NuEvent::inu, NuEvent::iresonance, MCEventInfo::iresonance, NuEvent::neuEnMC, NuEvent::neuPxMC, NuEvent::neuPyMC, NuEvent::neuPzMC, MCEventInfo::nucleus, NuEvent::nucleusMC, MCEventInfo::nuE, MCEventInfo::nuPx, MCEventInfo::nuPy, MCEventInfo::nuPz, MCEventInfo::q2, NuEvent::q2MC, MCEventInfo::tarE, MCEventInfo::tarPx, MCEventInfo::tarPy, MCEventInfo::tarPz, NuEvent::tgtEnMC, NuEvent::tgtPxMC, NuEvent::tgtPyMC, NuEvent::tgtPzMC, MCEventInfo::w2, NuEvent::w2MC, MCEventInfo::x, NuEvent::xMC, MCEventInfo::y, and NuEvent::yMC.

Referenced by NeugenXSecShift().

02140 {
02141   MCEventInfo mcEvent;
02142 
02143   mcEvent.nuE = nuEvent.neuEnMC;
02144   mcEvent.nuPx = nuEvent.neuPxMC;
02145   mcEvent.nuPy = nuEvent.neuPyMC;
02146   mcEvent.nuPz = nuEvent.neuPzMC;
02147   mcEvent.tarE = nuEvent.tgtEnMC;
02148   mcEvent.tarPx = nuEvent.tgtPxMC;
02149   mcEvent.tarPy = nuEvent.tgtPyMC;
02150   mcEvent.tarPz = nuEvent.tgtPzMC;
02151   mcEvent.y = nuEvent.yMC;
02152   mcEvent.x = nuEvent.xMC;
02153   mcEvent.q2 = nuEvent.q2MC;
02154   mcEvent.w2 = nuEvent.w2MC;
02155   mcEvent.iaction = nuEvent.iaction;
02156   mcEvent.inu = nuEvent.inu;
02157   mcEvent.iresonance = nuEvent.iresonance;
02158   mcEvent.initial_state = nuEvent.initialStateMC;
02159   mcEvent.nucleus = nuEvent.nucleusMC;
02160   mcEvent.had_fs = nuEvent.hadronicFinalStateMC;
02161 
02162   return mcEvent;
02163 }

double NuSystematic::CurrentSigma ( NuSyst::NuSystematic_t  syst  )  const [virtual]

Definition at line 708 of file NuSystematic.cxx.

References currentSigma, it, Msg::kError, and MSG.

Referenced by ConvertSigmaToValue(), NormalisationShift(), Shift(), ShiftAsSigma(), and ShiftAsValue().

00709 {
00710   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00711   it = currentSigma.find(syst);
00712   if (it == currentSigma.end()) {
00713     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in currentSigma." << endl;
00714     assert(false);
00715   }
00716   return it->second;
00717 }

void NuSystematic::EnergyResolutionEvent ( NuEvent event  )  const [virtual]

Definition at line 2017 of file NuSystematic.cxx.

References NuEvent::detector, MuELoss::e, NuSyst::kEnergyResolutionEventBoth, NuSyst::kEnergyResolutionEventNear, Msg::kInfo, Detector::kNear, MAXMSG, NuEvent::neuEnMC, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

02018 {
02019   MAXMSG("NuSystematic",Msg::kInfo,1)
02020     << "Performing event energy resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionEventBoth)
02021     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionEventNear) << "s" << endl;
02022 
02023   if (fabs(event.neuEnMC) < 1e-9) return;
02024   Double_t deltaE = (event.energy - event.neuEnMC) / event.neuEnMC;
02025   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionEventBoth);
02026   if (Detector::kNear == event.detector)
02027     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionEventNear);
02028   event.energy = deltaE*event.neuEnMC + event.neuEnMC;
02029   return;
02030 }

void NuSystematic::EnergyResolutionShower ( NuEvent event  )  const [virtual]

Definition at line 2033 of file NuSystematic.cxx.

References NuEvent::detector, MuELoss::e, NuSyst::kEnergyResolutionShowerBoth, NuSyst::kEnergyResolutionShowerNear, Msg::kInfo, Detector::kNear, MAXMSG, NuEvent::nshw, ShiftAsSigma(), ShiftAsValue(), NuEvent::shwEn, and NuEvent::shwEnMC.

Referenced by Shift().

02034 {
02035   MAXMSG("NuSystematic",Msg::kInfo,1)
02036     << "Performing shower energy resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionShowerBoth)
02037     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionShowerNear) << "s" << endl;
02038 
02039   if (fabs(event.shwEnMC) <= 1e-9) return;
02040   if (event.nshw < 1) return;
02041   if (fabs(event.shwEn) < 1e-9) return;
02042   Double_t deltaE = (event.shwEn - event.shwEnMC) / event.shwEnMC;
02043   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionShowerBoth);
02044   if (Detector::kNear == event.detector)
02045     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionShowerNear);
02046   event.shwEn = deltaE*event.shwEnMC + event.shwEnMC;
02047   event.energy = event.shwEn + event.trkEn;
02048   return;
02049 }

void NuSystematic::EnergyResolutionTrackCurve ( NuEvent event  )  const [virtual]

Definition at line 2082 of file NuSystematic.cxx.

References NuEvent::detector, MuELoss::e, NuSyst::kEnergyResolutionTrackCurveBoth, NuSyst::kEnergyResolutionTrackCurveNear, Msg::kInfo, Detector::kNear, MAXMSG, NuEvent::ntrk, ShiftAsSigma(), ShiftAsValue(), NuEvent::trkEn, NuEvent::trkEnCurv, NuEvent::trkEnMC, and NuEvent::usedCurv.

Referenced by Shift().

02083 {
02084   if (!event.usedCurv) return;
02085 
02086   MAXMSG("NuSystematic",Msg::kInfo,1)
02087     << "Performing track energy curve resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackCurveBoth)
02088     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackCurveNear) << "s" << endl;
02089 
02090 
02091   if (event.trkEnCurv != event.trkEn){
02092     cout << "Exiting event, but event.trkEnCurv != event.trkEn"
02093     << endl;
02094     assert(false);
02095   }
02096 
02097 
02098   if (fabs(event.trkEnMC) <= 1e-9) return;
02099   if (event.ntrk < 1) return;
02100   if (fabs(event.trkEn) < 1e-9) return;
02101   Double_t deltaE = (event.trkEnCurv - event.trkEnMC) / event.trkEnMC;
02102   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackCurveBoth);
02103   if (Detector::kNear == event.detector)
02104     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackCurveNear);
02105 
02106   event.trkEnCurv = deltaE*event.trkEnMC + event.trkEnMC;
02107 
02108   event.trkEn = event.trkEnCurv;
02109   event.energy = event.shwEn + event.trkEn;
02110   return;
02111 }

void NuSystematic::EnergyResolutionTrackRange ( NuEvent event  )  const [virtual]

Definition at line 2052 of file NuSystematic.cxx.

References NuEvent::detector, MuELoss::e, NuSyst::kEnergyResolutionTrackRangeBoth, NuSyst::kEnergyResolutionTrackRangeNear, Msg::kInfo, Detector::kNear, MAXMSG, NuEvent::ntrk, ShiftAsSigma(), ShiftAsValue(), NuEvent::trkEn, NuEvent::trkEnMC, NuEvent::trkEnRange, and NuEvent::usedRange.

Referenced by Shift().

02053 {
02054   if (!event.usedRange) return;
02055 
02056   MAXMSG("NuSystematic",Msg::kInfo,1)
02057     << "Performing track energy range resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackRangeBoth)
02058     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackRangeNear) << "s" << endl;
02059 
02060   if (event.trkEnRange != event.trkEn){
02061     cout << "Stopping event, but event.trkEnRange != event.trkEn"
02062     << endl;
02063     assert(false);
02064   }
02065 
02066   if (fabs(event.trkEnMC) <= 1e-9) return;
02067   if (event.ntrk < 1) return;
02068   if (fabs(event.trkEn) < 1e-9) return;
02069   Double_t deltaE = (event.trkEnRange - event.trkEnMC) / event.trkEnMC;
02070   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackRangeBoth);
02071   if (Detector::kNear == event.detector)
02072     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackRangeNear);
02073 
02074   event.trkEnRange = deltaE*event.trkEnMC + event.trkEnMC;
02075 
02076   event.trkEn = event.trkEnRange;
02077   event.energy = event.shwEn + event.trkEn;
02078   return;
02079 }

void NuSystematic::EverythingOff (  )  [virtual]

Definition at line 400 of file NuSystematic.cxx.

References currentSigma, NuSyst::kAbsoluteHadronicCalibrationSterile, NuSyst::kAcceptance, NuSyst::kAlignment, NuSyst::kAllBackgroundsScaleBoth, NuSyst::kBeam, NuSyst::kBFieldBoth, NuSyst::kBFieldFar, NuSyst::kBFieldNear, NuSyst::kCCBackground, NuSyst::kCCBackgroundSterile, NuSyst::kCCWSBackground, NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecMaQE, NuSyst::kCombinedXSecMaRes, NuSyst::kCombinedXSecOverall, NuSyst::kDPID, NuSyst::kEnergyResolutionEventBoth, NuSyst::kEnergyResolutionEventNear, NuSyst::kEnergyResolutionShowerBoth, NuSyst::kEnergyResolutionShowerNear, NuSyst::kEnergyResolutionTrackCurveBoth, NuSyst::kEnergyResolutionTrackCurveNear, NuSyst::kEnergyResolutionTrackRangeBoth, NuSyst::kEnergyResolutionTrackRangeNear, NuSyst::kFDCleaning, NuSyst::kFDCleaningCosmics, NuSyst::kFDCleaningCosmicsSterile, NuSyst::kFDCleaningSterile, NuSyst::kHornCurrent, NuSyst::kJitter, NuSyst::kJitterVDPID, NuSyst::kNCBackground, NuSyst::kNCNuBarBackground, NuSyst::kNDCleaning, NuSyst::kNDCleaningSterile, NuSyst::kNDCoilHole, NuSyst::kNormalisationBoth, NuSyst::kNormalisationFar, NuSyst::kNormalisationNC, NuSyst::kNormalisationNear, NuSyst::kNormalisationSterile, NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, NuSyst::kNuMuBarXSecOverall, NuSyst::kNuMuBarXSecQEL, NuSyst::kNuMuBarXSecRes, NuSyst::kNuMuBarXSecSum, NuSyst::kRelativeHadronicCalibrationSterile, NuSyst::kRockSelection, NuSyst::kRockXSec, NuSyst::kRockZA, NuSyst::kScraping, NuSyst::kShowerEnergyFunction, NuSyst::kShowerEnergyOffset, NuSyst::kShowerEnergyScale, NuSyst::kShowerEnergyScaleFar, NuSyst::kShowerEnergyScaleNear, NuSyst::kShowerEnergyScaleRelative, NuSyst::kTargetHole, NuSyst::kTauQELRes, NuSyst::kTFProb, NuSyst::kTrackEnergyCurvatureBoth, NuSyst::kTrackEnergyCurvatureFar, NuSyst::kTrackEnergyCurvatureNear, NuSyst::kTrackEnergyNeutrinoQE, NuSyst::kTrackEnergyOffset, NuSyst::kTrackEnergyOverall, NuSyst::kTrackEnergyRange, NuSyst::kTrackEnergyScale, and NuSyst::kWSNuBarBackground.

Referenced by NuSystematic().

00401 {
00402   currentSigma[NuSyst::kShowerEnergyOffset] = 0;
00403   currentSigma[NuSyst::kShowerEnergyScale] = 0;
00404   currentSigma[NuSyst::kShowerEnergyFunction] = 0;
00405   currentSigma[NuSyst::kShowerEnergyScaleFar] = 0;
00406   currentSigma[NuSyst::kShowerEnergyScaleNear] = 0;
00407   currentSigma[NuSyst::kShowerEnergyScaleRelative] = 0;
00408   currentSigma[NuSyst::kTrackEnergyCurvatureBoth] = 0;
00409   currentSigma[NuSyst::kTrackEnergyCurvatureFar] = 0;
00410   currentSigma[NuSyst::kTrackEnergyCurvatureNear] = 0;
00411   currentSigma[NuSyst::kTrackEnergyRange] = 0;
00412   currentSigma[NuSyst::kTrackEnergyScale] = 0;
00413   currentSigma[NuSyst::kTrackEnergyOffset] = 0;
00414   currentSigma[NuSyst::kTrackEnergyOverall] = 0;
00415   currentSigma[NuSyst::kTrackEnergyNeutrinoQE] = 0;
00416   currentSigma[NuSyst::kNDCoilHole] = 0;
00417   currentSigma[NuSyst::kBFieldBoth] = 0;
00418   currentSigma[NuSyst::kBFieldNear] = 0;
00419   currentSigma[NuSyst::kBFieldFar] = 0;
00420   currentSigma[NuSyst::kAlignment] = 0;
00421   currentSigma[NuSyst::kBeam] = 0;
00422   currentSigma[NuSyst::kAcceptance] = 0;
00423   currentSigma[NuSyst::kHornCurrent] = 0;
00424 
00425   currentSigma[NuSyst::kCombinedXSecOverall] = 0;
00426   currentSigma[NuSyst::kCombinedXSecCCMA] = 0;
00427   currentSigma[NuSyst::kCombinedXSecMaRes] = 0;
00428   currentSigma[NuSyst::kCombinedXSecMaQE] = 0;
00429   currentSigma[NuSyst::kCombinedXSecDISMultip2] = 0;
00430   currentSigma[NuSyst::kCombinedXSecDISMultip3] = 0;
00431   currentSigma[NuSyst::kNuMuBarXSecSum] = 0;
00432   currentSigma[NuSyst::kNuMuBarXSecOverall] = 0;
00433   currentSigma[NuSyst::kNuMuBarXSecCCMA] = 0;
00434   currentSigma[NuSyst::kNuMuBarXSecDISMultip2] = 0;
00435   currentSigma[NuSyst::kNuMuBarXSecQEL] = 0;
00436   currentSigma[NuSyst::kNuMuBarXSecRes] = 0;
00437   currentSigma[NuSyst::kRockXSec] = 0;
00438   currentSigma[NuSyst::kRockZA] = 0;
00439   currentSigma[NuSyst::kRockSelection] = 0;
00440   currentSigma[NuSyst::kNormalisationBoth] = 0;
00441   currentSigma[NuSyst::kNormalisationNear] = 0;
00442   currentSigma[NuSyst::kNormalisationFar] = 0;
00443   currentSigma[NuSyst::kNormalisationNC] = 0;
00444   currentSigma[NuSyst::kNCBackground] = 0;
00445   currentSigma[NuSyst::kNCNuBarBackground] = 0;
00446   currentSigma[NuSyst::kWSNuBarBackground] = 0;
00447   currentSigma[NuSyst::kCCBackground] = 0;
00448   currentSigma[NuSyst::kNDCleaning] = 0;
00449   currentSigma[NuSyst::kFDCleaning] = 0;
00450   currentSigma[NuSyst::kFDCleaningCosmics] = 0;
00451   currentSigma[NuSyst::kScraping] = 0;
00452   currentSigma[NuSyst::kJitterVDPID] = 0;
00453   currentSigma[NuSyst::kJitter] = 0;
00454   currentSigma[NuSyst::kDPID] = 0;
00455   currentSigma[NuSyst::kTFProb] = 0;
00456   currentSigma[NuSyst::kTargetHole] = 0;
00457   currentSigma[NuSyst::kTauQELRes] = 0;
00458   currentSigma[NuSyst::kAllBackgroundsScaleBoth] = 0;
00459   currentSigma[NuSyst::kEnergyResolutionEventBoth] = 0;
00460   currentSigma[NuSyst::kEnergyResolutionEventNear] = 0;
00461   currentSigma[NuSyst::kEnergyResolutionShowerBoth] = 0;
00462   currentSigma[NuSyst::kEnergyResolutionShowerNear] = 0;
00463   currentSigma[NuSyst::kEnergyResolutionTrackRangeBoth] = 0;
00464   currentSigma[NuSyst::kEnergyResolutionTrackRangeNear] = 0;
00465   currentSigma[NuSyst::kEnergyResolutionTrackCurveBoth] = 0;
00466   currentSigma[NuSyst::kEnergyResolutionTrackCurveNear] = 0;
00467   currentSigma[NuSyst::kCCWSBackground] = 0;
00468 
00469     //for nc separately --> A.Gavrilenko 4/13/2012
00470   currentSigma[NuSyst::kAbsoluteHadronicCalibrationSterile] = 0;
00471   currentSigma[NuSyst::kRelativeHadronicCalibrationSterile] = 0;
00472   currentSigma[NuSyst::kFDCleaningCosmicsSterile]           = 0;
00473   currentSigma[NuSyst::kFDCleaningSterile]                  = 0;
00474   currentSigma[NuSyst::kNDCleaningSterile]                  = 0;
00475   currentSigma[NuSyst::kCCBackgroundSterile]                = 0;
00476   currentSigma[NuSyst::kNormalisationSterile]               = 0;
00477 
00478 }

void NuSystematic::FDCleaningCosmicsShift ( NuEvent event  )  const [virtual]

Definition at line 1552 of file NuSystematic.cxx.

References NuEvent::energyNC, fNCSelector, Msg::kError, Detector::kFar, NuSyst::kFDCleaningCosmics, Msg::kInfo, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01553 {
01554   if(!fNCSelector){
01555     MSG("NuSystematic", Msg::kError)
01556       << "Cannot apply FDCleaningCosmics without doing SetNCSelector()"
01557       << endl;
01558     assert(false);
01559   }
01560 
01561   MAXMSG("NuSystematic", Msg::kInfo, 1)
01562     << "Performing FD cosmics cleaning shift "
01563     << ShiftAsSigma(NuSyst::kFDCleaningCosmics) << "s" << endl;
01564 
01565   const double percent = 1.61*exp(-event.energyNC/6.96);
01566 
01567   fNCSelector->MakeCuts(event);
01568   if(fNCSelector->Passed() && event.detector == Detector::kFar)
01569     event.rw *= 1.+(percent/100.)*ShiftAsValue(NuSyst::kFDCleaningCosmics);
01570 }

void NuSystematic::FDCleaningCosmicsShiftSterile ( NuEvent event  )  const [virtual]

Definition at line 1716 of file NuSystematic.cxx.

References NuEvent::detector, fNCSelector, Detector::kFar, NuSyst::kFDCleaningCosmicsSterile, SimFlag::kMC, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), NuEvent::shwEnLinNCCor, and NuEvent::simFlag.

Referenced by FitTree::FillNCVector(), and Shift().

01717 {
01718         fNCSelector->MakeCuts(event);
01719         if(SimFlag::kMC == event.simFlag && Detector::kFar == event.detector && fNCSelector->Passed())
01720         {
01721                 if(event.shwEnLinNCCor <= 0.5)
01722                         event.rw *= 1.0+0.011*ShiftAsValue(NuSyst::kFDCleaningCosmicsSterile);
01723                 if(event.shwEnLinNCCor > 0.5 && event.shwEnLinNCCor <= 1.0)
01724                         event.rw *= 1.0+0.027*ShiftAsValue(NuSyst::kFDCleaningCosmicsSterile);
01725                 if(event.shwEnLinNCCor > 1.0 && event.shwEnLinNCCor <= 2.0)
01726                         event.rw *= 1.0+0.023*ShiftAsValue(NuSyst::kFDCleaningCosmicsSterile);
01727                 if(event.shwEnLinNCCor > 2.0 && event.shwEnLinNCCor <= 3.0)
01728                         event.rw *= 1.0+0.021*ShiftAsValue(NuSyst::kFDCleaningCosmicsSterile);
01729                 if(event.shwEnLinNCCor > 3.0)
01730                 {
01731                         float spp  = 0.074*TMath::Exp(-event.shwEnLinNCCor/0.98);
01732                         float rms  = 0.021*TMath::Exp(-event.shwEnLinNCCor/20.8);
01733                         float dcos = 0.012*TMath::Exp(-event.shwEnLinNCCor/5.5);
01734                         event.rw   *= 1.0+sqrt(spp*spp + rms*rms + dcos*dcos)*ShiftAsValue(NuSyst::kFDCleaningCosmicsSterile);
01735                 }
01736                         
01737         }
01738 }

void NuSystematic::FDCleaningShift ( NuEvent event  )  const [virtual]

Definition at line 1530 of file NuSystematic.cxx.

References NuEvent::energyNC, fNCSelector, Msg::kError, Detector::kFar, NuSyst::kFDCleaning, Msg::kInfo, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01531 {
01532   if(!fNCSelector){
01533     MSG("NuSystematic", Msg::kError)
01534       << "Cannot apply FDCleaning without doing SetNCSelector()" << endl;
01535     assert(false);
01536   }
01537 
01538   MAXMSG("NuSystematic", Msg::kInfo, 1)
01539     << "Performing FD cleaning shift "
01540     << ShiftAsSigma(NuSyst::kFDCleaning) << "s" << endl;
01541 
01542   double percent = 0;
01543   if(event.energyNC < 0.5) percent = 7.8;
01544   if(event.energyNC >= 0.5 && event.energyNC < 0.75) percent = 1.5;
01545 
01546   fNCSelector->MakeCuts(event);
01547   if(fNCSelector->Passed() && event.detector == Detector::kFar)
01548     event.rw *= 1.+(percent/100.)*ShiftAsValue(NuSyst::kFDCleaning);
01549 }

void NuSystematic::FDCleaningShiftSterile ( NuEvent event  )  const [virtual]

Definition at line 1693 of file NuSystematic.cxx.

References NuEvent::detector, fNCSelector, Detector::kFar, NuSyst::kFDCleaningSterile, SimFlag::kMC, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), NuEvent::shwEnLinNCCor, and NuEvent::simFlag.

Referenced by FitTree::FillNCVector(), and Shift().

01694 {
01695         fNCSelector->MakeCuts(event);
01696         if(SimFlag::kMC == event.simFlag && Detector::kFar == event.detector && fNCSelector->Passed())
01697         {
01698                 if(event.shwEnLinNCCor <= 0.5)
01699                         event.rw *= 1.0+0.049*ShiftAsValue(NuSyst::kFDCleaningSterile);
01700                 if(event.shwEnLinNCCor > 0.5 && event.shwEnLinNCCor <= 1.0)
01701                         event.rw *= 1.0+0.010*ShiftAsValue(NuSyst::kFDCleaningSterile);
01702                 if(event.shwEnLinNCCor > 1.0 && event.shwEnLinNCCor <= 2.0)
01703                         event.rw *= 1.0+0.006*ShiftAsValue(NuSyst::kFDCleaningSterile);
01704                 if(event.shwEnLinNCCor > 2.0 && event.shwEnLinNCCor <= 3.0)
01705                         event.rw *= 1.0+0.004*ShiftAsValue(NuSyst::kFDCleaningSterile);
01706                 if(event.shwEnLinNCCor > 3.0)
01707                 {
01708                         float MainEvent = 0.005*TMath::Exp(-event.shwEnLinNCCor/7.1);
01709                         float MultiPlex = 0.016*TMath::Exp(-event.shwEnLinNCCor/1.1);
01710                         event.rw *= 1.0+sqrt(MainEvent*MainEvent+MultiPlex*MultiPlex)*ShiftAsValue(NuSyst::kFDCleaningSterile);
01711                 }
01712         }
01713 }

bool NuSystematic::FluxSyst ( const NuXMLConfig xmlConfig  )  [static]

Definition at line 746 of file NuSystematic.cxx.

References NuXMLConfig::Name().

Referenced by NuTransition::NuTransition(), and NuTransSME::NuTransSME().

00747 {
00748   TString systName = xmlConfig.Name();
00749   if (systName.Contains("Scraping",TString::kIgnoreCase) ||
00750       systName.Contains("DecayPipe",TString::kIgnoreCase)){
00751     return true;
00752   }
00753   if (systName.Contains("Beam",TString::kIgnoreCase) ||
00754       systName.Contains("SKZP",TString::kIgnoreCase) ||
00755       systName.Contains("Flux",TString::kIgnoreCase)){
00756     return true;
00757   }
00758   if (systName.Contains("TargetHole",TString::kIgnoreCase)){
00759     return true;
00760   }
00761 
00762   return false;
00763 }

TH1D* NuSystematic::horncurrenthisto ( int  i,
int  j 
) const [inline]

Definition at line 267 of file NuSystematic.h.

Referenced by HornCurrentShift().

00267                                             {
00268       // Get a pointer to the current directory so we can put it back later: 
00269       TDirectory* restore = gDirectory;
00270       //Open your new file
00271       TH1D *hornref;
00272       TFile myFile("/minos/app/radovic/dstProcessing_dev/fluxFile/HCM_M02.root", "READ");
00273       if(i==0&&j==0){
00274         hornref=(TH1D*)myFile.Get("rnm");
00275       }
00276       else if(i==0&&j==1){
00277         hornref=(TH1D*)myFile.Get("rnup");
00278       }
00279       else if(i==1&&j==0){
00280         hornref=(TH1D*)myFile.Get("rfm");
00281       }
00282       else{
00283         hornref=(TH1D*)myFile.Get("rfup");
00284       }
00285     
00286       hornref->SetDirectory(0);
00287       //Now put the directory back where you found it:                                                                                   
00288       restore->cd();
00289       return hornref;
00290     }

void NuSystematic::HornCurrentShift ( NuEvent event  )  const [virtual]

Definition at line 984 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, horncurrenthisto(), NuSyst::kAcceptance, Detector::kFar, NuSyst::kHornCurrent, Msg::kInfo, Detector::kNear, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

00985 {
00986 
00987   double hrnwt = 0.0; // default value means no shift
00988   double reweight = 1;
00989   
00990   if(event.detector ==Detector::kNear&&ShiftAsValue(NuSyst::kHornCurrent)<0){
00991     TH1D *result=horncurrenthisto(0,0);
00992     result->GetXaxis()->SetRangeUser(0, 200);
00993     hrnwt=result->GetBinContent(result->GetXaxis()->FindFixBin(event.energy));
00994     reweight =  1+(3*fabs(ShiftAsValue(NuSyst::kHornCurrent)) * (hrnwt-1));
00995     result->Delete();
00996   }
00997   if(event.detector ==Detector::kNear&&ShiftAsValue(NuSyst::kHornCurrent)>0){
00998     TH1D *result=horncurrenthisto(0,1);
00999     result->GetXaxis()->SetRangeUser(0, 200);
01000     hrnwt=result->GetBinContent(result->GetXaxis()->FindFixBin(event.energy));
01001     reweight =  1+(3*fabs(ShiftAsValue(NuSyst::kHornCurrent)) * (hrnwt-1));
01002     result->Delete();
01003   }
01004   if(event.detector ==Detector::kFar&&ShiftAsValue(NuSyst::kHornCurrent)<0){
01005     TH1D *result=horncurrenthisto(1,0);
01006     result->GetXaxis()->SetRangeUser(0, 200);
01007     hrnwt=result->GetBinContent(result->GetXaxis()->FindFixBin(event.energy));
01008     reweight =  1+(3*fabs(ShiftAsValue(NuSyst::kHornCurrent)) * (hrnwt-1));
01009     result->Delete();
01010   }
01011   if(event.detector ==Detector::kFar&&ShiftAsValue(NuSyst::kHornCurrent)>0){
01012     TH1D *result=horncurrenthisto(1,1);
01013     result->GetXaxis()->SetRangeUser(0, 200);
01014     hrnwt=result->GetBinContent(result->GetXaxis()->FindFixBin(event.energy));
01015     reweight =  1+(3*fabs(ShiftAsValue(NuSyst::kHornCurrent)) * (hrnwt-1));
01016     result->Delete();
01017   }
01018   
01019   if(reweight<0){
01020     reweight=0;
01021   }
01022   event.rw *= reweight;
01023 
01024   MAXMSG("NuSystematic",Msg::kInfo,500)
01025    << "Performing horn current shift = " << ShiftAsSigma(NuSyst::kAcceptance) << "s = " << reweight<< endl;
01026 
01027   return;
01028 }

void NuSystematic::InitializeSystematics (  )  [virtual]

Definition at line 222 of file NuSystematic.cxx.

References NuSyst::kAbsoluteHadronicCalibrationSterile, NuSyst::kAcceptance, NuSyst::kAlignment, NuSyst::kAllBackgroundsScaleBoth, kAsIs, NuSyst::kBeam, NuSyst::kBFieldBoth, NuSyst::kBFieldFar, NuSyst::kBFieldNear, NuSyst::kCCBackground, NuSyst::kCCBackgroundSterile, NuSyst::kCCWSBackground, NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecMaQE, NuSyst::kCombinedXSecMaRes, NuSyst::kCombinedXSecOverall, NuSyst::kDPID, NuSyst::kEnergyResolutionEventBoth, NuSyst::kEnergyResolutionEventNear, NuSyst::kEnergyResolutionShowerBoth, NuSyst::kEnergyResolutionShowerNear, NuSyst::kEnergyResolutionTrackCurveBoth, NuSyst::kEnergyResolutionTrackCurveNear, NuSyst::kEnergyResolutionTrackRangeBoth, NuSyst::kEnergyResolutionTrackRangeNear, NuSyst::kFDCleaning, NuSyst::kFDCleaningCosmics, NuSyst::kFDCleaningCosmicsSterile, NuSyst::kFDCleaningSterile, NuSyst::kHornCurrent, NuSyst::kJitter, NuSyst::kJitterVDPID, kMinusPlus, NuSyst::kNCBackground, NuSyst::kNCNuBarBackground, NuSyst::kNDCleaning, NuSyst::kNDCleaningSterile, NuSyst::kNDCoilHole, NuSyst::kNominal, NuSyst::kNormalisationBoth, NuSyst::kNormalisationFar, NuSyst::kNormalisationNC, NuSyst::kNormalisationNear, NuSyst::kNormalisationSterile, NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, NuSyst::kNuMuBarXSecOverall, NuSyst::kNuMuBarXSecQEL, NuSyst::kNuMuBarXSecRes, NuSyst::kNuMuBarXSecSum, NuSyst::kRelativeHadronicCalibrationSterile, NuSyst::kRockSelection, NuSyst::kRockXSec, NuSyst::kRockZA, NuSyst::kScraping, NuSyst::kShowerEnergyFunction, NuSyst::kShowerEnergyOffset, NuSyst::kShowerEnergyScale, NuSyst::kShowerEnergyScaleFar, NuSyst::kShowerEnergyScaleNear, NuSyst::kShowerEnergyScaleRelative, kSigma, NuSyst::kTargetHole, NuSyst::kTauQELRes, NuSyst::kTFProb, NuSyst::kTrackEnergyCurvatureBoth, NuSyst::kTrackEnergyCurvatureFar, NuSyst::kTrackEnergyCurvatureNear, NuSyst::kTrackEnergyNeutrinoQE, NuSyst::kTrackEnergyOffset, NuSyst::kTrackEnergyOverall, NuSyst::kTrackEnergyRange, NuSyst::kTrackEnergyScale, NuSyst::kWSNuBarBackground, systMode, and systNames.

Referenced by NuSystematic().

00223 {
00224   systNames[NuSyst::kNominal] = "Nominal";
00225 
00226   systNames[NuSyst::kShowerEnergyOffset] = "ShowerEnergyOffset";
00227   systNames[NuSyst::kShowerEnergyScale] = "ShowerEnergyScaleBoth";
00228   systNames[NuSyst::kShowerEnergyFunction] = "ShowerEnergyScaleFunctionBoth";
00229   systNames[NuSyst::kShowerEnergyScaleNear] = "ShowerEnergyScaleNear";
00230   systNames[NuSyst::kShowerEnergyScaleFar] = "ShowerEnergyScaleFar";
00231 
00232   systNames[NuSyst::kShowerEnergyScaleRelative] = "ShowerEnergyScaleRelative";
00233   systNames[NuSyst::kTrackEnergyCurvatureBoth] = "TrackEnergyCurvatureBoth";
00234   systNames[NuSyst::kTrackEnergyCurvatureFar] = "TrackEnergyCurvatureFar";
00235   systNames[NuSyst::kTrackEnergyCurvatureNear] = "TrackEnergyCurvatureNear";
00236   systNames[NuSyst::kTrackEnergyRange] = "TrackEnergyRange";
00237   systNames[NuSyst::kTrackEnergyOffset] = "TrackEnergyOffset";
00238   systNames[NuSyst::kTrackEnergyOverall] = "TrackEnergyOverall";
00239   systNames[NuSyst::kTrackEnergyNeutrinoQE] = "TrackEnergyNeutrinoQE";
00240   systNames[NuSyst::kTrackEnergyScale] = "TrackEnergyScale";
00241   systNames[NuSyst::kNDCoilHole] = "NDCoilHole";
00242 
00243   systNames[NuSyst::kBFieldBoth] = "BFieldBoth";
00244   systNames[NuSyst::kBFieldNear] = "BFieldNear";
00245   systNames[NuSyst::kBFieldFar] = "BFieldFar";
00246   systNames[NuSyst::kAlignment] = "Alignment";
00247   systNames[NuSyst::kBeam] = "Flux";
00248   systNames[NuSyst::kAcceptance] = "Acceptance";
00249   systNames[NuSyst::kHornCurrent] = "HornCurrent";
00250 
00251   systNames[NuSyst::kCombinedXSecCCMA] = "CombinedXSecCCMA";
00252   systNames[NuSyst::kCombinedXSecMaRes] = "CombinedXSecMaRes";
00253   systNames[NuSyst::kCombinedXSecMaQE] = "CombinedXSecMaQE";
00254   systNames[NuSyst::kCombinedXSecOverall] = "CombinedXSecOverall";
00255   systNames[NuSyst::kCombinedXSecDISMultip2] = "CombinedXSecDISMultip2";
00256   systNames[NuSyst::kCombinedXSecDISMultip3] = "CombinedXSecDISMultip3";
00257 
00258   systNames[NuSyst::kNuMuBarXSecCCMA] = "NuMuBarXSecCCMA";
00259   systNames[NuSyst::kNuMuBarXSecQEL] = "NuMuBarXSecQEL";
00260   systNames[NuSyst::kNuMuBarXSecRes] = "NuMuBarXSecRes";
00261   systNames[NuSyst::kNuMuBarXSecSum] = "NuMuBarXSecSum";
00262   systNames[NuSyst::kNuMuBarXSecOverall] = "NuMuBarXSecOverall";
00263   systNames[NuSyst::kNuMuBarXSecDISMultip2] = "NuMuBarXSecDISMultip2";
00264 
00265   systNames[NuSyst::kRockXSec] = "RockXSec";
00266   systNames[NuSyst::kRockZA] = "RockZA";
00267   systNames[NuSyst::kRockSelection] = "RockSelection";
00268 
00269   systNames[NuSyst::kNormalisationBoth] = "NormalisationBoth";
00270   systNames[NuSyst::kNormalisationNear] = "NormalisationNear";
00271   systNames[NuSyst::kNormalisationFar] = "NormalisationFar";
00272 
00273   systNames[NuSyst::kNormalisationNC] = "NormalisationNC";
00274   systNames[NuSyst::kNCBackground] = "NCBackground";
00275   systNames[NuSyst::kNCNuBarBackground] = "NCNuBarBackground";
00276   systNames[NuSyst::kWSNuBarBackground] = "WSNuBarBackground";
00277   systNames[NuSyst::kCCBackground] = "CCBackground";
00278   systNames[NuSyst::kNDCleaning] = "NDCleaning";
00279   systNames[NuSyst::kFDCleaning] = "FDCleaning";
00280   systNames[NuSyst::kFDCleaningCosmics] = "FDCleaningCosmics";
00281   systNames[NuSyst::kAllBackgroundsScaleBoth] = "AllBackgroundsScaleBoth";
00282   systNames[NuSyst::kScraping] = "DecayPipe";
00283 
00284   systNames[NuSyst::kJitterVDPID] = "JitterVDPID";
00285   systNames[NuSyst::kJitter] = "Jitter";
00286   systNames[NuSyst::kDPID] = "DPID";
00287   systNames[NuSyst::kTFProb] = "TFProb";
00288   systNames[NuSyst::kTargetHole] = "TargetHole";
00289   systNames[NuSyst::kTauQELRes] = "TauQELRes";
00290 
00291   systNames[NuSyst::kEnergyResolutionEventBoth] = "EnergyResolutionEventBoth";
00292   systNames[NuSyst::kEnergyResolutionEventNear] = "EnergyResolutionEventNear";
00293   systNames[NuSyst::kEnergyResolutionShowerBoth] = "EnergyResolutionShowerBoth";
00294   systNames[NuSyst::kEnergyResolutionShowerNear] = "EnergyResolutionShowerNear";
00295   systNames[NuSyst::kEnergyResolutionTrackRangeBoth] = "EnergyResolutionTrackRangeBoth";
00296   systNames[NuSyst::kEnergyResolutionTrackRangeNear] = "EnergyResolutionTrackRangeNear";
00297   systNames[NuSyst::kEnergyResolutionTrackCurveBoth] = "EnergyResolutionTrackCurveBoth";
00298   systNames[NuSyst::kEnergyResolutionTrackCurveNear] = "EnergyResolutionTrackCurveNear";
00299   systNames[NuSyst::kCCWSBackground] = "CCWSBackground";
00300 
00301   //adding in nc systematics separately --> A.Gavrilenko 4/13/2012
00302   systNames[NuSyst::kAbsoluteHadronicCalibrationSterile] = "AbsoluteHadronicCalibrationSterile";
00303   systNames[NuSyst::kRelativeHadronicCalibrationSterile] = "RelativeHadronicCalibrationSterile";
00304   systNames[NuSyst::kFDCleaningCosmicsSterile]           = "FDCleaningCosmicsSterile";
00305   systNames[NuSyst::kFDCleaningSterile]                  = "FDCleaningSterile";
00306   systNames[NuSyst::kNDCleaningSterile]                  = "NDCleaningSterile";
00307   systNames[NuSyst::kCCBackgroundSterile]                = "CCBackgroundSterile";
00308   systNames[NuSyst::kNormalisationSterile]               = "NormalisationSterile";
00309 
00310   systMode[NuSyst::kNominal] = kSigma;
00311 
00312   systMode[NuSyst::kShowerEnergyOffset] = kAsIs;
00313   systMode[NuSyst::kShowerEnergyScale] = kMinusPlus;
00314   systMode[NuSyst::kShowerEnergyFunction] = kSigma;
00315   systMode[NuSyst::kShowerEnergyScaleNear] = kMinusPlus;
00316   systMode[NuSyst::kShowerEnergyScaleFar] = kMinusPlus;
00317 
00318   systMode[NuSyst::kShowerEnergyScaleRelative] = kMinusPlus;
00319   systMode[NuSyst::kTrackEnergyCurvatureBoth] = kMinusPlus;
00320   systMode[NuSyst::kTrackEnergyCurvatureFar] = kMinusPlus;
00321   systMode[NuSyst::kTrackEnergyCurvatureNear] = kMinusPlus;
00322   systMode[NuSyst::kTrackEnergyRange] = kMinusPlus;
00323   systMode[NuSyst::kTrackEnergyOverall] = kSigma;
00324   systMode[NuSyst::kTrackEnergyOffset] = kAsIs;
00325   systMode[NuSyst::kTrackEnergyScale] = kMinusPlus;
00326   systMode[NuSyst::kTrackEnergyNeutrinoQE] = kAsIs;
00327   systMode[NuSyst::kNDCoilHole] = kMinusPlus;
00328 
00329   systMode[NuSyst::kBFieldBoth] = kMinusPlus;
00330   systMode[NuSyst::kBFieldNear] = kMinusPlus;
00331   systMode[NuSyst::kBFieldFar] = kMinusPlus;
00332   systMode[NuSyst::kAlignment] = kMinusPlus;
00333   systMode[NuSyst::kBeam] = kSigma;
00334   systMode[NuSyst::kAcceptance] = kSigma;
00335   systMode[NuSyst::kHornCurrent] = kSigma;
00336 
00337   systMode[NuSyst::kCombinedXSecCCMA] = kMinusPlus;
00338   systMode[NuSyst::kCombinedXSecMaRes] = kMinusPlus;
00339   systMode[NuSyst::kCombinedXSecMaQE] = kMinusPlus;
00340   systMode[NuSyst::kCombinedXSecOverall] = kMinusPlus;
00341   systMode[NuSyst::kCombinedXSecDISMultip2] = kAsIs;
00342   systMode[NuSyst::kCombinedXSecDISMultip3] = kAsIs;
00343 
00344   systMode[NuSyst::kNuMuBarXSecCCMA] = kMinusPlus;
00345   systMode[NuSyst::kNuMuBarXSecQEL] = kMinusPlus;
00346   systMode[NuSyst::kNuMuBarXSecRes] = kMinusPlus;
00347   systMode[NuSyst::kNuMuBarXSecSum] = kSigma;
00348   systMode[NuSyst::kNuMuBarXSecOverall] = kMinusPlus;
00349   systMode[NuSyst::kNuMuBarXSecDISMultip2] = kAsIs;
00350 
00351   systMode[NuSyst::kRockXSec] = kSigma;
00352   systMode[NuSyst::kRockZA] = kSigma;
00353   systMode[NuSyst::kRockSelection] = kSigma;
00354 
00355   systMode[NuSyst::kNormalisationBoth] = kMinusPlus;
00356   systMode[NuSyst::kNormalisationNear] = kMinusPlus;
00357   systMode[NuSyst::kNormalisationFar] = kMinusPlus;
00358 
00359   systMode[NuSyst::kNormalisationNC] = kMinusPlus;
00360   systMode[NuSyst::kNCBackground] = kMinusPlus;
00361   systMode[NuSyst::kNCNuBarBackground] = kMinusPlus;
00362   systMode[NuSyst::kWSNuBarBackground] = kMinusPlus;
00363   systMode[NuSyst::kCCBackground] = kMinusPlus;
00364   systMode[NuSyst::kNDCleaning] = kSigma;
00365   systMode[NuSyst::kFDCleaning] = kSigma;
00366   systMode[NuSyst::kFDCleaningCosmics] = kSigma;
00367   systMode[NuSyst::kAllBackgroundsScaleBoth] = kMinusPlus;
00368   systMode[NuSyst::kScraping] = kMinusPlus;
00369 
00370   systMode[NuSyst::kJitterVDPID] = kSigma;
00371   systMode[NuSyst::kJitter] = kAsIs;
00372   systMode[NuSyst::kDPID] = kAsIs;
00373   systMode[NuSyst::kTFProb] = kAsIs;
00374   systMode[NuSyst::kTargetHole] = kAsIs;
00375   systMode[NuSyst::kTauQELRes] = kMinusPlus;
00376 
00377   systMode[NuSyst::kEnergyResolutionEventBoth] = kMinusPlus;
00378   systMode[NuSyst::kEnergyResolutionEventNear] = kMinusPlus;
00379   systMode[NuSyst::kEnergyResolutionShowerBoth] = kMinusPlus;
00380   systMode[NuSyst::kEnergyResolutionShowerNear] = kMinusPlus;
00381   systMode[NuSyst::kEnergyResolutionTrackRangeBoth] = kMinusPlus;
00382   systMode[NuSyst::kEnergyResolutionTrackRangeNear] = kMinusPlus;
00383   systMode[NuSyst::kEnergyResolutionTrackCurveBoth] = kMinusPlus;
00384   systMode[NuSyst::kEnergyResolutionTrackCurveNear] = kMinusPlus;
00385   systMode[NuSyst::kCCWSBackground] = kMinusPlus;
00386 
00387   //for nc separately --> A.Gavrilenko 4/13/2012
00388   systMode[NuSyst::kAbsoluteHadronicCalibrationSterile] = kSigma;
00389   systMode[NuSyst::kRelativeHadronicCalibrationSterile] = kMinusPlus;
00390   systMode[NuSyst::kFDCleaningCosmicsSterile]           = kSigma;
00391   systMode[NuSyst::kFDCleaningSterile]                  = kSigma;
00392   systMode[NuSyst::kNDCleaningSterile]                  = kSigma;
00393   systMode[NuSyst::kCCBackgroundSterile]                = kMinusPlus;
00394   systMode[NuSyst::kNormalisationSterile]               = kMinusPlus;
00395 
00396   }

void NuSystematic::JitterVDPIDShift ( NuEvent event  )  const [virtual]

Definition at line 1031 of file NuSystematic.cxx.

References ConvertSigmaToValue(), NuSyst::kDPID, Msg::kInfo, NuSyst::kJitter, NuSyst::kJitterVDPID, MAXMSG, and ShiftAsSigma().

Referenced by Shift().

01032 {
01033   MAXMSG("NuSystematic",Msg::kInfo,1)
01034     << "Performing track jitter & DPID shift = " << ShiftAsSigma(NuSyst::kJitterVDPID) << "s" << endl;
01035   event.jitter += ConvertSigmaToValue(ShiftAsSigma(NuSyst::kJitterVDPID), NuSyst::kJitter);
01036   event.dpID += ConvertSigmaToValue(ShiftAsSigma(NuSyst::kJitterVDPID), NuSyst::kDPID);
01037   return;
01038 }

virtual Float_t NuSystematic::KNO112Default (  )  const [inline, private, virtual]

Definition at line 370 of file NuSystematic.h.

References fkno_r112Default.

Referenced by SetShiftedNeugenParameters().

00370 {return fkno_r112Default;}

virtual Float_t NuSystematic::KNO113Default (  )  const [inline, private, virtual]

Definition at line 374 of file NuSystematic.h.

References fkno_r113Default.

Referenced by SetShiftedNeugenParameters().

00374 {return fkno_r113Default;}

virtual Float_t NuSystematic::KNO122Default (  )  const [inline, private, virtual]

Definition at line 371 of file NuSystematic.h.

References fkno_r122Default.

Referenced by SetShiftedNeugenParameters().

00371 {return fkno_r122Default;}

virtual Float_t NuSystematic::KNO123Default (  )  const [inline, private, virtual]

Definition at line 375 of file NuSystematic.h.

References fkno_r123Default.

Referenced by SetShiftedNeugenParameters().

00375 {return fkno_r123Default;}

virtual Float_t NuSystematic::KNO132Default (  )  const [inline, private, virtual]

Definition at line 372 of file NuSystematic.h.

References fkno_r132Default.

Referenced by SetShiftedNeugenParameters().

00372 {return fkno_r132Default;}

virtual Float_t NuSystematic::KNO133Default (  )  const [inline, private, virtual]

Definition at line 376 of file NuSystematic.h.

References fkno_r133Default.

Referenced by SetShiftedNeugenParameters().

00376 {return fkno_r133Default;}

virtual Float_t NuSystematic::KNO142Default (  )  const [inline, private, virtual]

Definition at line 373 of file NuSystematic.h.

References fkno_r142Default.

Referenced by SetShiftedNeugenParameters().

00373 {return fkno_r142Default;}

virtual Float_t NuSystematic::KNO143Default (  )  const [inline, private, virtual]

Definition at line 377 of file NuSystematic.h.

References fkno_r143Default.

Referenced by SetShiftedNeugenParameters().

00377 {return fkno_r143Default;}

virtual Float_t NuSystematic::KNO212Default (  )  const [inline, private, virtual]

Definition at line 378 of file NuSystematic.h.

References fkno_r212Default.

Referenced by SetShiftedNeugenParameters().

00378 {return fkno_r212Default;}

virtual Float_t NuSystematic::KNO213Default (  )  const [inline, private, virtual]

Definition at line 382 of file NuSystematic.h.

References fkno_r213Default.

Referenced by SetShiftedNeugenParameters().

00382 {return fkno_r213Default;}

virtual Float_t NuSystematic::KNO222Default (  )  const [inline, private, virtual]

Definition at line 379 of file NuSystematic.h.

References fkno_r222Default.

Referenced by SetShiftedNeugenParameters().

00379 {return fkno_r222Default;}

virtual Float_t NuSystematic::KNO223Default (  )  const [inline, private, virtual]

Definition at line 383 of file NuSystematic.h.

References fkno_r223Default.

Referenced by SetShiftedNeugenParameters().

00383 {return fkno_r223Default;}

virtual Float_t NuSystematic::KNO232Default (  )  const [inline, private, virtual]

Definition at line 380 of file NuSystematic.h.

References fkno_r232Default.

Referenced by SetShiftedNeugenParameters().

00380 {return fkno_r232Default;}

virtual Float_t NuSystematic::KNO233Default (  )  const [inline, private, virtual]

Definition at line 384 of file NuSystematic.h.

References fkno_r233Default.

Referenced by SetShiftedNeugenParameters().

00384 {return fkno_r233Default;}

virtual Float_t NuSystematic::KNO242Default (  )  const [inline, private, virtual]

Definition at line 381 of file NuSystematic.h.

References fkno_r242Default.

Referenced by SetShiftedNeugenParameters().

00381 {return fkno_r242Default;}

virtual Float_t NuSystematic::KNO243Default (  )  const [inline, private, virtual]

Definition at line 385 of file NuSystematic.h.

References fkno_r243Default.

Referenced by SetShiftedNeugenParameters().

00385 {return fkno_r243Default;}

virtual Float_t NuSystematic::MA_QEDefault (  )  const [inline, private, virtual]

Definition at line 368 of file NuSystematic.h.

References fma_qeDefault.

Referenced by SetShiftedNeugenParameters().

00368 {return fma_qeDefault;}

virtual Float_t NuSystematic::MA_ResDefault (  )  const [inline, private, virtual]

Definition at line 369 of file NuSystematic.h.

References fma_resDefault.

Referenced by SetShiftedNeugenParameters().

00369 {return fma_resDefault;}

virtual TString NuSystematic::NameFromSyst ( const NuSyst::NuSystematic_t  syst  )  const [inline, virtual]

Definition at line 224 of file NuSystematic.h.

References SystNames().

Referenced by ConvertSigmaToValue(), and ConvertValueToSigma().

00225     { return SystNames(syst); };

void NuSystematic::NCBackgroundShift ( NuEvent event  )  const [virtual]

Definition at line 1434 of file NuSystematic.cxx.

References fCCSelector, NuEvent::iaction, Msg::kError, Msg::kInfo, NuSyst::kNCBackground, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01435 {
01436   if (!fCCSelector) {
01437     MSG("NuSystematic",Msg::kError) << "Cannot apply NCBackground without doing SetCCSelector()" << endl;
01438     assert(false);
01439   }
01440 
01441   MAXMSG("NuSystematic",Msg::kInfo,1)
01442     << "Performing NC background shift " << ShiftAsSigma(NuSyst::kNCBackground) << "s" << endl;
01443 
01444   fCCSelector->MakeCuts(event);
01445   if (0 == event.iaction && fCCSelector->Passed())
01446     event.rw *= ShiftAsValue(NuSyst::kNCBackground);
01447 }

void NuSystematic::NCNuBarBackgroundShift ( NuEvent event  )  const [virtual]

Definition at line 1450 of file NuSystematic.cxx.

References fNuBarSelector, NuEvent::iaction, Msg::kError, Msg::kInfo, NuSyst::kNCNuBarBackground, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01451 {
01452   if (!fNuBarSelector) {
01453     MSG("NuSystematic",Msg::kError) << "Cannot apply NCNuBarBackground without doing SetNuBarSelector()" << endl;
01454     assert(false);
01455   }
01456 
01457   MAXMSG("NuSystematic",Msg::kInfo,1)
01458   << "Performing NC NuBar background shift " << ShiftAsSigma(NuSyst::kNCNuBarBackground) << "s" << endl;
01459 
01460   fNuBarSelector->MakeCuts(event);
01461   if (0 == event.iaction && fNuBarSelector->Passed())
01462     event.rw *= ShiftAsValue(NuSyst::kNCNuBarBackground);
01463 }

void NuSystematic::NDCleaningShift ( NuEvent event  )  const [virtual]

Definition at line 1500 of file NuSystematic.cxx.

References NuEvent::energyNC, fNCSelector, Msg::kError, Msg::kInfo, NuSyst::kNDCleaning, Detector::kNear, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01501 {
01502   std::cout << "using old NDcleaning" << std::endl;
01503   if (!fNCSelector) {
01504     MSG("NuSystematic",Msg::kError) << "Cannot apply NDCleaning without doing SetNCSelector()" << endl;
01505     assert(false);
01506   }
01507  std::cout << "passed nc selector" << std::endl; 
01508 
01509   MAXMSG("NuSystematic",Msg::kInfo,1)
01510   << "Performing ND cleaning shift " << ShiftAsSigma(NuSyst::kNDCleaning) << "s" << endl;
01511 
01512  std::cout << "printed message" << std::endl;
01513 
01514   double percent = 0;
01515   if(event.energyNC < 0.5) percent = 15.2;
01516   if(event.energyNC >= 0.5 && event.energyNC < 1.0) percent = 2.9;
01517   if(event.energyNC >= 1.0 && event.energyNC < 1.5) percent = 0.4;
01518 
01519  std::cout << "set percent to: " << percent << std::endl;
01520 
01521   fNCSelector->MakeCuts(event);
01522   std::cout << "nc selector" << std::endl;
01523   if(fNCSelector->Passed() && event.detector == Detector::kNear)
01524     event.rw *= 1.+(percent/100.)*ShiftAsValue(NuSyst::kNDCleaning);
01525 
01526         std::cout << "weight is rw= " << event.rw << std::endl;
01527 }

void NuSystematic::NDCleaningShiftSterile ( NuEvent event  )  const [virtual]

Definition at line 1657 of file NuSystematic.cxx.

References NuEvent::detector, fNCSelector, SimFlag::kMC, NuSyst::kNDCleaningSterile, Detector::kNear, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), NuEvent::shwEnLinNCCor, and NuEvent::simFlag.

Referenced by FitTree::FillNCVector(), and Shift().

01658 {
01659 //      std::cout << "INSIDE STERILE ND CLEANING FUNCTION" << std::endl;
01660         
01661         fNCSelector->MakeCuts(event);
01662 
01663 //      std::cout << "rw currently = " << event.rw << std::endl;
01664         if(SimFlag::kMC == event.simFlag && Detector::kNear == event.detector && fNCSelector->Passed())
01665         {
01666                 const double cleaningSigmas = ShiftAsValue(NuSyst::kNDCleaningSterile);
01667 
01668 //              std::cout << "cleaningSigmas = " << cleaningSigmas << std::endl; 
01669         
01670                 double shift = 0.0;
01671 
01672                 //Old discrete model:
01673 //              if(event.shwEnLinNCCor <= 0.5) shift = 0.104;
01674 //              if(event.shwEnLinNCCor > 0.5 && event.shwEnLinNCCor <= 1.0) shift = 0.095;
01675 //              if(event.shwEnLinNCCor > 1.0 && event.shwEnLinNCCor <= 1.5) shift = 0.048;
01676 //              if(event.shwEnLinNCCor > 1.5 && event.shwEnLinNCCor <= 2.0) shift = 0.033;
01677 //              if(event.shwEnLinNCCor > 2.0 && event.shwEnLinNCCor <= 2.5) shift = 0.021;
01678 
01679                 //New continuous model
01680                 shift = 0.082 / pow(1.0 + event.shwEnLinNCCor/3.0 , 2);
01681 
01682 // std::cout << "set shift to: " << shift << std::endl;
01683 
01684                 event.rw *= 1.0+shift*cleaningSigmas;
01685 
01686 //              std::cout << "and rw = " << event.rw << std::endl;
01687         }
01688         
01689 }

void NuSystematic::NDCoilHole ( NuEvent event  )  const [virtual]

Definition at line 2002 of file NuSystematic.cxx.

References NuEvent::detector, Msg::kInfo, NuSyst::kNDCoilHole, Detector::kNear, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

02003 {
02004   MAXMSG("NuSystematic",Msg::kInfo,1)
02005   << "Performing ND coil hole shift "
02006   << this->ShiftAsSigma(NuSyst::kNDCoilHole) << " sigma"
02007   << endl;
02008   //only do this for the near detector
02009   if (Detector::kNear == event.detector){
02010     event.trkEn *= ShiftAsValue(NuSyst::kNDCoilHole);
02011     event.energy = event.shwEn+event.trkEn;
02012   }
02013   return;
02014 }

void NuSystematic::NeugenXSecShift ( NuEvent event  )  const [virtual]

Definition at line 1050 of file NuSystematic.cxx.

References MCReweight::AddWeightCalculator(), MCReweight::ComputeWeight(), CreateMCEventInfo(), firstMCReweight, NuEvent::iaction, MCReweight::Instance(), NuEvent::iresonance, ReleaseType::IsDaikon(), Msg::kError, Msg::kInfo, MAXMSG, MSG, NuEvent::releaseType, MCReweight::ResetAllReweightConfigs(), Registry::Set(), SetNeugenDefaults(), and SetShiftedNeugenParameters().

Referenced by Shift().

01051 {
01052     MAXMSG("NuSystematic",Msg::kInfo,1)
01053       << "Performing a Neugen cross section shift" << endl;
01054   if (0 == event.iaction) return;
01055 
01056   MCReweight& mcReweight = MCReweight::Instance();
01057   if (firstMCReweight){
01058     NeugenWeightCalculator* wc = new NeugenWeightCalculator();
01059     mcReweight.AddWeightCalculator(wc);
01060     firstMCReweight = false;
01061   }
01062   //  cout << "Num weight calc: " << mcReweight.NumWeightCalcAdded() << endl;
01063   Registry reweightConfigRegistry;
01064   Registry defaultRegistry;
01065 
01066   //Set to MODBYRS4 for Daikon.
01067   if (ReleaseType::IsDaikon(event.releaseType)){
01068     reweightConfigRegistry.Set("neugen:config_name","MODBYRS");
01069     reweightConfigRegistry.Set("neugen:config_no",4);
01070     defaultRegistry.Set("neugen:config_name","MODBYRS");
01071     defaultRegistry.Set("neugen:config_no",4);
01072   }
01073   else{
01074     MSG("NuSystematic",Msg::kError)
01075       << "Using non-daikon MC. I don't know how to apply Neugen "
01076       << "parameters to that."
01077       << endl;
01078   }
01079 
01080   //Temporary hack for rock systematics
01081   //if(event.iresonance!=1001 && event.iresonance!=1002 && event.iresonance!=1004){
01082   if(event.iresonance>1004){
01083     cout<<"Uh oh! iresonance="<<event.iresonance<<endl;
01084     return;
01085   }
01086   //Set the shifted CombinedXSecCCMA parameters.
01087   this->SetShiftedNeugenParameters(reweightConfigRegistry, event);
01088 
01089 
01090   //Create objects to give to MCReweight.
01091   MCEventInfo mcEventInfo = this->CreateMCEventInfo(event);
01092   NuParent* nuParent = 0;
01093 
01094   mcReweight.ResetAllReweightConfigs();
01095 
01096   //    cout << "iresonance is " << event.iresonance << endl;
01097   //Get the weight.
01098   Double_t weight = mcReweight.ComputeWeight(&mcEventInfo,
01099                                              nuParent,
01100                                              &reweightConfigRegistry);
01101   //  mcReweight.PrintReweightConfig(cout);
01102 
01103 
01104   //Get the default weight.
01105   this->SetNeugenDefaults(defaultRegistry);
01106   mcReweight.ResetAllReweightConfigs();
01107   Double_t defaultWeight = mcReweight.ComputeWeight(&mcEventInfo,
01108                                                     nuParent,
01109                                                     &defaultRegistry);
01110   //  cout << "Weight changed by " << weight << "/" << defaultWeight << endl;
01111   if (defaultWeight>0.0){
01112     event.rw *= weight/defaultWeight;
01113   }
01114   else{
01115     MSG("NuSystematic",Msg::kError)
01116       << "Default weight <= 0."
01117       << endl;
01118   }
01119   return;
01120 }

Double_t NuSystematic::NeugenXSecShiftScale ( const Double_t  energy,
const NuParticle::NuParticleType_t  particle 
) const [private, virtual]

Definition at line 2491 of file NuSystematic.cxx.

References e_cc, e_Fe56, e_mu, e_undefined_init_state, e_vbn, e_vbp, e_vn, e_vp, NuParticle::kNuMu, NuParticle::kNuMuBar, Nav::kWarning, MSG, and neugen_wrapper::xsec().

02493 {
02494   NuEvent event;
02495   if (NuParticle::kNuMuBar == particle) event.inu = -14;
02496   else                                  event.inu = 14;
02497 
02498   neugen_config shiftedConfig; //Defaults are MODBYRS4
02499   this->SetShiftedNeugenParameters(shiftedConfig, event);
02500   neugen_config defaultConfig;
02501   neugen_wrapper shiftedWrapper(&shiftedConfig);
02502   neugen_wrapper defaultWrapper(&defaultConfig);
02503   init_state_t inlStateP;
02504   init_state_t inlStateN;
02505   if (NuParticle::kNuMu == particle){
02506     inlStateP = e_vp;
02507     inlStateN = e_vn;
02508   }
02509   else if (NuParticle::kNuMuBar == particle){
02510     inlStateP = e_vbp;
02511     inlStateN = e_vbn;
02512   }
02513   else{
02514     MSG("NuSystematic",kWarning)
02515       << "Bad particle type for cross section shift."
02516       << endl;
02517     inlStateP = e_undefined_init_state;
02518     inlStateN = e_undefined_init_state;
02519   }
02520   interaction interP(e_mu,e_Fe56,e_cc,inlStateP);
02521   interaction interN(e_mu,e_Fe56,e_cc,inlStateP);
02522   Double_t defaultXSec = defaultWrapper.xsec(energy,&interP,0);
02523   defaultXSec += defaultWrapper.xsec(energy,&interN,0);
02524   Double_t shiftedXSec = shiftedWrapper.xsec(energy,&interP,0);
02525   shiftedXSec = shiftedWrapper.xsec(energy,&interN,0);
02526   if (defaultXSec){return shiftedXSec/defaultXSec;}
02527   else {return 0;}
02528 }

void NuSystematic::NormalisationShift ( NuEvent event  )  const [virtual]

Definition at line 1573 of file NuSystematic.cxx.

References ConvertSigmaToValue(), CurrentSigma(), NuEvent::detector, fNCSelector, Msg::kError, Detector::kFar, Msg::kInfo, Detector::kNear, NuSyst::kNormalisationBoth, NuSyst::kNormalisationFar, NuSyst::kNormalisationNC, NuSyst::kNormalisationNear, Msg::kWarning, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01574 {
01575   if (!fNCSelector) {
01576     MAXMSG("NuSystematic",Msg::kError,1) << "No NC Normalisation shift applied without doing SetNCSelector() " << endl;
01577   }
01578 
01579     MAXMSG("NuSystematic",Msg::kInfo,1)
01580       << "Performing Normalisation shift both = "  << ShiftAsSigma(NuSyst::kNormalisationBoth)
01581       << "s, near = " << ShiftAsSigma(NuSyst::kNormalisationNear)
01582       << "s, far = " << ShiftAsSigma(NuSyst::kNormalisationFar)
01583       << "s, NC = " << ShiftAsSigma(NuSyst::kNormalisationNC) << endl;
01584 
01585 
01586   event.rw *= ShiftAsValue(NuSyst::kNormalisationBoth);
01587   if (Detector::kNear==event.detector)
01588     event.rw *= ShiftAsValue(NuSyst::kNormalisationNear);
01589   if (Detector::kFar==event.detector) {
01590     double shift = ShiftAsValue(NuSyst::kNormalisationFar);
01591     if (fNCSelector) {
01592       fNCSelector->MakeCuts(event);
01593       if (fNCSelector->Passed()) {
01594         if (CurrentSigma(NuSyst::kNormalisationNC)) {
01595           MAXMSG("NuSystematic",Msg::kWarning,10) << "NC normalization is correlated with CC normalization, so "
01596           << "current sigma for NC normalization = " << CurrentSigma(NuSyst::kNormalisationNC)
01597           << " is being ignored" << endl;
01598         }
01599         shift = ConvertSigmaToValue(ShiftAsSigma(NuSyst::kNormalisationFar), NuSyst::kNormalisationNC);
01600       }
01601     }
01602 
01603     unsigned int runcode = event.run/1000000; // first two digits of run number
01604 
01605     // the 2 means far, the 3 means mixed rock+detector file
01606     if(runcode == 23){
01607       MSG("NuSystematic",Msg::kError)
01608         << "File containing both rock and detector events is in use.\n"
01609            "You must rewrite NuSystematic::NormalisationShift to find rock\n"
01610            "events in a mixed file.\n";
01611     }
01612     // the 2 means far, and the 2 means rock, respectively
01613     else if(runcode == 22){
01614       // Rock events have a slightly smaller normalization systematic because
01615       // they don't depend on the detector mass.  Shrink the error by 1.7%.
01616       // This must be separately updated if the detector systematic is.
01617       const double det2rock = 0.983;
01618       if(shift > 1) shift = (shift - 1)*det2rock + 1;
01619       else          shift = 1 - (1 - shift)*det2rock;
01620     }
01621 
01622     event.rw *= shift;
01623   }
01624   return;
01625 }

void NuSystematic::NormalisationShiftSterile ( NuEvent event  )  const [virtual]

Definition at line 1633 of file NuSystematic.cxx.

References NuEvent::detector, fNCSelector, Detector::kFar, SimFlag::kMC, NuSyst::kNormalisationSterile, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), and NuEvent::simFlag.

Referenced by Shift().

01634 {
01635         std::cout << "using NC normalization" << std::endl;
01636         fNCSelector->MakeCuts(event);
01637         if(SimFlag::kMC == event.simFlag && Detector::kFar == event.detector && fNCSelector->Passed())
01638         {
01639                 event.rw *= ShiftAsValue(NuSyst::kNormalisationSterile);
01640         }
01641 }

void NuSystematic::NuMuBarQELXSecShift ( NuEvent event  )  const [virtual]

Definition at line 1179 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, NuEvent::iresonance, Msg::kInfo, NuSyst::kNuMuBarXSecQEL, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01180 {
01181   MAXMSG("NuSystematic",Msg::kInfo,1)
01182     << "Performing NuMuBar QEL cross section shift = "
01183     << ShiftAsSigma(NuSyst::kNuMuBarXSecQEL) << "s" << endl;
01184 
01185   if (1 != event.iaction) return;
01186   //  if (-14 != event.inu) return;
01187   if (event.inu > 0) return;
01188   if (1001 != event.iresonance) return;
01189   event.rw *= ShiftAsValue(NuSyst::kNuMuBarXSecQEL);
01190   return;
01191 }

void NuSystematic::NuMuBarResXSecShift ( NuEvent event  )  const [virtual]

Definition at line 1194 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, NuEvent::iresonance, Msg::kInfo, NuSyst::kNuMuBarXSecRes, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01195 {
01196   MAXMSG("NuSystematic",Msg::kInfo,1)
01197     << "Performing NuMuBar Res cross section shift"
01198     << ShiftAsSigma(NuSyst::kNuMuBarXSecRes) << "s" << endl;
01199 
01200   if (1 != event.iaction) return;
01201   //  if (-14 != event.inu) return;
01202   if (event.inu > 0) return;
01203   if (1002 != event.iresonance) return;
01204   event.rw *= ShiftAsValue(NuSyst::kNuMuBarXSecRes);
01205   return;
01206 }

void NuSystematic::NuMuBarSumXSecShift ( NuEvent event  )  const [virtual]

Definition at line 1123 of file NuSystematic.cxx.

References MuELoss::a, NuEvent::iaction, NuEvent::inu, Msg::kInfo, NuSyst::kNuMuBarXSecSum, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01124 {
01125     MAXMSG("NuSystematic",Msg::kInfo,1)
01126     << "Performing numubar summed cross section shift = "
01127     << ShiftAsSigma(NuSyst::kNuMuBarXSecSum) << "s" << endl;
01128     if (1 != event.iaction) return;
01129     if (event.inu != -14) return;
01130 
01131     static double xp = 25.;
01132     static double a = 0.895;
01133     static double xc = 4.0;
01134     static double b = 7.59e-3;
01135     static double c = -8.05e-4;
01136     double E = event.neuEnMC;
01137     double shift = -0.0617;
01138     if (E < 25) shift += a - 1 + 2.*(1.-a)*E/xp + (a - 1.)*E*E/(xp*xp);
01139     if (E < xc) shift += (c*(xc-E)*(xc-E)*(xc-E)+b*(xc-E)*(xc-E));
01140     shift = 1 + ShiftAsValue(NuSyst::kNuMuBarXSecSum) * shift;
01141 
01142     event.rw *= shift;
01143     return;
01144 }

double NuSystematic::OneSigma ( NuSyst::NuSystematic_t  syst  )  const [virtual]

Definition at line 695 of file NuSystematic.cxx.

References it, Msg::kError, MSG, and oneSigma.

Referenced by ConvertSigmaToValue(), ConvertValueToSigma(), and PrintState().

00696 {
00697   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00698   it = oneSigma.find(syst);
00699   if (it == oneSigma.end()) {
00700     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in oneSigma." << endl;
00701     assert(false);
00702   }
00703   return it->second;
00704 }

void NuSystematic::OverallXSecShift ( NuEvent event  )  const [virtual]

Definition at line 1147 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, NuSyst::kCombinedXSecOverall, Msg::kInfo, NuSyst::kNuMuBarXSecOverall, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01148 {
01149   MAXMSG("NuSystematic",Msg::kInfo,1)
01150     << "Performing overall cross section shift combined = " << ShiftAsSigma(NuSyst::kCombinedXSecOverall)
01151   << "s, numubar = " << ShiftAsSigma(NuSyst::kNuMuBarXSecOverall) << "s" << endl;
01152   if (1 != event.iaction) return;
01153   Double_t before=event.rw;
01154   event.rw *= ShiftAsValue(NuSyst::kCombinedXSecOverall);
01155   Double_t after=event.rw;
01156   if (event.inu < 0)
01157     event.rw *= ShiftAsValue(NuSyst::kNuMuBarXSecOverall);
01158 
01159   if(before!=0){
01160     MAXMSG("NuSystematic",Msg::kInfo,50)<<"Before:"<<before<<
01161       " After:"<<after<<" Ratio:"<<after/before<<" shift: "<<ShiftAsValue(NuSyst::kCombinedXSecOverall)<<endl;
01162   }
01163 }

void NuSystematic::PrintState ( bool  verbose = false  )  const [virtual]

Definition at line 601 of file NuSystematic.cxx.

References currentSigma, it, Msg::kInfo, len, MSG, OneSigma(), and SystNames().

Referenced by FoverNHistos::FoverNHistos(), NuDSTAna::MMRereco(), NuDSTAna::MMTransSME(), FitTree::SetSystematics(), and NuDSTAna::TestNuSyst().

00602 {
00603   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00604 
00605 
00606   // Find the longest name
00607   Int_t lsize = 12;
00608   for (it = currentSigma.begin(); it != currentSigma.end(); ++it) {
00609     if (it->second || verbose) {
00610       int len = SystNames(it->first).Length();
00611       if (len > lsize) lsize = len;
00612     }
00613   }
00614 
00615   lsize++;
00616 
00617   // The 'total width'
00618   // Print a summary of this events cuts
00619   //MSG("NuSystematic",Msg::kInfo)
00620   MSG("NuSystematic",Msg::kInfo) << setw(lsize+21) << left << setfill('=') << "==== NuSystematics Summary " << endl;
00621 
00622   MSG("NuSystematic",Msg::kInfo) << setw(lsize) << left << setfill(' ') << "Systematic"
00623                                  << setw(10) << right << "1 sigma" << " "
00624                                  << setw(10) << right << "Current" << endl;
00625 
00626   for (it = currentSigma.begin(); it != currentSigma.end(); ++it) {
00627     if (it->second || verbose) {
00628       MSG("NuSystematic",Msg::kInfo) << setw(lsize) << left << setfill(' ') << SystNames(it->first)
00629                                      << setw(10) << right << OneSigma(it->first) << " "
00630                                      << setw(10) << right << it->second << endl;
00631     }
00632   }
00633   MSG("NuSystematic",Msg::kInfo) << endl;
00634 }

Double_t NuSystematic::QELXSecShiftScale ( const Double_t  energy,
const NuParticle::NuParticleType_t  particle 
) const [private, virtual]

Definition at line 2413 of file NuSystematic.cxx.

References e_cc, e_Fe56, e_mu, e_qel, e_undefined_init_state, e_vbn, e_vbp, e_vn, e_vp, NuParticle::kNuMu, NuParticle::kNuMuBar, NuSyst::kNuMuBarXSecQEL, Nav::kWarning, MSG, neugen_cuts::setOneProcess(), and neugen_wrapper::xsec().

02416 {
02417   neugen_config defaultConfig;
02418   neugen_wrapper defaultWrapper(&defaultConfig);
02419   init_state_t inlStateP;
02420   init_state_t inlStateN;
02421   if (NuParticle::kNuMu == particle){
02422     inlStateP = e_vp;
02423     inlStateN = e_vn;
02424   }
02425   else if (NuParticle::kNuMuBar == particle){
02426     inlStateP = e_vbp;
02427     inlStateN = e_vbn;
02428   }
02429   else{
02430     MSG("NuSystematic",kWarning)
02431       << "Bad particle type for cross section shift."
02432       << endl;
02433     inlStateP = e_undefined_init_state;
02434     inlStateN = e_undefined_init_state;
02435   }
02436   interaction interP(e_mu,e_Fe56,e_cc,inlStateP);
02437   interaction interN(e_mu,e_Fe56,e_cc,inlStateP);
02438   Double_t defaultXSec = defaultWrapper.xsec(energy,&interP,0);
02439   defaultXSec += defaultWrapper.xsec(energy,&interN,0);
02440 
02441   neugen_cuts cuts;
02442   cuts.setOneProcess(e_qel);
02443   Double_t qelXSec = defaultWrapper.xsec(energy,&interP,&cuts);
02444   qelXSec += defaultWrapper.xsec(energy,&interN,&cuts);
02445 
02446   if (!defaultXSec){return 1.0;}
02447   return (defaultXSec + (this->ShiftAsValue(NuSyst::kNuMuBarXSecQEL) - 1.0)*qelXSec)/defaultXSec;
02448 }

void NuSystematic::Randomize (  )  [virtual]

Definition at line 929 of file NuSystematic.cxx.

References currentSigma, MuELoss::e, fRandom, it, Msg::kInfo, and MAXMSG.

Referenced by NuDSTAna::TestNuSyst().

00930 {
00931   map<NuSyst::NuSystematic_t, double>::iterator it;
00932 
00933   MAXMSG("NuSystematic",Msg::kInfo, 1)
00934   << "Setting random gaussian shifts for all non-zero systematics" << endl;
00935 
00936   for (it = currentSigma.begin(); it != currentSigma.end(); ++it) {
00937     if (it->second) {
00938       it->second = fRandom->Gaus(0, 1);
00939       // Prevent a systematic from being turned off
00940       // persistently by a random draw
00941       if (!it->second) it->second = 1e-8;
00942     }
00943   }
00944 }

void NuSystematic::ReadXML ( const NuXMLConfig xmlConfig  )  [virtual]

Definition at line 506 of file NuSystematic.cxx.

References ConvertValueToSigma(), currentSigma, Msg::kInfo, MSG, NuXMLConfig::Name(), oneSigma, NuXMLConfig::Shift(), and SystFromName().

Referenced by NuSystematic().

00507 {
00508   NuSyst::NuSystematic_t fSystematicID = SystFromName(xmlConfig.Name());
00509 
00510   currentSigma[fSystematicID] = ConvertValueToSigma(xmlConfig.Shift(), fSystematicID);
00511 
00512   MSG("NuSystematic",Msg::kInfo)
00513   << "Reading NuXMLConfig for "
00514   << xmlConfig.Name() << " at "
00515   << currentSigma[fSystematicID] << " sigma = " << oneSigma[fSystematicID] << endl;
00516 }

void NuSystematic::RelativeHadronicCalibrationSterile ( NuEvent event  )  const [virtual]

Definition at line 1741 of file NuSystematic.cxx.

References NuEvent::detector, fNCSelector, Detector::kFar, SimFlag::kMC, NuSyst::kRelativeHadronicCalibrationSterile, NuCut::MakeCuts(), NuCut::Passed(), ShiftAsValue(), and NuEvent::simFlag.

Referenced by FitTree::FillNCVector(), and Shift().

01742 {
01743         fNCSelector->MakeCuts(event);
01744         if(SimFlag::kMC == event.simFlag && Detector::kFar == event.detector && fNCSelector->Passed())
01745         {
01746                 const double scale = 1.0+ShiftAsValue(NuSyst::kRelativeHadronicCalibrationSterile);
01747                 event.shwEnLinNCCor *= scale;
01748                 event.shwEnCC *= scale;
01749         }
01750 }

Double_t NuSystematic::ResXSecShiftScale ( const Double_t  energy,
const NuParticle::NuParticleType_t  particle 
) const [private, virtual]

Definition at line 2452 of file NuSystematic.cxx.

References e_cc, e_Fe56, e_mu, e_res, e_undefined_init_state, e_vbn, e_vbp, e_vn, e_vp, NuParticle::kNuMu, NuParticle::kNuMuBar, NuSyst::kNuMuBarXSecRes, Nav::kWarning, MSG, neugen_cuts::setOneProcess(), and neugen_wrapper::xsec().

02455 {
02456   neugen_config defaultConfig;
02457   neugen_wrapper defaultWrapper(&defaultConfig);
02458   init_state_t inlStateP;
02459   init_state_t inlStateN;
02460   if (NuParticle::kNuMu == particle){
02461     inlStateP = e_vp;
02462     inlStateN = e_vn;
02463   }
02464   else if (NuParticle::kNuMuBar == particle){
02465     inlStateP = e_vbp;
02466     inlStateN = e_vbn;
02467   }
02468   else{
02469     MSG("NuSystematic",kWarning)
02470       << "Bad particle type for cross section shift."
02471       << endl;
02472     inlStateP = e_undefined_init_state;
02473     inlStateN = e_undefined_init_state;
02474   }
02475   interaction interP(e_mu,e_Fe56,e_cc,inlStateP);
02476   interaction interN(e_mu,e_Fe56,e_cc,inlStateP);
02477   Double_t defaultXSec = defaultWrapper.xsec(energy,&interP,0);
02478   defaultXSec += defaultWrapper.xsec(energy,&interN,0);
02479 
02480   neugen_cuts cuts;
02481   cuts.setOneProcess(e_res);
02482   Double_t qelXSec = defaultWrapper.xsec(energy,&interP,&cuts);
02483   qelXSec += defaultWrapper.xsec(energy,&interN,&cuts);
02484 
02485   if (!defaultXSec){return 1.0;}
02486   return (defaultXSec + (this->ShiftAsValue(NuSyst::kNuMuBarXSecRes) - 1.0)*qelXSec)/defaultXSec;
02487 }

void NuSystematic::RockSelectionShift ( NuEvent event  )  const [virtual]

Definition at line 1338 of file NuSystematic.cxx.

References NuEvent::edgeRegionTrkVtx, fRockSelector, NuEvent::index, IntegerProbShift(), Msg::kError, Msg::kInfo, NuSyst::kRockSelection, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::regionTrkVtx, NuEvent::run, ShiftAsSigma(), ShiftAsValue(), and NuEvent::stripHoveNumTrkVtxNoShift.

Referenced by Shift().

01339 {
01340   if (!fRockSelector) {
01341     MSG("NuSystematic",Msg::kError)
01342       << "Cannot apply RockSelection without doing SetNuRockSelector()" << endl;
01343     assert(false);
01344   }
01345 
01346   // This only applies to horizontal and vertical edge events
01347   if(event.regionTrkVtx%4 != 1 || event.edgeRegionTrkVtx%2 != 0) return;
01348 
01349   fRockSelector->MakeCuts(event);
01350 
01351   if (!fRockSelector->Passed()) return;
01352 
01353   MAXMSG("NuSystematic",Msg::kInfo, 1) 
01354     << "Performing rock/detector selection shift"
01355     << ShiftAsSigma(NuSyst::kRockSelection) << "s" << endl;
01356 
01357   // Get the shift (gaussian with sigma 1).  Convert it to flat on [-1, 1].
01358   double sysroll = ShiftAsValue(NuSyst::kRockSelection);
01359   sysroll = TMath::Erf(sysroll/sqrt(2));
01360 
01361   // This represents the uncertainty in the misalignment of the scintillator
01362   // strips.  The misalignment itself is handled in NuReco::ShiftHoveStrip.
01363 
01364   // These are fractions of strip widths.  See doc 6870.
01365   const float hovefuzz    = 10.1/(2*41.1), // Nominal.  MUST MATCH NuReco!
01366               minhovefuzz =  8.1/(2*41.1), // best alignment we can imagine
01367               maxhovefuzz = 15.8/(2*41.1); // worst alignment we can imagine
01368 
01369   // Half the time, flat between min & nominal, rest flat between nominal & max
01370   float newhovefuzz;
01371   if(sysroll < 0) newhovefuzz = minhovefuzz - sysroll*(hovefuzz-minhovefuzz);
01372   else            newhovefuzz =    hovefuzz + sysroll*(maxhovefuzz-hovefuzz);
01373 
01374   float newshift, newzerotoone;
01375   
01376   // Make a random number generator, seeded with run and index number
01377   // The seed is a 4 byte unsigned integer.  Don't overflow.
01378   // run 22035432, index 2601 --> seed = 543 202 601
01379   // This is the same seed as used in NuReco::ShiftHoveStrip
01380   TRandom3 ionwalk((((UInt_t)event.run)%10000)*100000
01381                    +((UInt_t)event.index)%100000);
01382 
01383   newshift = ionwalk.Gaus(0, newhovefuzz);
01384   newzerotoone = ionwalk.Rndm();
01385   
01386   // It is totally possible at this point to shift by two strips even
01387   // though the new shift is nearly the same as the old one.  This is OK.
01388   // We aren't trying to represent actually moving individual strips
01389   // but rather trying to create a distribution that has a different spread.
01390   event.stripHoveNumTrkVtx
01391     = IntegerProbShift(event.stripHoveNumTrkVtxNoShift, newshift, newzerotoone);
01392 }

void NuSystematic::RockXSecShift ( NuEvent event  )  const [virtual]

Definition at line 1216 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::iresonance, Msg::kError, Detector::kFar, Msg::kInfo, NuSyst::kRockXSec, Msg::kWarning, MAXMSG, MSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01217 {
01218   MAXMSG("NuSystematic",Msg::kInfo, 1) << "Performing Rock cross section shift"
01219     << ShiftAsSigma(NuSyst::kRockXSec) << "s" << endl;
01220 
01221   // Apply only at the far detector.  The near detector rock is a whole
01222   // different can of worms and not (as far as I know) being used by anyone.
01223   if(event.detector != Detector::kFar) return;
01224 
01225   unsigned int runcode = event.run/1000000; // first two digits of run number
01226 
01227   // the 2 means far, the 3 means mixed rock+detector file
01228   if(runcode == 23){
01229     MSG("NuSystematic",Msg::kError)
01230       << "File containing both rock and detector events is in use.\n"
01231          "You must rewrite NuSystematic::RockXSecShift to find rock events\n"
01232          "in a mixed file.\n";
01233     return;
01234   }
01235 
01236   // Make the shift only if this event is in the rock.
01237   // First 2 means far detector.  Second 2 means rock.
01238   // Shift regardless of beam type (normal beam, nu_e, nu_tau, inverted) since
01239   // by lepton universality there should be the same effect.
01240   if(runcode != 22){
01241     // these should be the only other possibilities.  Just check to be sure.
01242     if(runcode != 21 && runcode != 20) {
01243       MSG("NuSystematic",Msg::kWarning)
01244         << "Whut? Odd runcode " << runcode << " in NuSystematic::RockXSecShift\n";
01245     }
01246     return;
01247   }
01248 
01249   // Do nothing to events that are not either quasielastic,
01250   // resonance or coherent pion production (as defined by neugen)
01251   // (The other categories are deep inelastic and inverse muon decay.)
01252   if(event.iresonance!=1001 && event.iresonance!=1002 && event.iresonance!=1004)
01253     return;
01254 
01255   // Size of systematic for carbon.  Despite being given to three digits, it
01256   // is almost TOTALLY ARBITRARY. It's set to this value to agree with the
01257   // suggestion (agreed upon at the 2010 03 01 meeting) on the last slide of
01258   // doc-6946-v3. A carbon systematic of 1.35% makes the average systematic 1%.
01259   const double carbon_sys = 0.0135;
01260 
01261   double sigma = ShiftAsValue(NuSyst::kRockXSec);
01262 
01263   // none of the elements in the rock are heavier than iron, but even if
01264   // a new model changes that, it just flips the sign of a the shift
01265   // which is fine, and maybe even correct.
01266   double fraction_of_Fe_to_C = (26.0 - event.zMC)/20.0;
01267 
01268   // Automatically does nothing to iron.
01269   // Of course, the near detector is not 100% iron, so this is strictly speaking
01270   // not quite right.  But trying to handle it in a more sophisticated way is
01271   // silly since the size of the systematic is nearly arbitrary to begin with.
01272   double mult = 1 + sigma*carbon_sys*fraction_of_Fe_to_C;
01273 
01274   event.rw *= mult;
01275 }

void NuSystematic::RockZAShift ( NuEvent event  )  const [virtual]

Definition at line 1289 of file NuSystematic.cxx.

References NuEvent::detector, Msg::kError, Detector::kFar, Msg::kInfo, NuSyst::kRockZA, Msg::kWarning, MAXMSG, MSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01290 {
01291   MAXMSG("NuSystematic",Msg::kInfo, 1) << "Performing Rock Z/A shift"
01292     << ShiftAsSigma(NuSyst::kRockZA) << "s" << endl;
01293 
01294   // Apply only at the far detector.  The near detector rock is a whole
01295   // different can of worms and not (as far as I know) being used by anyone.
01296   if(event.detector != Detector::kFar) return;
01297 
01298   unsigned int runcode = event.run/1000000; // first two digits of run number
01299 
01300   // the 2 means far, the 3 means mixed rock+detector file
01301   if(runcode == 23){
01302     MSG("NuSystematic",Msg::kError)
01303       << "File containing both rock and detector events is in use.\n"
01304          "You must rewrite NuSystematic::RockZAShift to find rock events\n"
01305          "in a mixed file.\n";
01306     return;
01307   }
01308 
01309   // Make the shift only if this event is in the rock.
01310   // First 2 means far detector.  Second 2 means rock.
01311   if(runcode != 22){
01312     // these should be the only other possibilities.  Just check to be sure.
01313     if(runcode != 21 && runcode != 20) {
01314       MSG("NuSystematic",Msg::kWarning)
01315         << "Whut? Odd runcode " << runcode << " in NuSystematic::RockZAShift\n";
01316     }
01317     return;
01318   }
01319 
01320   // Error on average Z/A of Ely greenstone as derived from
01321   // Geology of Minnesota, eds., Sims and Morey, MN geological Survey,
01322   // U of Minn, 1972; and Chem Analyzes of Igneous rocks, A. Ruotsala, 1965;
01323   // same journal.  Arbitrarily inflate by 10% since the measurements are
01324   // of generic Ely greenstone, not the actual rock around the MINOS cavern.
01325   const double ZAerror = 0.0081 * 1.1;
01326   double sigma = ShiftAsValue(NuSyst::kRockZA);
01327 
01328   event.rw *= 1 + sigma * ZAerror;
01329 }

void NuSystematic::ScrapingShift ( NuEvent event  )  const [virtual]

Definition at line 1807 of file NuSystematic.cxx.

References Msg::kInfo, NuSyst::kScraping, MAXMSG, NuEvent::ppvz, NuEvent::ptype, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01808 {
01809     MAXMSG("NuSystematic",Msg::kInfo,1)
01810       << "Performing scraping shift = " << ShiftAsSigma(NuSyst::kScraping) << "s" << endl;
01811 
01812 //    Float_t r = sqrt(event.ppvx*event.ppvx +
01813 //                     event.ppvy*event.ppvy);
01814 //    Float_t z = event.ppvz;
01815 //    Float_t Znom = 52.06; // -187.06 for HE
01816 //    if (BeamType::kL250z200i == event.beamType){
01817 //      Znom = -187.06;
01818 //    }
01819 //    else if (BeamType::kL010z185i == event.beamType){
01820 //      Znom = 52.06;
01821 //    }
01822 //    else{
01823 //      Znom = 52.06;
01824 //    }
01825 
01826     //Don't shift muons
01827     if (13 == event.ptype) return;
01828     if (-13 == event.ptype) return;
01829 
01830 //    if (r < 1.65 && TMath::Abs(z - Znom) < 0.1)
01831 //        return; // Target End
01832 //
01833 //    if (TMath::Abs(r - 1.51) < 0.11 && z < Znom)
01834 //        return; // Target Side
01835 
01836     if (event.ppvz < 4500)  return;
01837     //Not decay pipe
01838 
01839     event.rw *= ShiftAsValue(NuSyst::kScraping);
01840 
01841     return;
01842 }

void NuSystematic::SetCCSelector ( NuCut input  )  [virtual]
void NuSystematic::SetNCSelector ( NuCut input  )  [virtual]

Definition at line 780 of file NuSystematic.cxx.

References fNCSelector, Msg::kInfo, MSG, and NuCut::PrintSummary().

Referenced by DataStabilityAnalysisClass::DataStabilityAnalysisClass(), FoverNHistos::FoverNHistos(), NuDSTAna::MMRereco(), NuDSTAna::MMTransSME(), and FitTree::SetSystematics().

00781 {
00782   fNCSelector = input;
00783   MSG("NuSystematic",Msg::kInfo) << "Setting the NC selector" << endl;
00784   fNCSelector->PrintSummary();
00785 }

void NuSystematic::SetNeugenDefaults ( Registry registry  )  const [private, virtual]

Definition at line 2166 of file NuSystematic.cxx.

References fkno_r112Default, fkno_r113Default, fkno_r122Default, fkno_r123Default, fkno_r132Default, fkno_r133Default, fkno_r142Default, fkno_r143Default, fma_qeDefault, fma_resDefault, and Registry::Set().

Referenced by NeugenXSecShift().

02167 {
02168   registry.Set("neugen:kno_r112",fkno_r112Default);
02169   registry.Set("neugen:kno_r122",fkno_r122Default);
02170   registry.Set("neugen:kno_r132",fkno_r132Default);
02171   registry.Set("neugen:kno_r142",fkno_r142Default);
02172   registry.Set("neugen:kno_r113",fkno_r113Default);
02173   registry.Set("neugen:kno_r123",fkno_r123Default);
02174   registry.Set("neugen:kno_r133",fkno_r133Default);
02175   registry.Set("neugen:kno_r143",fkno_r143Default);
02176   registry.Set("neugen:ma_qe",fma_qeDefault);
02177   registry.Set("neugen:ma_res",fma_resDefault);
02178   return;
02179 }

void NuSystematic::SetNuBarSelector ( NuCut input  )  [virtual]
void NuSystematic::SetRockSelector ( NuCut input  )  [virtual]

Definition at line 796 of file NuSystematic.cxx.

References fRockSelector, Msg::kInfo, MSG, and NuCut::PrintSummary().

00797 {
00798   fRockSelector = input;
00799   MSG("NuSystematic",Msg::kInfo) << "Setting the Rock selector" << endl;
00800   fRockSelector->PrintSummary();
00801 }

void NuSystematic::SetShiftedNeugenParameters ( neugen_config config,
const NuEvent  event 
) const [private, virtual]

Definition at line 2270 of file NuSystematic.cxx.

References e_vbn, e_vbp, e_vn, e_vp, NuEvent::inu, NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecMaQE, NuSyst::kCombinedXSecMaRes, KNO112Default(), KNO113Default(), KNO122Default(), KNO123Default(), KNO132Default(), KNO133Default(), KNO142Default(), KNO143Default(), KNO212Default(), KNO213Default(), KNO222Default(), KNO223Default(), KNO232Default(), KNO233Default(), KNO242Default(), KNO243Default(), NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, MA_QEDefault(), MA_ResDefault(), neugen_config::set_dis_res(), neugen_config::set_ma_qe(), neugen_config::set_ma_res(), and ShiftAsValue().

02271 {
02272   Float_t ma_qe = this->MA_QEDefault();
02273   Float_t ma_res = this->MA_ResDefault();
02274 
02275   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
02276   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
02277   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecMaQE);
02278   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecMaRes);
02279 
02280   if (event.inu<0) {
02281     ma_qe *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
02282     ma_res *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
02283   }
02284 
02285   config.set_ma_qe(ma_qe);
02286   config.set_ma_res(ma_res);
02287 
02288   Float_t kno112 = this->KNO112Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02289   if (kno112<0.0){kno112=0.0;}
02290   if (kno112>1.0){kno112=1.0;}
02291   Float_t kno122 = this->KNO122Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02292   if (kno122<0.0){kno122=0.0;}
02293   if (kno122>1.0){kno122=1.0;}
02294   Float_t kno132 = this->KNO132Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02295   if (event.inu<0) kno132 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
02296   if (kno132<0.0){kno132=0.0;}
02297   if (kno132>1.0){kno132=1.0;}
02298   Float_t kno142 = this->KNO142Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02299   if (event.inu<0) kno142 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
02300   if (kno142<0.0){kno142=0.0;}
02301   if (kno142>1.0){kno142=1.0;}
02302   Float_t kno212 = this->KNO212Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02303   if (kno212<0.0){kno212=0.0;}
02304   if (kno212>1.0){kno212=1.0;}
02305   Float_t kno222 = this->KNO222Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02306   if (kno222<0.0){kno222=0.0;}
02307   if (kno222>1.0){kno222=1.0;}
02308   Float_t kno232 = this->KNO232Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02309   if (kno232<0.0){kno232=0.0;}
02310   if (kno232>1.0){kno232=1.0;}
02311   Float_t kno242 = this->KNO242Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02312   if (kno242<0.0){kno242=0.0;}
02313   if (kno242>1.0){kno242=1.0;}
02314   config.set_dis_res(1,2,e_vp,kno112);
02315   config.set_dis_res(1,2,e_vn,kno122);
02316   config.set_dis_res(1,2,e_vbp,kno132);
02317   config.set_dis_res(1,2,e_vbn,kno142);
02318   config.set_dis_res(2,2,e_vp,kno212);
02319   config.set_dis_res(2,2,e_vn,kno222);
02320   config.set_dis_res(2,2,e_vbp,kno232);
02321   config.set_dis_res(2,2,e_vbn,kno242);
02322 
02323   Float_t kno113 = this->KNO113Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02324   if (kno113<0.0){kno113=0.0;}
02325   if (kno113>1.0){kno113=1.0;}
02326   Float_t kno123 = this->KNO123Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02327   if (kno123<0.0){kno123=0.0;}
02328   if (kno123>1.0){kno123=1.0;}
02329   Float_t kno133 = this->KNO133Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02330   if (kno133<0.0){kno133=0.0;}
02331   if (kno133>1.0){kno133=1.0;}
02332   Float_t kno143 = this->KNO143Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02333   if (kno143<0.0){kno143=0.0;}
02334   if (kno143>1.0){kno143=1.0;}
02335   Float_t kno213 = this->KNO213Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02336   if (kno213<0.0){kno213=0.0;}
02337   if (kno213>1.0){kno213=1.0;}
02338   Float_t kno223 = this->KNO223Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02339   if (kno223<0.0){kno223=0.0;}
02340   if (kno223>1.0){kno223=1.0;}
02341   Float_t kno233 = this->KNO233Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02342   if (kno233<0.0){kno233=0.0;}
02343   if (kno233>1.0){kno233=1.0;}
02344   Float_t kno243 = this->KNO243Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02345   if (kno243<0.0){kno243=0.0;}
02346   if (kno243>1.0){kno243=1.0;}
02347   config.set_dis_res(1,3,e_vp,kno113);
02348   config.set_dis_res(1,3,e_vn,kno123);
02349   config.set_dis_res(1,3,e_vbp,kno133);
02350   config.set_dis_res(1,3,e_vbn,kno143);
02351   config.set_dis_res(2,3,e_vp,kno213);
02352   config.set_dis_res(2,3,e_vn,kno223);
02353   config.set_dis_res(2,3,e_vbp,kno233);
02354   config.set_dis_res(2,3,e_vbn,kno243);
02355 }

void NuSystematic::SetShiftedNeugenParameters ( Registry registry,
const NuEvent  event 
) const [private, virtual]

Definition at line 2182 of file NuSystematic.cxx.

References NuEvent::inu, NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecMaQE, NuSyst::kCombinedXSecMaRes, KNO112Default(), KNO113Default(), KNO122Default(), KNO123Default(), KNO132Default(), KNO133Default(), KNO142Default(), KNO143Default(), KNO212Default(), KNO213Default(), KNO222Default(), KNO223Default(), KNO232Default(), KNO233Default(), KNO242Default(), KNO243Default(), NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, MA_QEDefault(), MA_ResDefault(), Registry::Set(), and ShiftAsValue().

Referenced by NeugenXSecShift().

02183 {
02184   Float_t ma_qe = this->MA_QEDefault();
02185   Float_t ma_res = this->MA_ResDefault();
02186 
02187   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
02188   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
02189   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecMaQE);
02190   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecMaRes);
02191 
02192   if (event.inu<0) {
02193     ma_qe *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
02194     ma_res *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
02195   }
02196 
02197   registry.Set("neugen:ma_qe",ma_qe);
02198   registry.Set("neugen:ma_res",ma_res);
02199 
02200   Float_t kno112 = this->KNO112Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02201   if (kno112<0.0){kno112=0.0;}
02202   if (kno112>1.0){kno112=1.0;}
02203   Float_t kno122 = this->KNO122Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02204   if (kno122<0.0){kno122=0.0;}
02205   if (kno122>1.0){kno122=1.0;}
02206   Float_t kno132 = this->KNO132Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02207   if (event.inu<0) kno132 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
02208   if (kno132<0.0){kno132=0.0;}
02209   if (kno132>1.0){kno132=1.0;}
02210   Float_t kno142 = this->KNO142Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02211   if (event.inu<0) kno142 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
02212   if (kno142<0.0){kno142=0.0;}
02213   if (kno142>1.0){kno142=1.0;}
02214   Float_t kno212 = this->KNO212Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02215   if (kno212<0.0){kno212=0.0;}
02216   if (kno212>1.0){kno212=1.0;}
02217   Float_t kno222 = this->KNO222Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02218   if (kno222<0.0){kno222=0.0;}
02219   if (kno222>1.0){kno222=1.0;}
02220   Float_t kno232 = this->KNO232Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02221   if (kno232<0.0){kno232=0.0;}
02222   if (kno232>1.0){kno232=1.0;}
02223   Float_t kno242 = this->KNO242Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
02224   if (kno242<0.0){kno242=0.0;}
02225   if (kno242>1.0){kno242=1.0;}
02226   registry.Set("neugen:kno_r112",kno112);
02227   registry.Set("neugen:kno_r122",kno122);
02228   registry.Set("neugen:kno_r132",kno132);
02229   registry.Set("neugen:kno_r142",kno142);
02230   registry.Set("neugen:kno_r212",kno212);
02231   registry.Set("neugen:kno_r222",kno222);
02232   registry.Set("neugen:kno_r232",kno232);
02233   registry.Set("neugen:kno_r242",kno242);
02234 
02235   Float_t kno113 = this->KNO113Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02236   if (kno113<0.0){kno113=0.0;}
02237   if (kno113>1.0){kno113=1.0;}
02238   Float_t kno123 = this->KNO123Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02239   if (kno123<0.0){kno123=0.0;}
02240   if (kno123>1.0){kno123=1.0;}
02241   Float_t kno133 = this->KNO133Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02242   if (kno133<0.0){kno133=0.0;}
02243   if (kno133>1.0){kno133=1.0;}
02244   Float_t kno143 = this->KNO143Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02245   if (kno143<0.0){kno143=0.0;}
02246   if (kno143>1.0){kno143=1.0;}
02247   Float_t kno213 = this->KNO213Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02248   if (kno213<0.0){kno213=0.0;}
02249   if (kno213>1.0){kno213=1.0;}
02250   Float_t kno223 = this->KNO223Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02251   if (kno223<0.0){kno223=0.0;}
02252   if (kno223>1.0){kno223=1.0;}
02253   Float_t kno233 = this->KNO233Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02254   if (kno233<0.0){kno233=0.0;}
02255   if (kno233>1.0){kno233=1.0;}
02256   Float_t kno243 = this->KNO243Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
02257   if (kno243<0.0){kno243=0.0;}
02258   if (kno243>1.0){kno243=1.0;}
02259   registry.Set("neugen:kno_r113",kno113);
02260   registry.Set("neugen:kno_r123",kno123);
02261   registry.Set("neugen:kno_r133",kno133);
02262   registry.Set("neugen:kno_r143",kno143);
02263   registry.Set("neugen:kno_r213",kno213);
02264   registry.Set("neugen:kno_r223",kno223);
02265   registry.Set("neugen:kno_r233",kno233);
02266   registry.Set("neugen:kno_r243",kno243);
02267 }

void NuSystematic::SetShiftsAsSigmas ( map< TString, double >  input  )  [virtual]

Definition at line 559 of file NuSystematic.cxx.

References currentSigma, it, Msg::kInfo, MAXMSG, and SystFromName().

00560 {
00561   cout << "Calling SetShifts" << endl;
00562   map<TString, double>::const_iterator it;
00563   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size()
00564   << " systematic shifts." << endl;
00565 
00566   for (it = input.begin(); it != input.end(); ++it) {
00567     NuSyst::NuSystematic_t fSys = SystFromName(it->first);
00568     currentSigma[fSys] = it->second;
00569   }
00570 }

void NuSystematic::SetShiftsAsSigmas ( map< NuSyst::NuSystematic_t, double >  input  )  [virtual]

Definition at line 546 of file NuSystematic.cxx.

References currentSigma, it, Msg::kInfo, and MAXMSG.

Referenced by FitTree::SetSystematics(), and NuDSTAna::TestNuSyst().

00547 {
00548   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00549   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size()
00550   << " systematic shifts." << endl;
00551 
00552   for (it = input.begin(); it != input.end(); ++it) {
00553     currentSigma[it->first] = it->second;
00554   }
00555 }

void NuSystematic::SetShiftsAsValues ( map< TString, double >  input  )  [virtual]

Definition at line 532 of file NuSystematic.cxx.

References ConvertValueToSigma(), currentSigma, it, Msg::kInfo, MAXMSG, and SystFromName().

00533 {
00534   cout << "Calling SetShifts" << endl;
00535   map<TString, double>::const_iterator it;
00536   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size()
00537   << " systematic shifts." << endl;
00538 
00539   for (it = input.begin(); it != input.end(); ++it) {
00540     NuSyst::NuSystematic_t fSys = SystFromName(it->first);
00541     currentSigma[fSys] = ConvertValueToSigma(it->second, fSys);
00542   }
00543 }

void NuSystematic::SetShiftsAsValues ( map< NuSyst::NuSystematic_t, double >  input  )  [virtual]

Definition at line 519 of file NuSystematic.cxx.

References ConvertValueToSigma(), currentSigma, it, Msg::kInfo, and MAXMSG.

Referenced by NuDSTAna::TestNuSyst().

00520 {
00521   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00522   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size()
00523   << " systematic shifts." << endl;
00524 
00525   for (it = input.begin(); it != input.end(); ++it) {
00526     currentSigma[it->first] = ConvertValueToSigma(it->second, it->first);
00527   }
00528 }

void NuSystematic::SetSigmas ( map< TString, double >  input  )  [virtual]

Definition at line 588 of file NuSystematic.cxx.

References currentSigma, it, Msg::kInfo, MSG, and SystFromName().

00589 {
00590   map<TString, double>::const_iterator it;
00591 
00592   for (it = input.begin(); it != input.end(); ++it) {
00593     MSG("NuSystematic",Msg::kInfo) << "Setting " << it->first
00594     << " 1 sigma to " << it->second << endl;
00595     NuSyst::NuSystematic_t fSys = SystFromName(it->first);
00596     currentSigma[fSys] = it->second;
00597   }
00598 }

void NuSystematic::SetSigmas ( map< NuSyst::NuSystematic_t, double >  input  )  [virtual]

Definition at line 574 of file NuSystematic.cxx.

References it, Msg::kInfo, MSG, oneSigma, and SystNames().

00575 {
00576   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00577 
00578   for (it = input.begin(); it != input.end(); ++it) {
00579     MSG("NuSystematic",Msg::kInfo) << "Setting " << SystNames(it->first)
00580     << " 1 sigma to " << it->second << endl;
00581     oneSigma[it->first] = it->second;
00582   }
00583 
00584 }

void NuSystematic::Shift ( NuEvent event  )  const [virtual]

Definition at line 812 of file NuSystematic.cxx.

References AbsoluteHadronicCalibrationSterile(), AcceptanceShift(), AllBackgroundsScaleBothShift(), BeamShift(), BFieldShift(), CCBackgroundShift(), CCBackgroundShiftSterile(), CCWSBackground(), CurrentSigma(), EnergyResolutionEvent(), EnergyResolutionShower(), EnergyResolutionTrackCurve(), EnergyResolutionTrackRange(), FDCleaningCosmicsShift(), FDCleaningCosmicsShiftSterile(), FDCleaningShift(), FDCleaningShiftSterile(), HornCurrentShift(), JitterVDPIDShift(), NuSyst::kAbsoluteHadronicCalibrationSterile, NuSyst::kAcceptance, NuSyst::kAllBackgroundsScaleBoth, NuSyst::kBeam, NuSyst::kBFieldBoth, NuSyst::kBFieldFar, NuSyst::kBFieldNear, NuSyst::kCCBackground, NuSyst::kCCBackgroundSterile, NuSyst::kCCWSBackground, NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecMaQE, NuSyst::kCombinedXSecMaRes, NuSyst::kCombinedXSecOverall, NuSyst::kEnergyResolutionEventBoth, NuSyst::kEnergyResolutionEventNear, NuSyst::kEnergyResolutionShowerBoth, NuSyst::kEnergyResolutionShowerNear, NuSyst::kEnergyResolutionTrackCurveBoth, NuSyst::kEnergyResolutionTrackCurveNear, NuSyst::kEnergyResolutionTrackRangeBoth, NuSyst::kEnergyResolutionTrackRangeNear, NuSyst::kFDCleaning, NuSyst::kFDCleaningCosmics, NuSyst::kFDCleaningCosmicsSterile, NuSyst::kFDCleaningSterile, NuSyst::kHornCurrent, NuSyst::kJitterVDPID, NuSyst::kNCBackground, NuSyst::kNCNuBarBackground, NuSyst::kNDCleaning, NuSyst::kNDCleaningSterile, NuSyst::kNDCoilHole, NuSyst::kNormalisationBoth, NuSyst::kNormalisationFar, NuSyst::kNormalisationNC, NuSyst::kNormalisationNear, NuSyst::kNormalisationSterile, NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, NuSyst::kNuMuBarXSecOverall, NuSyst::kNuMuBarXSecQEL, NuSyst::kNuMuBarXSecRes, NuSyst::kNuMuBarXSecSum, NuSyst::kRelativeHadronicCalibrationSterile, NuSyst::kRockSelection, NuSyst::kRockXSec, NuSyst::kRockZA, NuSyst::kScraping, NuSyst::kShowerEnergyFunction, NuSyst::kShowerEnergyOffset, NuSyst::kShowerEnergyScale, NuSyst::kShowerEnergyScaleFar, NuSyst::kShowerEnergyScaleNear, NuSyst::kShowerEnergyScaleRelative, NuSyst::kTargetHole, NuSyst::kTauQELRes, NuSyst::kTrackEnergyCurvatureBoth, NuSyst::kTrackEnergyCurvatureFar, NuSyst::kTrackEnergyNeutrinoQE, NuSyst::kTrackEnergyOffset, NuSyst::kTrackEnergyOverall, NuSyst::kTrackEnergyRange, NuSyst::kTrackEnergyScale, NuSyst::kWSNuBarBackground, NCBackgroundShift(), NCNuBarBackgroundShift(), NDCleaningShift(), NDCleaningShiftSterile(), NDCoilHole(), NeugenXSecShift(), NormalisationShift(), NormalisationShiftSterile(), NuMuBarQELXSecShift(), NuMuBarResXSecShift(), NuMuBarSumXSecShift(), OverallXSecShift(), RelativeHadronicCalibrationSterile(), RockSelectionShift(), RockXSecShift(), RockZAShift(), ScrapingShift(), ShowerEnergyFunction(), ShowerEnergyOffset(), ShowerEnergyScale(), TargetHoleShift(), TauQELResShift(), TrackEnergyNeutrinoQE(), TrackEnergyOffset(), TrackEnergyOverall(), TrackEnergyScale(), and WSNuBarBackgroundShift().

Referenced by NuTransSME::DoSystematicShifts(), NuTransition::DoSystematicShifts(), NuDSTAna::DoSystematicShifts(), NuFluctuator::MakeShiftedCPTPDFs(), NuFluctuator::MakeShiftedTransitionPDFs(), NuDSTAna::MMRereco(), FoverNHistos::PrepareCCEventForPlotting(), TemplateAnalysisClass::PrepareEventForPlotting(), DataMCPlots::PrepareEventForPlotting(), DataStabilityAnalysisClass::PrepareEventForPlotting(), FoverNHistos::PrepareNCEventForPlotting(), NuDSTAna::StdNMBAna(), and NuDSTAna::TestNuSyst().

00813 {
00814   if (CurrentSigma(NuSyst::kScraping))   this->ScrapingShift(event);
00815   if (CurrentSigma(NuSyst::kTargetHole)) this->TargetHoleShift(event);
00816   if (CurrentSigma(NuSyst::kShowerEnergyOffset)) this->ShowerEnergyOffset(event);
00817   if (CurrentSigma(NuSyst::kShowerEnergyFunction)) this->ShowerEnergyFunction(event);
00818   if (CurrentSigma(NuSyst::kShowerEnergyScale) ||
00819       CurrentSigma(NuSyst::kShowerEnergyScaleNear) ||
00820       CurrentSigma(NuSyst::kShowerEnergyScaleFar) ||
00821       CurrentSigma(NuSyst::kShowerEnergyScaleRelative) ) this->ShowerEnergyScale(event);
00822   if (CurrentSigma(NuSyst::kTrackEnergyRange) ||
00823       CurrentSigma(NuSyst::kTrackEnergyScale) ||
00824       CurrentSigma(NuSyst::kTrackEnergyCurvatureBoth) ||
00825       CurrentSigma(NuSyst::kTrackEnergyCurvatureFar) ) this->TrackEnergyScale(event);
00826 
00827   if (CurrentSigma(NuSyst::kTrackEnergyOffset)) this->TrackEnergyOffset(event);
00828   if (CurrentSigma(NuSyst::kTrackEnergyOverall)) this->TrackEnergyOverall(event);
00829   if (CurrentSigma(NuSyst::kTrackEnergyNeutrinoQE)) this->TrackEnergyNeutrinoQE(event);
00830   if (CurrentSigma(NuSyst::kNDCoilHole)) this->NDCoilHole(event);
00831   if (CurrentSigma(NuSyst::kBeam)) this->BeamShift(event);
00832   if (CurrentSigma(NuSyst::kAcceptance)) this->AcceptanceShift(event);
00833   if (CurrentSigma(NuSyst::kHornCurrent)) this->HornCurrentShift(event);
00834   
00835   if (CurrentSigma(NuSyst::kBFieldBoth) ||
00836       CurrentSigma(NuSyst::kBFieldNear) ||
00837       CurrentSigma(NuSyst::kBFieldFar) ) this->BFieldShift(event);
00838   if (CurrentSigma(NuSyst::kAllBackgroundsScaleBoth)) this->AllBackgroundsScaleBothShift(event);
00839   if (CurrentSigma(NuSyst::kNCBackground)) this->NCBackgroundShift(event);
00840   if (CurrentSigma(NuSyst::kNCNuBarBackground)) this->NCNuBarBackgroundShift(event);
00841   if (CurrentSigma(NuSyst::kWSNuBarBackground)) this->WSNuBarBackgroundShift(event);
00842   if (CurrentSigma(NuSyst::kCCBackground)) this->CCBackgroundShift(event);
00843   if (CurrentSigma(NuSyst::kNDCleaning)) this->NDCleaningShift(event);
00844   if (CurrentSigma(NuSyst::kFDCleaning)) this->FDCleaningShift(event);
00845   if (CurrentSigma(NuSyst::kFDCleaningCosmics)) this->FDCleaningCosmicsShift(event);
00846   if (CurrentSigma(NuSyst::kNormalisationBoth) ||
00847       CurrentSigma(NuSyst::kNormalisationNear) ||
00848       CurrentSigma(NuSyst::kNormalisationFar) ||
00849       CurrentSigma(NuSyst::kNormalisationNC)) this->NormalisationShift(event);
00850   if (CurrentSigma(NuSyst::kNuMuBarXSecSum)) this->NuMuBarSumXSecShift(event);
00851   if (CurrentSigma(NuSyst::kCombinedXSecOverall) ||
00852       CurrentSigma(NuSyst::kNuMuBarXSecOverall)) this->OverallXSecShift(event);
00853   if (CurrentSigma(NuSyst::kNuMuBarXSecQEL)) this->NuMuBarQELXSecShift(event);
00854   if (CurrentSigma(NuSyst::kNuMuBarXSecRes)) this->NuMuBarResXSecShift(event);
00855   if (CurrentSigma(NuSyst::kCombinedXSecCCMA) ||
00856       CurrentSigma(NuSyst::kCombinedXSecMaRes) ||
00857       CurrentSigma(NuSyst::kCombinedXSecMaQE) ||
00858       CurrentSigma(NuSyst::kCombinedXSecDISMultip2) ||
00859       CurrentSigma(NuSyst::kCombinedXSecDISMultip3) ||
00860       CurrentSigma(NuSyst::kNuMuBarXSecCCMA) ||
00861       CurrentSigma(NuSyst::kNuMuBarXSecDISMultip2)) this->NeugenXSecShift(event);
00862   if (CurrentSigma(NuSyst::kRockXSec)) this->RockXSecShift(event);
00863   if (CurrentSigma(NuSyst::kRockZA)) this->RockZAShift(event);
00864   if (CurrentSigma(NuSyst::kRockSelection)) this->RockSelectionShift(event);
00865   if (CurrentSigma(NuSyst::kJitterVDPID)) this->JitterVDPIDShift(event);
00866   if (CurrentSigma(NuSyst::kTauQELRes)) this->TauQELResShift(event);
00867   if (CurrentSigma(NuSyst::kEnergyResolutionEventBoth) ||
00868       CurrentSigma(NuSyst::kEnergyResolutionEventNear)) this->EnergyResolutionEvent(event);
00869   if (CurrentSigma(NuSyst::kEnergyResolutionShowerBoth) ||
00870       CurrentSigma(NuSyst::kEnergyResolutionShowerNear)) this->EnergyResolutionShower(event);
00871   if (CurrentSigma(NuSyst::kEnergyResolutionTrackRangeBoth) ||
00872       CurrentSigma(NuSyst::kEnergyResolutionTrackRangeNear)) this->EnergyResolutionTrackRange(event);
00873   if (CurrentSigma(NuSyst::kEnergyResolutionTrackCurveBoth) ||
00874       CurrentSigma(NuSyst::kEnergyResolutionTrackCurveNear)) this->EnergyResolutionTrackCurve(event);
00875   if (CurrentSigma(NuSyst::kCCWSBackground)) this->CCWSBackground(event);
00876 
00877   //do separate functions if you want nc systematics --> A.Gavrilenko 4/13/2012
00878   if(CurrentSigma(NuSyst::kAbsoluteHadronicCalibrationSterile)) this->AbsoluteHadronicCalibrationSterile(event);
00879   if(CurrentSigma(NuSyst::kRelativeHadronicCalibrationSterile)) this->RelativeHadronicCalibrationSterile(event);
00880   if(CurrentSigma(NuSyst::kFDCleaningCosmicsSterile)) this->FDCleaningCosmicsShiftSterile(event);
00881   if(CurrentSigma(NuSyst::kFDCleaningSterile)) this->FDCleaningShiftSterile(event);
00882   if(CurrentSigma(NuSyst::kNDCleaningSterile)) this->NDCleaningShiftSterile(event);
00883   if(CurrentSigma(NuSyst::kCCBackgroundSterile)) this->CCBackgroundShiftSterile(event);
00884   if(CurrentSigma(NuSyst::kNormalisationSterile)) this->NormalisationShiftSterile(event);
00885 
00886 }

virtual Float_t NuSystematic::ShiftAsSigma ( NuSyst::NuSystematic_t  fSys  )  const [inline, virtual]
virtual Float_t NuSystematic::ShiftAsValue ( NuSyst::NuSystematic_t  fSys  )  const [inline, virtual]
void NuSystematic::ShowerEnergyFunction ( NuEvent event  )  const [virtual]

Definition at line 1885 of file NuSystematic.cxx.

References Msg::kInfo, NuSyst::kShowerEnergyFunction, MAXMSG, ShiftAsSigma(), and NuEvent::shwEn.

Referenced by FitTree::FillCCVector(), and Shift().

01886 {
01887 
01888 /*
01889   Double_t offset = 7.0;
01890   Double_t scale = 4.0;
01891   Double_t eLife = 1.5; //GeV
01892 
01893   if (NuCuts::kCC0720Std == event.anaVersion ||
01894       NuCuts::kRHC0150Std == event.anaVersion ||
01895       NuCuts::kRHC0350Std == event.anaVersion ||
01896       NuCuts::kNSI2011Fhc == event.anaVersion ||
01897       NuCuts::kNSI2011Rhc == event.anaVersion ||
01898       NuCuts::kRM2 == event.anaVersion ||
01899       NuCuts::kNMB0720RM == event.anaVersion ||
01900       NuCuts::kNMB0720Bravo == event.anaVersion ||
01901       NuCuts::kNMB0720Charlie == event.anaVersion){
01902     offset = 6.6;
01903     scale = 3.5;
01904     eLife = 1.44; //GeV
01905   }
01906 */
01907 
01908   Double_t offset = 6.6;
01909   Double_t scale = 3.5;
01910   Double_t eLife = 1.44; //GeV
01911 
01912   MAXMSG("NuSystematic",Msg::kInfo,1)
01913     << "Performing shower energy function scale "
01914     << ShiftAsSigma(NuSyst::kShowerEnergyFunction)
01915     << "s" << endl
01916     << "Function: (" << offset << "%) + ("
01917     << scale << "%) x exp(E_shw / " << eLife << " GeV)" << endl;
01918 
01919   Double_t enShift = 1.0 + this->ShiftAsSigma(NuSyst::kShowerEnergyFunction)*0.01*
01920     (offset + scale*TMath::Exp(-1.0*event.shwEn/eLife));
01921   event.shwEn *= enShift;
01922   event.energy = event.shwEn+event.trkEn;
01923   return;
01924 }

void NuSystematic::ShowerEnergyOffset ( NuEvent event  )  const [virtual]

Definition at line 1845 of file NuSystematic.cxx.

References Munits::GeV, Msg::kInfo, NuSyst::kShowerEnergyOffset, MAXMSG, Munits::MeV, and ShiftAsValue().

Referenced by Shift().

01846 {
01847     MAXMSG("NuSystematic",Msg::kInfo,1)
01848       << "Performing shower energy offset shift = " << ShiftAsValue(NuSyst::kShowerEnergyOffset)/Munits::MeV << " MeV" << endl;
01849   event.shwEn += ShiftAsValue(NuSyst::kShowerEnergyOffset)/Munits::GeV;
01850   event.energy = event.shwEn+event.trkEn;
01851   return;
01852 }

void NuSystematic::ShowerEnergyScale ( NuEvent event  )  const [virtual]

Definition at line 1927 of file NuSystematic.cxx.

References NuEvent::detector, Detector::kFar, Msg::kInfo, Detector::kNear, NuSyst::kShowerEnergyScale, NuSyst::kShowerEnergyScaleFar, NuSyst::kShowerEnergyScaleNear, NuSyst::kShowerEnergyScaleRelative, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01928 {
01929   MAXMSG("NuSystematic",Msg::kInfo,1)
01930       << "Performing shower energy scale with near = " << ShiftAsSigma(NuSyst::kShowerEnergyScaleNear)
01931       << "s, far = " << ShiftAsSigma(NuSyst::kShowerEnergyScaleFar)
01932       << "s, relative = " << ShiftAsSigma(NuSyst::kShowerEnergyScaleRelative)
01933       << "s, overall = " << ShiftAsSigma(NuSyst::kShowerEnergyScale) << "s" << endl;
01934 
01935   if (Detector::kNear==event.detector) {
01936     event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScaleNear);
01937     event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScaleRelative);
01938   }
01939   if (Detector::kFar==event.detector) {
01940     event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScaleFar);
01941   }
01942   event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScale);
01943   event.energy = event.shwEn+event.trkEn;
01944   return;
01945 }

NuSyst::NuSystematic_t NuSystematic::SystFromName ( TString  systName  )  const [virtual]

Definition at line 645 of file NuSystematic.cxx.

References it, Msg::kError, NuSyst::kUnknown, Msg::kWarning, MSG, and systNames.

Referenced by ReadXML(), SetShiftsAsSigmas(), SetShiftsAsValues(), and SetSigmas().

00646 {
00647   // First transform alternate names into cannonical ones
00648   TString origname = systName;
00649   if (systName.Contains("Scraping",TString::kIgnoreCase))
00650     systName = "DecayPipe";
00651   else if (systName.Contains("AbsoluteEnergyCalibration",TString::kIgnoreCase))
00652     systName = "ShowerEnergyScaleBoth";
00653   else if (systName.Contains("RelativeEnergyCalibrationNear",TString::kIgnoreCase))
00654     systName = "ShowerEnergyScaleNear";
00655   else if (systName.Contains("RelativeEnergyCalibrationFar",TString::kIgnoreCase))
00656     systName = "ShowerEnergyScaleFar";
00657   else if (systName.Contains("RelativeEnergyCalibration",TString::kIgnoreCase))
00658     systName = "ShowerEnergyScaleRelative";
00659   else if (systName.Contains("Beam",TString::kIgnoreCase) ||
00660            systName.Contains("SKZP",TString::kIgnoreCase) )
00661     systName = "Flux";
00662   else if (systName.Contains("Acceptance",TString::kIgnoreCase)) {
00663     //systName.ToLower();
00664     systName = "Acceptance";
00665   }
00666   else if (systName.Contains("HornCurrent",TString::kIgnoreCase)) {
00667     //systName.ToLower();
00668     systName = "HornCurrent";
00669   }
00670   else if (systName.Contains("Normalisation",TString::kIgnoreCase)) {
00671     systName.ToLower();
00672     systName.ReplaceAll("lization", "lisation");
00673   }
00674 
00675   if(origname.CompareTo(systName) != 0){
00676     MSG("NuSystematic",Msg::kWarning) << "I renamed your systematic from "
00677      << origname << " to " << systName << " because I think that's what you "
00678      "meant.  I hope that's ok\n";
00679   }
00680 
00681   map<NuSyst::NuSystematic_t, TString>::const_iterator it;
00682 
00683   for (it = systNames.begin(); it != systNames.end(); ++it) {
00684     if (0 == it->second.CompareTo(systName, TString::kIgnoreCase)) {
00685       return it->first;
00686     }
00687   }
00688 
00689   MSG("NuSystematic",Msg::kError) << "Cannot find systematic named " << systName << ", returning kUnknown." << endl;
00690   return NuSyst::kUnknown;
00691 }

Int_t NuSystematic::SystMode ( NuSyst::NuSystematic_t  syst  )  const [virtual]

Definition at line 721 of file NuSystematic.cxx.

References it, Msg::kError, MSG, and systMode.

Referenced by ConvertSigmaToValue(), and ConvertValueToSigma().

00722 {
00723   map<NuSyst::NuSystematic_t, Int_t>::const_iterator it;
00724   it = systMode.find(syst);
00725   if (it == systMode.end()) {
00726     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in systMode." << endl;
00727     assert(false);
00728   }
00729   return it->second;
00730 }

const TString NuSystematic::SystNames ( NuSyst::NuSystematic_t  syst  )  const [virtual]

Definition at line 734 of file NuSystematic.cxx.

References it, Msg::kError, MSG, and systNames.

Referenced by NameFromSyst(), PrintState(), and SetSigmas().

00735 {
00736   map<NuSyst::NuSystematic_t, TString>::const_iterator it;
00737   it = systNames.find(syst);
00738   if (it == systNames.end()) {
00739     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in systNames." << endl;
00740     assert(false);
00741   }
00742   return it->second;
00743 }

void NuSystematic::TargetHoleShift ( NuEvent event  )  const [virtual]

Definition at line 1791 of file NuSystematic.cxx.

References Msg::kInfo, NuSyst::kTargetHole, MAXMSG, NuEvent::ppvz, and ShiftAsValue().

Referenced by Shift().

01792 {
01793   Double_t holeStart = 20.0;
01794   Double_t holeLength = ShiftAsValue(NuSyst::kTargetHole);
01795 
01796   MAXMSG("NuSystematic",Msg::kInfo,1)
01797     << "Performing target hole shift. Hole length: "
01798     << holeLength << " cm" << endl;
01799 
01800   if ((event.ppvz > holeStart) && (event.ppvz < holeStart+holeLength)){
01801     event.rw = 0;
01802   }
01803   return;
01804 }

void NuSystematic::TauQELResShift ( NuEvent event  )  const [virtual]

Definition at line 1165 of file NuSystematic.cxx.

References NuEvent::inu, Msg::kInfo, NuSyst::kTauQELRes, MAXMSG, and ShiftAsValue().

Referenced by Shift().

01166 {
01167   MAXMSG("NuSystematic",Msg::kInfo,1)
01168     << "Performing tau QEL+Res shift: "
01169     << (this->ShiftAsValue(NuSyst::kTauQELRes)-1.)*100. << "%." << endl;
01170 
01171   if (16 == TMath::Abs(event.inu) && 1 == event.iaction
01172       && (1001 == event.iresonance || 1002 == event.iresonance)){
01173     event.rw *= ShiftAsValue(NuSyst::kTauQELRes);
01174   }
01175   return;
01176 }

void NuSystematic::TFProbShift ( NuEvent event  )  const [virtual]

Definition at line 1041 of file NuSystematic.cxx.

References Msg::kInfo, NuSyst::kTFProb, MAXMSG, ShiftAsSigma(), and ShiftAsValue().

01042 {
01043   MAXMSG("NuSystematic",Msg::kInfo,1)
01044     << "Performing track fit probability shift = " << ShiftAsSigma(NuSyst::kTFProb) << "s" << endl;
01045   event.prob += ShiftAsValue(NuSyst::kTFProb);
01046   return;
01047 }

void NuSystematic::TrackEnergyNeutrinoQE ( NuEvent event  )  const [virtual]

Definition at line 1867 of file NuSystematic.cxx.

References NuEvent::charge, Munits::GeV, NuEvent::inu, NuEvent::iresonance, SimFlag::kData, Msg::kInfo, SimFlag::kMC, NuSyst::kTrackEnergyNeutrinoQE, MAXMSG, Munits::MeV, ShiftAsValue(), and NuEvent::simFlag.

Referenced by Shift().

01868 {
01869   MAXMSG("NuSystematic", Msg::kInfo, 1)
01870     << "Performing track energy neutrino QE offset shift = " << ShiftAsValue(NuSyst::kTrackEnergyNeutrinoQE)/Munits::MeV << " MeV" << endl;
01871   if (event.iresonance == 1001) {
01872     if (event.simFlag == SimFlag::kMC && event.inu == 14) {
01873       event.trkEn += ShiftAsValue(NuSyst::kTrackEnergyNeutrinoQE) / Munits::GeV;
01874       event.energy = event.shwEn + event.trkEn;
01875     } else if (event.simFlag == SimFlag::kData && event.charge == -1) {
01876       event.trkEn += ShiftAsValue(NuSyst::kTrackEnergyNeutrinoQE) / Munits::GeV;
01877       event.energy = event.shwEn + event.trkEn;
01878     }
01879   }
01880   return;
01881 }

void NuSystematic::TrackEnergyOffset ( NuEvent event  )  const [virtual]

Definition at line 1856 of file NuSystematic.cxx.

References Munits::GeV, Msg::kInfo, NuSyst::kTrackEnergyOffset, MAXMSG, Munits::MeV, and ShiftAsValue().

Referenced by Shift().

01857 {
01858   MAXMSG("NuSystematic",Msg::kInfo,1)
01859     << "Performing track energy offset shift = " << ShiftAsValue(NuSyst::kTrackEnergyOffset)/Munits::MeV << " MeV" << endl;
01860   event.trkEn += ShiftAsValue(NuSyst::kTrackEnergyOffset) / Munits::GeV;
01861   event.energy = event.shwEn + event.trkEn;
01862   return;
01863 }

void NuSystematic::TrackEnergyOverall ( NuEvent event  )  const [virtual]

Definition at line 1973 of file NuSystematic.cxx.

References Msg::kInfo, NuSyst::kTrackEnergyOverall, MAXMSG, ShiftAsSigma(), NuEvent::usedCurv, and NuEvent::usedRange.

Referenced by FitTree::FillCCVector(), and Shift().

01974 {
01975   MAXMSG("NuSystematic",Msg::kInfo,1)
01976   << "Performing overall track energy shift "
01977   << this->ShiftAsSigma(NuSyst::kTrackEnergyOverall) << " sigma\n";
01978 
01979   const Double_t rangeError = 0.02, // 2% error on range
01980                  curveError = 0.03; // 3% error on curvature
01981 
01982   Double_t mult = this->ShiftAsSigma(NuSyst::kTrackEnergyOverall);
01983 
01984   /* Shift range and curvature measurements in concert.  Really the
01985      curvature shift should be only *correlated* with the range shift.
01986      However, within the framework of this function, I can't see how
01987      that would matter unless someone down the line uses *both* range
01988      and curvature at the same time. */
01989   event.trkEnRange *= 1.0 + mult*rangeError;
01990   event.trkEnCurv  *= 1.0 + mult*curveError;
01991 
01992   /* Update the "best" track energy accordingly. If it used neither
01993      range nor curvature, either it has no track or something has gone
01994      horribly wrong.  In either case, do not modify trkEn. */
01995   if     (event.usedRange) event.trkEn = event.trkEnRange;
01996   else if(event.usedCurv ) event.trkEn = event.trkEnCurv;
01997 
01998   event.energy = event.shwEn + event.trkEn;
01999 }

void NuSystematic::TrackEnergyScale ( NuEvent event  )  const [virtual]

Definition at line 1948 of file NuSystematic.cxx.

References NuEvent::detector, Detector::kFar, Msg::kInfo, Detector::kNear, NuSyst::kShowerEnergyScale, NuSyst::kTrackEnergyCurvatureBoth, NuSyst::kTrackEnergyCurvatureFar, NuSyst::kTrackEnergyCurvatureNear, NuSyst::kTrackEnergyRange, NuSyst::kTrackEnergyScale, MAXMSG, ShiftAsSigma(), ShiftAsValue(), and NuEvent::usedRange.

Referenced by Shift().

01949 {
01950   MAXMSG("NuSystematic",Msg::kInfo,1)
01951   << "Performing track energy scale with range = " << ShiftAsSigma(NuSyst::kTrackEnergyRange)
01952   << "s, curve near = " << ShiftAsSigma(NuSyst::kTrackEnergyCurvatureNear)
01953   << "s, curve far = " << ShiftAsSigma(NuSyst::kTrackEnergyCurvatureFar)
01954   << "s, curve both = " << ShiftAsSigma(NuSyst::kTrackEnergyCurvatureBoth)
01955   << "s, scale = " << ShiftAsSigma(NuSyst::kShowerEnergyScale) << "s" << endl;
01956 
01957   if (event.usedRange){
01958     event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyRange);
01959   }
01960   else {
01961     event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyCurvatureBoth);
01962     if (Detector::kNear==event.detector)
01963       event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyCurvatureNear);
01964     if (Detector::kFar==event.detector)
01965       event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyCurvatureFar);
01966   }
01967   event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyScale);
01968   event.energy = event.shwEn+event.trkEn;
01969   return;
01970 }

void NuSystematic::WSNuBarBackgroundShift ( NuEvent event  )  const [virtual]

Definition at line 1467 of file NuSystematic.cxx.

References NuEvent::charge, fNuBarSelector, NuEvent::iaction, NuEvent::inu, Msg::kError, Msg::kInfo, NuSyst::kWSNuBarBackground, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01468 {
01469   if (!fNuBarSelector) {
01470     MSG("NuSystematic",Msg::kError) << "Cannot apply WSNuBarBackground without doing SetNuBarSelector()" << endl;
01471     assert(false);
01472   }
01473 
01474   MAXMSG("NuSystematic",Msg::kInfo,1)
01475   << "Performing Wrong Sign NuBar background shift " << ShiftAsSigma(NuSyst::kWSNuBarBackground) << "s" << endl;
01476 
01477   fNuBarSelector->MakeCuts(event);
01478   if (event.iaction == 1 && 1==event.charge &&
01479       14 == event.inu && fNuBarSelector->Passed() )
01480     event.rw *= ShiftAsValue(NuSyst::kWSNuBarBackground);
01481 }

Double_t NuSystematic::XSecShiftScale ( const Double_t  energy,
const NuParticle::NuParticleType_t  particle 
) const [virtual]

Definition at line 2366 of file NuSystematic.cxx.

References NuSyst::kCombinedXSecCCMA, NuSyst::kCombinedXSecDISMultip2, NuSyst::kCombinedXSecDISMultip3, NuSyst::kCombinedXSecOverall, NuParticle::kNuMu, NuParticle::kNuMuBar, NuSyst::kNuMuBarXSecCCMA, NuSyst::kNuMuBarXSecDISMultip2, NuSyst::kNuMuBarXSecOverall, NuSyst::kNuMuBarXSecQEL, NuSyst::kNuMuBarXSecRes, Msg::kWarning, and MSG.

Referenced by NuMatrixMethod::ShiftXSecGraph().

02368 {
02369   if (!(NuParticle::kNuMu == particle || NuParticle::kNuMuBar == particle)){
02370     MSG("NuSystematic",Msg::kWarning)
02371       << "I don't know how to systematically shift this particle"
02372       << endl;
02373     return 1.0;
02374   }
02375 
02376   if (CurrentSigma(NuSyst::kCombinedXSecOverall)){
02377     return this->ShiftAsValue(NuSyst::kCombinedXSecOverall);
02378   }
02379   else if (CurrentSigma(NuSyst::kNuMuBarXSecOverall)){
02380     if (NuParticle::kNuMuBar == particle){
02381       return this->ShiftAsValue(NuSyst::kNuMuBarXSecOverall);
02382     }
02383     else {
02384       return 1.0;
02385     }
02386   }
02387   else if (CurrentSigma(NuSyst::kNuMuBarXSecCCMA) ||
02388            CurrentSigma(NuSyst::kNuMuBarXSecDISMultip2)){
02389     if (NuParticle::kNuMuBar != particle){
02390       return 1.0;
02391     }
02392     else {return this->NeugenXSecShiftScale(energy,particle);}
02393   }
02394   else if(CurrentSigma(NuSyst::kCombinedXSecCCMA) ||
02395           CurrentSigma(NuSyst::kCombinedXSecDISMultip2) ||
02396           CurrentSigma(NuSyst::kCombinedXSecDISMultip3)){
02397     if (!(NuParticle::kNuMu == particle || NuParticle::kNuMuBar == particle)){
02398       return 1.0;
02399     }
02400     else if(CurrentSigma(NuSyst::kNuMuBarXSecQEL)){
02401       return this->QELXSecShiftScale(energy,particle);
02402     }
02403     else if (CurrentSigma(NuSyst::kNuMuBarXSecRes)){
02404       return this->ResXSecShiftScale(energy,particle);
02405     }
02406     else {return this->NeugenXSecShiftScale(energy,particle);}
02407   }
02408   else {return 1.0;}
02409 }


Member Data Documentation

Definition at line 353 of file NuSystematic.h.

Referenced by CCWSBackground(), NCBackgroundShift(), NuSystematic(), and SetCCSelector().

Bool_t NuSystematic::firstMCReweight = true [static, private]

Definition at line 387 of file NuSystematic.h.

Referenced by NeugenXSecShift().

Float_t NuSystematic::fkno_r112Default [private]

Definition at line 389 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO112Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r113Default [private]

Definition at line 393 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO113Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r122Default [private]

Definition at line 390 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO122Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r123Default [private]

Definition at line 394 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO123Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r132Default [private]

Definition at line 391 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO132Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r133Default [private]

Definition at line 395 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO133Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r142Default [private]

Definition at line 392 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO142Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r143Default [private]

Definition at line 396 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), KNO143Default(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r212Default [private]

Definition at line 397 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO212Default().

Float_t NuSystematic::fkno_r213Default [private]

Definition at line 401 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO213Default().

Float_t NuSystematic::fkno_r222Default [private]

Definition at line 398 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO222Default().

Float_t NuSystematic::fkno_r223Default [private]

Definition at line 402 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO223Default().

Float_t NuSystematic::fkno_r232Default [private]

Definition at line 399 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO232Default().

Float_t NuSystematic::fkno_r233Default [private]

Definition at line 403 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO233Default().

Float_t NuSystematic::fkno_r242Default [private]

Definition at line 400 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO242Default().

Float_t NuSystematic::fkno_r243Default [private]

Definition at line 404 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and KNO243Default().

Float_t NuSystematic::fma_qeDefault [private]

Definition at line 405 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), MA_QEDefault(), and SetNeugenDefaults().

Float_t NuSystematic::fma_resDefault [private]

Definition at line 406 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), MA_ResDefault(), and SetNeugenDefaults().

TRandom3* NuSystematic::fRandom [private]

Definition at line 358 of file NuSystematic.h.

Referenced by NuSystematic(), Randomize(), and ~NuSystematic().

Definition at line 356 of file NuSystematic.h.

Referenced by NuSystematic(), RockSelectionShift(), and SetRockSelector().

Int_t NuSystematic::kAsIs = 2 [static]

Definition at line 198 of file NuSystematic.h.

Referenced by ConvertSigmaToValue(), ConvertValueToSigma(), and InitializeSystematics().

Int_t NuSystematic::kMinusPlus = 1 [static]

Definition at line 197 of file NuSystematic.h.

Referenced by ConvertSigmaToValue(), ConvertValueToSigma(), and InitializeSystematics().

Int_t NuSystematic::kSigma = 3 [static]

Definition at line 199 of file NuSystematic.h.

Referenced by ConvertSigmaToValue(), ConvertValueToSigma(), and InitializeSystematics().

Definition at line 345 of file NuSystematic.h.

Referenced by ConfigureDefaultSystematics(), OneSigma(), ReadXML(), and SetSigmas().

Definition at line 349 of file NuSystematic.h.

Referenced by InitializeSystematics(), and SystMode().

Definition at line 351 of file NuSystematic.h.

Referenced by InitializeSystematics(), SystFromName(), and SystNames().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1