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

Anp::Event Class Reference

#include <Event.h>

List of all members.

Public Member Functions

 Event ()
 ~Event ()
bool Add (int key, float data)
void SetNu (const RecoNu &value)
void SetPid (float value)
void SetWeight (double value)
void Clear ()
void ClearData ()
DataIterator DataBegIterator ()
DataIterator DataEndIterator ()
DataIterator Erase (DataIterator it)
DataIterator Erase (DataIterator ibeg, DataIterator iend)
RecoNuGetRecoNu ()
const BasicGetBasic () const
const RecoNuGetNu () const
const VertexGetVtx () const
short GetNShowers () const
short GetNTracks () const
short EventIndex () const
float Gev () const
float Pid () const
double Weight () const
bool MatchTrack (short index) const
bool MatchShower (short index) const
bool FirstShower (short index) const
DataIter DataBeg () const
DataIter DataEnd () const
bool KeyExists (short key) const
float operator[] (short key) const
float DataAt (short key) const
void Print (std::ostream &os=std::cout) const

Private Attributes

Basic fBasic
RecoNu fNu
Vertex fVtx
Short_t index
Float_t gev
Float_t pid
DataVec fData
std::vector< Short_t > fShower
std::vector< Short_t > fTrack

Friends

class FillEvent


Constructor & Destructor Documentation

Anp::Event::Event  ) 
 

Definition at line 19 of file PhysicsNtuple/Event.cxx.

00020    :fBasic(),
00021     fNu(),
00022     fVtx(),
00023     index(-1000),
00024     gev(-1.0e6),
00025     pid(-1.0e6),
00026     fData(),
00027     fShower(),
00028     fTrack()
00029 {
00030 }

Anp::Event::~Event  ) 
 

Definition at line 33 of file PhysicsNtuple/Event.cxx.

00034 {
00035 }


Member Function Documentation

bool Anp::Event::Add int  key,
float  data
 

Definition at line 60 of file PhysicsNtuple/Event.cxx.

References Anp::Data, fData, and KeyExists().

Referenced by Anp::SelectAntiNeutrino::AddData(), Anp::RunkNN::AddData(), Anp::FillShortEvent::Explore(), Anp::FillEvent::FillNearestR(), Anp::FillEvent::FillNearestT(), Anp::PrevDataKey::operator()(), Anp::SelectNuMu::Run(), Anp::SelectAntiNeutrino::Run(), Anp::FillNPlane::Run(), Anp::FillMuonId::Run(), and Anp::FillkNN::Run().

00061 { 
00062    //
00063    // Add data at key, if key does not already exits 
00064    //
00065 
00066    assert(std::abs(key) < SHRT_MAX && "key is out of range");
00067    
00068    if(KeyExists(key))
00069    {
00070       cerr << "Event::Add(" << key << ") - key already exists" << endl;
00071       return false;
00072    }
00073    
00074    fData.push_back(Anp::Data(static_cast<short>(key), data));
00075    return true;
00076 }

void Anp::Event::Clear  ) 
 

Definition at line 38 of file PhysicsNtuple/Event.cxx.

References Anp::Vertex::Clear(), Anp::RecoNu::Clear(), Anp::Basic::Clear(), fBasic, fData, fNu, fShower, fTrack, fVtx, gev, index, and pid.

00039 {
00040    fBasic.Clear();
00041    fNu.Clear();
00042    fVtx.Clear();
00043 
00044    index = -10000;
00045    gev   = -1.0e6;
00046    pid   = -1.0e6;
00047 
00048    fData.clear();
00049    fShower.clear();
00050    fTrack.clear();
00051 }

void Anp::Event::ClearData  ) 
 

Definition at line 54 of file PhysicsNtuple/Event.cxx.

References fData.

00055 { 
00056    fData.clear();
00057 }

float Anp::Event::DataAt short  key  )  const
 

Definition at line 90 of file PhysicsNtuple/Event.cxx.

