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

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 const 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 const Float_t ConvertSigmaToValue (const Float_t sigma, NuSyst::NuSystematic_t fSys) const
 !Changes contents of event!!
virtual const Float_t ConvertValueToSigma (const Float_t shift, NuSyst::NuSystematic_t fSys) const
virtual const Float_t ShiftAsValue (NuSyst::NuSystematic_t fSys) const
virtual const Float_t ShiftAsSigma (NuSyst::NuSystematic_t fSys) const
virtual void Randomize ()
virtual const Double_t XSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const

Static Public Member Functions

bool FluxSyst (const NuXMLConfig &xmlConfig)

Static Public Attributes

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

Private Member Functions

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 CCBackgroundShift (NuEvent &event) const
virtual void NDCleaningShift (NuEvent &event) const
virtual void NeugenXSecShift (NuEvent &event) const
virtual void NormalisationShift (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 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 TrackEnergyOverall (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 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 const Float_t MA_QEDefault () const
virtual const Float_t MA_ResDefault () const
virtual const Float_t KNO112Default () const
virtual const Float_t KNO122Default () const
virtual const Float_t KNO132Default () const
virtual const Float_t KNO142Default () const
virtual const Float_t KNO113Default () const
virtual const Float_t KNO123Default () const
virtual const Float_t KNO133Default () const
virtual const Float_t KNO143Default () const
virtual const Float_t KNO212Default () const
virtual const Float_t KNO222Default () const
virtual const Float_t KNO232Default () const
virtual const Float_t KNO242Default () const
virtual const Float_t KNO213Default () const
virtual const Float_t KNO223Default () const
virtual const Float_t KNO233Default () const
virtual const Float_t KNO243Default () const
virtual const Double_t NeugenXSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const
virtual const Double_t QELXSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const
virtual const Double_t ResXSecShiftScale (const Double_t energy, const NuParticle::NuParticleType_t particle) const
 ClassDef (NuSystematic, 7)

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

Bool_t firstMCReweight = true


Constructor & Destructor Documentation

NuSystematic::NuSystematic  )  [explicit]
 

Definition at line 325 of file NuSystematic.cxx.

References MSG.

00326 {
00327   MSG("NuSystematic.cxx",Msg::kInfo)
00328     << "Constructing default NuSystematic object" << endl;
00329 
00330   this->ConfigureDefaultSystematics();
00331   this->ConfigureNeugenDefaults();
00332   this->InitializeSystematics();
00333   this->EverythingOff();
00334   
00335   fCCSelector = 0;
00336   fNCSelector = 0;
00337   fNuBarSelector = 0;
00338   fRockSelector = 0;
00339   
00340   fRandom = new TRandom3(0);
00341   //fFluctuator = new NuFluctuator();
00342 }

NuSystematic::NuSystematic const NuXMLConfig xmlConfig  )  [explicit]
 

Definition at line 345 of file NuSystematic.cxx.

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

00346 {
00347   this->ConfigureDefaultSystematics();
00348   this->ConfigureNeugenDefaults();
00349   this->InitializeSystematics();
00350   this->EverythingOff();
00351   
00352   fCCSelector = 0;
00353   fNCSelector = 0;
00354   fNuBarSelector = 0;
00355   fRockSelector = 0;
00356   
00357   fRandom = new TRandom3(0);
00358   //fFluctuator = new NuFluctuator();
00359 
00360   this->ReadXML(xmlConfig);
00361 }

NuSystematic::~NuSystematic  )  [virtual]
 

Definition at line 364 of file NuSystematic.cxx.

References fCCSelector, fNCSelector, fNuBarSelector, fRandom, and fRockSelector.

00365 {
00366   //if (fFluctuator)    {delete fFluctuator;    fFluctuator = 0;}
00367   if (fRandom)        {delete fRandom;        fRandom = 0;}
00368   if (fCCSelector)    {delete fCCSelector;    fCCSelector = 0;}
00369   if (fNCSelector)    {delete fNCSelector;    fNCSelector = 0;}
00370   if (fNuBarSelector) {delete fNuBarSelector; fNuBarSelector = 0;}
00371   if (fRockSelector)  {delete fRockSelector;  fRockSelector = 0;}
00372 }


Member Function Documentation

void NuSystematic::AllBackgroundsScaleBothShift NuEvent event  )  const [private, virtual]
 

Definition at line 1237 of file NuSystematic.cxx.

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

Referenced by Shift().

01238 {
01239   if (!fNuBarSelector) {
01240     MSG("NuSystematic",Msg::kError) << "Cannot apply AllBackgroundsScaleBoth without doing SetNuBarSelector()" << endl;
01241     assert(false);
01242   }
01243   
01244   fNuBarSelector->MakeCuts(event);
01245   if (1==event.charge && fNuBarSelector->Passed()
01246       && (14 == event.inu || 0 == event.iaction)) {
01247 
01248     MAXMSG("NuSystematic",Msg::kInfo,1)
01249     << "Performing AllBackgroundsScaleBoth shift ="
01250     << ShiftAsSigma(NuSyst::kAllBackgroundsScaleBoth) << "s" << endl;
01251     
01252     event.rw *= ShiftAsValue(NuSyst::kAllBackgroundsScaleBoth);
01253   }
01254   return;
01255 }

void NuSystematic::BeamShift NuEvent event  )  const [private, virtual]
 

Definition at line 1061 of file NuSystematic.cxx.

References NuEvent::fluxErr, MAXMSG, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01062 {
01063   MAXMSG("NuSystematic",Msg::kInfo,1)
01064     << "Performing beam shift = " << ShiftAsSigma(NuSyst::kBeam) << "s" << endl;
01065   event.rw *= 1.0 + ShiftAsValue(NuSyst::kBeam) * (event.fluxErr-1.0);
01066   return;
01067 }

void NuSystematic::BFieldShift NuEvent event  )  const [private, virtual]
 

Definition at line 1258 of file NuSystematic.cxx.

References NuEvent::charge, NuEvent::detector, NuEvent::iaction, NuEvent::inu, MAXMSG, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01259 {
01260   MAXMSG("NuSystematic",Msg::kInfo,1)
01261     << "Performing BField shift both = " << ShiftAsSigma(NuSyst::kBFieldBoth) 
01262     << "s, near = " << ShiftAsSigma(NuSyst::kBFieldNear) 
01263     << "s, far = " << ShiftAsSigma(NuSyst::kBFieldFar) << endl;
01264   if (1==event.charge && 14 == event.inu && 1 == event.iaction){
01265     event.rw *= ShiftAsValue(NuSyst::kBFieldBoth);
01266     if (Detector::kNear==event.detector)
01267       event.rw *= ShiftAsValue(NuSyst::kBFieldNear);
01268     if (Detector::kFar==event.detector)
01269       event.rw *= ShiftAsValue(NuSyst::kBFieldFar);
01270   }
01271   return;
01272 }

void NuSystematic::CCBackgroundShift NuEvent event  )  const [private, virtual]
 

Definition at line 1291 of file NuSystematic.cxx.

References fNCSelector, NuEvent::iaction, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01292 {
01293   if (!fNCSelector) {
01294     MSG("NuSystematic",Msg::kError) << "Cannot apply CCBackground without doing SetNCSelector()" << endl;
01295     assert(false);
01296   }
01297   
01298   MAXMSG("NuSystematic",Msg::kInfo,1)
01299   << "Performing CC background shift " << ShiftAsSigma(NuSyst::kCCBackground) << "s" << endl;
01300   
01301   fNCSelector->MakeCuts(event);
01302   if (1 == event.iaction && fNCSelector->Passed()) 
01303     event.rw *= ShiftAsValue(NuSyst::kCCBackground);
01304 }

NuSystematic::ClassDef NuSystematic  ,
[private]
 

void NuSystematic::ConfigureDefaultSystematics  )  [virtual]
 

Definition at line 381 of file NuSystematic.cxx.

References oneSigma.

Referenced by NuSystematic().

00382 {
00383   oneSigma[NuSyst::kShowerEnergyOffset] = 100*Munits::MeV;
00384   oneSigma[NuSyst::kShowerEnergyScale] = 1.10;
00385   oneSigma[NuSyst::kShowerEnergyFunction] = 1.0;
00386   oneSigma[NuSyst::kShowerEnergyScaleFar] = 1.023;
00387   oneSigma[NuSyst::kShowerEnergyScaleNear] = 1.031;
00388   oneSigma[NuSyst::kShowerEnergyScaleRelative] = 1.039;
00389   
00390   oneSigma[NuSyst::kTrackEnergyCurvatureBoth] = 1.03;
00391   oneSigma[NuSyst::kTrackEnergyCurvatureFar] = 1.03;
00392   oneSigma[NuSyst::kTrackEnergyCurvatureNear] = 1.03;
00393   oneSigma[NuSyst::kTrackEnergyRange] = 1.02;
00394   oneSigma[NuSyst::kTrackEnergyScale] = 1.02;
00395   oneSigma[NuSyst::kTrackEnergyOverall] = -999;
00396   
00397   oneSigma[NuSyst::kBFieldBoth] = 2.0;
00398   oneSigma[NuSyst::kBFieldNear] = 2.0;
00399   oneSigma[NuSyst::kBFieldFar] = 2.0;  
00400   oneSigma[NuSyst::kAlignment] = -999;  
00401   oneSigma[NuSyst::kBeam] = 1.0;
00402   
00403   oneSigma[NuSyst::kCombinedXSecOverall] = 1.035;
00404   oneSigma[NuSyst::kCombinedXSecCCMA] = 1.15;
00405   oneSigma[NuSyst::kCombinedXSecMaRes] = 1.15;
00406   oneSigma[NuSyst::kCombinedXSecMaQE] = 1.15;
00407   oneSigma[NuSyst::kCombinedXSecDISMultip2] = 0.1;
00408   oneSigma[NuSyst::kCombinedXSecDISMultip3] = 0.2;
00409   
00410   oneSigma[NuSyst::kNuMuBarXSecSum] = 1.0;
00411   oneSigma[NuSyst::kNuMuBarXSecOverall] = 1.04;
00412   oneSigma[NuSyst::kNuMuBarXSecCCMA] = 1.08;
00413   oneSigma[NuSyst::kNuMuBarXSecDISMultip2] = 0.2;  
00414   oneSigma[NuSyst::kNuMuBarXSecQEL] = 1.08;
00415   oneSigma[NuSyst::kNuMuBarXSecRes] = 1.08;
00416   
00417   oneSigma[NuSyst::kNormalisationBoth] = 1.04;
00418   oneSigma[NuSyst::kNormalisationNear] = 1.04;
00419   oneSigma[NuSyst::kNormalisationFar] = 1.04;
00420   oneSigma[NuSyst::kNCBackground] = 1.50;
00421   oneSigma[NuSyst::kCCBackground] = 1.15;  // Value used in the NC analysis
00422   oneSigma[NuSyst::kNDCleaning] = 1.0;
00423   oneSigma[NuSyst::kAllBackgroundsScaleBoth] = 1.5;//50% scale
00424   oneSigma[NuSyst::kScraping] = 1.37;
00425   
00426   oneSigma[NuSyst::kJitterVDPID] = -999;
00427   oneSigma[NuSyst::kJitter]= 0.01;
00428   oneSigma[NuSyst::kDPID] = 0.03;  
00429   oneSigma[NuSyst::kTFProb] = 0.005;//Complete guess.
00430   oneSigma[NuSyst::kTargetHole] = 4.0;//cm: length of the hole
00431   oneSigma[NuSyst::kTauQELRes] = 1.15;//15% scale
00432   
00433   oneSigma[NuSyst::kEnergyResolutionEventBoth] = 1.1;
00434   oneSigma[NuSyst::kEnergyResolutionEventNear] = 1.1;
00435   oneSigma[NuSyst::kEnergyResolutionShowerBoth] = 1.1;
00436   oneSigma[NuSyst::kEnergyResolutionShowerNear] = 1.1;
00437   oneSigma[NuSyst::kEnergyResolutionTrackRangeBoth] = 1.1;
00438   oneSigma[NuSyst::kEnergyResolutionTrackRangeNear] = 1.1;
00439   oneSigma[NuSyst::kEnergyResolutionTrackCurveBoth] = 1.1;
00440   oneSigma[NuSyst::kEnergyResolutionTrackCurveNear] = 1.1;
00441 }

