AtNuReweight Class Reference

#include <AtNuReweight.h>

List of all members.

Public Member Functions

Double_t ReturnWeight (Bool_t isCV, Int_t idnu, Int_t idact, Double_t enu, Double_t coszen)
void ReturnEnergy (Bool_t isCE, Double_t recoemu, Double_t recoeshw, Double_t &recoemuNew, Double_t &recoeshwNew)
void SetParams (Double_t norm, Double_t normupmu, Double_t elmu, Double_t ccnc, Double_t updn, Double_t chg, Double_t chgupmu, Double_t specnu, Double_t specnubar, Double_t emurange, Double_t emucurve, Double_t eshw)
void SetChargeWeight (Double_t weight)
void SetEnuSpec (Double_t energy)
void SetSigmaSpecNu (Double_t sigma)
void SetSigmaSpecNuBar (Double_t sigma)

Static Public Member Functions

static AtNuReweightInstance ()
static Double_t GetWeight (Bool_t isCV, Int_t idnu, Int_t idact, Double_t enu, Double_t coszen)
static void GetEnergy (Bool_t isCE, Double_t recoemu, Double_t recoeshw, Double_t &recoemuNew, Double_t &recoeshwNew)

Private Member Functions

 AtNuReweight ()
 ~AtNuReweight ()
 ClassDef (AtNuReweight, 1)

Private Attributes

Double_t fNorm
Double_t fNormUpmu
Double_t fElmu
Double_t fCCNC
Double_t fUpdn
Double_t fChg
Double_t fChgUpmu
Double_t fSpecNu
Double_t fSpecNuBar
Double_t fEmuRange
Double_t fEmuCurve
Double_t fEshw
Double_t fChargeWeight
Double_t fEnuSpec
Double_t fSigmaSpecNu
Double_t fSigmaSpecNuBar

Detailed Description

Definition at line 6 of file AtNuReweight.h.


Constructor & Destructor Documentation

AtNuReweight::AtNuReweight (  )  [private]

Definition at line 28 of file AtNuReweight.cxx.

References fCCNC, fChargeWeight, fChg, fChgUpmu, fElmu, fEmuCurve, fEmuRange, fEnuSpec, fEshw, fNorm, fNormUpmu, fSigmaSpecNu, fSigmaSpecNuBar, fSpecNu, fSpecNuBar, and fUpdn.

00029 {
00030   std::cout << " *** AtNuReweight::AtNuReweight() *** " << std::endl;
00031 
00032   fNorm      = 0.0;
00033   fNormUpmu  = 0.0;
00034   fElmu      = 0.0;
00035   fCCNC      = 0.0;
00036   fUpdn      = 0.0;
00037   fChg       = 0.0;
00038   fChgUpmu   = 0.0;
00039   fSpecNu    = 0.0;
00040   fSpecNuBar = 0.0;
00041   fEmuRange  = 0.0;
00042   fEmuCurve  = 0.0;
00043   fEshw      = 0.0;
00044 
00045   fChargeWeight = +0.33;
00046 
00047   fEnuSpec = 3.0;
00048   fSigmaSpecNu = 0.06;
00049   fSigmaSpecNuBar = 0.06;
00050 }

AtNuReweight::~AtNuReweight (  )  [private]

Definition at line 52 of file AtNuReweight.cxx.

00053 {
00054 
00055 }


Member Function Documentation

AtNuReweight::ClassDef ( AtNuReweight  ,
 
) [private]
void AtNuReweight::GetEnergy ( Bool_t  isCE,
Double_t  recoemu,
Double_t  recoeshw,
Double_t &  recoemuNew,
Double_t &  recoeshwNew 
) [static]

Definition at line 161 of file AtNuReweight.cxx.

References Instance(), and ReturnEnergy().

00162 {
00163   return AtNuReweight::Instance()->ReturnEnergy(isCE,
00164                                                 recoemu,recoeshw,
00165                                                 recoemuNew,recoeshwNew);
00166 }

Double_t AtNuReweight::GetWeight ( Bool_t  isCV,
Int_t  idnu,
Int_t  idact,
Double_t  enu,
Double_t  coszen 
) [static]

Definition at line 84 of file AtNuReweight.cxx.

References Instance(), and ReturnWeight().

00085 {
00086   return AtNuReweight::Instance()->ReturnWeight(isCV,
00087                                                 idnu,idact,
00088                                                 enu,coszen);
00089 }

AtNuReweight * AtNuReweight::Instance (  )  [static]

Definition at line 11 of file AtNuReweight.cxx.

