NuTransition Class Reference

#include <NuTransition.h>

List of all members.

Public Member Functions

 NuTransition (const NuXMLConfig *xmlConfig)
 ~NuTransition ()
void Fill (NuMCEvent &mc)
void Reweight (NuEvent &nu)
NuEventGetTransitionEvent (const NuEvent &nu)
Bool_t IsSetToDoTransitions () const

Private Member Functions

Float_t Baseline () const
Float_t OscillationWeight (const Float_t energy, const Int_t inu, const NuXMLConfig *lxmlConfig=0) const
void DoSystematicShifts (NuEvent &event)
Double_t GetXSecGraph (NuEvent &nu, bool opp_charge=false) const
Double_t GetXSecGraph (NuMCEvent &nu, bool opp_charge=false) const
Double_t GetXSecNeugen (NuEvent &nu, bool opp_charge=false) const

Private Attributes

TH1D * numu_flux
TH1D * nubar_flux
TH1D * flux_weight
TGraph * fNuMuXGraph
TGraph * fNuBarXGraph
NuXMLConfigfxmlConfig
NuSystematicfSyst
bool applyTranSyst
bool firstRunTrans
bool doNothing


Detailed Description

Definition at line 18 of file NuTransition.h.


Constructor & Destructor Documentation

NuTransition::NuTransition ( const NuXMLConfig xmlConfig  ) 

Definition at line 46 of file NuTransition.cxx.

References applyTranSyst, NuXMLConfig::BinningScheme(), NuXMLConfig::DM2Bar(), NuXMLConfig::DM2Nu(), doNothing, firstRunTrans, flux_weight, NuSystematic::FluxSyst(), fNuBarXGraph, fNuMuXGraph, fSyst, fxmlConfig, Msg::kError, Msg::kInfo, MAXMSG, MSG, nubar_flux, numu_flux, NuUtilities::RecoBins(), NuXMLConfig::SN2Bar(), NuXMLConfig::SN2Nu(), NuXMLConfig::TransitionProb(), and NuUtilities::TrueBins().