void NuSystematic::ConfigureNeugenDefaults  )  [virtual]
 

Definition at line 631 of file NuSystematic.cxx.

References fkno_r112Default, fkno_r113Default, fkno_r122Default, fkno_r123Default, fkno_r132Default, fkno_r133Default, fkno_r142Default, fkno_r143Default, fkno_r212Default, fkno_r213Default, fkno_r222Default, fkno_r223Default, fkno_r232Default, fkno_r233Default, fkno_r242Default, fkno_r243Default, fma_qeDefault, and fma_resDefault.

Referenced by NuSystematic().

00632 {
00633   fkno_r112Default = 0.1;
00634   fkno_r122Default = 0.3;
00635   fkno_r132Default = 0.3;
00636   fkno_r142Default = 0.1;
00637   fkno_r113Default = 1.0;
00638   fkno_r123Default = 1.0;
00639   fkno_r133Default = 1.0;
00640   fkno_r143Default = 1.0;
00641   fkno_r212Default = 0.1;
00642   fkno_r222Default = 0.3;
00643   fkno_r232Default = 0.3;
00644   fkno_r242Default = 0.1;
00645   fkno_r213Default = 1.0;
00646   fkno_r223Default = 1.0;
00647   fkno_r233Default = 1.0;
00648   fkno_r243Default = 1.0;
00649   fma_qeDefault = 0.99;
00650   fma_resDefault = 1.12;
00651 }

const Float_t NuSystematic::ConvertSigmaToValue const Float_t  sigma,
NuSyst::NuSystematic_t  fSys
const [virtual]
 

!Changes contents of event!!

Definition at line 997 of file NuSystematic.cxx.

References CurrentSigma(), MSG, NameFromSyst(), OneSigma(), and SystMode().

Referenced by JitterVDPIDShift().

00998 {  
00999   if (sigma == -999) sigma = CurrentSigma(fSys);
01000   
01001   if (SystMode(fSys) == kMinusPlus) {
01002     return sigma*(OneSigma(fSys) - 1.0) + 1.0;
01003   }
01004   else if (SystMode(fSys) == kAsIs) {
01005     return sigma*OneSigma(fSys);
01006   }
01007   else if (SystMode(fSys) == kSigma) {
01008     return sigma;
01009   }
01010   else {
01011     MSG("NuSystematic",Msg::kError) << "Didn't recognize syst mode " << SystMode(fSys) << " for systematic " 
01012     << NameFromSyst(fSys) << "(" << fSys << ")" << endl;
01013     return 0;
01014   }
01015 }

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

Definition at line 1018 of file NuSystematic.cxx.

References MSG, NameFromSyst(), OneSigma(), and SystMode().

Referenced by SetShiftsAsValues().

01019 {
01020   if (SystMode(fSys) == kMinusPlus) {
01021     return (shift-1.0)/(OneSigma(fSys)-1.0);
01022   }
01023   else if (SystMode(fSys) == kAsIs) {
01024     return shift/OneSigma(fSys);
01025   }
01026   else if (SystMode(fSys) == kSigma) {
01027     return shift;
01028   }
01029   else {
01030     MSG("NuSystematic",Msg::kError) << "Didn't recognize syst mode " << SystMode(fSys) << " for systematic " 
01031     << NameFromSyst(fSys) << "(" << fSys << ")" << endl;
01032     return 0;
01033   }
01034 }

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

Definition at line 1599 of file NuSystematic.cxx.

References MCEventInfo::had_fs, NuEvent::hadronicFinalStateMC, NuEvent::iaction, MCEventInfo::iaction, MCEventInfo::initial_state, NuEvent::initialStateMC, NuEvent::inu, MCEventInfo::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().

01600 {
01601   MCEventInfo mcEvent;
01602   
01603   mcEvent.nuE = nuEvent.neuEnMC;
01604   mcEvent.nuPx = nuEvent.neuPxMC;
01605   mcEvent.nuPy = nuEvent.neuPyMC;
01606   mcEvent.nuPz = nuEvent.neuPzMC;
01607   mcEvent.tarE = nuEvent.tgtEnMC;
01608   mcEvent.tarPx = nuEvent.tgtPxMC;
01609   mcEvent.tarPy = nuEvent.tgtPyMC;
01610   mcEvent.tarPz = nuEvent.tgtPzMC;
01611   mcEvent.y = nuEvent.yMC;
01612   mcEvent.x = nuEvent.xMC;
01613   mcEvent.q2 = nuEvent.q2MC;
01614   mcEvent.w2 = nuEvent.w2MC;
01615   mcEvent.iaction = nuEvent.iaction;
01616   mcEvent.inu = nuEvent.inu;
01617   mcEvent.iresonance = nuEvent.iresonance;
01618   mcEvent.initial_state = nuEvent.initialStateMC;
01619   mcEvent.nucleus = nuEvent.nucleusMC;
01620   mcEvent.had_fs = nuEvent.hadronicFinalStateMC;
01621   
01622   return mcEvent;
01623 }

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

Definition at line 842 of file NuSystematic.cxx.

References currentSigma, and MSG.

Referenced by ConvertSigmaToValue(), and Shift().

00843 {
00844   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00845   it = currentSigma.find(syst);
00846   if (it == currentSigma.end()) {
00847     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in currentSigma." << endl;
00848     assert(false);
00849   }
00850   return it->second;  
00851 }

void NuSystematic::EnergyResolutionEvent NuEvent event  )  const [private, virtual]
 

Definition at line 1494 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, MAXMSG, NuEvent::neuEnMC, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01495 {
01496   MAXMSG("NuSystematic",Msg::kInfo,1)
01497     << "Performing event energy resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionEventBoth)
01498     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionEventNear) << "s" << endl;
01499   
01500   if (fabs(event.neuEnMC) < 1e-9) return;
01501   Double_t deltaE = (event.energy - event.neuEnMC) / event.neuEnMC;
01502   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionEventBoth);
01503   if (Detector::kNear == event.detector)
01504     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionEventNear);  
01505   event.energy = deltaE*event.neuEnMC + event.neuEnMC;
01506   return;
01507 }

void NuSystematic::EnergyResolutionShower NuEvent event  )  const [private, virtual]
 

Definition at line 1510 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, MAXMSG, NuEvent::nshw, ShiftAsSigma(), ShiftAsValue(), NuEvent::shwEn, NuEvent::shwEnMC, and NuEvent::trkEn.

Referenced by Shift().

01511 {
01512   MAXMSG("NuSystematic",Msg::kInfo,1)
01513     << "Performing shower energy resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionShowerBoth)
01514     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionShowerNear) << "s" << endl;
01515   
01516   if (fabs(event.shwEnMC) <= 1e-9) return;
01517   if (event.nshw < 1) return;
01518   if (fabs(event.shwEn) < 1e-9) return;
01519   Double_t deltaE = (event.shwEn - event.shwEnMC) / event.shwEnMC;
01520   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionShowerBoth);
01521   if (Detector::kNear == event.detector)
01522     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionShowerNear);  
01523   event.shwEn = deltaE*event.shwEnMC + event.shwEnMC;
01524   event.energy = event.shwEn + event.trkEn;
01525   return;
01526 }

void NuSystematic::EnergyResolutionTrackCurve NuEvent event  )  const [private, virtual]
 

Definition at line 1559 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, MAXMSG, NuEvent::ntrk, ShiftAsSigma(), ShiftAsValue(), NuEvent::shwEn, NuEvent::trkEn, NuEvent::trkEnCurv, NuEvent::trkEnMC, and NuEvent::usedCurv.

Referenced by Shift().

01560 {
01561   if (!event.usedCurv) return;
01562 
01563   MAXMSG("NuSystematic",Msg::kInfo,1)
01564     << "Performing track energy curve resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackCurveBoth)
01565     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackCurveNear) << "s" << endl;
01566   
01567   
01568   if (event.trkEnCurv != event.trkEn){
01569     cout << "Exiting event, but event.trkEnCurv != event.trkEn"
01570     << endl;
01571     assert(false);
01572   }
01573 
01574 
01575   if (fabs(event.trkEnMC) <= 1e-9) return;
01576   if (event.ntrk < 1) return;
01577   if (fabs(event.trkEn) < 1e-9) return;
01578   Double_t deltaE = (event.trkEnCurv - event.trkEnMC) / event.trkEnMC;
01579   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackCurveBoth);
01580   if (Detector::kNear == event.detector)
01581     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackCurveNear);  
01582 
01583   event.trkEnCurv = deltaE*event.trkEnMC + event.trkEnMC;
01584 
01585   event.trkEn = event.trkEnCurv;
01586   event.energy = event.shwEn + event.trkEn;
01587   return;
01588 }

void NuSystematic::EnergyResolutionTrackRange NuEvent event  )  const [private, virtual]
 

Definition at line 1529 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, MAXMSG, NuEvent::ntrk, ShiftAsSigma(), ShiftAsValue(), NuEvent::shwEn, NuEvent::trkEn, NuEvent::trkEnMC, NuEvent::trkEnRange, and NuEvent::usedRange.

Referenced by Shift().

01530 {
01531   if (!event.usedRange) return;
01532 
01533   MAXMSG("NuSystematic",Msg::kInfo,1)
01534     << "Performing track energy range resolution shift both = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackRangeBoth)
01535     << "s, near = " << ShiftAsSigma(NuSyst::kEnergyResolutionTrackRangeNear) << "s" << endl;
01536 
01537   if (event.trkEnRange != event.trkEn){
01538     cout << "Stopping event, but event.trkEnRange != event.trkEn"
01539     << endl;
01540     assert(false);
01541   }
01542 
01543   if (fabs(event.trkEnMC) <= 1e-9) return;
01544   if (event.ntrk < 1) return;
01545   if (fabs(event.trkEn) < 1e-9) return;
01546   Double_t deltaE = (event.trkEnRange - event.trkEnMC) / event.trkEnMC;
01547   deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackRangeBoth);
01548   if (Detector::kNear == event.detector)
01549     deltaE *= ShiftAsValue(NuSyst::kEnergyResolutionTrackRangeNear);  
01550   
01551   event.trkEnRange = deltaE*event.trkEnMC + event.trkEnMC;
01552 
01553   event.trkEn = event.trkEnRange;
01554   event.energy = event.shwEn + event.trkEn;
01555   return;
01556 }

void NuSystematic::EverythingOff  )  [virtual]
 

Definition at line 574 of file NuSystematic.cxx.

References currentSigma.

Referenced by NuSystematic().