Referenced by GetEnergy(), and GetWeight().

00012 {
00013   if( !fgAtNuReweight ){
00014     fgAtNuReweight = new AtNuReweight();
00015   }
00016 
00017   if( !fgAtNuReweight ){
00018     assert(fgAtNuReweight);
00019   }
00020 
00021   if( fgAtNuReweight ){
00022 
00023   }
00024 
00025   return fgAtNuReweight;
00026 }

void AtNuReweight::ReturnEnergy ( Bool_t  isCE,
Double_t  recoemu,
Double_t  recoeshw,
Double_t &  recoemuNew,
Double_t &  recoeshwNew 
)

Definition at line 168 of file AtNuReweight.cxx.

References fEmuCurve, fEmuRange, and fEshw.

Referenced by GetEnergy().

00169 {
00170   Double_t trkscale = 0.0;
00171   Double_t shwscale = 0.0;  
00172 
00173   if( isCE ) trkscale = fEmuRange;
00174   else trkscale = fEmuCurve;
00175   shwscale = fEshw;
00176 
00177   if( trkscale<-1.0 ) trkscale = -1.0;
00178   if( shwscale<-1.0 ) shwscale = -1.0;
00179 
00180   recoemuNew  = (1.0+trkscale)*recoemu;
00181   recoeshwNew = (1.0+shwscale)*recoeshw;
00182 
00183   return;
00184 }

Double_t AtNuReweight::ReturnWeight ( Bool_t  isCV,
Int_t  idnu,
Int_t  idact,
Double_t  enu,
Double_t  coszen 
)

Definition at line 91 of file AtNuReweight.cxx.

References fCCNC, fChargeWeight, fChg, fChgUpmu, fElmu, fEnuSpec, fNorm, fNormUpmu, fSigmaSpecNu, fSigmaSpecNuBar, fSpecNu, fSpecNuBar, and fUpdn.

Referenced by GetWeight().

00092 {
00093   // nominal weight
00094   // ==============
00095   Double_t weight = 1.0;
00096 
00097   // contained vertex interactions
00098   // =============================
00099   if( isCV ){
00100 
00101     // norm weight
00102     weight *= 1.0+fNorm;
00103 
00104     // flux weight
00105     if( fabs(idnu)==14 && idact==1 ){
00106       if( idnu==+14 ) weight *= 1.0+0.5*fChg*(1.0-fChargeWeight);
00107       if( idnu==-14 ) weight *= 1.0-0.5*fChg*(1.0+fChargeWeight);
00108       if( coszen<=0 ) weight *= 1.0+0.5*fUpdn; 
00109       if( coszen>0  ) weight *= 1.0-0.5*fUpdn; 
00110     }
00111     if( fabs(idnu)==12 ){ // nue
00112       weight *= 1.0+fElmu;
00113     }
00114     if( idact==0 ){ // NC
00115       weight *= 1.0-fCCNC;
00116     }
00117 
00118     // spectral weight
00119     Double_t spec = 0.0;
00120     Double_t sigmaspec = 0.0;
00121 
00122     Double_t enustop = 0.0;
00123     Double_t enufix = 0.0;
00124     
00125     if( idnu>0 ){ spec = fSpecNu;    sigmaspec = fSigmaSpecNu;    }
00126     if( idnu<0 ){ spec = fSpecNuBar; sigmaspec = fSigmaSpecNuBar; }
00127         
00128     if( fEnuSpec>0.0 && sigmaspec>0.0 && spec!=0.0 ){
00129       if( enu>0 && enu<=fEnuSpec ){ 
00130         weight *= 1.0 + spec*(enu-fEnuSpec);
00131       }
00132       else if( enu>fEnuSpec ){
00133         enustop = fEnuSpec*exp(1.0/(2.0*sigmaspec)); // a fix to keep
00134         enufix = enustop*(1.0-exp(-enu/enustop));    // -1<weight<+1
00135         weight *= 1.0 + spec*(log(enufix/fEnuSpec));
00136       }
00137     }
00138 
00139   }
00140 
00141   // neutrino-induced rock muons
00142   // ===========================
00143   else{
00144   
00145     // norm weight
00146     weight *= 1.0+fNormUpmu;
00147 
00148     // flux weight
00149     if( fabs(idnu)==14 && idact==1 ){ // numu CC
00150       if( idnu==+14 ) weight *= 1.0+0.5*fChgUpmu*(1.0-fChargeWeight);
00151       if( idnu==-14 ) weight *= 1.0-0.5*fChgUpmu*(1.0+fChargeWeight);
00152     }
00153 
00154   }  
00155 
00156   // return total weight
00157   // ===================
00158   return weight;
00159 }  