00047 {
00048     // Get our local xmlConfig copy, if it is safe to do so
00049     if (!xmlConfig) {
00050         // If the XML file does not exist, we can't do anything
00051         doNothing = true;
00052         
00053         MAXMSG("NuTransition",Msg::kInfo,5)
00054         << "No NuXMLConfig object supplied: "
00055         << "performing no systematic shifts, oscillations, or transitions."
00056         << endl;
00057         return;
00058     }
00059     
00060     fxmlConfig = (NuXMLConfig*)xmlConfig->Clone();
00061     firstRunTrans = true;
00062 
00063     MSG("NuTransition",Msg::kInfo) << "Applying parameters: " 
00064     << "dm2nu = " << xmlConfig->DM2Nu()   << ", sn2nu = " << xmlConfig->SN2Nu()
00065     << ", dm2bar = " << xmlConfig->DM2Bar() << ", sn2bar = " << xmlConfig->SN2Bar()
00066     << ", alpha = " << xmlConfig->TransitionProb() << endl;
00067     
00068     doNothing  = false;
00069     
00070     if (doNothing) return;
00071     
00072     fSyst = new NuSystematic(*fxmlConfig);
00073     
00074     // Get the binning scheme set up
00075     const NuUtilities cuts;
00076   
00077     //Binning scheme
00078     NuBinningScheme::NuBinningScheme_t binningScheme =
00079         static_cast<NuBinningScheme::NuBinningScheme_t>(xmlConfig->BinningScheme());
00080   
00081     std::vector<Double_t> vReco = cuts.RecoBins(binningScheme);
00082     std::vector<Double_t> vTrue = cuts.TrueBins(binningScheme);
00083     
00084     Int_t numRecoBins = vReco.size() - 1;
00085     Int_t numTrueBins = vTrue.size() - 1;
00086     
00087     Double_t *recoBinsArray = &(vReco[0]);
00088     Double_t *trueBinsArray = &(vTrue[0]);
00089     
00090     // Creat the reweighting histograms
00091     numu_flux   = new TH1D("numu_flux","numu_flux",numTrueBins,trueBinsArray);
00092     nubar_flux  = new TH1D("nubar_flux","nubar_flux",numRecoBins,recoBinsArray);
00093     flux_weight = new TH1D("flux_weight","flux_weight",numRecoBins,recoBinsArray);
00094     
00095     // Determine how the systematics are applied
00096     if (NuSystematic::FluxSyst(*xmlConfig)) { 
00097         MSG("NuTransition", Msg::kInfo) << "Not applying " << xmlConfig->Name() 
00098         << " to transitions b/c it's a flux systematic." << endl;
00099         applyTranSyst = false;
00100     }
00101     else {
00102         applyTranSyst = true;
00103     }
00104     
00105     // Get the XSec graphs from file
00106     TDirectory *start = gDirectory;
00107     
00108     MSG("NuTransition",Msg::kInfo) << "Get cross-section graphs from file." << endl;
00109     
00110     const char * fxsecfilename = getenv("xf");
00111     
00112     MSG("NuTransition",Msg::kInfo) << "Opening xsec file: " << fxsecfilename << endl;
00113     TFile *xsecfile = new TFile(fxsecfilename,"READ");
00114   
00115     // Check to see if this failed
00116     if (!xsecfile->IsOpen()) {
00117       MSG("NuTransition", Msg::kError) << "\n\n"
00118         << "*****************************************************************************\n"
00119         << "Failed to open cross section file.\n"
00120         << "Currently the cross section file is found through the 'xf' environment variable.\n"
00121         << "Perhaps you need to issue a command such as:\n   "
00122         << "   export xf=\"$SRT_PRIVATE_CONTEXT/NtupleUtils/data/xsec_minos_modbyrs4_v3_5_0_mk.root\"\n"
00123         << "*****************************************************************************\n\n"
00124         << endl;
00125       throw runtime_error("Failed to read crosssection file");
00126     }
00127     
00128     // NuMu
00129     TH1F *fhNuMuCCCrossSections = (TH1F*) xsecfile->Get("h_numu_cc_tot");
00130     Float_t *x = new Float_t[fhNuMuCCCrossSections->GetNbinsX()];
00131     Float_t *y = new Float_t[fhNuMuCCCrossSections->GetNbinsX()];
00132     for(int i=0;i<fhNuMuCCCrossSections->GetNbinsX();i++) {
00133         x[i] = fhNuMuCCCrossSections->GetBinCenter(i+1);
00134         y[i] = fhNuMuCCCrossSections->GetBinContent(i+1);
00135     }
00136     fNuMuXGraph = new TGraph(fhNuMuCCCrossSections->GetNbinsX(),x,y);
00137     if (x) {delete[] x; x = 0;}
00138     if (y) {delete[] y; y = 0;}
00139     
00140     // NuMuBar
00141     TH1F *fhNuBarCCCrossSections = (TH1F*) xsecfile->Get("h_numubar_cc_tot");
00142     x = new Float_t[fhNuBarCCCrossSections->GetNbinsX()];
00143     y = new Float_t[fhNuBarCCCrossSections->GetNbinsX()];
00144     for(int i=0;i<fhNuBarCCCrossSections->GetNbinsX();i++) {
00145         x[i] = fhNuBarCCCrossSections->GetBinCenter(i+1);
00146         y[i] = fhNuBarCCCrossSections->GetBinContent(i+1);
00147     }
00148     fNuBarXGraph = new TGraph(fhNuBarCCCrossSections->GetNbinsX(),x,y);
00149     if (x) {delete[] x; x = 0;}
00150     if (y) {delete[] y; y = 0;}
00151     
00152     xsecfile->Close();
00153     if (xsecfile){delete xsecfile; xsecfile = 0;}
00154     
00155     gDirectory = start;
00156 
00157 }

NuTransition::~NuTransition (  ) 

Definition at line 160 of file NuTransition.cxx.

References flux_weight, nubar_flux, and numu_flux.

00161 {
00162     if (numu_flux) delete numu_flux; numu_flux = 0;
00163     if (nubar_flux) delete nubar_flux; nubar_flux = 0;
00164     if (flux_weight) delete flux_weight; flux_weight = 0;
00165 }


Member Function Documentation

Float_t NuTransition::Baseline (  )  const [inline, private]

Definition at line 39 of file NuTransition.h.