References Anp::Data, Anp::DataIter, fData, and find().

Referenced by Anp::PlotShort::FillStandard(), Anp::PlotShortSelect::Plot(), and Anp::SelectNC::Run().

00091 {
00092    //
00093    // Return data at key, if key exits 
00094    //
00095 
00096    const DataIter it = find(fData.begin(), fData.end(), key);
00097    if(it == fData.end())
00098    {
00099       return -999.0;
00100    }
00101    
00102    return it -> Data();
00103 }

DataIter Anp::Event::DataBeg  )  const [inline]
 

Definition at line 119 of file PhysicsNtuple/Event.h.

References Anp::DataIter.

Referenced by Anp::PlotResol::Plot(), Anp::PlotData::Plot(), Anp::RecordStore::PrintData(), and Anp::FillkNN::Run().

00119 { return fData.begin(); }

DataIterator Anp::Event::DataBegIterator  )  [inline]
 

Definition at line 110 of file PhysicsNtuple/Event.h.

References Anp::DataIterator.

00110 { return fData.begin(); }

DataIter Anp::Event::DataEnd  )  const [inline]
 

Definition at line 120 of file PhysicsNtuple/Event.h.

References Anp::DataIter.

Referenced by Anp::PlotResol::Plot(), Anp::PlotData::Plot(), Anp::RecordStore::PrintData(), and Anp::FillkNN::Run().

00120 { return fData.end(); }

DataIterator Anp::Event::DataEndIterator  )  [inline]
 

Definition at line 111 of file PhysicsNtuple/Event.h.

References Anp::DataIterator.

00111 { return fData.end(); }

DataIterator Anp::Event::Erase DataIterator  ibeg,
DataIterator  iend
[inline]
 

Definition at line 114 of file PhysicsNtuple/Event.h.

References Anp::DataIterator.

00115    {
00116       return fData.erase(ibeg, iend);
00117    }

DataIterator Anp::Event::Erase DataIterator  it  )  [inline]
 

Definition at line 113 of file PhysicsNtuple/Event.h.

References Anp::DataIterator.

00113 { return fData.erase(it); }

short Anp::Event::EventIndex  )  const [inline]
 

Definition at line 140 of file PhysicsNtuple/Event.h.

Referenced by Anp::FillEvent::Fill(), Anp::FillEvent::FillNearestR(), Anp::FillEvent::FillNearestT(), Anp::DrawSpan::FindSpan(), Anp::Record::FindStdHep(), Anp::Record::FindTruth(), Anp::FillShortEvent::GetPlaneStrips(), Anp::GetStrip(), Anp::operator==(), Anp::SelectCount::Run(), Anp::FillNPlane::Run(), and Anp::SnarlTimeTab::Set().

00140 { return index; }

bool Anp::Event::FirstShower short  index  )  const
 

Definition at line 79 of file PhysicsNtuple/Event.cxx.

References fShower.

Referenced by Anp::FirstShower().

00080 {
00081    if(fShower.empty())
00082    {
00083       return false;
00084    }
00085    
00086    return (fShower.front() == index);
00087 }

const Basic & Anp::Event::GetBasic  )  const [inline]
 

Definition at line 133 of file PhysicsNtuple/Event.h.

Referenced by Anp::FillShortEvent::Explore(), Anp::FillEvent::FillNearestR(), Anp::FillEvent::FillNearestT(), Anp::PlotEvent::Run(), and Anp::PlotBasic::Run().

00133 { return fBasic; }

short Anp::Event::GetNShowers  )  const [inline]
 

Definition at line 137 of file PhysicsNtuple/Event.h.

Referenced by Print(), Anp::SelectNC::Run(), Anp::PlotShower::Run(), Anp::PlotEvent::Run(), and Anp::EventHitTab::SetShowers().

00137 { return fShower.size(); }

short Anp::Event::GetNTracks  )  const [inline]
 