void AtNuReweight::SetChargeWeight ( Double_t  weight  )  [inline]

Definition at line 33 of file AtNuReweight.h.

References fChargeWeight.

00033                                           {
00034     fChargeWeight = weight;
00035   }

void AtNuReweight::SetEnuSpec ( Double_t  energy  )  [inline]

Definition at line 37 of file AtNuReweight.h.

References fEnuSpec.

00037                                     {
00038     if( energy>0.0 ) fEnuSpec = energy;
00039   }

void AtNuReweight::SetParams ( Double_t  norm,
Double_t  normupmu,
Double_t  elmu,
Double_t  ccnc,
Double_t  updn,
Double_t  chg,
Double_t  chgupmu,
Double_t  specnu,
Double_t  specnubar,
Double_t  emurange,
Double_t  emucurve,
Double_t  eshw 
)

Definition at line 57 of file AtNuReweight.cxx.

References fCCNC, fChg, fChgUpmu, fElmu, fEmuCurve, fEmuRange, fEshw, fNorm, fNormUpmu, fSpecNu, fSpecNuBar, and fUpdn.

00058 {
00059   std::cout << " *** AtNuReweight::SetParams(...) *** " << std::endl;
00060 
00061   fNorm      = norm;
00062   fNormUpmu  = normupmu;
00063   fElmu      = elmu;
00064   fCCNC      = ccnc;
00065   fUpdn      = updn;
00066   fChg       = chg;
00067   fChgUpmu   = chgupmu;
00068   
00069   fSpecNu    = specnu;
00070   fSpecNuBar = specnubar;
00071   fEmuRange  = emurange;
00072   fEmuCurve  = emucurve;
00073   fEshw      = eshw;
00074 
00075   std::cout << "   Norm = " << fNorm << ", NormUpmu = " << fNormUpmu << std::endl
00076             << "   Elmu = " << fElmu << ", CCNC = " << fCCNC << ", Updn = " << fUpdn << std::endl
00077             << "   Chg = " << fChg << ", ChgUpmu = " <<  fChgUpmu << std::endl
00078             << "   SpecNu = " << fSpecNu << ", SpecNuBar = " << fSpecNuBar << std::endl
00079             << "   EmuRange = " << fEmuRange << ", EmuCurve = " << fEmuCurve << ", Eshw = " << fEshw << std::endl;
00080 
00081   return;
00082 }

void AtNuReweight::SetSigmaSpecNu ( Double_t  sigma  )  [inline]

Definition at line 41 of file AtNuReweight.h.

References fSigmaSpecNu.

00041                                      {
00042     if( sigma>0.0 ) fSigmaSpecNu = sigma;
00043   }

void AtNuReweight::SetSigmaSpecNuBar ( Double_t  sigma  )  [inline]

Definition at line 45 of file AtNuReweight.h.

References fSigmaSpecNuBar.

00045                                         {
00046     if( sigma>0.0 ) fSigmaSpecNuBar = sigma;
00047   }


Member Data Documentation

Double_t AtNuReweight::fCCNC [private]

Definition at line 57 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fChargeWeight [private]

Definition at line 67 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetChargeWeight().

Double_t AtNuReweight::fChg [private]

Definition at line 59 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fChgUpmu [private]

Definition at line 60 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fElmu [private]

Definition at line 56 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fEmuCurve [private]

Definition at line 64 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnEnergy(), and SetParams().

Double_t AtNuReweight::fEmuRange [private]

Definition at line 63 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnEnergy(), and SetParams().

Double_t AtNuReweight::fEnuSpec [private]

Definition at line 69 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetEnuSpec().

Double_t AtNuReweight::fEshw [private]

Definition at line 65 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnEnergy(), and SetParams().

Double_t AtNuReweight::fNorm [private]

Definition at line 54 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fNormUpmu [private]

Definition at line 55 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fSigmaSpecNu [private]

Definition at line 70 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetSigmaSpecNu().

Double_t AtNuReweight::fSigmaSpecNuBar [private]

Definition at line 71 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetSigmaSpecNuBar().

Double_t AtNuReweight::fSpecNu [private]

Definition at line 61 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fSpecNuBar [private]

Definition at line 62 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().

Double_t AtNuReweight::fUpdn [private]

Definition at line 58 of file AtNuReweight.h.

Referenced by AtNuReweight(), ReturnWeight(), and SetParams().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1