00575 {
00576   currentSigma[NuSyst::kShowerEnergyOffset] = 0;
00577   currentSigma[NuSyst::kShowerEnergyScale] = 0;
00578   currentSigma[NuSyst::kShowerEnergyFunction] = 0;
00579   currentSigma[NuSyst::kShowerEnergyScaleFar] = 0;
00580   currentSigma[NuSyst::kShowerEnergyScaleNear] = 0;
00581   currentSigma[NuSyst::kShowerEnergyScaleRelative] = 0;
00582   currentSigma[NuSyst::kTrackEnergyCurvatureBoth] = 0;
00583   currentSigma[NuSyst::kTrackEnergyCurvatureFar] = 0;
00584   currentSigma[NuSyst::kTrackEnergyCurvatureNear] = 0;
00585   currentSigma[NuSyst::kTrackEnergyRange] = 0;
00586   currentSigma[NuSyst::kTrackEnergyScale] = 0;
00587   currentSigma[NuSyst::kTrackEnergyOverall] = 0;
00588   currentSigma[NuSyst::kBFieldBoth] = 0;
00589   currentSigma[NuSyst::kBFieldNear] = 0;
00590   currentSigma[NuSyst::kBFieldFar] = 0;  
00591   currentSigma[NuSyst::kAlignment] = 0;  
00592   currentSigma[NuSyst::kBeam] = 0;
00593   currentSigma[NuSyst::kCombinedXSecOverall] = 0;
00594   currentSigma[NuSyst::kCombinedXSecCCMA] = 0;
00595   currentSigma[NuSyst::kCombinedXSecMaRes] = 0;
00596   currentSigma[NuSyst::kCombinedXSecMaQE] = 0;
00597   currentSigma[NuSyst::kCombinedXSecDISMultip2] = 0;
00598   currentSigma[NuSyst::kCombinedXSecDISMultip3] = 0;
00599   currentSigma[NuSyst::kNuMuBarXSecSum] = 0;
00600   currentSigma[NuSyst::kNuMuBarXSecOverall] = 0;
00601   currentSigma[NuSyst::kNuMuBarXSecCCMA] = 0;
00602   currentSigma[NuSyst::kNuMuBarXSecDISMultip2] = 0;  
00603   currentSigma[NuSyst::kNuMuBarXSecQEL] = 0;
00604   currentSigma[NuSyst::kNuMuBarXSecRes] = 0;
00605   currentSigma[NuSyst::kNormalisationBoth] = 0;
00606   currentSigma[NuSyst::kNormalisationNear] = 0;
00607   currentSigma[NuSyst::kNormalisationFar] = 0;
00608   currentSigma[NuSyst::kNCBackground] = 0;
00609   currentSigma[NuSyst::kCCBackground] = 0;
00610   currentSigma[NuSyst::kNDCleaning] = 0;
00611   currentSigma[NuSyst::kScraping] = 0;
00612   currentSigma[NuSyst::kJitterVDPID] = 0;
00613   currentSigma[NuSyst::kJitter] = 0;
00614   currentSigma[NuSyst::kDPID] = 0;  
00615   currentSigma[NuSyst::kTFProb] = 0;
00616   currentSigma[NuSyst::kTargetHole] = 0;
00617   currentSigma[NuSyst::kTauQELRes] = 0;
00618   currentSigma[NuSyst::kAllBackgroundsScaleBoth] = 0;
00619   currentSigma[NuSyst::kEnergyResolutionEventBoth] = 0;
00620   currentSigma[NuSyst::kEnergyResolutionEventNear] = 0;
00621   currentSigma[NuSyst::kEnergyResolutionShowerBoth] = 0;
00622   currentSigma[NuSyst::kEnergyResolutionShowerNear] = 0;
00623   currentSigma[NuSyst::kEnergyResolutionTrackRangeBoth] = 0;
00624   currentSigma[NuSyst::kEnergyResolutionTrackRangeNear] = 0;
00625   currentSigma[NuSyst::kEnergyResolutionTrackCurveBoth] = 0;
00626   currentSigma[NuSyst::kEnergyResolutionTrackCurveNear] = 0;
00627 }

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

Definition at line 880 of file NuSystematic.cxx.

References NuXMLConfig::Name().

Referenced by NuTransition::NuTransition().

00881 {
00882   TString systName = xmlConfig.Name();
00883   if (systName.Contains("Scraping",TString::kIgnoreCase) ||
00884       systName.Contains("DecayPipe",TString::kIgnoreCase)){
00885     return true;
00886   }
00887   if (systName.Contains("Beam",TString::kIgnoreCase) ||
00888       systName.Contains("SKZP",TString::kIgnoreCase) ||
00889       systName.Contains("Flux",TString::kIgnoreCase)){
00890     return true;
00891   }
00892   if (systName.Contains("TargetHole",TString::kIgnoreCase)){
00893     return true;
00894   }
00895   
00896   return false;
00897 }

void NuSystematic::InitializeSystematics  )  [virtual]
 

Definition at line 445 of file NuSystematic.cxx.

References systMode, and systNames.

Referenced by NuSystematic().

00446 {
00447   systNames[NuSyst::kNominal] = "Nominal";
00448   
00449   systNames[NuSyst::kShowerEnergyOffset] = "ShowerEnergyOffset";
00450   systNames[NuSyst::kShowerEnergyScale] = "ShowerEnergyScaleBoth"; 
00451   systNames[NuSyst::kShowerEnergyFunction] = "ShowerEnergyScaleFunctionBoth"; 
00452   systNames[NuSyst::kShowerEnergyScaleNear] = "ShowerEnergyScaleNear";
00453   systNames[NuSyst::kShowerEnergyScaleFar] = "ShowerEnergyScaleFar"; 
00454   
00455   systNames[NuSyst::kShowerEnergyScaleRelative] = "ShowerEnergyScaleRelative"; 
00456   systNames[NuSyst::kTrackEnergyCurvatureBoth] = "TrackEnergyCurvatureBoth";
00457   systNames[NuSyst::kTrackEnergyCurvatureFar] = "TrackEnergyCurvatureFar"; 
00458   systNames[NuSyst::kTrackEnergyCurvatureNear] = "TrackEnergyCurvatureNear"; 
00459   systNames[NuSyst::kTrackEnergyRange] = "TrackEnergyRange";
00460   systNames[NuSyst::kTrackEnergyOverall] = "TrackEnergyOverall"; 
00461   systNames[NuSyst::kTrackEnergyScale] = "TrackEnergyScale"; 
00462   
00463   systNames[NuSyst::kBFieldBoth] = "BFieldBoth"; 
00464   systNames[NuSyst::kBFieldNear] = "BFieldNear";
00465   systNames[NuSyst::kBFieldFar] = "BFieldFar";   
00466   systNames[NuSyst::kAlignment] = "Alignment";
00467   systNames[NuSyst::kBeam] = "Flux";
00468 
00469   systNames[NuSyst::kCombinedXSecCCMA] = "CombinedXSecCCMA"; 
00470   systNames[NuSyst::kCombinedXSecMaRes] = "CombinedXSecMaRes";
00471   systNames[NuSyst::kCombinedXSecMaQE] = "CombinedXSecMaQE"; 
00472   systNames[NuSyst::kCombinedXSecOverall] = "CombinedXSecOverall"; 
00473   systNames[NuSyst::kCombinedXSecDISMultip2] = "CombinedXSecDISMultip2";
00474   systNames[NuSyst::kCombinedXSecDISMultip3] = "CombinedXSecDISMultip3"; 
00475 
00476   systNames[NuSyst::kNuMuBarXSecCCMA] = "NuMuBarXSecCCMA"; 
00477   systNames[NuSyst::kNuMuBarXSecQEL] = "NuMuBarXSecQEL";
00478   systNames[NuSyst::kNuMuBarXSecRes] = "NuMuBarXSecRes"; 
00479   systNames[NuSyst::kNuMuBarXSecSum] = "NuMuBarXSecSum"; 
00480   systNames[NuSyst::kNuMuBarXSecOverall] = "NuMuBarXSecOverall";
00481   systNames[NuSyst::kNuMuBarXSecDISMultip2] = "NuMuBarXSecDISMultip2"; 
00482   
00483   systNames[NuSyst::kNormalisationBoth] = "NormalisationBoth"; 
00484   systNames[NuSyst::kNormalisationNear] = "NormalisationNear";
00485   systNames[NuSyst::kNormalisationFar] = "NormalisationFar"; 
00486   systNames[NuSyst::kNCBackground] = "NCBackground"; 
00487   systNames[NuSyst::kCCBackground] = "CCBackground";   
00488   systNames[NuSyst::kNDCleaning] = "NDCleaning";   
00489   systNames[NuSyst::kAllBackgroundsScaleBoth] = "AllBackgroundsScaleBoth"; 
00490   systNames[NuSyst::kScraping] = "DecayPipe"; 
00491 
00492   systNames[NuSyst::kJitterVDPID] = "JitterVDPID"; 
00493   systNames[NuSyst::kJitter] = "Jitter";
00494   systNames[NuSyst::kDPID] = "DPID"; 
00495   systNames[NuSyst::kTFProb] = "TFProb"; 
00496   systNames[NuSyst::kTargetHole] = "TargetHole";
00497   systNames[NuSyst::kTauQELRes] = "TauQELRes"; 
00498   
00499   systNames[NuSyst::kEnergyResolutionEventBoth] = "EnergyResolutionEventBoth";
00500   systNames[NuSyst::kEnergyResolutionEventNear] = "EnergyResolutionEventNear"; 
00501   systNames[NuSyst::kEnergyResolutionShowerBoth] = "EnergyResolutionShowerBoth"; 
00502   systNames[NuSyst::kEnergyResolutionShowerNear] = "EnergyResolutionShowerNear";
00503   systNames[NuSyst::kEnergyResolutionTrackRangeBoth] = "EnergyResolutionTrackRangeBoth"; 
00504   systNames[NuSyst::kEnergyResolutionTrackRangeNear] = "EnergyResolutionTrackRangeNear"; 
00505   systNames[NuSyst::kEnergyResolutionTrackCurveBoth] = "EnergyResolutionTrackCurveBoth";
00506   systNames[NuSyst::kEnergyResolutionTrackCurveNear] = "EnergyResolutionTrackCurveNear"; 
00507 
00508 
00509   systMode[NuSyst::kNominal] = kSigma;
00510   
00511   systMode[NuSyst::kShowerEnergyOffset] = kAsIs;
00512   systMode[NuSyst::kShowerEnergyScale] = kMinusPlus; 
00513   systMode[NuSyst::kShowerEnergyFunction] = kSigma; 
00514   systMode[NuSyst::kShowerEnergyScaleNear] = kMinusPlus;
00515   systMode[NuSyst::kShowerEnergyScaleFar] = kMinusPlus; 
00516   
00517   systMode[NuSyst::kShowerEnergyScaleRelative] = kMinusPlus; 
00518   systMode[NuSyst::kTrackEnergyCurvatureBoth] = kMinusPlus;
00519   systMode[NuSyst::kTrackEnergyCurvatureFar] = kMinusPlus; 
00520   systMode[NuSyst::kTrackEnergyCurvatureNear] = kMinusPlus; 
00521   systMode[NuSyst::kTrackEnergyRange] = kMinusPlus;
00522   systMode[NuSyst::kTrackEnergyOverall] = kSigma; 
00523   systMode[NuSyst::kTrackEnergyScale] = kMinusPlus; 
00524   
00525   systMode[NuSyst::kBFieldBoth] = kMinusPlus; 
00526   systMode[NuSyst::kBFieldNear] = kMinusPlus;
00527   systMode[NuSyst::kBFieldFar] = kMinusPlus;   
00528   systMode[NuSyst::kAlignment] = kMinusPlus;
00529   systMode[NuSyst::kBeam] = kSigma;
00530   
00531   systMode[NuSyst::kCombinedXSecCCMA] = kMinusPlus; 
00532   systMode[NuSyst::kCombinedXSecMaRes] = kMinusPlus;
00533   systMode[NuSyst::kCombinedXSecMaQE] = kMinusPlus; 
00534   systMode[NuSyst::kCombinedXSecOverall] = kMinusPlus; 
00535   systMode[NuSyst::kCombinedXSecDISMultip2] = kAsIs;
00536   systMode[NuSyst::kCombinedXSecDISMultip3] = kAsIs; 
00537   
00538   systMode[NuSyst::kNuMuBarXSecCCMA] = kMinusPlus; 
00539   systMode[NuSyst::kNuMuBarXSecQEL] = kMinusPlus;
00540   systMode[NuSyst::kNuMuBarXSecRes] = kMinusPlus; 
00541   systMode[NuSyst::kNuMuBarXSecSum] = kSigma; 
00542   systMode[NuSyst::kNuMuBarXSecOverall] = kMinusPlus;
00543   systMode[NuSyst::kNuMuBarXSecDISMultip2] = kAsIs; 
00544   
00545   systMode[NuSyst::kNormalisationBoth] = kMinusPlus; 
00546   systMode[NuSyst::kNormalisationNear] = kMinusPlus;
00547   systMode[NuSyst::kNormalisationFar] = kMinusPlus; 
00548   systMode[NuSyst::kNCBackground] = kMinusPlus; 
00549   systMode[NuSyst::kCCBackground] = kMinusPlus; 
00550   systMode[NuSyst::kNDCleaning] = kSigma; 
00551   systMode[NuSyst::kAllBackgroundsScaleBoth] = kMinusPlus; 
00552   systMode[NuSyst::kScraping] = kMinusPlus; 
00553   
00554   systMode[NuSyst::kJitterVDPID] = kSigma; 
00555   systMode[NuSyst::kJitter] = kAsIs;
00556   systMode[NuSyst::kDPID] = kAsIs; 
00557   systMode[NuSyst::kTFProb] = kAsIs;
00558   systMode[NuSyst::kTargetHole] = kAsIs;
00559   systMode[NuSyst::kTauQELRes] = kMinusPlus; 
00560   
00561   systMode[NuSyst::kEnergyResolutionEventBoth] = kMinusPlus;
00562   systMode[NuSyst::kEnergyResolutionEventNear] = kMinusPlus; 
00563   systMode[NuSyst::kEnergyResolutionShowerBoth] = kMinusPlus; 
00564   systMode[NuSyst::kEnergyResolutionShowerNear] = kMinusPlus;
00565   systMode[NuSyst::kEnergyResolutionTrackRangeBoth] = kMinusPlus; 
00566   systMode[NuSyst::kEnergyResolutionTrackRangeNear] = kMinusPlus; 
00567   systMode[NuSyst::kEnergyResolutionTrackCurveBoth] = kMinusPlus;
00568   systMode[NuSyst::kEnergyResolutionTrackCurveNear] = kMinusPlus; 
00569   
00570 }