Definition at line 138 of file PhysicsNtuple/Event.h.

Referenced by Anp::PlotShort::PlotStandard(), Print(), Anp::SelectReson::Run(), and Anp::PlotEvent::Run().

00138 { return fTrack.size(); }

const RecoNu & Anp::Event::GetNu  )  const [inline]
 

Definition at line 134 of file PhysicsNtuple/Event.h.

Referenced by Anp::RunkNN::AddData(), Anp::FillFlux::Fill(), Anp::SelectKinem::Pass(), Anp::PlotReson::Plot(), Anp::PlotResol::Plot(), Anp::PlotPur::Run(), Anp::PlotKinem::Run(), Anp::PlotEvent::Run(), and Anp::PlotEff::Run().

00134 { return fNu; }

RecoNu & Anp::Event::GetRecoNu  )  [inline]
 

Definition at line 131 of file PhysicsNtuple/Event.h.

Referenced by Anp::FillFlux::Fill(), Anp::PlotShort::FillStandard(), Anp::PlotShortSelect::Plot(), Anp::SelectNuMu::ResetStop(), and Anp::SelectNC::Run().

00131 { return fNu; }

const Vertex & Anp::Event::GetVtx  )  const [inline]
 

Definition at line 135 of file PhysicsNtuple/Event.h.

Referenced by Anp::FillEvent::FillNearestR(), Anp::FillEvent::FillNearestT(), and Anp::PlotVtx::Run().

00135 { return fVtx; }

float Anp::Event::Gev  )  const [inline]
 

Definition at line 141 of file PhysicsNtuple/Event.h.

Referenced by Anp::FillShortEvent::Explore(), Anp::PlotShort::FillStandard(), and Anp::RecordStore::PrintTruth().

00141 { return gev; }

bool Anp::Event::KeyExists short  key  )  const [inline]
 

Definition at line 146 of file PhysicsNtuple/Event.h.

References find().

Referenced by Add(), Anp::SelectAntiNeutrino::AddData(), Anp::PlotShort::FillStandard(), Anp::PlotShortSelect::Plot(), Anp::PlotResol::Plot(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectAntiNeutrino::Run(), Anp::SelectAntiNeutrino::Run2(), and Anp::SelectKinem::Select().

00147    {
00148       return (std::find(fData.begin(), fData.end(), key) != fData.end());
00149    }

bool Anp::Event::MatchShower short  index  )  const [inline]
 

Definition at line 126 of file PhysicsNtuple/Event.h.

References find().

Referenced by Anp::GetShower(), Anp::operator==(), Anp::SelectNC::Run(), and Anp::PlotShower::Run().

00127    {
00128       return (std::find(fShower.begin(), fShower.end(), index) != fShower.end());
00129    }

bool Anp::Event::MatchTrack short  index  )  const [inline]
 

Definition at line 122 of file PhysicsNtuple/Event.h.

References find().

Referenced by Anp::GetTrack(), Anp::LongestTrack(), Anp::operator==(), Anp::PlotTrackGeom::Run(), and Anp::PlotData::Run().

00123    {
00124       return (std::find(fTrack.begin(), fTrack.end(), index) != fTrack.end());
00125    }

float Anp::Event::operator[] short  key  )  const [inline]
 

Definition at line 150 of file PhysicsNtuple/Event.h.

00151    {
00152       return DataAt(key);
00153    }

float Anp::Event::Pid  )  const [inline]
 

Definition at line 142 of file PhysicsNtuple/Event.h.

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

00142 { return pid; }

void Anp::Event::Print std::ostream &  os = std::cout  )  const
 

Definition at line 106 of file PhysicsNtuple/Event.cxx.

References Anp::Data, fBasic, fData, fNu, fVtx, GetNShowers(), GetNTracks(), gev, index, Anp::Corr::Key, Anp::Vertex::Print(), Anp::RecoNu::Print(), and Anp::Basic::Print().

