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

Detailed Description

Definition at line 26 of file PhysicsNtuple/HEAD/Event.h.


Constructor & Destructor Documentation

Event::Event (  ) 

Definition at line 19 of file PhysicsNtuple/HEAD/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 }

Event::~Event (  ) 

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

00034 {
00035 }


Member Function Documentation

bool Event::Add ( int  key,
float  data 
)

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

References fData, and KeyExists().

Referenced by Anp::FillShortEvent::Explore(), and Anp::SelectNuMu::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 Event::Clear ( void   ) 

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

References Anp::RecoNu::Clear(), Anp::Vertex::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 Event::ClearData (  ) 

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

References fData.

00055 { 
00056    fData.clear();
00057 }

float Event::DataAt ( short  key  )  const

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

References fData, find(), and it.

Referenced by Anp::PlotShort::FillStandard(), operator[](), 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 Event::DataBeg (  )  const [inline]

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

References fData.

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

00119 { return fData.begin(); }

DataIterator Event::DataBegIterator (  )  [inline]

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

References fData.

00110 { return fData.begin(); }

DataIter Event::DataEnd (  )  const [inline]

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

References fData.

00120 { return fData.end(); }

DataIterator Event::DataEndIterator (  )  [inline]

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

References fData.

00111 { return fData.end(); }

DataIterator Event::Erase ( DataIterator  ibeg,
DataIterator  iend 
) [inline]

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

References fData.

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

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

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

References fData.

00113 { return fData.erase(it); }

short Event::EventIndex (  )  const [inline]
bool Event::FirstShower ( short  index  )  const

Definition at line 79 of file PhysicsNtuple/HEAD/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 & Event::GetBasic (  )  const [inline]

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

References fBasic.

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

00133 { return fBasic; }

short Event::GetNShowers (  )  const [inline]

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

References fShower.

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

00137 { return fShower.size(); }

short Event::GetNTracks (  )  const [inline]

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

References fTrack.

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

00138 { return fTrack.size(); }

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

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

References fNu.

Referenced by Anp::SelectKinem::Pass(), Anp::PlotPur::Run(), and Anp::PlotEff::Run().

00134 { return fNu; }

RecoNu & Event::GetRecoNu (  )  [inline]

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

References fNu.

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

00131 { return fNu; }

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

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

References fVtx.

Referenced by Anp::PlotVtx::Run(), and Anp::EventHitTab::Set().

00135 { return fVtx; }

float Event::Gev (  )  const [inline]

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

References gev.

Referenced by Anp::PlotShort::FillStandard().

00141 { return gev; }

bool Event::KeyExists ( short  key  )  const [inline]
bool Event::MatchShower ( short  index  )  const [inline]

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

References find(), and fShower.

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

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

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

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

References find(), and fTrack.

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

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

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

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

References DataAt().

00151    {
00152       return DataAt(key);
00153    }

float Event::Pid (  )  const [inline]

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

References pid.

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

00142 { return pid; }

void Anp::Event::Print ( std::ostream &  os = std::cout  )  const
void Event::SetNu ( const RecoNu value  )  [inline]

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

References fNu.

00106 { fNu = value; }

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

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

References pid.

00107 { pid = value; }

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

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

References fNu, and Anp::RecoNu::SetWeight().

00108 { fNu.SetWeight(value); }

double Event::Weight (  )  const [inline]

Friends And Related Function Documentation

friend class FillEvent [friend]

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


Member Data Documentation

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

Referenced by Clear(), and GetBasic().

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

Referenced by Clear(), GetNu(), GetRecoNu(), SetNu(), SetWeight(), and Weight().

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

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

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

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

Referenced by Clear(), and GetVtx().

Float_t Anp::Event::gev [private]

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

Referenced by Clear(), and Gev().

Short_t Anp::Event::index [private]

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

Referenced by Clear(), and EventIndex().

Float_t Anp::Event::pid [private]

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

Referenced by Clear(), Pid(), and SetPid().


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

Generated on 18 Oct 2018 for loon by  doxygen 1.6.1