void NuSystematic::JitterVDPIDShift NuEvent event  )  const [private, virtual]
 

Definition at line 1070 of file NuSystematic.cxx.

References ConvertSigmaToValue(), NuEvent::dpID, NuEvent::jitter, MAXMSG, and ShiftAsSigma().

Referenced by Shift().

01071 {
01072   MAXMSG("NuSystematic",Msg::kInfo,1)
01073     << "Performing track jitter & DPID shift = " << ShiftAsSigma(NuSyst::kJitterVDPID) << "s" << endl;
01074   event.jitter += ConvertSigmaToValue(ShiftAsSigma(NuSyst::kJitterVDPID), NuSyst::kJitter);
01075   event.dpID += ConvertSigmaToValue(ShiftAsSigma(NuSyst::kJitterVDPID), NuSyst::kDPID);
01076   return;
01077 }

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

Definition at line 402 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00402 {return fkno_r112Default;}

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

Definition at line 406 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00406 {return fkno_r113Default;}

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

Definition at line 403 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00403 {return fkno_r122Default;}

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

Definition at line 407 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00407 {return fkno_r123Default;}

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

Definition at line 404 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00404 {return fkno_r132Default;}

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

Definition at line 408 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00408 {return fkno_r133Default;}

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

Definition at line 405 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00405 {return fkno_r142Default;}

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

Definition at line 409 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00409 {return fkno_r143Default;}

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

Definition at line 410 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00410 {return fkno_r212Default;}

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

Definition at line 414 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00414 {return fkno_r213Default;}

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

Definition at line 411 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00411 {return fkno_r222Default;}

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

Definition at line 415 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00415 {return fkno_r223Default;}

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

Definition at line 412 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00412 {return fkno_r232Default;}

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

Definition at line 416 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00416 {return fkno_r233Default;}

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

Definition at line 413 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00413 {return fkno_r242Default;}

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

Definition at line 417 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00417 {return fkno_r243Default;}

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

Definition at line 400 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00400 {return fma_qeDefault;}

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

Definition at line 401 of file NuSystematic.h.

Referenced by SetShiftedNeugenParameters().

00401 {return fma_resDefault;}

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

Definition at line 319 of file NuSystematic.h.

Referenced by ConvertSigmaToValue(), and ConvertValueToSigma().

00320     { return SystNames(syst); };

void NuSystematic::NCBackgroundShift NuEvent event  )  const [private, virtual]
 

Definition at line 1275 of file NuSystematic.cxx.

References fCCSelector, NuEvent::iaction, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01276 {
01277   if (!fCCSelector) {
01278     MSG("NuSystematic",Msg::kError) << "Cannot apply NCBackground without doing SetCCSelector()" << endl;
01279     assert(false);
01280   }
01281   
01282   MAXMSG("NuSystematic",Msg::kInfo,1)
01283     << "Performing NC background shift " << ShiftAsSigma(NuSyst::kNCBackground) << "s" << endl;
01284   
01285   fCCSelector->MakeCuts(event);
01286   if (0 == event.iaction && fCCSelector->Passed()) 
01287     event.rw *= ShiftAsValue(NuSyst::kNCBackground);
01288 }

void NuSystematic::NDCleaningShift NuEvent event  )  const [private, virtual]
 

Definition at line 1307 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energyNC, fNCSelector, NuCut::MakeCuts(), MAXMSG, MSG, NuCut::Passed(), NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01308 {
01309   if (!fNCSelector) {
01310     MSG("NuSystematic",Msg::kError) << "Cannot apply NDCleaning without doing SetNCSelector()" << endl;
01311     assert(false);
01312   }
01313   
01314   MAXMSG("NuSystematic",Msg::kInfo,1)
01315   << "Performing ND cleaning shift " << ShiftAsSigma(NuSyst::kNDCleaning) << "s" << endl;
01316   
01317   double percent = 0;
01318   if(event.energyNC < 0.5) percent = 15.2;
01319   if(event.energyNC >= 0.5 && event.energyNC < 1.0) percent = 2.9;
01320   if(event.energyNC >= 1.0 && event.energyNC < 1.5) percent = 0.4;
01321   
01322   fNCSelector->MakeCuts(event);
01323   if(fNCSelector->Passed() && event.detector == Detector::kNear)
01324     event.rw *= 1.+(percent/100.)*ShiftAsValue(NuSyst::kNDCleaning);
01325 }

void NuSystematic::NeugenXSecShift NuEvent event  )  const [private, virtual]
 

Definition at line 1089 of file NuSystematic.cxx.

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

Referenced by Shift().

01090 {
01091     MAXMSG("NuSystematic",Msg::kInfo,1)
01092       << "Performing a Neugen cross section shift" << endl;
01093   if (0 == event.iaction) return;
01094   
01095   MCReweight& mcReweight = MCReweight::Instance();
01096   if (firstMCReweight){
01097     NeugenWeightCalculator* wc = new NeugenWeightCalculator();
01098     mcReweight.AddWeightCalculator(wc);
01099     firstMCReweight = false;
01100   }
01101   //  cout << "Num weight calc: " << mcReweight.NumWeightCalcAdded() << endl;
01102   Registry reweightConfigRegistry;
01103   Registry defaultRegistry;
01104 
01105   //Set to MODBYRS4 for Daikon.
01106   if (ReleaseType::IsDaikon(event.releaseType)){
01107     reweightConfigRegistry.Set("neugen:config_name","MODBYRS");
01108     reweightConfigRegistry.Set("neugen:config_no",4);
01109     defaultRegistry.Set("neugen:config_name","MODBYRS");
01110     defaultRegistry.Set("neugen:config_no",4);
01111   }
01112   else{
01113     MSG("NuSystematic.cxx",Msg::kError)
01114       << "Using non-daikon MC. I don't know how to apply Neugen "
01115       << "parameters to that."
01116       << endl;
01117   }
01118 
01119   //Set the shifted CombinedXSecCCMA parameters.
01120   this->SetShiftedNeugenParameters(reweightConfigRegistry, event);
01121 
01122   
01123   //Create objects to give to MCReweight.
01124   MCEventInfo mcEventInfo = this->CreateMCEventInfo(event);
01125   NuParent* nuParent = 0;
01126 
01127   mcReweight.ResetAllReweightConfigs();
01128 
01129   //    cout << "iresonance is " << event.iresonance << endl;
01130   //Get the weight.
01131   Double_t weight = mcReweight.ComputeWeight(&mcEventInfo,
01132                                              nuParent,
01133                                              &reweightConfigRegistry);
01134   //  mcReweight.PrintReweightConfig(cout);
01135 
01136 
01137   //Get the default weight.
01138   this->SetNeugenDefaults(defaultRegistry);
01139   mcReweight.ResetAllReweightConfigs();
01140   Double_t defaultWeight = mcReweight.ComputeWeight(&mcEventInfo,
01141                                                     nuParent,
01142                                                     &defaultRegistry);
01143   //  cout << "Weight changed by " << weight << "/" << defaultWeight << endl;
01144   if (defaultWeight>0.0){
01145     event.rw *= weight/defaultWeight;
01146   }
01147   else{
01148     MSG("NuSystematic.cxx",Msg::kError)
01149       << "Default weight <= 0."
01150       << endl;
01151   }
01152   return;
01153 }

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

Definition at line 1951 of file NuSystematic.cxx.

References e_cc, e_Fe56, e_mu, init_state_t, NuEvent::inu, MSG, and neugen_wrapper::xsec().

01953 {
01954   NuEvent event;
01955   if (NuParticle::kNuMuBar == particle) event.inu = -14;
01956   else                                  event.inu = 14;
01957 
01958   neugen_config shiftedConfig; //Defaults are MODBYRS4
01959   this->SetShiftedNeugenParameters(shiftedConfig, event);
01960   neugen_config defaultConfig;
01961   neugen_wrapper shiftedWrapper(&shiftedConfig);
01962   neugen_wrapper defaultWrapper(&defaultConfig);
01963   init_state_t inlStateP;
01964   init_state_t inlStateN;
01965   if (NuParticle::kNuMu == particle){
01966     inlStateP = e_vp;
01967     inlStateN = e_vn;
01968   }
01969   else if (NuParticle::kNuMuBar == particle){
01970     inlStateP = e_vbp;
01971     inlStateN = e_vbn;
01972   }
01973   else{
01974     MSG("NuSystematic.cxx",kWarning)
01975       << "Bad particle type for cross section shift."
01976       << endl;
01977     inlStateP = e_undefined_init_state;
01978     inlStateN = e_undefined_init_state;
01979   }
01980   interaction interP(e_mu,e_Fe56,e_cc,inlStateP);
01981   interaction interN(e_mu,e_Fe56,e_cc,inlStateP);
01982   Double_t defaultXSec = defaultWrapper.xsec(energy,&interP,0);
01983   defaultXSec += defaultWrapper.xsec(energy,&interN,0);
01984   Double_t shiftedXSec = shiftedWrapper.xsec(energy,&interP,0);
01985   shiftedXSec = shiftedWrapper.xsec(energy,&interN,0);
01986   if (defaultXSec){return shiftedXSec/defaultXSec;}
01987   else {return 0;}
01988 }

void NuSystematic::NormalisationShift NuEvent event  )  const [private, virtual]
 

Definition at line 1328 of file NuSystematic.cxx.

References NuEvent::detector, MAXMSG, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01329 {
01330     MAXMSG("NuSystematic",Msg::kInfo,1)
01331       << "Performing Normalisation shift both = "  << ShiftAsSigma(NuSyst::kNormalisationBoth)
01332       << "s, near = " << ShiftAsSigma(NuSyst::kNormalisationNear)
01333       << "s, far = " << ShiftAsSigma(NuSyst::kNormalisationFar) << endl;
01334   
01335   event.rw *= ShiftAsValue(NuSyst::kNormalisationBoth);
01336   if (Detector::kNear==event.detector)
01337     event.rw *= ShiftAsValue(NuSyst::kNormalisationNear);
01338   if (Detector::kFar==event.detector)
01339     event.rw *= ShiftAsValue(NuSyst::kNormalisationFar);
01340   return;
01341 }

void NuSystematic::NuMuBarQELXSecShift NuEvent event  )  const [private, virtual]
 

Definition at line 1207 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, NuEvent::iresonance, MAXMSG, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01208 {
01209   MAXMSG("NuSystematic",Msg::kInfo,1)
01210     << "Performing NuMuBar QEL cross section shift = "
01211     << ShiftAsSigma(NuSyst::kNuMuBarXSecQEL) << "s" << endl;
01212 
01213   if (1 != event.iaction) return;
01214   //  if (-14 != event.inu) return;
01215   if (event.inu > 0) return;
01216   if (1001 != event.iresonance) return;
01217   event.rw *= ShiftAsValue(NuSyst::kNuMuBarXSecQEL);
01218   return;
01219 }

void NuSystematic::NuMuBarResXSecShift NuEvent event  )  const [private, virtual]
 

Definition at line 1222 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, NuEvent::iresonance, MAXMSG, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01223 {
01224   MAXMSG("NuSystematic",Msg::kInfo,1)
01225     << "Performing NuMuBar Res cross section shift"
01226     << ShiftAsSigma(NuSyst::kNuMuBarXSecRes) << "s" << endl;
01227 
01228   if (1 != event.iaction) return;
01229   //  if (-14 != event.inu) return;
01230   if (event.inu > 0) return;
01231   if (1002 != event.iresonance) return;
01232   event.rw *= ShiftAsValue(NuSyst::kNuMuBarXSecRes);
01233   return;
01234 }

