#include <TrueNu.h>
Public Member Functions | |
| TrueNu () | |
| TrueNu (const Truth &truth, const Record &record) | |
| ~TrueNu () | |
| void | SetEScale (float value) |
| int | Index () const |
| int | INu () const |
| int | Resonance () const |
| int | IAction () const |
| int | Flags () const |
| int | InitState () const |
| int | Nucleus () const |
| int | HadFS () const |
| int | TPtype () const |
| float | ENeu () const |
| float | ELep () const |
| float | EHad () const |
| float | LepE () const |
| float | LepCos () const |
| float | TrueY () const |
| float | TrueX () const |
| float | TrueQ2 () const |
| float | TrueW2 () const |
| float | TPt () const |
| float | TPz () const |
| float | EScale () const |
| double | Weight () const |
| bool | IsCC () const |
| bool | IsNC () const |
| bool | IsDIS () const |
| bool | IsRES () const |
| bool | IsQES () const |
| bool | IsNuMu () const |
| bool | IsNuMuBar () const |
| bool | Match (const RecoNu &rnu) 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 | inu |
| Short_t | iresonance |
| Short_t | iaction |
| Short_t | iflags |
| Short_t | init_state |
| Short_t | nucleus |
| Short_t | had_fstate |
| Short_t | tptype |
| Float_t | neu_e |
| Float_t | lep_e |
| Float_t | lep_cos |
| Float_t | y |
| Float_t | x |
| Float_t | q2 |
| Float_t | w2 |
| Float_t | tpt |
| Float_t | tpz |
| Float_t | escale |
| Double_t | weight |
| std::vector< Short_t > | fReco |
| DataVec | fData |
|
|
Definition at line 18 of file TrueNu.cxx. 00019 :index(-1), 00020 inu(0), 00021 iresonance(0), 00022 iaction(-1), 00023 iflags(-1), 00024 init_state(-1), 00025 nucleus(-1), 00026 had_fstate(-1), 00027 tptype(-1), 00028 neu_e(0.0), 00029 lep_e(0.0), 00030 lep_cos(-1.0), 00031 y(-1.0), 00032 x(0.0), 00033 q2(0.0), 00034 w2(0.0), 00035 tpt(0.0), 00036 tpz(0.0), 00037 escale(1.0), 00038 weight(1.0) 00039 { 00040 }
|
|
||||||||||||
|
Definition at line 43 of file TrueNu.cxx. References Anp::Truth::ChildBeg(), Anp::Truth::ChildEnd(), Anp::Truth::Flags(), Anp::Truth::Flux(), fReco, Anp::StdHep::GetIstHEP(), Anp::Record::GetStdHep(), Anp::Truth::HadFS(), Anp::Truth::InitState(), Anp::Truth::Interaction(), Anp::Truth::INu(), Anp::StdHep::IsLepton(), lep_cos, Anp::Truth::Nucleus(), Anp::StdHep::ParentBeg(), Anp::StdHep::ParentEnd(), Anp::StdHep::Print(), Anp::Truth::Print(), Anp::Truth::Px(), Anp::StdHep::Px(), Anp::Truth::Py(), Anp::StdHep::Py(), Anp::Truth::Pz(), Anp::StdHep::Pz(), Anp::Truth::RecoBeg(), Anp::Truth::RecoEnd(), Anp::Truth::Resonance(), Anp::Record::StdHepBeg(), Anp::Record::StdHepEnd(), Anp::StdHep::StdHepIndex(), Anp::FluxInfo::tptype, Anp::Truth::TruthIndex(), Anp::StdHep::TruthIndex(), and Anp::TruthRecoIter. 00044 :index(tnu.TruthIndex()), 00045 inu(tnu.INu()), 00046 iresonance(tnu.Resonance()), 00047 iaction(tnu.Interaction()), 00048 iflags(tnu.Flags()), 00049 init_state(tnu.InitState()), 00050 nucleus(tnu.Nucleus()), 00051 had_fstate(tnu.HadFS()), 00052 tptype(tnu.Flux().tptype), 00053 neu_e(tnu.ENeu()), 00054 lep_e(0.0), 00055 lep_cos(0.0), 00056 y(tnu.TrueY()), 00057 x(tnu.TrueX()), 00058 q2(tnu.TrueQ2()), 00059 w2(tnu.TrueW2()), 00060 tpt(std::sqrt(tnu.Flux().tpy*tnu.Flux().tpy + tnu.Flux().tpx*tnu.Flux().tpx)), 00061 tpz(tnu.Flux().tpz), 00062 escale(1.0), 00063 weight(tnu.Weight()) 00064 { 00065 // 00066 // Collect indexes of matching reconstructed events 00067 // 00068 for(TruthRecoIter it = tnu.RecoBeg(); it != tnu.RecoEnd(); ++it) 00069 { 00070 if(it -> IsEvent()) 00071 { 00072 fReco.push_back(it -> RecoIndex()); 00073 } 00074 } 00075 00076 if(record.StdHepBeg() != record.StdHepEnd()) 00077 { 00078 const int ibeg = tnu.ChildBeg(); 00079 const int iend = tnu.ChildEnd(); 00080 00081 if(ibeg < 0 || iend < 0 || iend < ibeg) 00082 { 00083 cerr << "TrueNu ctor - StdHep range is invalid: " << endl; 00084 tnu.Print(); 00085 } 00086 else 00087 { 00088 const vector<StdHep> &svec = record.GetStdHep(); 00089 bool ifound = false; 00090 00091 for(unsigned int ihep = 0; ihep < svec.size(); ++ihep) 00092 { 00093 const StdHep &hep = svec[ihep]; 00094 00095 if(hep.TruthIndex() != tnu.TruthIndex()) 00096 { 00097 continue; 00098 } 00099 00100 if(hep.StdHepIndex() < ibeg || hep.StdHepIndex() > iend) 00101 { 00102 cerr << "TrueNu ctor - StdHep range is invalid: " << svec.size() << endl; 00103 tnu.Print(); 00104 hep.Print(); 00105 continue; 00106 } 00107 00108 if(hep.IsLepton() && 00109 hep.GetIstHEP() == 1 && 00110 hep.ParentBeg() >= 0 && 00111 hep.ParentEnd() >= 0) 00112 { 00113 const double plep_ = std::sqrt(hep.Px()*hep.Px()+hep.Py()*hep.Py()+hep.Pz()*hep.Pz()); 00114 const double pneu_ = std::sqrt(tnu.Px()*tnu.Px()+tnu.Py()*tnu.Py()+tnu.Pz()*tnu.Pz()); 00115 if(plep_ > 0.0 && pneu_ > 0.0) 00116 { 00117 lep_cos = (hep.Px()*tnu.Px()+hep.Py()*tnu.Py()+hep.Pz()*tnu.Pz())/(plep_*pneu_); 00118 ifound = true; 00119 break; 00120 } 00121 } 00122 } 00123 00124 if(!ifound) 00125 { 00126 cerr << "TrueNu ctor - failed to find lepton StdHep" << endl; 00127 } 00128 } 00129 } 00130 00131 // 00132 // Stupid way to make sure that int values are within allowed short range 00133 // 00134 assert(std::abs(tnu.INu()) < SHRT_MAX && "inu is out of range"); 00135 assert(std::abs(tnu.Resonance()) < SHRT_MAX && "iresonance is out of range"); 00136 assert(std::abs(tnu.Interaction()) < SHRT_MAX && "iaction is out of range"); 00137 assert(std::abs(tnu.Flags()) < SHRT_MAX && "iflags is out of range"); 00138 assert(std::abs(tnu.InitState()) < SHRT_MAX && "init_state is out of range"); 00139 assert(std::abs(tnu.Nucleus()) < SHRT_MAX && "nucleus is out of range"); 00140 assert(std::abs(tnu.HadFS()) < SHRT_MAX && "had_fstate is out of range"); 00141 assert(std::abs(tnu.Flux().tptype) < SHRT_MAX && "tptype is out of range"); 00142 }
|
|
|
Definition at line 145 of file TrueNu.cxx. 00146 {
00147 }
|
|
||||||||||||
|
Definition at line 150 of file TrueNu.cxx. References Anp::Data, fData, and KeyExists(). 00151 {
00152 if(KeyExists(key))
00153 {
00154 cerr << "TrueNu::Add - key " << key << " already exists " << endl;
00155 assert(!KeyExists(key) && "key already exists");
00156 return false;
00157 }
00158
00159 fData.push_back(Anp::Data(key, value));
00160 return true;
00161 }
|
|
|
Definition at line 190 of file TrueNu.cxx. References Anp::Data, Anp::DataIter, fData, and find(). Referenced by operator[](). 00191 {
00192 DataIter it = find(fData.begin(), fData.end(), key);
00193 if(it == fData.end())
00194 {
00195 cerr << "TrueNu: key " << key << " does not exist" << endl;
00196 return 0.0;
00197 }
00198
00199 return it -> Data();
00200 }
|
|
|
Definition at line 131 of file TrueNu.h. References ENeu(), and TrueY().
|
|
|
Definition at line 130 of file TrueNu.h. References ENeu(), and TrueY().
|
|
|
Definition at line 129 of file TrueNu.h. Referenced by EHad(), ELep(), and Print(). 00129 { return neu_e; }
|
|
|
Definition at line 164 of file TrueNu.cxx. 00165 {
00166 DataVec::iterator it = std::find(fData.begin(), fData.end(), key);
00167 if(it == fData.end())
00168 {
00169 cerr << "TrueNu::Erase - key " << key << " does not exist" << endl;
00170 return false;
00171 }
00172
00173 fData.erase(it);
00174 return true;
00175 }
|
|
|
Definition at line 142 of file TrueNu.h. 00142 { return escale; }
|
|
|
Definition at line 123 of file TrueNu.h. 00123 { return iflags; }
|
|
|
Definition at line 126 of file TrueNu.h. Referenced by Print(). 00126 { return had_fstate; }
|
|
|
Definition at line 122 of file TrueNu.h. 00122 { return iaction; }
|
|
|
Definition at line 119 of file TrueNu.h. Referenced by Anp::operator==(), and Print(). 00119 { return index; }
|
|
|
Definition at line 124 of file TrueNu.h. Referenced by Print(). 00124 { return init_state; }
|
|
|
Definition at line 120 of file TrueNu.h. 00120 { return inu; }
|
|
|
Definition at line 145 of file TrueNu.h. References iaction. 00145 { return (iaction == 1); }
|
|
|
Definition at line 148 of file TrueNu.h. References iresonance. 00148 { return (iresonance == 1003); }
|
|
|
Definition at line 146 of file TrueNu.h. References iaction. 00146 { return (iaction == 0); }
|
|
|
Definition at line 152 of file TrueNu.h. References inu. 00152 { return (inu == +14); }
|
|
|
Definition at line 153 of file TrueNu.h. References inu. 00153 { return (inu == -14); }
|
|
|
Definition at line 150 of file TrueNu.h. References iresonance. 00150 { return (iresonance == 1001); }
|
|
|
Definition at line 149 of file TrueNu.h. References iresonance. 00149 { return (iresonance == 1002); }
|
|
|
Definition at line 178 of file TrueNu.cxx. Referenced by Add().
|
|
|
Definition at line 133 of file TrueNu.h. 00133 { return lep_cos; }
|
|
|
Definition at line 132 of file TrueNu.h. Referenced by Print(). 00132 { return lep_e; }
|
|
|
Definition at line 155 of file TrueNu.h. Referenced by Anp::operator==().
|
|
|
Definition at line 125 of file TrueNu.h. Referenced by Print(). 00125 { return nucleus; }
|
|
|
Definition at line 184 of file TrueNu.cxx. References DataAt(). 00185 {
00186 return DataAt(key);
00187 }
|
|
|
Definition at line 203 of file TrueNu.cxx. References Anp::Data, ENeu(), fData, HadFS(), iaction, Index(), InitState(), iresonance, Anp::Corr::Key, LepE(), Nucleus(), TrueQ2(), TrueW2(), TrueX(), and TrueY(). 00204 {
00205 o << "TrueNu: index = " << Index() << endl
00206 << " (iaction, reson, q2, x, y, w2) = ("
00207 << iaction << ", "
00208 << iresonance << ", "
00209 << TrueQ2() << ", "
00210 << TrueX() << ", "
00211 << TrueY() << ", "
00212 << TrueW2() << ")" << endl
00213 << " (init, nucl, finl) = ("
00214 << InitState() << ", "
00215 << Nucleus() << ", "
00216 << HadFS() << ")" << endl
00217 << " E_neu = " << ENeu() << ")" << endl
00218 << " E_lep = " << LepE() << ")" << endl;
00219
00220 for(DataVec::const_iterator it = fData.begin(); it != fData.end(); ++it)
00221 {
00222 o << " data[" << it -> Key() << "] = " << it -> Data() << endl;
00223 }
00224 }
|
|
|
Definition at line 121 of file TrueNu.h. 00121 { return iresonance; }
|
|
|
Definition at line 117 of file TrueNu.h. References escale. 00117 { escale = value; }
|
|
|
Definition at line 139 of file TrueNu.h. 00139 { return tpt; }
|
|
|
Definition at line 127 of file TrueNu.h. 00127 { return tptype; }
|
|
|
Definition at line 140 of file TrueNu.h. 00140 { return tpz; }
|
|
|
Definition at line 136 of file TrueNu.h. Referenced by Print(). 00136 { return q2; }
|
|
|
Definition at line 137 of file TrueNu.h. Referenced by Print(). 00137 { return w2; }
|
|
|
Definition at line 135 of file TrueNu.h. Referenced by Print(). 00135 { return x; }
|
|
|
Definition at line 134 of file TrueNu.h. Referenced by EHad(), ELep(), and Print(). 00134 { return y; }
|
|
|
Definition at line 143 of file TrueNu.h. 00143 { return weight; }
|
|
|
Definition at line 99 of file TrueNu.h. Referenced by SetEScale(). |
|
|
Definition at line 104 of file TrueNu.h. Referenced by Add(), DataAt(), Erase(), KeyExists(), and Print(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 82 of file TrueNu.h. Referenced by IsNuMu(), and IsNuMuBar(). |
|
|
|
|
|
Definition at line 92 of file TrueNu.h. Referenced by TrueNu(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.9.1