00039 {return 735.0;};

void NuTransition::DoSystematicShifts ( NuEvent event  )  [private]

Definition at line 331 of file NuTransition.cxx.

References fSyst, NuXMLConfig::FullTitle(), fxmlConfig, Msg::kInfo, MAXMSG, and NuSystematic::Shift().

Referenced by Reweight().

00332 {
00333     MAXMSG("NuTransition",Msg::kInfo,5)
00334     << "Performing systematic shift "
00335     << fxmlConfig->FullTitle()
00336     << endl;
00337     fSyst->Shift(event);
00338 }

void NuTransition::Fill ( NuMCEvent mc  ) 

Definition at line 168 of file NuTransition.cxx.

References doNothing, GetXSecGraph(), NuMCEvent::iaction, NuMCEvent::inu, Msg::kInfo, MAXMSG, NuMCEvent::neuEnMC, nubar_flux, numu_flux, and NuMCEvent::rw.

00169 {
00170     if (doNothing) return;
00171     
00172     // CC-only
00173     if (mc.iaction==1) { 
00174         double fw = 1;
00175         
00176         // Correct for Cross section
00177         fw *= this->GetXSecGraph(mc);
00178         
00179         if (mc.inu == 14) {
00180             numu_flux->Fill(mc.neuEnMC, mc.rw/fw);
00181             MAXMSG("NuTransition",Msg::kInfo,5) << "===> Fill numu, xsec=" << fw << endl;
00182         }
00183         else if (mc.inu == -14) {
00184             nubar_flux->Fill(mc.neuEnMC, mc.rw/fw);
00185             MAXMSG("NuTransition",Msg::kInfo,5) << "===> Fill nubar, xsec=" << fw << endl;
00186         }
00187         else{
00188             MAXMSG("NuTransition",Msg::kInfo,5) << "===> Fill nothing, ntyp=" << mc.inu << endl;
00189         }
00190     }
00191 }

NuEvent* NuTransition::GetTransitionEvent ( const NuEvent nu  ) 

Double_t NuTransition::GetXSecGraph ( NuMCEvent nu,
bool  opp_charge = false 
) const [private]

Definition at line 387 of file NuTransition.cxx.

References fNuBarXGraph, fNuMuXGraph, NuMCEvent::inu, NuMCEvent::neuEnMC, and NueConvention::numu.

00388 {
00389     Double_t nuBarXSec = fNuBarXGraph->Eval(nu.neuEnMC,0,"");
00390     Double_t nuMuXSec =  fNuMuXGraph->Eval( nu.neuEnMC,0,"");
00391     
00392     bool numu = (nu.inu > 0);
00393     if (opp_charge) numu = !numu;
00394        
00395     if (numu) return nuMuXSec;
00396     else      return nuBarXSec;
00397 }

Double_t NuTransition::GetXSecGraph ( NuEvent nu,
bool  opp_charge = false 
) const [private]

Definition at line 374 of file NuTransition.cxx.

References fNuBarXGraph, fNuMuXGraph, NuEvent::inu, NuEvent::neuEnMC, and NueConvention::numu.

Referenced by Fill().

00375 {
00376     Double_t nuBarXSec = fNuBarXGraph->Eval(nu.neuEnMC,0,"");
00377     Double_t nuMuXSec =  fNuMuXGraph->Eval( nu.neuEnMC,0,"");
00378     
00379     bool numu = (nu.inu > 0);
00380     if (opp_charge) numu = !numu;
00381     
00382     if (numu) return nuMuXSec;
00383     else      return nuBarXSec;
00384 }

Double_t NuTransition::GetXSecNeugen ( NuEvent nu,
bool  opp_charge = false 
) const [private]

Definition at line 401 of file NuTransition.cxx.

References e_undefined_init_state, e_vA, e_vbA, e_vbn, e_vbN, e_vbp, e_vn, e_vN, e_vp, NuEvent::hadronicFinalStateMC, NuEvent::iaction, init(), NuEvent::initialStateMC, NuEvent::inu, NuEvent::iresonance, Msg::kError, Msg::kInfo, Msg::kWarning, MSG, NuEvent::neuEnMC, NuEvent::neuPxMC, NuEvent::neuPyMC, NuEvent::neuPzMC, NuEvent::nucleusMC, neugen_wrapper::offshell_diff_xsec(), NuEvent::q2MC, neugen_config::set_best_parameters(), NuEvent::tgtEnMC, NuEvent::tgtPxMC, NuEvent::tgtPyMC, NuEvent::tgtPzMC, NuEvent::w2MC, NuEvent::xMC, and NuEvent::yMC.