void NuSystematic::NuMuBarSumXSecShift NuEvent event  )  const [private, virtual]
 

Definition at line 1156 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, MAXMSG, NuEvent::neuEnMC, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01157 {
01158     MAXMSG("NuSystematic",Msg::kInfo,1)
01159     << "Performing numubar summed cross section shift = "
01160     << ShiftAsSigma(NuSyst::kNuMuBarXSecSum) << "s" << endl;
01161     if (1 != event.iaction) return;
01162     if (event.inu != -14) return;
01163     
01164     static double xp = 25.;
01165     static double a = 0.895;
01166     static double xc = 4.0;
01167     static double b = 7.59e-3;
01168     static double c = -8.05e-4;
01169     double E = event.neuEnMC;
01170     double shift = -0.0617;
01171     if (E < 25) shift += a - 1 + 2.*(1.-a)*E/xp + (a - 1.)*E*E/(xp*xp);
01172     if (E < xc) shift += (c*(xc-E)*(xc-E)*(xc-E)+b*(xc-E)*(xc-E));
01173     shift = 1 + ShiftAsValue(NuSyst::kNuMuBarXSecSum) * shift;
01174     
01175     event.rw *= shift;
01176     return;
01177 }

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

Definition at line 829 of file NuSystematic.cxx.

References MSG, and oneSigma.

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

00830 {
00831   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00832   it = oneSigma.find(syst);
00833   if (it == oneSigma.end()) {
00834     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in oneSigma." << endl;
00835     assert(false);
00836   }
00837   return it->second;
00838 }

void NuSystematic::OverallXSecShift NuEvent event  )  const [private, virtual]
 

Definition at line 1180 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, MAXMSG, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01181 {
01182   MAXMSG("NuSystematic",Msg::kInfo,1)
01183     << "Performing overall cross section shift combined = " << ShiftAsSigma(NuSyst::kCombinedXSecOverall)
01184   << "s, numubar = " << ShiftAsSigma(NuSyst::kNuMuBarXSecOverall) << "s" << endl;
01185   if (1 != event.iaction) return;
01186   
01187   event.rw *= ShiftAsValue(NuSyst::kCombinedXSecOverall);
01188   if (event.inu < 0) 
01189     event.rw *= ShiftAsValue(NuSyst::kNuMuBarXSecOverall);
01190 }

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

Definition at line 750 of file NuSystematic.cxx.

References currentSigma, len, MSG, OneSigma(), and SystNames().

Referenced by NuDSTAna::TestNuSyst().

00751 {
00752   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00753   
00754   
00755   // Find the longest name
00756   Int_t lsize = 12;
00757   for (it = currentSigma.begin(); it != currentSigma.end(); ++it) {
00758     if (it->second || verbose) {
00759       int len = SystNames(it->first).Length();
00760       if (len > lsize) lsize = len;
00761     }
00762   }
00763   
00764   lsize++;
00765   
00766   // The 'total width'
00767   // Print a summary of this events cuts
00768   //MSG("NuSystematic",Msg::kInfo)
00769   MSG("NuSystematic",Msg::kInfo) << setw(lsize+21) << left << setfill('=') << "==== NuSystematics Summary " << endl;
00770   
00771   MSG("NuSystematic",Msg::kInfo) << setw(lsize) << left << setfill(' ') << "Systematic" 
00772                                  << setw(10) << right << "1 sigma" << " "
00773                                  << setw(10) << right << "Current" << endl;
00774   
00775   for (it = currentSigma.begin(); it != currentSigma.end(); ++it) {
00776     if (it->second || verbose) {
00777       MSG("NuSystematic",Msg::kInfo) << setw(lsize) << left << setfill(' ') << SystNames(it->first) 
00778                                      << setw(10) << right << OneSigma(it->first) << " "
00779                                      << setw(10) << right << it->second << endl;
00780     }
00781   }
00782   MSG("NuSystematic",Msg::kInfo) << endl;
00783 }

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

Definition at line 1873 of file NuSystematic.cxx.

References e_cc, e_Fe56, e_mu, e_qel, init_state_t, MSG, neugen_cuts::setOneProcess(), and neugen_wrapper::xsec().

01876 {
01877   neugen_config defaultConfig;
01878   neugen_wrapper defaultWrapper(&defaultConfig);
01879   init_state_t inlStateP;
01880   init_state_t inlStateN;
01881   if (NuParticle::kNuMu == particle){
01882     inlStateP = e_vp;
01883     inlStateN = e_vn;
01884   }
01885   else if (NuParticle::kNuMuBar == particle){
01886     inlStateP = e_vbp;
01887     inlStateN = e_vbn;
01888   }
01889   else{
01890     MSG("NuSystematic.cxx",kWarning)
01891       << "Bad particle type for cross section shift."
01892       << endl;
01893     inlStateP = e_undefined_init_state;
01894     inlStateN = e_undefined_init_state;
01895   }
01896   interaction interP(e_mu,e_Fe56,e_cc,inlStateP);
01897   interaction interN(e_mu,e_Fe56,e_cc,inlStateP);
01898   Double_t defaultXSec = defaultWrapper.xsec(energy,&interP,0);
01899   defaultXSec += defaultWrapper.xsec(energy,&interN,0);
01900 
01901   neugen_cuts cuts;
01902   cuts.setOneProcess(e_qel);
01903   Double_t qelXSec = defaultWrapper.xsec(energy,&interP,&cuts);
01904   qelXSec += defaultWrapper.xsec(energy,&interN,&cuts);
01905 
01906   if (!defaultXSec){return 1.0;}
01907   return (defaultXSec + (this->ShiftAsValue(NuSyst::kNuMuBarXSecQEL) - 1.0)*qelXSec)/defaultXSec;
01908 }

void NuSystematic::Randomize  )  [virtual]
 

Definition at line 1037 of file NuSystematic.cxx.

References currentSigma, fRandom, and MAXMSG.

Referenced by NuDSTAna::TestNuSyst().

01038 {
01039   map<NuSyst::NuSystematic_t, double>::iterator it;
01040   
01041   MAXMSG("NuSystematic",Msg::kInfo, 1) 
01042   << "Setting random gaussian shifts for all non-zero systematics" << endl;
01043   
01044   for (it = currentSigma.begin(); it != currentSigma.end(); ++it) {
01045     if (it->second) {
01046       it->second = fRandom->Gaus(0, 1);
01047       // Prevent a systematic from being turned off 
01048       // persistently by a random draw
01049       if (!it->second) it->second = 1e-8; 
01050     }
01051   }
01052 }

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

Definition at line 655 of file NuSystematic.cxx.

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

Referenced by NuSystematic().

00656 {
00657   NuSyst::NuSystematic_t fSystematicID = SystFromName(xmlConfig.Name());
00658   currentSigma[fSystematicID] = 1;
00659   oneSigma[fSystematicID] = xmlConfig.Shift();
00660   
00661   MSG("NuSystematic.cxx",Msg::kInfo)
00662   << "Reading NuXMLConfig for " 
00663   << xmlConfig.Name() << " at "
00664   << currentSigma[fSystematicID] << " sigma = " << oneSigma[fSystematicID] << endl;
00665 }

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

Definition at line 1912 of file NuSystematic.cxx.

References e_cc, e_Fe56, e_mu, e_res, init_state_t, MSG, neugen_cuts::setOneProcess(), and neugen_wrapper::xsec().

01915 {
01916   neugen_config defaultConfig;
01917   neugen_wrapper defaultWrapper(&defaultConfig);
01918   init_state_t inlStateP;
01919   init_state_t inlStateN;
01920   if (NuParticle::kNuMu == particle){
01921     inlStateP = e_vp;
01922     inlStateN = e_vn;
01923   }
01924   else if (NuParticle::kNuMuBar == particle){
01925     inlStateP = e_vbp;
01926     inlStateN = e_vbn;
01927   }
01928   else{
01929     MSG("NuSystematic.cxx",kWarning)
01930       << "Bad particle type for cross section shift."
01931       << endl;
01932     inlStateP = e_undefined_init_state;
01933     inlStateN = e_undefined_init_state;
01934   }
01935   interaction interP(e_mu,e_Fe56,e_cc,inlStateP);
01936   interaction interN(e_mu,e_Fe56,e_cc,inlStateP);
01937   Double_t defaultXSec = defaultWrapper.xsec(energy,&interP,0);
01938   defaultXSec += defaultWrapper.xsec(energy,&interN,0);
01939 
01940   neugen_cuts cuts;
01941   cuts.setOneProcess(e_res);
01942   Double_t qelXSec = defaultWrapper.xsec(energy,&interP,&cuts);
01943   qelXSec += defaultWrapper.xsec(energy,&interN,&cuts);
01944 
01945   if (!defaultXSec){return 1.0;}
01946   return (defaultXSec + (this->ShiftAsValue(NuSyst::kNuMuBarXSecRes) - 1.0)*qelXSec)/defaultXSec;
01947 }

void NuSystematic::ScrapingShift NuEvent event  )  const [private, virtual]
 

Definition at line 1360 of file NuSystematic.cxx.

References MAXMSG, NuEvent::ppvz, NuEvent::ptype, NuEvent::rw, ShiftAsSigma(), and ShiftAsValue().

Referenced by Shift().

01361 {
01362     MAXMSG("NuSystematic",Msg::kInfo,1)
01363       << "Performing scraping shift = " << ShiftAsSigma(NuSyst::kScraping) << "s" << endl;
01364   
01365 //    Float_t r = sqrt(event.ppvx*event.ppvx +
01366 //                     event.ppvy*event.ppvy);
01367 //    Float_t z = event.ppvz;
01368 //    Float_t Znom = 52.06; // -187.06 for HE
01369 //    if (BeamType::kL250z200i == event.beamType){
01370 //      Znom = -187.06;
01371 //    }
01372 //    else if (BeamType::kL010z185i == event.beamType){
01373 //      Znom = 52.06;
01374 //    }
01375 //    else{
01376 //      Znom = 52.06;
01377 //    }
01378 
01379     //Don't shift muons
01380     if (13 == event.ptype) return;
01381     if (-13 == event.ptype) return;
01382     
01383 //    if (r < 1.65 && TMath::Abs(z - Znom) < 0.1)
01384 //        return; // Target End
01385 //    
01386 //    if (TMath::Abs(r - 1.51) < 0.11 && z < Znom)
01387 //        return; // Target Side
01388 
01389     if (event.ppvz < 4500)  return;
01390     //Not decay pipe
01391     
01392     event.rw *= ShiftAsValue(NuSyst::kScraping);
01393     
01394     return;
01395 }

void NuSystematic::SetCCSelector NuCut input  )  [virtual]
 

Definition at line 906 of file NuSystematic.cxx.

References fCCSelector, MSG, and NuCut::PrintSummary().

00907 { 
00908   fCCSelector = input; 
00909   MSG("NuSystematic",Msg::kInfo) << "Setting the CC selector" << endl;
00910   fCCSelector->PrintSummary();
00911 }

void NuSystematic::SetNCSelector NuCut input  )  [virtual]
 

Definition at line 914 of file NuSystematic.cxx.

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

00915 { 
00916   fNCSelector = input; 
00917   MSG("NuSystematic",Msg::kInfo) << "Setting the NC selector" << endl;
00918   fNCSelector->PrintSummary();
00919 }

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

Definition at line 1626 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().

01627 {
01628   registry.Set("neugen:kno_r112",fkno_r112Default);
01629   registry.Set("neugen:kno_r122",fkno_r122Default);
01630   registry.Set("neugen:kno_r132",fkno_r132Default);
01631   registry.Set("neugen:kno_r142",fkno_r142Default);
01632   registry.Set("neugen:kno_r113",fkno_r113Default);
01633   registry.Set("neugen:kno_r123",fkno_r123Default);
01634   registry.Set("neugen:kno_r133",fkno_r133Default);
01635   registry.Set("neugen:kno_r143",fkno_r143Default);
01636   registry.Set("neugen:ma_qe",fma_qeDefault);
01637   registry.Set("neugen:ma_res",fma_resDefault);
01638   return;
01639 }

