Anp::RecoNu Class Reference

#include <RecoNu.h>

List of all members.

Public Member Functions

 RecoNu ()
 ~RecoNu ()
void Clear ()
void SetEScale (float value)
void SetWeight (double value)
void SetEHad (double value)
void SetELep (double value)
void SetPLep (double value)
void SetPCur (double value)
void SetPRan (double value)
void SetStop (bool value)
short Index () const
short Sign () const
double EHad () const
double PLep () const
double PCur () const
double PRan () const
float CosN () const
double Weight () const
float EScale () const
bool ExitBack () const
bool ExitSide () const
bool Pass () const
bool Stop () const
double ENeu () const
double ELep () const
double ECur () const
double ERan () const
double Y () const
double X () const
double Q2 () const
double W2 () const
double EQES (double ebin=0.036) const
double ERES (double ebin=0.036) const
bool Add (short key, float data)
bool Erase (short key)
bool KeyExists (short key) const
float operator[] (short key) const
float DataAt (short key) const
void Print (std::ostream &o=std::cout) const

Private Attributes

Short_t index
Short_t sign
Double_t ehad
Double_t plep
Double_t pcur
Double_t pran
Double_t weight
Float_t escale
Float_t cosn
Bool_t exit_back
Bool_t exit_side
Bool_t pass
Bool_t stop
DataVec fData

Friends

class FillEvent

Detailed Description

Definition at line 23 of file RecoNu.h.


Constructor & Destructor Documentation

Anp::RecoNu::RecoNu (  ) 

Definition at line 13 of file RecoNu.cxx.

00014    :index(-1),
00015     sign(0),
00016     ehad(-1.0e6),
00017     plep(-1.0e6),
00018     pcur(-1.0e6),
00019     pran(-1.0e6),
00020     weight(1.0),
00021     escale(1.0),
00022     cosn(-1.0),
00023     exit_back(false),
00024     exit_side(false),
00025     pass(false),
00026     stop(false)
00027 {
00028 }

Anp::RecoNu::~RecoNu (  ) 

Definition at line 31 of file RecoNu.cxx.

00032 {
00033 }


Member Function Documentation

bool Anp::RecoNu::Add ( short  key,
float  data 
)

Definition at line 80 of file RecoNu.cxx.

References fData, and KeyExists().

00081 { 
00082    if(RecoNu::KeyExists(key))
00083    {
00084       cerr << "RecoNu::Add(" << key << ") - key already exists" << endl;
00085       return false;
00086    }
00087    
00088    fData.push_back(Anp::Data(key, value));
00089    return true;
00090 }

void Anp::RecoNu::Clear ( void   ) 

Definition at line 36 of file RecoNu.cxx.

References cosn, ehad, escale, exit_back, exit_side, fData, index, pass, pcur, plep, pran, sign, stop, and weight.

Referenced by Anp::Event::Clear().

00037 {
00038    index     = -1;
00039    sign      =  0;
00040    ehad      = -1.0e6;
00041    plep      = -1.0e6;
00042    pcur      = -1.0e6;
00043    pran      = -1.0e6;
00044    weight    = +1.0;
00045    escale    = +1.0,
00046    cosn      = -1.0;
00047    exit_back = false;
00048    exit_side = false;
00049    pass      = false;
00050    stop      = false;
00051    fData.clear();
00052 }

float Anp::RecoNu::CosN (  )  const [inline]

Definition at line 156 of file RecoNu.h.

References cosn.

Referenced by EQES(), ERES(), Anp::PlotEvent::Plot(), Q2(), and Anp::RecoQ2().

00156 { return cosn; }

float Anp::RecoNu::DataAt ( short  key  )  const

Definition at line 107 of file RecoNu.cxx.

References fData, find(), and it.

Referenced by operator[]().

00108 {
00109    const DataIter it = std::find(fData.begin(), fData.end(), key);
00110    if(it == fData.end())
00111    {
00112       cerr << "RecoNu: key " << key << " does not exist" << endl;
00113       return 0.0;
00114    }
00115    
00116    return it -> Data();
00117 }

double Anp::RecoNu::ECur (  )  const [inline]

Definition at line 171 of file RecoNu.h.

References Anp::m_muon2(), and PCur().

00171 { return std::sqrt(PCur()*PCur() + m_muon2()); }