00402 {
00404     // Get Cross Sections //
00406     
00407     static neugen_wrapper *fNuWrap = 0;
00408     //static Registry std_registry;   
00409     static neugen_config *std_config = 0;
00410     
00411     if (!fNuWrap) {
00412         //std_registry.Set("neugen:config_name","MODBYRS");
00413         //std_registry.Set("neugen:config_no",4);
00414         
00415         //NuSystematic::SetNeugenDefaults(std_registry);
00416         
00417         std_config = new neugen_config("stdNeuConfig");
00418         std_config->set_best_parameters();
00419         //if(config) SetStandardConfig(config);
00420         
00421         fNuWrap = new neugen_wrapper(std_config);
00422     }
00423     
00424     //event kinematic variables:
00425     double kval[5] = {0,0,0,0,0};
00426     int kid1 = -1;
00427     int kid2 = -1;
00428     kval[1] = nu.q2MC;
00429     kval[2] = nu.w2MC; 
00430     kval[3] = nu.xMC;
00431     kval[4] = nu.yMC;
00432     
00433     //translate from minossoft-speak to neugen-speak:
00434     int flavor = 4;
00435     if(abs(nu.inu)==12) flavor = 1;
00436     else if(abs(nu.inu)==14) flavor = 2; 
00437     else if(abs(nu.inu)==16) flavor = 3;
00438     else if(abs(nu.inu)==1 || abs(nu.inu)==2 || abs(nu.inu)==3) flavor = abs(nu.inu);
00439     else {
00440         MSG("NuTransition",Msg::kError) << "Invalid event:inu value " << nu.inu << endl;
00441         return 0;
00442     }
00443     
00444     int ccnc = nu.iaction;
00445     if(ccnc==0) ccnc = 2;
00446     if(!(ccnc==1||ccnc==2)) {
00447         MSG("NuTransition",Msg::kError) << "Invalid event:iaction value " 
00448         << nu.iaction << endl;
00449         return 0;
00450     }
00451     
00452     int process = 0;
00453     if(nu.iresonance>=1001&&nu.iresonance<=1004) process = nu.iresonance - 1000;
00454     else if(nu.iresonance>=1&&nu.iresonance<=4) process = nu.iresonance;
00455     else {
00456         if(nu.iresonance==1005) MSG("NuTransition",Msg::kInfo) 
00457             << "Event:iresonance value is 1005 "
00458             << "- no reweighting performed" << endl;
00459         else MSG("NeugenWC",Msg::kError) 
00460             << "Invalid event:iresonance (or event:process) value "
00461             << nu.iresonance << endl;
00462         return 0;
00463     }
00464     
00465     //extract necessary kinematic variables:
00466     if(process==1) {   //qel
00467         kid1=1;
00468         kid2=0;
00469         if(kval[1]==999999) {
00470             MSG("NuTransition",Msg::kWarning) 
00471             << "Current event is QEL: q^2 kinematic variable not set!"
00472             << " Returning weight of 1." << endl;
00473             return 0;
00474         }    
00475     }
00476     else if(process==2) { //res
00477         kid1=1;
00478         kid2=2;
00479         if(kval[1]==999999) {
00480             MSG("NuTransition",Msg::kWarning) 
00481             << "Current event is RES: q^2 kinematic variable not set!"
00482             << " Returning weight of 1." << endl;
00483             return 0;
00484         }
00485         if(kval[2]==999999) {
00486             MSG("NuTransition",Msg::kWarning) 
00487             << "Current event is RES: w^2 kinematic variable not set!"
00488             << " Returning weight of 1." << endl;
00489             return 0;
00490         }
00491         //need to pass w rather than w^2 to neugen
00492         if(kval[2]>0) kval[2]=sqrt(kval[2]); 
00493         else {
00494             MSG("NuTransition",Msg::kWarning) 
00495             << "w^2 kinematic variable is negative!"
00496             << " Returning weight of 1." << endl;
00497             return 0;
00498         }
00499     }
00500     else if(process==3) { //dis
00501         kid1=3;
00502         kid2=4;
00503         if(kval[3]==999999) {
00504             MSG("NuTransition",Msg::kWarning) 
00505             << "Current event is DIS: x kinematic variable not set!"
00506             << " Returning weight of 1." << endl;
00507             return 0;
00508         }
00509         if(kval[4]==999999) {
00510             MSG("NuTransition",Msg::kWarning) 
00511             << "Current event is DIS: y kinematic variable not set!"
00512             << " Returning weight of 1." << endl;
00513             return 0;
00514         }
00515     }
00516     else if(process==4) { //coh
00517         //reweighting not possible here yet
00518         return 0;
00519     }
00520     
00521     //start making neugen style objects:
00522     TLorentzVector *nu_lv = new TLorentzVector(nu.neuPxMC,nu.neuPyMC,nu.neuPzMC,nu.neuEnMC);
00523     TLorentzVector *tar_lv = new TLorentzVector(nu.tgtPxMC,nu.tgtPyMC,nu.tgtPzMC,nu.tgtEnMC);
00524     
00525     init_state_t init = init_state_enum(nu.initialStateMC);
00526     
00527     if (opp_charge) {
00528         using namespace init_state;
00529         switch(init) {
00530             case e_vN:   init = e_vbN;  break;
00531             case e_vbN:  init = e_vN;   break;
00532                 
00533             case e_vA:   init = e_vbA;  break;
00534             case e_vbA:  init = e_vA;   break;
00535                 
00536             case e_vp:   init = e_vbp;  break;
00537             case e_vbp:  init = e_vp;   break;
00538                 
00539             case e_vn:   init = e_vbn;  break;
00540             case e_vbn:  init = e_vn;   break;
00541                 
00542             case e_undefined_init_state:
00543             default:            
00544                 MSG("NuTransition",Msg::kWarning) << "Unknown initial state" << endl;
00545                 return 0;
00546         }
00547         
00548         if (process == 1) {
00549             if (init == e_vbn) init = e_vbp;
00550             if (init == e_vp)  init = e_vn;
00551         }  
00552     }
00553     
00554     interaction *iact = new interaction(flavor_enum(flavor),
00555                                         nucleus_enum(nu.nucleusMC),
00556                                         ccnc_enum(ccnc),
00557                                         init); 
00558     
00559     final_state *fs = new final_state(nu.hadronicFinalStateMC);
00560     
00561     
00562     //calculate cross section
00563     Double_t sigma = fNuWrap->offshell_diff_xsec(nu_lv,tar_lv,
00564                                                  iact,process_enum(process),fs,
00565                                                  kinematic_variable_enum(kid1),float(kval[kid1]),
00566                                                  kinematic_variable_enum(kid2),float(kval[kid2]));
00567     
00568     
00569     delete nu_lv;
00570     delete tar_lv;
00571     delete iact;
00572     delete fs;
00573     
00574     
00575     return sigma;
00576 }