void NuSystematic::SetNuBarSelector NuCut input  )  [virtual]
 

Definition at line 922 of file NuSystematic.cxx.

References fNuBarSelector, MSG, and NuCut::PrintSummary().

Referenced by NuDSTAna::TestNuSyst().

00923 { 
00924   fNuBarSelector = input; 
00925   MSG("NuSystematic",Msg::kInfo) << "Setting the NuBar selector" << endl;
00926   fNuBarSelector->PrintSummary();
00927 }

void NuSystematic::SetRockSelector NuCut input  )  [virtual]
 

Definition at line 930 of file NuSystematic.cxx.

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

00931 { 
00932   fRockSelector = input; 
00933   MSG("NuSystematic",Msg::kInfo) << "Setting the Rock selector" << endl;
00934   fRockSelector->PrintSummary();
00935 }

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

Definition at line 1730 of file NuSystematic.cxx.

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

01731 {
01732   Float_t ma_qe = this->MA_QEDefault();
01733   Float_t ma_res = this->MA_ResDefault();
01734   
01735   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
01736   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
01737   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecMaQE);
01738   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecMaRes);
01739   
01740   if (event.inu<0) {
01741     ma_qe *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
01742     ma_res *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
01743   }
01744   
01745   config.set_ma_qe(ma_qe);
01746   config.set_ma_res(ma_res);
01747   
01748   Float_t kno112 = this->KNO112Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01749   if (kno112<0.0){kno112=0.0;}
01750   if (kno112>1.0){kno112=1.0;}
01751   Float_t kno122 = this->KNO122Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01752   if (kno122<0.0){kno122=0.0;}
01753   if (kno122>1.0){kno122=1.0;}
01754   Float_t kno132 = this->KNO132Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01755   if (event.inu<0) kno132 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
01756   if (kno132<0.0){kno132=0.0;}
01757   if (kno132>1.0){kno132=1.0;}
01758   Float_t kno142 = this->KNO142Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01759   if (event.inu<0) kno142 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
01760   if (kno142<0.0){kno142=0.0;}
01761   if (kno142>1.0){kno142=1.0;}
01762   Float_t kno212 = this->KNO212Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01763   if (kno212<0.0){kno212=0.0;}
01764   if (kno212>1.0){kno212=1.0;}
01765   Float_t kno222 = this->KNO222Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01766   if (kno222<0.0){kno222=0.0;}
01767   if (kno222>1.0){kno222=1.0;}
01768   Float_t kno232 = this->KNO232Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01769   if (kno232<0.0){kno232=0.0;}
01770   if (kno232>1.0){kno232=1.0;}
01771   Float_t kno242 = this->KNO242Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01772   if (kno242<0.0){kno242=0.0;}
01773   if (kno242>1.0){kno242=1.0;}
01774   config.set_dis_res(1,2,e_vp,kno112);
01775   config.set_dis_res(1,2,e_vn,kno122);
01776   config.set_dis_res(1,2,e_vbp,kno132);
01777   config.set_dis_res(1,2,e_vbn,kno142);
01778   config.set_dis_res(2,2,e_vp,kno212);
01779   config.set_dis_res(2,2,e_vn,kno222);
01780   config.set_dis_res(2,2,e_vbp,kno232);
01781   config.set_dis_res(2,2,e_vbn,kno242);
01782   
01783   Float_t kno113 = this->KNO113Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01784   if (kno113<0.0){kno113=0.0;}
01785   if (kno113>1.0){kno113=1.0;}
01786   Float_t kno123 = this->KNO123Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01787   if (kno123<0.0){kno123=0.0;}
01788   if (kno123>1.0){kno123=1.0;}
01789   Float_t kno133 = this->KNO133Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01790   if (kno133<0.0){kno133=0.0;}
01791   if (kno133>1.0){kno133=1.0;}
01792   Float_t kno143 = this->KNO143Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01793   if (kno143<0.0){kno143=0.0;}
01794   if (kno143>1.0){kno143=1.0;}
01795   Float_t kno213 = this->KNO213Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01796   if (kno213<0.0){kno213=0.0;}
01797   if (kno213>1.0){kno213=1.0;}
01798   Float_t kno223 = this->KNO223Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01799   if (kno223<0.0){kno223=0.0;}
01800   if (kno223>1.0){kno223=1.0;}
01801   Float_t kno233 = this->KNO233Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01802   if (kno233<0.0){kno233=0.0;}
01803   if (kno233>1.0){kno233=1.0;}
01804   Float_t kno243 = this->KNO243Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01805   if (kno243<0.0){kno243=0.0;}
01806   if (kno243>1.0){kno243=1.0;}
01807   config.set_dis_res(1,3,e_vp,kno113);
01808   config.set_dis_res(1,3,e_vn,kno123);
01809   config.set_dis_res(1,3,e_vbp,kno133);
01810   config.set_dis_res(1,3,e_vbn,kno143);
01811   config.set_dis_res(2,3,e_vp,kno213);
01812   config.set_dis_res(2,3,e_vn,kno223);
01813   config.set_dis_res(2,3,e_vbp,kno233);
01814   config.set_dis_res(2,3,e_vbn,kno243);
01815 }

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

Definition at line 1642 of file NuSystematic.cxx.

References NuEvent::inu, KNO112Default(), KNO113Default(), KNO122Default(), KNO123Default(), KNO132Default(), KNO133Default(), KNO142Default(), KNO143Default(), KNO212Default(), KNO213Default(), KNO222Default(), KNO223Default(), KNO232Default(), KNO233Default(), KNO242Default(), KNO243Default(), MA_QEDefault(), MA_ResDefault(), Registry::Set(), and ShiftAsValue().

Referenced by NeugenXSecShift().

01643 {
01644   Float_t ma_qe = this->MA_QEDefault();
01645   Float_t ma_res = this->MA_ResDefault();
01646   
01647   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
01648   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecCCMA);
01649   ma_qe *= ShiftAsValue(NuSyst::kCombinedXSecMaQE);
01650   ma_res *= ShiftAsValue(NuSyst::kCombinedXSecMaRes);
01651   
01652   if (event.inu<0) {
01653     ma_qe *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
01654     ma_res *= ShiftAsValue(NuSyst::kNuMuBarXSecCCMA);
01655   }
01656 
01657   registry.Set("neugen:ma_qe",ma_qe);
01658   registry.Set("neugen:ma_res",ma_res);
01659 
01660   Float_t kno112 = this->KNO112Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01661   if (kno112<0.0){kno112=0.0;}
01662   if (kno112>1.0){kno112=1.0;}
01663   Float_t kno122 = this->KNO122Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01664   if (kno122<0.0){kno122=0.0;}
01665   if (kno122>1.0){kno122=1.0;}
01666   Float_t kno132 = this->KNO132Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01667   if (event.inu<0) kno132 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
01668   if (kno132<0.0){kno132=0.0;}
01669   if (kno132>1.0){kno132=1.0;}
01670   Float_t kno142 = this->KNO142Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01671   if (event.inu<0) kno142 += this->ShiftAsValue(NuSyst::kNuMuBarXSecDISMultip2);
01672   if (kno142<0.0){kno142=0.0;}
01673   if (kno142>1.0){kno142=1.0;}
01674   Float_t kno212 = this->KNO212Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01675   if (kno212<0.0){kno212=0.0;}
01676   if (kno212>1.0){kno212=1.0;}
01677   Float_t kno222 = this->KNO222Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01678   if (kno222<0.0){kno222=0.0;}
01679   if (kno222>1.0){kno222=1.0;}
01680   Float_t kno232 = this->KNO232Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01681   if (kno232<0.0){kno232=0.0;}
01682   if (kno232>1.0){kno232=1.0;}
01683   Float_t kno242 = this->KNO242Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip2);
01684   if (kno242<0.0){kno242=0.0;}
01685   if (kno242>1.0){kno242=1.0;}
01686   registry.Set("neugen:kno_r112",kno112);
01687   registry.Set("neugen:kno_r122",kno122);
01688   registry.Set("neugen:kno_r132",kno132);
01689   registry.Set("neugen:kno_r142",kno142);
01690   registry.Set("neugen:kno_r212",kno212);
01691   registry.Set("neugen:kno_r222",kno222);
01692   registry.Set("neugen:kno_r232",kno232);
01693   registry.Set("neugen:kno_r242",kno242);
01694 
01695   Float_t kno113 = this->KNO113Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01696   if (kno113<0.0){kno113=0.0;}
01697   if (kno113>1.0){kno113=1.0;}
01698   Float_t kno123 = this->KNO123Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01699   if (kno123<0.0){kno123=0.0;}
01700   if (kno123>1.0){kno123=1.0;}
01701   Float_t kno133 = this->KNO133Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01702   if (kno133<0.0){kno133=0.0;}
01703   if (kno133>1.0){kno133=1.0;}
01704   Float_t kno143 = this->KNO143Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01705   if (kno143<0.0){kno143=0.0;}
01706   if (kno143>1.0){kno143=1.0;}
01707   Float_t kno213 = this->KNO213Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01708   if (kno213<0.0){kno213=0.0;}
01709   if (kno213>1.0){kno213=1.0;}
01710   Float_t kno223 = this->KNO223Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01711   if (kno223<0.0){kno223=0.0;}
01712   if (kno223>1.0){kno223=1.0;}
01713   Float_t kno233 = this->KNO233Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01714   if (kno233<0.0){kno233=0.0;}
01715   if (kno233>1.0){kno233=1.0;}
01716   Float_t kno243 = this->KNO243Default() + this->ShiftAsValue(NuSyst::kCombinedXSecDISMultip3);
01717   if (kno243<0.0){kno243=0.0;}
01718   if (kno243>1.0){kno243=1.0;}
01719   registry.Set("neugen:kno_r113",kno113);
01720   registry.Set("neugen:kno_r123",kno123);
01721   registry.Set("neugen:kno_r133",kno133);
01722   registry.Set("neugen:kno_r143",kno143);
01723   registry.Set("neugen:kno_r213",kno213);
01724   registry.Set("neugen:kno_r223",kno223);
01725   registry.Set("neugen:kno_r233",kno233);
01726   registry.Set("neugen:kno_r243",kno243);
01727 }

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

Definition at line 708 of file NuSystematic.cxx.

References currentSigma, MAXMSG, and SystFromName().

00709 {
00710   cout << "Calling SetShifts" << endl;
00711   map<TString, double>::const_iterator it;
00712   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size() 
00713   << " systematic shifts." << endl;
00714   
00715   for (it = input.begin(); it != input.end(); ++it) {
00716     NuSyst::NuSystematic_t fSys = SystFromName(it->first);
00717     currentSigma[fSys] = it->second;
00718   }  
00719 }

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

Definition at line 695 of file NuSystematic.cxx.

References currentSigma, and MAXMSG.

Referenced by NuDSTAna::TestNuSyst().

00696 {
00697   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00698   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size() 
00699   << " systematic shifts." << endl;
00700          
00701   for (it = input.begin(); it != input.end(); ++it) {
00702     currentSigma[it->first] = it->second;
00703   }  
00704 }

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

Definition at line 681 of file NuSystematic.cxx.

References ConvertValueToSigma(), currentSigma, MAXMSG, and SystFromName().

00682 {
00683   cout << "Calling SetShifts" << endl;
00684   map<TString, double>::const_iterator it;
00685   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size() 
00686   << " systematic shifts." << endl;
00687   
00688   for (it = input.begin(); it != input.end(); ++it) {
00689     NuSyst::NuSystematic_t fSys = SystFromName(it->first);
00690     currentSigma[fSys] = ConvertValueToSigma(it->second, fSys);
00691   }  
00692 }

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

Definition at line 668 of file NuSystematic.cxx.

References ConvertValueToSigma(), currentSigma, and MAXMSG.

Referenced by NuDSTAna::TestNuSyst().

00669 {
00670   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00671   MAXMSG("NuSystematic",Msg::kInfo,5) << "Setting " << input.size() 
00672   << " systematic shifts." << endl;
00673   
00674   for (it = input.begin(); it != input.end(); ++it) {
00675     currentSigma[it->first] = ConvertValueToSigma(it->second, it->first);
00676   }  
00677 }

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

Definition at line 737 of file NuSystematic.cxx.