00107 {
00108    os << "Event::Print" << endl
00109       << "   index = " << index << endl
00110       << "   gev = " << gev << endl
00111       << "   nshower = " << GetNShowers() << endl
00112       << "   ntrack = " << GetNTracks() << endl;
00113    
00114    for(DataVec::const_iterator dit = fData.begin(); dit != fData.end(); ++dit)
00115    {
00116       os  << "   (key, data) = (" << dit -> Key() << ", " << dit -> Data() << ")" << endl;
00117    }
00118    
00119    fBasic.Print(os);
00120    fNu.Print(os);
00121    fVtx.Print(os);
00122 }

void Anp::Event::SetNu const RecoNu value  )  [inline]
 

Definition at line 106 of file PhysicsNtuple/Event.h.

00106 { fNu = value; }

void Anp::Event::SetPid float  value  )  [inline]
 

Definition at line 107 of file PhysicsNtuple/Event.h.

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

00107 { pid = value; }

void Anp::Event::SetWeight double  value  )  [inline]
 

Definition at line 108 of file PhysicsNtuple/Event.h.

References Anp::RecoNu::SetWeight().

Referenced by Anp::FillFlux::Fill().

00108 { fNu.SetWeight(value); }

double Anp::Event::Weight  )  const [inline]
 

Definition at line 144 of file PhysicsNtuple/Event.h.

References Anp::RecoNu::Weight().

Referenced by Anp::FillFlux::Fill(), Anp::RunAlgEvent::Run(), Anp::PlotVtx::Run(), Anp::PlotTruth::Run(), Anp::PlotTrack::Run(), Anp::PlotShower::Run(), Anp::PlotPur::Run(), Anp::PlotFlux::Run(), Anp::PlotEvent::Run(), Anp::PlotEff::Run(), Anp::PlotData::Run(), Anp::PlotBasic::Run(), and Anp::FillkNN::Run().

00144 { return fNu.Weight(); }


Friends And Related Function Documentation

friend class FillEvent [friend]
 

Definition at line 77 of file PhysicsNtuple/Event.h.


Member Data Documentation

Basic Anp::Event::fBasic [private]
 

Definition at line 79 of file PhysicsNtuple/Event.h.

Referenced by Clear(), Print(), and Anp::FillEvent::Run().

DataVec Anp::Event::fData [private]
 

Definition at line 87 of file PhysicsNtuple/Event.h.

Referenced by Add(), Clear(), ClearData(), DataAt(), and Print().

RecoNu Anp::Event::fNu [private]
 

Definition at line 80 of file PhysicsNtuple/Event.h.

Referenced by Clear(), Print(), and Anp::FillEvent::Run().

std::vector<Short_t> Anp::Event::fShower [private]
 

Definition at line 89 of file PhysicsNtuple/Event.h.

Referenced by Clear(), FirstShower(), and Anp::FillEvent::Run().

std::vector<Short_t> Anp::Event::fTrack [private]
 

Definition at line 90 of file PhysicsNtuple/Event.h.

Referenced by Clear(), and Anp::FillEvent::Run().

Vertex Anp::Event::fVtx [private]
 

Definition at line 81 of file PhysicsNtuple/Event.h.

Referenced by Clear(), Print(), and Anp::FillEvent::Run().

Float_t Anp::Event::gev [private]
 

Definition at line 84 of file PhysicsNtuple/Event.h.

Referenced by Clear(), Print(), and Anp::FillEvent::Run().

Short_t Anp::Event::index [private]
 

Definition at line 83 of file PhysicsNtuple/Event.h.

Referenced by Clear(), Print(), and Anp::FillEvent::Run().

Float_t Anp::Event::pid [private]
 

Definition at line 85 of file PhysicsNtuple/Event.h.

Referenced by Clear(), and Anp::FillEvent::Run().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:31 2010 for loon by  doxygen 1.3.9.1