Bool_t NuTransition::IsSetToDoTransitions (  )  const [inline]

Definition at line 27 of file NuTransition.h.

00027 {return !doNothing;};

Float_t NuTransition::OscillationWeight ( const Float_t  energy,
const Int_t  inu,
const NuXMLConfig lxmlConfig = 0 
) const [private]

Definition at line 343 of file NuTransition.cxx.

References NuXMLConfig::DM2Bar(), NuXMLConfig::DM2Nu(), NuOscProbCalc::OscillationWeight(), NuXMLConfig::SN2Bar(), and NuXMLConfig::SN2Nu().

Referenced by Reweight().

00344 {
00345     const NuXMLConfig *xmlConfig;
00346     if (lxmlConfig) xmlConfig = lxmlConfig;
00347     else            xmlConfig = fxmlConfig;
00348         
00349     if (14==inu){
00350       return NuOscProbCalc::OscillationWeight(energy,
00351                                             xmlConfig->DM2Nu(),
00352                                             xmlConfig->SN2Nu());
00353     }
00354     else if (-14==inu){
00355       return NuOscProbCalc::OscillationWeight(energy,
00356                                             xmlConfig->DM2Bar(),
00357                                             xmlConfig->SN2Bar());
00358     }
00359     if (16==inu){
00360       return 1-NuOscProbCalc::OscillationWeight(energy,
00361                                               xmlConfig->DM2Nu(),
00362                                               xmlConfig->SN2Nu());
00363     }
00364     else if (-16==inu){
00365       return 1-NuOscProbCalc::OscillationWeight(energy,
00366                                               xmlConfig->DM2Bar(),
00367                                               xmlConfig->SN2Bar());
00368     }
00369     else return 1; // Doesn't oscillate
00370 }