References currentSigma, MSG, and SystFromName().

00738 {
00739   map<TString, double>::const_iterator it;
00740   
00741   for (it = input.begin(); it != input.end(); ++it) {
00742     MSG("NuSystematic",Msg::kInfo) << "Setting " << it->first
00743     << " 1 sigma to " << it->second << endl;
00744     NuSyst::NuSystematic_t fSys = SystFromName(it->first);
00745     currentSigma[fSys] = it->second;
00746   }  
00747 }

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

Definition at line 723 of file NuSystematic.cxx.

References MSG, oneSigma, and SystNames().

00724 {
00725   map<NuSyst::NuSystematic_t, double>::const_iterator it;
00726   
00727   for (it = input.begin(); it != input.end(); ++it) {
00728     MSG("NuSystematic",Msg::kInfo) << "Setting " << SystNames(it->first)
00729     << " 1 sigma to " << it->second << endl;
00730     oneSigma[it->first] = it->second;
00731   }  
00732   
00733 }

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

Definition at line 946 of file NuSystematic.cxx.

References AllBackgroundsScaleBothShift(), BeamShift(), BFieldShift(), CCBackgroundShift(), CurrentSigma(), EnergyResolutionEvent(), EnergyResolutionShower(), EnergyResolutionTrackCurve(), EnergyResolutionTrackRange(), JitterVDPIDShift(), NCBackgroundShift(), NDCleaningShift(), NeugenXSecShift(), NormalisationShift(), NuMuBarQELXSecShift(), NuMuBarResXSecShift(), NuMuBarSumXSecShift(), OverallXSecShift(), ScrapingShift(), ShowerEnergyFunction(), ShowerEnergyOffset(), ShowerEnergyScale(), TargetHoleShift(), TauQELResShift(), TrackEnergyOverall(), and TrackEnergyScale().

Referenced by NuXFitAnalysis::CacheFDMCEvents(), NuCrossSectionFitter::CacheNDMCEvents(), NuTransition::DoSystematicShifts(), NuDSTAna::DoSystematicShifts(), NuFluctuator::MakeShiftedCPTPDFs(), NuFluctuator::MakeShiftedTransitionPDFs(), and NuDSTAna::TestNuSyst().

00947 {
00948   if (CurrentSigma(NuSyst::kScraping))   this->ScrapingShift(event);
00949   if (CurrentSigma(NuSyst::kTargetHole)) this->TargetHoleShift(event);
00950   if (CurrentSigma(NuSyst::kShowerEnergyOffset)) this->ShowerEnergyOffset(event);
00951   if (CurrentSigma(NuSyst::kShowerEnergyFunction)) this->ShowerEnergyFunction(event);
00952   if (CurrentSigma(NuSyst::kShowerEnergyScale) ||
00953       CurrentSigma(NuSyst::kShowerEnergyScaleNear) ||
00954       CurrentSigma(NuSyst::kShowerEnergyScaleFar) ||
00955       CurrentSigma(NuSyst::kShowerEnergyScaleRelative) ) this->ShowerEnergyScale(event);
00956   if (CurrentSigma(NuSyst::kTrackEnergyRange) ||
00957       CurrentSigma(NuSyst::kTrackEnergyScale) ||
00958       CurrentSigma(NuSyst::kTrackEnergyCurvatureBoth) ||
00959       CurrentSigma(NuSyst::kTrackEnergyCurvatureFar) ) this->TrackEnergyScale(event);
00960   if (CurrentSigma(NuSyst::kTrackEnergyOverall)) this->TrackEnergyOverall(event);
00961   if (CurrentSigma(NuSyst::kBeam)) this->BeamShift(event);
00962   if (CurrentSigma(NuSyst::kBFieldBoth) ||
00963       CurrentSigma(NuSyst::kBFieldNear) ||
00964       CurrentSigma(NuSyst::kBFieldFar) ) this->BFieldShift(event);
00965   if (CurrentSigma(NuSyst::kAllBackgroundsScaleBoth)) this->AllBackgroundsScaleBothShift(event);
00966   if (CurrentSigma(NuSyst::kNCBackground)) this->NCBackgroundShift(event);
00967   if (CurrentSigma(NuSyst::kCCBackground)) this->CCBackgroundShift(event);
00968   if (CurrentSigma(NuSyst::kNDCleaning)) this->NDCleaningShift(event);
00969   if (CurrentSigma(NuSyst::kNormalisationBoth) ||
00970       CurrentSigma(NuSyst::kNormalisationNear) ||
00971       CurrentSigma(NuSyst::kNormalisationFar)) this->NormalisationShift(event);
00972   if (CurrentSigma(NuSyst::kNuMuBarXSecSum)) this->NuMuBarSumXSecShift(event);
00973   if (CurrentSigma(NuSyst::kCombinedXSecOverall) ||
00974       CurrentSigma(NuSyst::kNuMuBarXSecOverall)) this->OverallXSecShift(event);
00975   if (CurrentSigma(NuSyst::kNuMuBarXSecQEL)) this->NuMuBarQELXSecShift(event);
00976   if (CurrentSigma(NuSyst::kNuMuBarXSecRes)) this->NuMuBarResXSecShift(event);
00977   if (CurrentSigma(NuSyst::kCombinedXSecCCMA) ||
00978       CurrentSigma(NuSyst::kCombinedXSecMaRes) ||
00979       CurrentSigma(NuSyst::kCombinedXSecMaQE) ||
00980       CurrentSigma(NuSyst::kCombinedXSecDISMultip2) ||
00981       CurrentSigma(NuSyst::kCombinedXSecDISMultip3) ||
00982       CurrentSigma(NuSyst::kNuMuBarXSecCCMA) ||
00983       CurrentSigma(NuSyst::kNuMuBarXSecDISMultip2)) this->NeugenXSecShift(event);
00984   if (CurrentSigma(NuSyst::kJitterVDPID)) this->JitterVDPIDShift(event);
00985   if (CurrentSigma(NuSyst::kTauQELRes)) this->TauQELResShift(event);
00986   if (CurrentSigma(NuSyst::kEnergyResolutionEventBoth) ||
00987       CurrentSigma(NuSyst::kEnergyResolutionEventNear)) this->EnergyResolutionEvent(event);
00988   if (CurrentSigma(NuSyst::kEnergyResolutionShowerBoth) ||
00989       CurrentSigma(NuSyst::kEnergyResolutionShowerNear)) this->EnergyResolutionShower(event);
00990   if (CurrentSigma(NuSyst::kEnergyResolutionTrackRangeBoth) ||
00991       CurrentSigma(NuSyst::kEnergyResolutionTrackRangeNear)) this->EnergyResolutionTrackRange(event);
00992   if (CurrentSigma(NuSyst::kEnergyResolutionTrackCurveBoth) ||
00993       CurrentSigma(NuSyst::kEnergyResolutionTrackCurveNear)) this->EnergyResolutionTrackCurve(event);
00994 }

virtual const Float_t NuSystematic::ShiftAsSigma NuSyst::NuSystematic_t  fSys  )  const [inline, virtual]
 

Definition at line 340 of file NuSystematic.h.

Referenced by AllBackgroundsScaleBothShift(), BeamShift(), BFieldShift(), CCBackgroundShift(), EnergyResolutionEvent(), EnergyResolutionShower(), EnergyResolutionTrackCurve(), EnergyResolutionTrackRange(), JitterVDPIDShift(), NCBackgroundShift(), NDCleaningShift(), NormalisationShift(), NuMuBarQELXSecShift(), NuMuBarResXSecShift(), NuMuBarSumXSecShift(), OverallXSecShift(), ScrapingShift(), ShowerEnergyFunction(), ShowerEnergyScale(), TFProbShift(), TrackEnergyOverall(), and TrackEnergyScale().

00341     { return CurrentSigma(fSys); }

virtual const Float_t NuSystematic::ShiftAsValue NuSyst::NuSystematic_t  fSys  )  const [inline, virtual]
 

Definition at line 338 of file NuSystematic.h.

Referenced by AllBackgroundsScaleBothShift(), BeamShift(), BFieldShift(), CCBackgroundShift(), EnergyResolutionEvent(), EnergyResolutionShower(), EnergyResolutionTrackCurve(), EnergyResolutionTrackRange(), NCBackgroundShift(), NDCleaningShift(), NormalisationShift(), NuMuBarQELXSecShift(), NuMuBarResXSecShift(), NuMuBarSumXSecShift(), OverallXSecShift(), ScrapingShift(), SetShiftedNeugenParameters(), ShowerEnergyOffset(), ShowerEnergyScale(), TargetHoleShift(), TauQELResShift(), TFProbShift(), and TrackEnergyScale().

00339     { return ConvertSigmaToValue(CurrentSigma(fSys), fSys); }

void NuSystematic::ShowerEnergyFunction NuEvent event  )  const [private, virtual]
 

Definition at line 1408 of file NuSystematic.cxx.

References NuEvent::energy, MAXMSG, ShiftAsSigma(), NuEvent::shwEn, and NuEvent::trkEn.

Referenced by Shift().

01409 {
01410   MAXMSG("NuSystematic",Msg::kInfo,1)
01411     << "Performing shower energy function scale " 
01412     << ShiftAsSigma(NuSyst::kShowerEnergyFunction)
01413     << "s" << endl;
01414 
01415   Double_t offset = 7.0;
01416   Double_t scale = 4.0;
01417   Double_t eLife = 1.5; //GeV
01418   Double_t enShift = 1.0 + this->ShiftAsSigma(NuSyst::kShowerEnergyFunction)*0.01*
01419     (offset + scale*TMath::Exp(-1.0*event.shwEn/eLife));
01420   event.shwEn *= enShift;
01421   event.energy = event.shwEn+event.trkEn;
01422   return;
01423 }

void NuSystematic::ShowerEnergyOffset NuEvent event  )  const [private, virtual]
 

Definition at line 1398 of file NuSystematic.cxx.

References NuEvent::energy, MAXMSG, ShiftAsValue(), NuEvent::shwEn, and NuEvent::trkEn.

Referenced by Shift().

01399 {
01400     MAXMSG("NuSystematic",Msg::kInfo,1)
01401       << "Performing shower energy offset shift = " << ShiftAsValue(NuSyst::kShowerEnergyOffset)/Munits::MeV << " MeV" << endl;
01402   event.shwEn += ShiftAsValue(NuSyst::kShowerEnergyOffset)/Munits::GeV;
01403   event.energy = event.shwEn+event.trkEn;
01404   return;
01405 }

void NuSystematic::ShowerEnergyScale NuEvent event  )  const [private, virtual]
 

Definition at line 1426 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, MAXMSG, ShiftAsSigma(), ShiftAsValue(), NuEvent::shwEn, and NuEvent::trkEn.

Referenced by Shift().

01427 {
01428   MAXMSG("NuSystematic",Msg::kInfo,1)
01429       << "Performing shower energy scale with near = " << ShiftAsSigma(NuSyst::kShowerEnergyScaleNear)
01430       << "s, far = " << ShiftAsSigma(NuSyst::kShowerEnergyScaleFar)
01431       << "s, relative = " << ShiftAsSigma(NuSyst::kShowerEnergyScaleRelative)
01432       << "s, overall = " << ShiftAsSigma(NuSyst::kShowerEnergyScale) << "s" << endl;
01433   
01434   if (Detector::kNear==event.detector) {
01435     event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScaleNear);
01436     event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScaleRelative);
01437   }
01438   if (Detector::kFar==event.detector) {
01439     event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScaleFar);
01440   }
01441   event.shwEn *= ShiftAsValue(NuSyst::kShowerEnergyScale);
01442   event.energy = event.shwEn+event.trkEn;
01443   return;
01444 }

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

Definition at line 794 of file NuSystematic.cxx.

References MSG, and systNames.

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