double Anp::RecoNu::EHad (  )  const [inline]
double Anp::RecoNu::ELep (  )  const [inline]

Definition at line 170 of file RecoNu.h.

References Anp::m_muon2(), and PLep().

Referenced by ENeu(), EQES(), ERES(), Anp::PlotResol::Plot(), Anp::PlotReson::Plot(), Q2(), Anp::RecoQ2(), Anp::RecoW2(), Anp::PlotEvent::Run(), and Anp::PlotKinem::Run().

00170 { return std::sqrt(PLep()*PLep() + m_muon2()); }

double Anp::RecoNu::ENeu (  )  const [inline]
double Anp::RecoNu::EQES ( double  ebin = 0.036  )  const

Definition at line 120 of file RecoNu.cxx.

References CosN(), ELep(), ENeu(), EScale(), Munits::m, Anp::m_muon2(), Anp::m_proton(), Anp::m_proton2(), n, and PLep().

Referenced by Anp::PlotResol::Plot(), Anp::PlotEvent::Plot(), Anp::RecoQ2(), Anp::RecoW2(), Anp::PlotEvent::Run(), and Anp::PlotKinem::Run().

00121 {
00122    //
00123    // Compute event energy assuming events is QES interaction
00124    //
00125    
00126    if(ebin < 0.0)
00127    {
00128       cerr << "Anp::RecoNu::EQES - incorrect sign for binding energy:" << ebin << endl;
00129       return ENeu();
00130    }
00131 
00132    const double m = m_proton() - ebin;
00133    const double n = m * ELep() + 0.5*(m_proton2() - m*m - m_muon2());
00134    const double d = m - ELep() + PLep()*CosN();
00135 
00136    if(d > std::fabs(ebin)) return EScale()*n/d;
00137 
00138    return EScale()*ELep();
00139 }

double Anp::RecoNu::ERan (  )  const [inline]

Definition at line 172 of file RecoNu.h.

References Anp::m_muon2(), and PRan().

00172 { return std::sqrt(PRan()*PRan() + m_muon2()); }

bool Anp::RecoNu::Erase ( short  key  ) 

Definition at line 93 of file RecoNu.cxx.

References fData, find(), and it.

00094 {
00095    DataVec::iterator it = std::find(fData.begin(), fData.end(), key);
00096    if(it == fData.end())
00097    {
00098       cerr << "RecoNu::Erase - key " << key << " does not exist" << endl;
00099       return false;      
00100    }
00101 
00102    fData.erase(it);
00103    return true;
00104 }

double Anp::RecoNu::ERES ( double  ebin = 0.036  )  const

Definition at line 142 of file RecoNu.cxx.

References CosN(), ELep(), ENeu(), EScale(), Munits::m, Anp::m_delta2(), Anp::m_muon2(), Anp::m_proton(), n, and PLep().

Referenced by Anp::PlotResol::Plot(), Anp::PlotEvent::Plot(), Anp::RecoQ2(), and Anp::RecoW2().

00143 {
00144    //
00145    // Compute event energy assuming events is QES interaction
00146    //
00147    
00148    if(ebin < 0.0)
00149    {
00150       cerr << "Anp::RecoNu::ERES - incorrect sign for binding energy:" << ebin << endl;
00151       return ENeu();
00152    }
00153 
00154    const double m = m_proton() - ebin;
00155    const double n = m * ELep() + 0.5*(m_delta2() - m*m - m_muon2());
00156    const double d = m - ELep() + PLep()*CosN();
00157 
00158    if(d > std::fabs(ebin)) return EScale()*n/d;
00159 
00160    return EScale()*ELep();
00161 }

float Anp::RecoNu::EScale (  )  const [inline]

Definition at line 158 of file RecoNu.h.

References escale.

Referenced by ENeu(), EQES(), and ERES().

00158 { return escale; }

bool Anp::RecoNu::ExitBack (  )  const [inline]

Definition at line 161 of file RecoNu.h.

References exit_back.

Referenced by Anp::SelectKinem::Pass(), and Anp::PlotEvent::Plot().

00161 { return exit_back; }

bool Anp::RecoNu::ExitSide (  )  const [inline]

Definition at line 162 of file RecoNu.h.

References exit_side.

Referenced by Anp::SelectKinem::Pass(), and Anp::PlotEvent::Plot().

00162 { return exit_side; }

short Anp::RecoNu::Index (  )  const [inline]