void NuTransition::Reweight ( NuEvent nu  ) 

Definition at line 194 of file NuTransition.cxx.

References applyTranSyst, NuEvent::detector, NuXMLConfig::DM2Bar(), NuXMLConfig::DM2Nu(), doNothing, DoSystematicShifts(), firstRunTrans, flux_weight, fxmlConfig, NuEvent::iaction, NuEvent::inu, NuEvent::inunoosc, SimFlag::kData, Detector::kFar, Msg::kInfo, MAXMSG, NuEvent::neuEnMC, nubar_flux, numu_flux, OscillationWeight(), NuEvent::rw, NuEvent::simFlag, NuXMLConfig::SN2Bar(), NuXMLConfig::SN2Nu(), NuXMLConfig::TransitionProb(), and NuUtilities::ValueAt().

Referenced by DataMCPlots::PrepareEventForPlotting(), and NuDSTAna::StdNMBAna().

00195 {
00196     // With no xml file, do neither systematics or oscillations
00197     if (doNothing) return;    
00198  
00199     double wTotal = 1;
00200     
00201     // If Systematics are applied to transitioned events,
00202     // can simply shift the whole event
00203     if (applyTranSyst) {
00204         this->DoSystematicShifts(nu);
00205     }
00206     else {
00207         NuEvent * nuCopy = (NuEvent*)nu.Clone();
00208         this->DoSystematicShifts(*nuCopy);
00209         wTotal *= nuCopy->rw / nu.rw;
00210         delete nuCopy;
00211     }
00212     
00213   //bool isNuE = (nu.inu == 12 || nu.inu == -12);
00214     bool isNuMu = (nu.inu == 14 || nu.inu == -14);
00215     bool isNuTau = (nu.inu == 16 || nu.inu == -16);
00216   
00217   
00218     if (SimFlag::kData == nu.simFlag) {
00219         // don't oscillate real data
00220         MAXMSG("NuTransition",Msg::kInfo,1) 
00221         << "Not applying fake oscillations to data" << endl;
00222     }
00223     else if (Detector::kFar != nu.detector) { 
00224         // don't oscillate the ND data
00225         MAXMSG("NuTransition",Msg::kInfo,1) 
00226         << "Not applying fake oscillations to ND MC" << endl;
00227     }
00228     else if (1 != nu.iaction) { 
00229         // check for !CC (i.e. NC)
00230         if(isNuTau) {
00231             MAXMSG("NuTransition",Msg::kInfo,1) << "Removing NC events from tau file (nu.rw set to zero)" << endl;
00232             wTotal = 0;
00233         }
00234         MAXMSG("NuTransition",Msg::kInfo,1) << "Not oscillating NCs" << endl;
00235     }
00236     else if ( !(isNuMu || isNuTau) ) { 
00237         // select everything that is not NuMu(bar) or NuTau(bar) i.e. true if nue(bar)
00238         MAXMSG("NuTransition",Msg::kInfo,1)
00239         << "Not oscillating nue events (non-muon/tau (anti)neutinos)" << endl;
00240     }
00241     else if ( isNuTau && (nu.inunoosc == 12 || nu.inunoosc==-12) ) {
00242         // select events that started as nues and were turned in to nutaus
00243         MAXMSG("NuTransition",Msg::kInfo,1)
00244         << "Removing beam nue events from tau file (nu.rw set to zero)" << endl;
00245         wTotal = 0;
00246     }
00247     else if (fxmlConfig->DM2Nu() < 0.0 ||  // Do this last, so that taus and nue's are still properly
00248              fxmlConfig->SN2Nu() < 0.0 ||  // reweighted, even in the no-oscillation case
00249              fxmlConfig->DM2Bar() < 0.0 || // For example, in the no-osc case the nutaus are given a weight of 0
00250              fxmlConfig->SN2Bar() < 0.0){  // so have to explictly just not touch them
00251         MAXMSG("NuTransition",Msg::kInfo,1)
00252         <<"Not applying fake oscillations due to xml configuration"<<endl;
00253     }
00254     else {
00255         //include the oscillation weight in the general nu.rw variable
00256         wTotal *= this->OscillationWeight(nu.neuEnMC, nu.inu);
00257         MAXMSG("NuTransition",Msg::kInfo,10)
00258         << "Oscillating with dm2=" << fxmlConfig->DM2Nu()
00259         << "; weight=" << this->OscillationWeight(nu.neuEnMC, nu.inu)
00260         << "; energy=" << nu.neuEnMC << endl;
00261         
00262         // Only create transitioned events if there are transitions
00263         if (fxmlConfig->TransitionProb() > 0) {
00264             if (isNuTau) {
00265                 MAXMSG("NuTransition",Msg::kInfo,1)
00266                 << "Weighting down appeared NuTaus for transitions by " 
00267                 << (1.0 - fxmlConfig->TransitionProb()) << endl;
00268                 wTotal *= (1.0 - fxmlConfig->TransitionProb());
00269             }
00270             else if (nu.inu == -14) { // and this is an antineutrino
00271                 MAXMSG("NuTransition",Msg::kInfo,10) << "Getting a transitioned event" << endl;
00272                 
00273                 if (firstRunTrans) {
00274                     flux_weight->Divide(numu_flux, nubar_flux);
00275                     firstRunTrans = false;
00276                 }            
00277                 
00278                 // Disappearance Probability = 1 - survival probability
00279                 Double_t transitionWeight =  1.0 - this->OscillationWeight(nu.neuEnMC,nu.inu); 
00280                 transitionWeight *= fxmlConfig->TransitionProb();
00281                 transitionWeight *= NuUtilities::ValueAt(flux_weight, nu.neuEnMC);
00282                 
00283                 // Add, not multiply, the transition weight
00284                 wTotal += transitionWeight;
00285             }
00286         }
00287     }
00288     
00289     nu.rw *= wTotal;
00290 }