00795 {
00796   // First transform alternate names into cannonical ones
00797   if (systName.Contains("Scraping",TString::kIgnoreCase))
00798     systName = "DecayPipe";
00799   else if (systName.Contains("AbsoluteEnergyCalibration",TString::kIgnoreCase))
00800     systName = "ShowerEnergyScaleBoth";
00801   else if (systName.Contains("RelativeEnergyCalibrationNear",TString::kIgnoreCase))
00802     systName = "ShowerEnergyScaleNear";
00803   else if (systName.Contains("RelativeEnergyCalibrationFar",TString::kIgnoreCase))
00804     systName = "ShowerEnergyScaleFar";
00805   else if (systName.Contains("RelativeEnergyCalibration",TString::kIgnoreCase))
00806     systName = "ShowerEnergyScaleRelative";
00807   else if (systName.Contains("Beam",TString::kIgnoreCase) ||
00808            systName.Contains("SKZP",TString::kIgnoreCase) )
00809     systName = "Flux";
00810   else if (systName.Contains("Normalization",TString::kIgnoreCase)) {
00811     systName.ToLower();
00812     systName.ReplaceAll("lization", "lisation");
00813   }
00814 
00815   map<NuSyst::NuSystematic_t, TString>::const_iterator it;
00816   
00817   for (it = systNames.begin(); it != systNames.end(); ++it) {
00818     if (it->second.Contains(systName, TString::kIgnoreCase)) {
00819       return it->first;
00820     }
00821   }
00822   
00823   MSG("NuSystematic",Msg::kError) << "Cannot find systematic named " << systName << ", returning kUnknown." << endl;
00824   return NuSyst::kUnknown;
00825 }

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

Definition at line 855 of file NuSystematic.cxx.

References MSG, and systMode.

Referenced by ConvertSigmaToValue(), and ConvertValueToSigma().

00856 {
00857   map<NuSyst::NuSystematic_t, Int_t>::const_iterator it;
00858   it = systMode.find(syst);
00859   if (it == systMode.end()) {
00860     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in systMode." << endl;
00861     assert(false);
00862   }
00863   return it->second;  
00864 }

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

Definition at line 868 of file NuSystematic.cxx.

References MSG, and systNames.

Referenced by PrintState(), and SetSigmas().

00869 {
00870   map<NuSyst::NuSystematic_t, TString>::const_iterator it;
00871   it = systNames.find(syst);
00872   if (it == systNames.end()) {
00873     MSG("NuSystematic",Msg::kError) << "Systematic # " << syst << " does not exist in systNames." << endl;
00874     assert(false);
00875   }
00876   return it->second;  
00877 }

void NuSystematic::TargetHoleShift NuEvent event  )  const [private, virtual]
 

Definition at line 1344 of file NuSystematic.cxx.

References MAXMSG, NuEvent::ppvz, NuEvent::rw, and ShiftAsValue().

Referenced by Shift().

01345 {
01346   Double_t holeStart = 20.0;
01347   Double_t holeLength = ShiftAsValue(NuSyst::kTargetHole);
01348 
01349   MAXMSG("NuSystematic",Msg::kInfo,1)
01350     << "Performing target hole shift. Hole length: "
01351     << holeLength << " cm" << endl;
01352 
01353   if ((event.ppvz > holeStart) && (event.ppvz < holeStart+holeLength)){
01354     event.rw = 0;
01355   }
01356   return;
01357 }

void NuSystematic::TauQELResShift NuEvent event  )  const [private, virtual]
 

Definition at line 1193 of file NuSystematic.cxx.

References NuEvent::iaction, NuEvent::inu, NuEvent::iresonance, MAXMSG, NuEvent::rw, and ShiftAsValue().

Referenced by Shift().

01194 {
01195   MAXMSG("NuSystematic",Msg::kInfo,1)
01196     << "Performing tau QEL+Res shift: "
01197     << (this->ShiftAsValue(NuSyst::kTauQELRes)-1.)*100. << "%." << endl;
01198 
01199   if (16 == TMath::Abs(event.inu) && 1 == event.iaction
01200       && (1001 == event.iresonance || 1002 == event.iresonance)){
01201     event.rw *= ShiftAsValue(NuSyst::kTauQELRes);
01202   }
01203   return;
01204 }

void NuSystematic::TFProbShift NuEvent event  )  const [private, virtual]
 

Definition at line 1080 of file NuSystematic.cxx.

References MAXMSG, NuEvent::prob, ShiftAsSigma(), and ShiftAsValue().

01081 {
01082   MAXMSG("NuSystematic",Msg::kInfo,1)
01083     << "Performing track fit probability shift = " << ShiftAsSigma(NuSyst::kTFProb) << "s" << endl;
01084   event.prob += ShiftAsValue(NuSyst::kTFProb);
01085   return;
01086 }

void NuSystematic::TrackEnergyOverall NuEvent event  )  const [private, virtual]
 

Definition at line 1472 of file NuSystematic.cxx.

References NuEvent::energy, MAXMSG, ShiftAsSigma(), NuEvent::shwEn, NuEvent::trkEn, NuEvent::usedCurv, and NuEvent::usedRange.

Referenced by Shift().

01473 {
01474   MAXMSG("NuSystematic",Msg::kInfo,1)
01475   << "Performing overall track energy shift "
01476   << this->ShiftAsSigma(NuSyst::kTrackEnergyOverall) << " sigma"
01477   << endl;
01478   Double_t eScale = 1.0;
01479   if (event.usedRange){
01480     eScale = 2.0;
01481   }
01482   else if (event.usedCurv){
01483     eScale = 3.0;
01484   }
01485   else {
01486     eScale = 1.0;
01487   }
01488   event.trkEn *= 1.0 + this->ShiftAsSigma(NuSyst::kTrackEnergyOverall)*0.01*eScale;
01489   event.energy = event.shwEn+event.trkEn;
01490   return;
01491 }

void NuSystematic::TrackEnergyScale NuEvent event  )  const [private, virtual]
 

Definition at line 1447 of file NuSystematic.cxx.

References NuEvent::detector, NuEvent::energy, MAXMSG, ShiftAsSigma(), ShiftAsValue(), NuEvent::shwEn, NuEvent::trkEn, and NuEvent::usedRange.

Referenced by Shift().

01448 {
01449   MAXMSG("NuSystematic",Msg::kInfo,1)
01450   << "Performing track energy scale with range = " << ShiftAsSigma(NuSyst::kTrackEnergyRange)
01451   << "s, curve near = " << ShiftAsSigma(NuSyst::kTrackEnergyCurvatureNear)
01452   << "s, curve far = " << ShiftAsSigma(NuSyst::kTrackEnergyCurvatureFar)
01453   << "s, curve both = " << ShiftAsSigma(NuSyst::kTrackEnergyCurvatureBoth)
01454   << "s, scale = " << ShiftAsSigma(NuSyst::kShowerEnergyScale) << "s" << endl;
01455   
01456   if (event.usedRange){
01457     event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyRange);
01458   }
01459   else {
01460     event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyCurvatureBoth);
01461     if (Detector::kNear==event.detector)
01462       event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyCurvatureNear);
01463     if (Detector::kFar==event.detector)
01464       event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyCurvatureFar);
01465   }
01466   event.trkEn *= ShiftAsValue(NuSyst::kTrackEnergyScale);
01467   event.energy = event.shwEn+event.trkEn;
01468   return;
01469 }

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

Definition at line 1826 of file NuSystematic.cxx.

References MSG.

Referenced by NuMatrixMethod::ShiftXSecGraph().

01828 {
01829   if (!(NuParticle::kNuMu == particle || NuParticle::kNuMuBar == particle)){
01830     MSG("NuSystematic.cxx",Msg::kWarning)
01831       << "I don't know how to systematically shift this particle"
01832       << endl;
01833     return 1.0;
01834   }
01835 
01836   if (CurrentSigma(NuSyst::kCombinedXSecOverall)){
01837     return this->ShiftAsValue(NuSyst::kCombinedXSecOverall);
01838   }
01839   else if (CurrentSigma(NuSyst::kNuMuBarXSecOverall)){
01840     if (NuParticle::kNuMuBar == particle){
01841       return this->ShiftAsValue(NuSyst::kNuMuBarXSecOverall);
01842     }
01843     else {
01844       return 1.0;
01845     }
01846   }
01847   else if (CurrentSigma(NuSyst::kNuMuBarXSecCCMA) ||
01848            CurrentSigma(NuSyst::kNuMuBarXSecDISMultip2)){
01849     if (NuParticle::kNuMuBar != particle){
01850       return 1.0;
01851     }
01852     else {return this->NeugenXSecShiftScale(energy,particle);}
01853   }
01854   else if(CurrentSigma(NuSyst::kCombinedXSecCCMA) ||
01855           CurrentSigma(NuSyst::kCombinedXSecDISMultip2) ||
01856           CurrentSigma(NuSyst::kCombinedXSecDISMultip3)){
01857     if (!(NuParticle::kNuMu == particle || NuParticle::kNuMuBar == particle)){
01858       return 1.0;
01859     }
01860     else if(CurrentSigma(NuSyst::kNuMuBarXSecQEL)){
01861       return this->QELXSecShiftScale(energy,particle);
01862     }
01863     else if (CurrentSigma(NuSyst::kNuMuBarXSecRes)){
01864       return this->ResXSecShiftScale(energy,particle);
01865     }
01866     else {return this->NeugenXSecShiftScale(energy,particle);}
01867   }
01868   else {return 1.0;}
01869 }


Member Data Documentation

map<NuSyst::NuSystematic_t, double> NuSystematic::currentSigma [private]
 

Definition at line 350 of file NuSystematic.h.

Referenced by CurrentSigma(), EverythingOff(), PrintState(), Randomize(), ReadXML(), SetShiftsAsSigmas(), SetShiftsAsValues(), and SetSigmas().

NuCut* NuSystematic::fCCSelector [private]
 

Definition at line 356 of file NuSystematic.h.

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

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

Definition at line 313 of file NuSystematic.cxx.

Referenced by NeugenXSecShift().

Float_t NuSystematic::fkno_r112Default [private]
 

Definition at line 421 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r113Default [private]
 

Definition at line 425 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r122Default [private]
 

Definition at line 422 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r123Default [private]
 

Definition at line 426 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r132Default [private]
 

Definition at line 423 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r133Default [private]
 

Definition at line 427 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r142Default [private]
 

Definition at line 424 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r143Default [private]
 

Definition at line 428 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fkno_r212Default [private]
 

Definition at line 429 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r213Default [private]
 

Definition at line 433 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r222Default [private]
 

Definition at line 430 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r223Default [private]
 

Definition at line 434 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r232Default [private]
 

Definition at line 431 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r233Default [private]
 

Definition at line 435 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r242Default [private]
 

Definition at line 432 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fkno_r243Default [private]
 

Definition at line 436 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults().

Float_t NuSystematic::fma_qeDefault [private]
 

Definition at line 437 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

Float_t NuSystematic::fma_resDefault [private]
 

Definition at line 438 of file NuSystematic.h.

Referenced by ConfigureNeugenDefaults(), and SetNeugenDefaults().

NuCut* NuSystematic::fNCSelector [private]
 

Definition at line 357 of file NuSystematic.h.

Referenced by CCBackgroundShift(), NDCleaningShift(), NuSystematic(), SetNCSelector(), and ~NuSystematic().

NuCut* NuSystematic::fNuBarSelector [private]
 

Definition at line 358 of file NuSystematic.h.

Referenced by AllBackgroundsScaleBothShift(), NuSystematic(), SetNuBarSelector(), and ~NuSystematic().

TRandom3* NuSystematic::fRandom [private]
 

Definition at line 361 of file NuSystematic.h.

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

NuCut* NuSystematic::fRockSelector [private]
 

Definition at line 359 of file NuSystematic.h.

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

Int_t NuSystematic::kAsIs = 2 [static]
 

Definition at line 315 of file NuSystematic.cxx.

Int_t NuSystematic::kMinusPlus = 1 [static]
 

Definition at line 314 of file NuSystematic.cxx.

Int_t NuSystematic::kSigma = 3 [static]
 

Definition at line 316 of file NuSystematic.cxx.

map<NuSyst::NuSystematic_t, double> NuSystematic::oneSigma [private]
 

Definition at line 348 of file NuSystematic.h.

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

map<NuSyst::NuSystematic_t, Int_t> NuSystematic::systMode [private]
 

Definition at line 352 of file NuSystematic.h.

Referenced by InitializeSystematics(), and SystMode().

map<NuSyst::NuSystematic_t, TString> NuSystematic::systNames [private]
 

Definition at line 354 of file NuSystematic.h.

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


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