Definition at line 150 of file RecoNu.h.

References index.

Referenced by Anp::operator==().

00150 { return index; }

bool Anp::RecoNu::KeyExists ( short  key  )  const [inline]

Definition at line 205 of file RecoNu.h.

References fData, and find().

Referenced by Add().

00206    {
00207       return (std::find(fData.begin(), fData.end(), key) != fData.end());
00208    }

float Anp::RecoNu::operator[] ( short  key  )  const [inline]

Definition at line 209 of file RecoNu.h.

References DataAt().

00210    {
00211       return DataAt(key);
00212    }

bool Anp::RecoNu::Pass (  )  const [inline]

Definition at line 163 of file RecoNu.h.

References pass.

Referenced by Anp::PlotEvent::Plot(), and Anp::SelectNuMu::ResetStop().

00163 { return pass; }

double Anp::RecoNu::PCur (  )  const [inline]

Definition at line 154 of file RecoNu.h.

References pcur.

Referenced by ECur(), Anp::PlotEvent::Plot(), and Anp::SelectNuMu::ResetStop().

00154 { return pcur; }

double Anp::RecoNu::PLep (  )  const [inline]

Definition at line 153 of file RecoNu.h.

References plep.

Referenced by ELep(), EQES(), ERES(), and Anp::PlotEvent::Plot().

00153 { return plep; }

double Anp::RecoNu::PRan (  )  const [inline]

Definition at line 155 of file RecoNu.h.

References pran.

Referenced by ERan(), Anp::PlotEvent::Plot(), and Anp::SelectNuMu::ResetStop().

00155 { return pran; }

void Anp::RecoNu::Print ( std::ostream &  o = std::cout  )  const
double Anp::RecoNu::Q2 (  )  const [inline]

Definition at line 195 of file RecoNu.h.

References CosN(), ELep(), and ENeu().

Referenced by Anp::PlotKinem::GetBinQ2(), Anp::PlotResol::Plot(), Anp::PlotEvent::Plot(), Anp::PlotKinem::Run(), W2(), and X().

00196    {
00197       return 2.0*ENeu()*ELep()*(1-CosN());
00198    }

void Anp::RecoNu::SetEHad ( double  value  )  [inline]

Definition at line 145 of file RecoNu.h.

References ehad.

Referenced by Anp::FillEnergy::Run(), Anp::PlotEvent::Run(), and Anp::PlotKinem::Run().

00145 { ehad = value; }

void Anp::RecoNu::SetELep ( double  value  ) 

Definition at line 55 of file RecoNu.cxx.

References Anp::m_muon2(), and plep.

00056 {
00057    const double diff = value*value - Anp::m_muon2();
00058    if(diff > 0.0)
00059    {
00060       plep = std::sqrt(diff);
00061    }
00062    else
00063    {
00064       plep = 0.0;
00065    }
00066 }

void Anp::RecoNu::SetEScale ( float  value  )  [inline]

Definition at line 143 of file RecoNu.h.

References escale.

00143 { escale *= value; }

void Anp::RecoNu::SetPCur ( double  value  )  [inline]

Definition at line 147 of file RecoNu.h.

References pcur.

00147 { pcur = value; }

void Anp::RecoNu::SetPLep ( double  value  )  [inline]

Definition at line 146 of file RecoNu.h.

References plep.

Referenced by Anp::SelectNuMu::ResetStop().

00146 { plep = value; }

void Anp::RecoNu::SetPRan ( double  value  )  [inline]

Definition at line 148 of file RecoNu.h.

References pran.

00148 { pran = value; }

void Anp::RecoNu::SetStop ( bool  value  ) 

Definition at line 69 of file RecoNu.cxx.

References exit_back, exit_side, and stop.

Referenced by Anp::SelectNuMu::ResetStop().

00070 {
00071    stop = value;
00072    if(stop)
00073    {
00074       exit_back = false;
00075       exit_side = false;
00076    }
00077 }

void Anp::RecoNu::SetWeight ( double  value  )  [inline]

Definition at line 144 of file RecoNu.h.

References weight.

Referenced by Anp::Event::SetWeight().

00144 { weight  = value; }

short Anp::RecoNu::Sign (  )  const [inline]

Definition at line 151 of file RecoNu.h.

References sign.

Referenced by Anp::PlotEvent::Plot().