Member Data Documentation

bool NuTransition::applyTranSyst [private]

Definition at line 49 of file NuTransition.h.

Referenced by NuTransition(), and Reweight().

bool NuTransition::doNothing [private]

Definition at line 51 of file NuTransition.h.

Referenced by Fill(), NuTransition(), and Reweight().

bool NuTransition::firstRunTrans [private]

Definition at line 50 of file NuTransition.h.

Referenced by NuTransition(), and Reweight().

TH1D* NuTransition::flux_weight [private]

Definition at line 33 of file NuTransition.h.

Referenced by NuTransition(), Reweight(), and ~NuTransition().

TGraph* NuTransition::fNuBarXGraph [private]

Definition at line 35 of file NuTransition.h.

Referenced by GetXSecGraph(), and NuTransition().

TGraph* NuTransition::fNuMuXGraph [private]

Definition at line 34 of file NuTransition.h.

Referenced by GetXSecGraph(), and NuTransition().

NuSystematic* NuTransition::fSyst [private]

Definition at line 37 of file NuTransition.h.

Referenced by DoSystematicShifts(), and NuTransition().

NuXMLConfig* NuTransition::fxmlConfig [private]

Definition at line 36 of file NuTransition.h.

Referenced by DoSystematicShifts(), NuTransition(), and Reweight().

TH1D* NuTransition::nubar_flux [private]

Definition at line 32 of file NuTransition.h.

Referenced by Fill(), NuTransition(), Reweight(), and ~NuTransition().

TH1D* NuTransition::numu_flux [private]

Definition at line 27 of file NuTransition.h.

Referenced by Fill(), NuTransition(), Reweight(), and ~NuTransition().


The documentation for this class was generated from the following files:
Generated on Mon Sep 1 00:52:25 2014 for loon by  doxygen 1.4.7