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

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

const Float_t Baseline () const
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


Constructor & Destructor Documentation

NuTransition::NuTransition const NuXMLConfig xmlConfig  ) 
 

Definition at line 45 of file NuTransition.cxx.

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

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

NuTransition::~NuTransition  ) 
 

Definition at line 159 of file NuTransition.cxx.

References flux_weight, nubar_flux, and numu_flux.

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


Member Function Documentation

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

Definition at line 42 of file NuTransition.h.

00042 {return 735.0;};

void NuTransition::DoSystematicShifts NuEvent event  )  [private]
 

Definition at line 330 of file NuTransition.cxx.

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

Referenced by Reweight().

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

void NuTransition::Fill NuMCEvent mc  ) 
 

Definition at line 167 of file NuTransition.cxx.

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

Referenced by NuDSTAna::MMTransition(), and NuDSTAna::StdNMBAna().

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

NuEvent* NuTransition::GetTransitionEvent const NuEvent nu  ) 
 

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

Definition at line 386 of file NuTransition.cxx.

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

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

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

Definition at line 373 of file NuTransition.cxx.

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

Referenced by Fill().

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

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

Definition at line 400 of file NuTransition.cxx.

References abs(), ccnc_enum, e_undefined_init_state, e_vA, e_vbA, e_vbn, e_vbN, e_vbp, e_vn, e_vN, e_vp, flavor_enum, NuEvent::hadronicFinalStateMC, NuEvent::iaction, init_state_enum, init_state_t, NuEvent::initialStateMC, NuEvent::inu, NuEvent::iresonance, kinematic_variable_enum, MSG, NuEvent::neuEnMC, NuEvent::neuPxMC, NuEvent::neuPyMC, NuEvent::neuPzMC, nucleus_enum, NuEvent::nucleusMC, neugen_wrapper::offshell_diff_xsec(), process_enum, NuEvent::q2MC, neugen_config::set_best_parameters(), NuEvent::tgtEnMC, NuEvent::tgtPxMC, NuEvent::tgtPyMC, NuEvent::tgtPzMC, NuEvent::w2MC, NuEvent::xMC, and NuEvent::yMC.

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

Bool_t NuTransition::IsSetToDoTransitions  )  const [inline]
 

Definition at line 30 of file NuTransition.h.

00030 {return !doNothing;};

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

Definition at line 342 of file NuTransition.cxx.

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

Referenced by Reweight().

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

void NuTransition::Reweight NuEvent nu  ) 
 

Definition at line 193 of file NuTransition.cxx.

References NuEvent::detector, NuXMLConfig::DM2Bar(), NuXMLConfig::DM2Nu(), DoSystematicShifts(), firstRunTrans, flux_weight, fxmlConfig, NuEvent::iaction, NuEvent::inu, NuEvent::inunoosc, MAXMSG, NuEvent::neuEnMC, nubar_flux, numu_flux, OscillationWeight(), NuEvent::rw, NuEvent::simFlag, NuXMLConfig::SN2Bar(), NuXMLConfig::SN2Nu(), NuXMLConfig::TransitionProb(), and NuUtilities::ValueAt().

Referenced by NuDSTAna::MMTransition(), and NuDSTAna::StdNMBAna().

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


Member Data Documentation

bool NuTransition::applyTranSyst [private]
 

Definition at line 52 of file NuTransition.h.

Referenced by NuTransition().

bool NuTransition::doNothing [private]
 

Definition at line 54 of file NuTransition.h.

Referenced by NuTransition().

bool NuTransition::firstRunTrans [private]
 

Definition at line 53 of file NuTransition.h.

Referenced by NuTransition(), and Reweight().

TH1D* NuTransition::flux_weight [private]
 

Definition at line 36 of file NuTransition.h.

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

TGraph* NuTransition::fNuBarXGraph [private]
 

Definition at line 38 of file NuTransition.h.

Referenced by GetXSecGraph(), and NuTransition().

TGraph* NuTransition::fNuMuXGraph [private]
 

Definition at line 37 of file NuTransition.h.

Referenced by GetXSecGraph(), and NuTransition().

NuSystematic* NuTransition::fSyst [private]
 

Definition at line 40 of file NuTransition.h.

Referenced by DoSystematicShifts(), and NuTransition().

NuXMLConfig* NuTransition::fxmlConfig [private]
 

Definition at line 39 of file NuTransition.h.

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

TH1D* NuTransition::nubar_flux [private]
 

Definition at line 35 of file NuTransition.h.

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

TH1D* NuTransition::numu_flux [private]
 

Definition at line 34 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 Feb 15 11:09:58 2010 for loon by  doxygen 1.3.9.1