00151 { return sign; }

bool Anp::RecoNu::Stop (  )  const [inline]

Definition at line 164 of file RecoNu.h.

References stop.

Referenced by Anp::SelectKinem::Pass(), Anp::PlotEvent::Plot(), and Anp::SelectNuMu::ResetStop().

00164 { return stop; }

double Anp::RecoNu::W2 (  )  const [inline]

Definition at line 200 of file RecoNu.h.

References EHad(), Anp::m_proton(), Anp::m_proton2(), and Q2().

Referenced by Anp::SelectKinem::Pass(), Anp::PlotResol::Plot(), and Anp::PlotEvent::Plot().

00201    {
00202       return m_proton2() + 2.0*m_proton()*EHad() + Q2();
00203    }

double Anp::RecoNu::Weight (  )  const [inline]

Definition at line 159 of file RecoNu.h.

References weight.

Referenced by Anp::PlotResol::Plot(), Anp::PlotEvent::Plot(), Anp::PlotReson::Plot(), Anp::PlotKinem::Run(), and Anp::Event::Weight().

00159 { return weight; }

double Anp::RecoNu::X (  )  const [inline]

Definition at line 185 of file RecoNu.h.

References EHad(), Anp::m_proton(), and Q2().

Referenced by Anp::PlotKinem::GetBinX(), Anp::PlotResol::Plot(), Anp::PlotEvent::Plot(), and Anp::PlotKinem::Run().

00186    {
00187       if(EHad() > 0.0)
00188       {
00189          return Q2()/(2.0*m_proton()*EHad());
00190       }
00191 
00192       return 1.0;
00193    }

double Anp::RecoNu::Y (  )  const [inline]

Definition at line 174 of file RecoNu.h.

References EHad(), and ENeu().

Referenced by Anp::PlotShort::FillStandard(), Anp::PlotResol::Plot(), Anp::PlotShortSelect::Plot(), and Anp::PlotEvent::Plot().

00175    {
00176       const double eneu_ = ENeu();
00177       if(eneu_ > 0.0)
00178       {
00179          return EHad()/eneu_;
00180       }
00181       
00182       return 1.0;
00183    }


Friends And Related Function Documentation

friend class FillEvent [friend]

Definition at line 80 of file RecoNu.h.


Member Data Documentation

Float_t Anp::RecoNu::cosn [private]

Definition at line 90 of file RecoNu.h.

Referenced by Clear(), CosN(), and Anp::FillEvent::Fill().

Double_t Anp::RecoNu::ehad [private]

Definition at line 84 of file RecoNu.h.

Referenced by Clear(), EHad(), Anp::FillEvent::Fill(), and SetEHad().

Float_t Anp::RecoNu::escale [private]

Definition at line 89 of file RecoNu.h.

Referenced by Clear(), EScale(), and SetEScale().

Bool_t Anp::RecoNu::exit_back [private]

Definition at line 91 of file RecoNu.h.

Referenced by Clear(), ExitBack(), Anp::FillEvent::Fill(), and SetStop().

Bool_t Anp::RecoNu::exit_side [private]

Definition at line 92 of file RecoNu.h.

Referenced by Clear(), ExitSide(), Anp::FillEvent::Fill(), and SetStop().

Definition at line 96 of file RecoNu.h.

Referenced by Add(), Clear(), DataAt(), Erase(), and KeyExists().

Short_t Anp::RecoNu::index [private]

Definition at line 82 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), and Index().

Bool_t Anp::RecoNu::pass [private]

Definition at line 93 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), and Pass().

Double_t Anp::RecoNu::pcur [private]

Definition at line 86 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), PCur(), and SetPCur().

Double_t Anp::RecoNu::plep [private]

Definition at line 85 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), PLep(), SetELep(), and SetPLep().

Double_t Anp::RecoNu::pran [private]

Definition at line 87 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), PRan(), and SetPRan().

Short_t Anp::RecoNu::sign [private]

Definition at line 83 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), and Sign().

Bool_t Anp::RecoNu::stop [private]

Definition at line 94 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), SetStop(), and Stop().

Double_t Anp::RecoNu::weight [private]

Definition at line 88 of file RecoNu.h.

Referenced by Clear(), Anp::FillEvent::Fill(), SetWeight(), and Weight().


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

Generated on 15 Nov 2018 for loon by  doxygen 1.6.1