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

Anp::Record Class Reference

#include <Record.h>

List of all members.

Public Member Functions

 Record ()
 ~Record ()
void Set (const Header &value)
void Add (const Event &value)
void Add (const Shower &value)
void Add (const StdHep &value)
void Add (const Strip &value)
void Add (const Track &value)
void Add (const Truth &value)
void Add (const MRCCInfo &value)
bool Add (int key, float data)
std::vector< Event > & GetEvent ()
std::vector< Shower > & GetShower ()
std::vector< StdHep > & GetStdHep ()
std::vector< Strip > & GetStrip ()
std::vector< Track > & GetTrack ()
std::vector< Truth > & GetTruth ()
std::vector< MRCCInfo > & GetMRCC ()
const std::vector< Event > & GetEvent () const
const std::vector< Shower > & GetShower () const
const std::vector< StdHep > & GetStdHep () const
const std::vector< Strip > & GetStrip () const
const std::vector< Track > & GetTrack () const
const std::vector< Truth > & GetTruth () const
const std::vector< MRCCInfo > & GetMRCC () const
EventIterator EventBegIterator ()
EventIterator EventEndIterator ()
ShowerIterator ShowerBegIterator ()
ShowerIterator ShowerEndIterator ()
StdHepIterator StdHepBegIterator ()
StdHepIterator StdHepEndIterator ()
StripIterator StripBegIterator ()
StripIterator StripEndIterator ()
TrackIterator TrackBegIterator ()
TrackIterator TrackEndIterator ()
TruthIterator TruthBegIterator ()
TruthIterator TruthEndIterator ()
MRCCIterator MRCCBegIterator ()
MRCCIterator MRCCEndIterator ()
EventIterator Erase (EventIterator it)
ShowerIterator Erase (ShowerIterator it)
StdHepIterator Erase (StdHepIterator it)
StripIterator Erase (StripIterator it)
TrackIterator Erase (TrackIterator it)
TruthIterator Erase (TruthIterator it)
MRCCIterator Erase (MRCCIterator it)
void Clear ()
const HeaderGetHeader () const
EventIter EventBeg () const
EventIter EventEnd () const
ShowerIter ShowerBeg () const
ShowerIter ShowerEnd () const
StdHepIter StdHepBeg () const
StdHepIter StdHepEnd () const
StripIter StripBeg () const
StripIter StripEnd () const
TrackIter TrackBeg () const
TrackIter TrackEnd () const
TruthIter TruthBeg () const
TruthIter TruthEnd () const
MRCCIter MRCCBeg () const
MRCCIter MRCCEnd () const
EventIter FindEvent (short index) const
EventIter FindEvent (const Track &track) const
EventIter FindEvent (const Shower &shower) const
StdHepIter FindStdHep (short index) const
StdHepIter FindStdHep (const Track &track) const
StdHepIter FindStdHep (const Event &event) const
TruthIter FindTruth (short index) const
TruthIter FindTruth (const Event &event) const
TruthIter FindTruth (const Track &track) const
TruthIter FindTruth (const Shower &shower) const
TruthIter FindTruth (const StdHep &stdhep) const
EventIter FindMRCCEvent (const MRCCInfo &mrcc_evt) const
DataIter DataBeg () const
DataIter DataEnd () const
bool KeyExists (short key) const
float operator[] (short key) const
float DataAt (short key) const
unsigned int GetNEvents () const
unsigned int GetNShowers () const
unsigned int GetNStdHeps () const
unsigned int GetNStrips () const
unsigned int GetNTracks () const
unsigned int GetNTruths () const
unsigned int GetMRCCSize () const
void Print (std::ostream &o=std::cout) const

Private Attributes

std::vector< Anp::EventfEvent
std::vector< Anp::ShowerfShower
std::vector< Anp::StdHepfStdhep
std::vector< Anp::StripfStrip
std::vector< Anp::TrackfTrack
std::vector< Anp::TruthfTruth
std::vector< Anp::MRCCInfofMRCC
Header fHeader
DataVec fData


Constructor & Destructor Documentation

Anp::Record::Record  ) 
 

Definition at line 17 of file Record.cxx.

00018    :fEvent(),
00019     fShower(),
00020     fStdhep(),
00021     fStrip(),
00022     fTrack(),
00023     fTruth(),
00024     fMRCC(),
00025     fHeader()
00026 {
00027 }

Anp::Record::~Record  ) 
 

Definition at line 30 of file Record.cxx.

00031 {
00032 }


Member Function Documentation

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

Definition at line 50 of file Record.cxx.

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

00051 { 
00052    //
00053    // Add data at key, if key does not already exits 
00054    //
00055 
00056    assert(std::abs(key) < SHRT_MAX && "key is out of range");
00057    
00058    if(KeyExists(key))
00059    {
00060       cerr << "Record::Add(" << key << ") - key already exists" << endl;
00061       return false;
00062    }
00063    
00064    fData.push_back(Anp::Data(static_cast<short>(key), data));
00065    return true;
00066 }

void Anp::Record::Add const MRCCInfo value  )  [inline]
 

Definition at line 148 of file Record.h.

References fMRCC.

00148 { fMRCC.push_back(value); }

void Anp::Record::Add const Truth value  )  [inline]
 

Definition at line 143 of file Record.h.

References fTruth.

00143 { fTruth.push_back(value); }

void Anp::Record::Add const Track value  )  [inline]
 

Definition at line 144 of file Record.h.

References fTrack.

00144 { fTrack.push_back(value); }

void Anp::Record::Add const Strip value  )  [inline]
 

Definition at line 145 of file Record.h.

References fStrip.

00145 { fStrip.push_back(value); }

void Anp::Record::Add const StdHep value  )  [inline]
 

Definition at line 146 of file Record.h.

References fStdhep.

00146 { fStdhep.push_back(value); }

void Anp::Record::Add const Shower value  )  [inline]
 

Definition at line 147 of file Record.h.

References fShower.

00147 { fShower.push_back(value); }

void Anp::Record::Add const Event value  )  [inline]
 

Definition at line 142 of file Record.h.

References fEvent.

Referenced by Anp::SelectShort::Run(), Anp::FillTruth::Run(), Anp::FillTrack::Run(), Anp::FillSnarl::Run(), Anp::FillShower::Run(), Anp::FillShortVar::Run(), Anp::FillMRCC::Run(), and Anp::FillEvent::Run().

00142 { fEvent.push_back(value); }

void Anp::Record::Clear  ) 
 

Definition at line 35 of file Record.cxx.

References Anp::Header::Clear(), fData, fEvent, fHeader, fMRCC, fShower, fStdhep, fStrip, fTrack, and fTruth.

00036 {
00037    fEvent.clear();
00038    fShower.clear();
00039    fStdhep.clear();
00040    fStrip.clear();
00041    fTrack.clear();
00042    fTruth.clear();
00043    fMRCC.clear();
00044 
00045    fHeader.Clear();
00046    fData.clear();
00047 }

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

Definition at line 354 of file Record.cxx.

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

Referenced by operator[](), Anp::SelectShort::Run(), and Anp::PlotShort::Run().

00355 {
00356    //
00357    // Return data at key, if key exits 
00358    //
00359 
00360    const DataIter it = std::find(fData.begin(), fData.end(), key);
00361    if(it == fData.end())
00362    {
00363       cerr << "Record::DataAt(" << key << ") - key does not exist" << endl;
00364       return 0.0;
00365    }
00366    
00367    return it -> Data();
00368 }

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

Definition at line 209 of file Record.h.

References Anp::DataIter, and fData.

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

00209 { return fData.begin(); }

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

Definition at line 210 of file Record.h.

References Anp::DataIter, and fData.

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

00210 { return fData.end(); }

MRCCIterator Anp::Record::Erase MRCCIterator  it  )  [inline]
 

Definition at line 187 of file Record.h.

References fMRCC, and Anp::MRCCIterator.

00187 { return fMRCC.erase(it); }

TruthIterator Anp::Record::Erase TruthIterator  it  )  [inline]
 

Definition at line 186 of file Record.h.

References fTruth, and Anp::TruthIterator.

00186 { return fTruth.erase(it); }

TrackIterator Anp::Record::Erase TrackIterator  it  )  [inline]
 

Definition at line 185 of file Record.h.

References fTrack, and Anp::TrackIterator.

00185 { return fTrack.erase(it); }

StripIterator Anp::Record::Erase StripIterator  it  )  [inline]
 

Definition at line 184 of file Record.h.

References fStrip, and Anp::StripIterator.

00184 { return fStrip.erase(it); }

StdHepIterator Anp::Record::Erase StdHepIterator  it  )  [inline]
 

Definition at line 183 of file Record.h.

References fStdhep, and Anp::StdHepIterator.

00183 { return fStdhep.erase(it); }

ShowerIterator Anp::Record::Erase ShowerIterator  it  )  [inline]
 

Definition at line 182 of file Record.h.

References fShower, and Anp::ShowerIterator.

00182 { return fShower.erase(it); }

EventIterator Anp::Record::Erase EventIterator  it  )  [inline]
 

Definition at line 181 of file Record.h.

References Anp::EventIterator, and fEvent.

Referenced by Anp::CleanRecord(), Anp::SelectTrue::Run(), Anp::SelectShort::Run(), Anp::SelectReson::Run(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectKinem::Run(), Anp::SelectFiducial::Run(), Anp::SelectAntiNeutrino::Run(), Anp::RunAlgEvent::Run(), Anp::FillShortVar::Run(), and Anp::FillShortEvent::Run().

00181 { return fEvent.erase(it); }

EventIter Anp::Record::EventBeg  )  const [inline]
 

Definition at line 189 of file Record.h.

References Anp::EventIter, and fEvent.

Referenced by Anp::AlgCaddy< T >::AllSnarl(), Anp::FillEvent::FillNearestR(), Anp::FillEvent::FillNearestT(), FindEvent(), Anp::FillTruth::IsConsistent(), Anp::AlgCaddy< T >::OutSnarl(), Anp::SelectFiducial::PassTruth(), Anp::PlotShortSelect::Plot(), Anp::StudyFiducial::Run(), Anp::SelectTrue::Run(), Anp::SelectShort::Run(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectKinem::Run(), Anp::SelectFiducial::Run(), Anp::RunkNN::Run(), Anp::PlotSnarl::Run(), Anp::PlotEff::Run(), Anp::PlotData::Run(), Anp::FillShortEvent::Run(), and Anp::FillData::Run().

00189 { return fEvent.begin(); }

EventIterator Anp::Record::EventBegIterator  )  [inline]
 

Definition at line 166 of file Record.h.

References Anp::EventIterator, and fEvent.

Referenced by Anp::RunkNN::AddData(), Anp::ApplyTrueWeights(), Anp::RunkNN::CutData(), Anp::SelectTrue::Run(), Anp::SelectShort::Run(), Anp::SelectReson::Run(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectKinem::Run(), Anp::SelectFlux::Run(), Anp::SelectFiducial::Run(), Anp::SelectAntiNeutrino::Run(), Anp::RunkNN::Run(), Anp::RunAlgEvent::Run(), Anp::PlotVtx::Run(), Anp::PlotTruth::Run(), Anp::PlotShower::Run(), Anp::PlotShort::Run(), Anp::PlotPur::Run(), Anp::PlotKinem::Run(), Anp::PlotEvent::Run(), Anp::PlotBasic::Run(), Anp::FillShortVar::Run(), Anp::FillShortEvent::Run(), Anp::FillNPlane::Run(), Anp::FillMuonId::Run(), Anp::FillMadId::Run(), Anp::FillkNN::Run(), Anp::FillFlux::Run(), Anp::FillEvent::Run(), Anp::FillEnergy::Run(), and Anp::AlgThread::Run().

00166 { return fEvent.begin(); }

EventIter Anp::Record::EventEnd  )  const [inline]
 

Definition at line 190 of file Record.h.

References Anp::EventIter, and fEvent.

Referenced by Anp::AlgCaddy< T >::AllSnarl(), Anp::FillEvent::FillNearestR(), Anp::FillEvent::FillNearestT(), Anp::PlotShort::FillStandard(), FindEvent(), Anp::FillTruth::IsConsistent(), Anp::FillShortVar::IsGoodTrack(), Anp::AlgCaddy< T >::OutSnarl(), Anp::SelectFiducial::PassTruth(), Anp::PlotShortSelect::Plot(), Anp::StudyFiducial::Run(), Anp::SelectTrue::Run(), Anp::SelectShort::Run(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectKinem::Run(), Anp::SelectFiducial::Run(), Anp::RunkNN::Run(), Anp::PlotSnarl::Run(), Anp::PlotShort::Run(), Anp::PlotEff::Run(), Anp::PlotData::Run(), Anp::FillShortVar::Run(), Anp::FillShortEvent::Run(), and Anp::FillData::Run().

00190 { return fEvent.end(); }

EventIterator Anp::Record::EventEndIterator  )  [inline]
 

Definition at line 167 of file Record.h.

References NtpSRTrack::end, Anp::EventIterator, and fEvent.

Referenced by Anp::RunkNN::AddData(), Anp::ApplyTrueWeights(), Anp::RunkNN::CutData(), Anp::SelectTrue::Run(), Anp::SelectShort::Run(), Anp::SelectReson::Run(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectKinem::Run(), Anp::SelectFlux::Run(), Anp::SelectFiducial::Run(), Anp::SelectAntiNeutrino::Run(), Anp::RunkNN::Run(), Anp::RunAlgEvent::Run(), Anp::PlotVtx::Run(), Anp::PlotTruth::Run(), Anp::PlotShower::Run(), Anp::PlotPur::Run(), Anp::PlotKinem::Run(), Anp::PlotEvent::Run(), Anp::PlotBasic::Run(), Anp::FillShortEvent::Run(), Anp::FillNPlane::Run(), Anp::FillMuonId::Run(), Anp::FillMadId::Run(), Anp::FillkNN::Run(), Anp::FillFlux::Run(), Anp::FillEvent::Run(), Anp::FillEnergy::Run(), and Anp::AlgThread::Run().

00167 { return fEvent.end(); }

Anp::EventIter Anp::Record::FindEvent const Shower shower  )  const
 

Definition at line 105 of file Record.cxx.

References EventBeg(), EventEnd(), Anp::EventIter, and Anp::Shower::ShowerIndex().

00106 {  
00107    //
00108    // Find (first) event that contains this shower
00109    //
00110 
00111    for(EventIter it = EventBeg(); it != EventEnd(); ++it)
00112    {
00113       if(it -> MatchShower(shower.ShowerIndex()))
00114       {
00115          return it;
00116       }      
00117    }
00118    return EventEnd();
00119 }

Anp::EventIter Anp::Record::FindEvent const Track track  )  const
 

Definition at line 87 of file Record.cxx.

References EventBeg(), EventEnd(), Anp::EventIter, and Anp::Track::TrackIndex().

00088 {  
00089    //
00090    // Find (first) event that contains this track
00091    //
00092 
00093    for(EventIter it = EventBeg(); it != EventEnd(); ++it)
00094    {
00095       if(it -> MatchTrack(track.TrackIndex()))
00096       {
00097          return it;
00098       }      
00099    }
00100 
00101    return EventEnd();
00102 }

Anp::EventIter Anp::Record::FindEvent short  index  )  const
 

Definition at line 69 of file Record.cxx.

References EventBeg(), EventEnd(), and Anp::EventIter.

Referenced by Anp::PlotShort::FillStandard(), FindMRCCEvent(), Anp::FillShortVar::IsGoodTrack(), Anp::PlotShortSelect::Plot(), Anp::SelectFiducial::Run(), and Anp::PlotShort::Run().

00070 { 
00071    //
00072    // Find event with this index
00073    //
00074 
00075    for(EventIter ievent = EventBeg(); ievent != EventEnd(); ++ievent)
00076    {
00077       if(ievent -> EventIndex() == index)
00078       {
00079          return ievent;
00080       }      
00081    }
00082 
00083    return EventEnd();
00084 }

Anp::EventIter Anp::Record::FindMRCCEvent const MRCCInfo mrcc_evt  )  const
 

Definition at line 249 of file Record.cxx.

References Anp::EventIter, FindEvent(), and Anp::MRCCInfo::GetBestIndex().

00250 {
00251   //
00252   // for some point in the MRCCInfo find the corresponding muon (track) removed event
00253   //
00254   EventIter it = FindEvent(mrcc_evt.GetBestIndex());
00255   return it;
00256 
00257 }

Anp::StdHepIter Anp::Record::FindStdHep const Event event  )  const
 

Definition at line 316 of file Record.cxx.

References Anp::Event::EventIndex(), fHeader, Lit::Find(), FindStdHep(), fStdhep, Anp::Header::IsData(), StdHepEnd(), Anp::StdHepIter, TruthBeg(), TruthEnd(), Anp::TruthIter, and Anp::TruthRecoIter.

00317 {
00318    //
00319    // Find stdhep record that matches this reconstructed event
00320    //
00321 
00322    if(fHeader.IsData())
00323    {      
00324       cerr << "Record::FindStdHep() - looking for stdhep info in the data" << endl;
00325       abort();
00326       return StdHepEnd();
00327    }
00328 
00329    for(TruthIter truth = TruthBeg(); truth != TruthEnd(); ++truth)
00330    {
00331       TruthRecoIter reco = truth -> Find(event);
00332       if(reco == truth -> RecoEnd())
00333       {
00334          continue;
00335       }
00336 
00337       StdHepIter stdhep = FindStdHep(reco -> StdHepIndex());
00338       if(stdhep != fStdhep.end())
00339       {
00340          return stdhep;
00341       }
00342       else
00343       {
00344          break;
00345       }
00346    }
00347    
00348    cerr << "Record::FindStdHep(" << event.EventIndex() << ") - failed to find StdHep for track" << endl;
00349    
00350    return StdHepEnd();
00351 }

Anp::StdHepIter Anp::Record::FindStdHep const Track track  )  const
 

Definition at line 279 of file Record.cxx.

References fHeader, Lit::Find(), FindStdHep(), Anp::Header::IsData(), StdHepEnd(), Anp::StdHepIter, Anp::Track::TrackIndex(), TruthBeg(), TruthEnd(), Anp::TruthIter, and Anp::TruthRecoIter.

00280 {
00281    //
00282    // Find stdhep record that matches this reconstructed track
00283    //
00284 
00285    if(fHeader.IsData())
00286    {      
00287       cerr << "Record::FindStdHep - looking for stdhep info in the data" << endl;
00288       return StdHepEnd();
00289    }
00290 
00291    for(TruthIter truth = TruthBeg(); truth != TruthEnd(); ++truth)
00292    {
00293       TruthRecoIter reco = truth -> Find(track);
00294       if(reco == truth -> RecoEnd())
00295       {
00296          continue;
00297       }
00298 
00299       StdHepIter stdhep = FindStdHep(reco -> StdHepIndex());
00300       if(stdhep != StdHepEnd())
00301       {
00302          return stdhep;
00303       }
00304       else
00305       {
00306          break;
00307       }
00308    }
00309    
00310    cerr << "Record::FindStdHep(" << track.TrackIndex() << ") - failed to find StdHep for track" << endl;
00311 
00312    return StdHepEnd();
00313 }

Anp::StdHepIter Anp::Record::FindStdHep short  index  )  const
 

Definition at line 261 of file Record.cxx.

References StdHepBeg(), StdHepEnd(), and Anp::StdHepIter.

Referenced by Anp::PlotTrack::FillResol(), FindStdHep(), Anp::PlotShortSelect::Particle(), Anp::PlotShort::Particle(), Anp::PlotData::Particle(), Anp::PlotData::Plot(), Anp::FillTruth::Run(), and Anp::FillMuonId::Run().

00262 {
00263    //
00264    // Find truth with this index
00265    //
00266 
00267    for(StdHepIter it = StdHepBeg(); it != StdHepEnd(); ++it)
00268    {
00269       if(it -> StdHepIndex() == index)
00270       {
00271          return it;
00272       }
00273    }
00274 
00275    return StdHepEnd();
00276 }

Anp::TruthIter Anp::Record::FindTruth const StdHep stdhep  )  const
 

Definition at line 226 of file Record.cxx.

References fHeader, Anp::Header::IsData(), TruthBeg(), TruthEnd(), and Anp::TruthIter.

00227 {
00228    //
00229    // Find parent truth record that owns this stdhep record
00230    //
00231 
00232    if(fHeader.IsData())
00233    {
00234       cerr << " Record::FindTruth - looking for MC truth information in data" << endl;
00235       return TruthEnd(); 
00236    }
00237    
00238    for(TruthIter it = TruthBeg(); it != TruthEnd(); ++it)
00239    {       
00240       if(it -> Match(stdhep))
00241       {
00242          return it;
00243       }
00244    }
00245 
00246    return TruthEnd();   
00247 }

Anp::TruthIter Anp::Record::FindTruth const Shower shower  )  const
 

Definition at line 200 of file Record.cxx.

References fHeader, Anp::Header::IsData(), Anp::Shower::ShowerIndex(), TruthBeg(), TruthEnd(), and Anp::TruthIter.

00201 {
00202    //
00203    // Find truth that matches this reconstructed shower
00204    //
00205 
00206    if(fHeader.IsData())
00207    {
00208       cerr << " Record::FindTruth - looking for MC truth information in data" << endl;
00209       return TruthEnd(); 
00210    }
00211    
00212    for(TruthIter it = TruthBeg(); it != TruthEnd(); ++it)
00213    {       
00214       if(it -> Match(shower))
00215       {
00216          return it;
00217       }
00218    }
00219 
00220    cerr << "Record::FindTruth(" << shower.ShowerIndex() << ") - failed to find Truth for shower" << endl;
00221       
00222    return TruthEnd();
00223 }

Anp::TruthIter Anp::Record::FindTruth const Track track  )  const
 

Definition at line 174 of file Record.cxx.

References fHeader, Anp::Header::IsData(), Anp::Track::TrackIndex(), TruthBeg(), TruthEnd(), and Anp::TruthIter.

00175 {
00176    //
00177    // Find truth that matches this reconstructed track
00178    //
00179 
00180    if(fHeader.IsData())
00181    {
00182       cerr << " Record::FindTruth - looking for MC truth information in data" << endl;
00183       return TruthEnd(); 
00184    }
00185    
00186    for(TruthIter it = TruthBeg(); it != TruthEnd(); ++it)
00187    {
00188       if(it -> Match(track))
00189       {
00190          return it;
00191       }
00192    }
00193 
00194    cerr << "Record::FindTruth(" << track.TrackIndex() << ") - failed to find Truth for track" << endl;
00195       
00196    return TruthEnd();
00197 }

Anp::TruthIter Anp::Record::FindTruth const Event event  )  const
 

Definition at line 148 of file Record.cxx.

References Anp::Event::EventIndex(), fHeader, Anp::Header::IsData(), TruthBeg(), TruthEnd(), and Anp::TruthIter.

00149 {
00150    //
00151    // Find truth that matches this reconstructed event
00152    //
00153 
00154    if(fHeader.IsData())
00155    {
00156       cerr << "Record::FindTruth - looking for MC truth information in the data" << endl;
00157       return TruthEnd(); 
00158    }
00159 
00160    for(TruthIter it = TruthBeg(); it != TruthEnd(); ++it)
00161    {       
00162       if(it -> Match(event))
00163       {
00164          return it;
00165       }
00166    }
00167 
00168    cerr << "Record::FindTruth(" << event.EventIndex() << ") - failed to find Truth for event" << endl;
00169       
00170    return TruthEnd();
00171 }

Anp::TruthIter Anp::Record::FindTruth short  index  )  const
 

Definition at line 122 of file Record.cxx.

References fHeader, Anp::Header::IsData(), TruthBeg(), TruthEnd(), and Anp::TruthIter.

Referenced by Anp::RunkNN::AddData(), Anp::ApplyTrueWeights(), Anp::FillFlux::Fill(), Anp::PlotShort::FillStandard(), Anp::FillShortVar::IsGoodTrack(), Anp::PlotShort::Plot(), Anp::PlotData::Plot(), Anp::PlotShort::PlotStandard(), Anp::RecordStore::PrintTruth(), Anp::SelectShort::Run(), Anp::SelectReson::Run(), Anp::SelectFlux::Run(), Anp::SelectCount::Run(), Anp::PlotVtx::Run(), Anp::PlotTruth::Run(), Anp::PlotShort::Run(), Anp::PlotPur::Run(), Anp::PlotFlux::Run(), Anp::PlotEff::Run(), Anp::FillShortEvent::Run(), Anp::SelectTrue::Select(), and Anp::StdHepTab::Set().

00123 {
00124    //
00125    // Find truth with this index
00126    //
00127 
00128    if(fHeader.IsData())
00129    {
00130       cerr << "Record::FindTruth - looking for MC truth information in the data" << endl;
00131       return TruthEnd(); 
00132    }
00133 
00134    for(TruthIter it = TruthBeg(); it != TruthEnd(); ++it)
00135    {
00136       if(it -> TruthIndex() == index)
00137       {
00138          return it;
00139       }
00140    }
00141 
00142    cerr << "Record::FindTruth(" << index << ") - failed to find Truth" << endl;
00143 
00144    return TruthEnd();
00145 }

const std::vector< Event > & Anp::Record::GetEvent  )  const [inline]
 

Definition at line 158 of file Record.h.

00158 { return fEvent; }

std::vector< Event > & Anp::Record::GetEvent  )  [inline]
 

Definition at line 150 of file Record.h.

00150 { return fEvent; }

const Header & Anp::Record::GetHeader  )  const [inline]
 

Definition at line 204 of file Record.h.

Referenced by DataBlock::Add(), Anp::RunkNN::AddData(), Anp::ApplyTrueWeights(), Anp::PlotPmt::Collect(), Anp::HistTime::Fill(), Anp::FillFlux::Fill(), Anp::FillEvent::Fill(), Anp::PlotTrack::FillResol(), Anp::FillShortEvent::GetPlaneStrips(), Anp::FillShortVar::GetTrackMap(), Anp::StdHepTab::Init(), Anp::SnarlTimeTab::Init(), Anp::SnarlAdcTab::Init(), Anp::EventHitTab::Init(), Anp::EventAdcTab::Init(), Anp::SnarlTimeTab::NewSnarl(), Anp::PlotShortSelect::Particle(), Anp::PlotShort::Particle(), Anp::PlotData::Particle(), Anp::SelectKinem::Pass(), Anp::SelectFiducial::Pass(), Anp::PlotData::Plot(), Anp::RecordStore::PrintTruth(), Anp::FillMadId::Reset(), Anp::SelectTrue::Run(), Anp::SelectSpill::Run(), Anp::SelectReson::Run(), Anp::SelectNuMu::Run(), Anp::SelectKinem::Run(), Anp::SelectFlux::Run(), Anp::SelectCount::Run(), Anp::RunModule::Run(), Anp::RunAlgSnarl::Run(), Anp::PlotVtx::Run(), Anp::PlotTruth::Run(), Anp::PlotTime::Run(), Anp::PlotSnarl::Run(), Anp::PlotShower::Run(), Anp::PlotShortSelect::Run(), Anp::PlotPur::Run(), Anp::PlotFlux::Run(), Anp::PlotEff::Run(), Anp::FillShower::Run(), Anp::FillShortEvent::Run(), Anp::FillMuonId::Run(), Anp::FillMadId::Run(), Anp::FillFlux::Run(), Anp::FillEvent::Run(), Anp::FillEnergy::Run(), Anp::DrawSnarl::Run(), Anp::RunAlgSnarl::RunRecord(), Anp::FillMuonId::Select(), Anp::StdHepTab::Set(), Anp::SnarlTimeTab::Set(), and Anp::FillShortVar::Study().

00205    {
00206       return fHeader;
00207    }

const std::vector< MRCCInfo > & Anp::Record::GetMRCC  )  const [inline]
 

Definition at line 164 of file Record.h.

00164 { return fMRCC; }

std::vector< MRCCInfo > & Anp::Record::GetMRCC  )  [inline]
 

Definition at line 156 of file Record.h.

00156 { return fMRCC; }

unsigned int Anp::Record::GetMRCCSize  )  const [inline]
 

Definition at line 227 of file Record.h.

References fMRCC.

00227 { return fMRCC.size(); }

unsigned int Anp::Record::GetNEvents  )  const [inline]
 

Definition at line 221 of file Record.h.

References fEvent.

Referenced by DataBlock::Add(), Anp::HistTime::Fill(), Print(), Anp::RunModule::Run(), and Anp::DrawSnarl::Run().

00221 { return fEvent.size(); }

unsigned int Anp::Record::GetNShowers  )  const [inline]
 

Definition at line 223 of file Record.h.

References fShower.

Referenced by Print(), and Anp::PlotShower::Run().

00223 { return fShower.size(); }

unsigned int Anp::Record::GetNStdHeps  )  const [inline]
 

Definition at line 224 of file Record.h.

References fStdhep.

Referenced by Print(), Anp::SelectFiducial::Run(), and Anp::FillTruth::Run().

00224 { return fStdhep.size(); }

unsigned int Anp::Record::GetNStrips  )  const [inline]
 

Definition at line 222 of file Record.h.

References fStrip.

Referenced by Print(), and Anp::FillSnarl::Run().

00222 { return fStrip.size(); }

unsigned int Anp::Record::GetNTracks  )  const [inline]
 

Definition at line 225 of file Record.h.

References fTrack.

Referenced by Print().

00225 { return fTrack.size(); }

unsigned int Anp::Record::GetNTruths  )  const [inline]
 

Definition at line 226 of file Record.h.

References fTruth.

Referenced by Print(), and Anp::FillTruth::Run().

00226 { return fTruth.size(); }

const std::vector< Shower > & Anp::Record::GetShower  )  const [inline]
 

Definition at line 159 of file Record.h.

00159 { return fShower; }

std::vector< Shower > & Anp::Record::GetShower  )  [inline]
 

Definition at line 151 of file Record.h.

00151 { return fShower; }

const std::vector< StdHep > & Anp::Record::GetStdHep  )  const [inline]
 

Definition at line 160 of file Record.h.

00160 { return fStdhep; }

std::vector< StdHep > & Anp::Record::GetStdHep  )  [inline]
 

Definition at line 152 of file Record.h.

Referenced by Anp::FillTruth::FillStdHep(), Anp::RunkNN::Run(), and Anp::TrueNu::TrueNu().

00152 { return fStdhep; }

const std::vector< Strip > & Anp::Record::GetStrip  )  const [inline]
 

Definition at line 161 of file Record.h.

00161 { return fStrip; }

std::vector< Strip > & Anp::Record::GetStrip  )  [inline]
 

Definition at line 153 of file Record.h.

Referenced by Anp::FillShortEvent::GetEventQuantities(), Anp::RunkNN::Run(), and Anp::FillStrip::Run().

00153 { return fStrip; }

const std::vector< Track > & Anp::Record::GetTrack  )  const [inline]
 

Definition at line 162 of file Record.h.

00162 { return fTrack; }

std::vector< Track > & Anp::Record::GetTrack  )  [inline]
 

Definition at line 154 of file Record.h.

00154 { return fTrack; }

const std::vector< Truth > & Anp::Record::GetTruth  )  const [inline]
 

Definition at line 163 of file Record.h.

00163 { return fTruth; }

std::vector< Truth > & Anp::Record::GetTruth  )  [inline]
 

Definition at line 155 of file Record.h.

00155 { return fTruth; }

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

Definition at line 212 of file Record.h.

References fData, and find().

Referenced by Add().

00213    {
00214       return (std::find(fData.begin(), fData.end(), key) != fData.end());
00215    }

MRCCIter Anp::Record::MRCCBeg  )  const [inline]
 

Definition at line 201 of file Record.h.

References fMRCC, and Anp::MRCCIter.

00201 { return fMRCC.begin(); }

MRCCIterator Anp::Record::MRCCBegIterator  )  [inline]
 

Definition at line 178 of file Record.h.

References fMRCC, and Anp::MRCCIterator.

00178 { return fMRCC.begin(); }

MRCCIter Anp::Record::MRCCEnd  )  const [inline]
 

Definition at line 202 of file Record.h.

References fMRCC, and Anp::MRCCIter.

00202 { return fMRCC.end(); }

MRCCIterator Anp::Record::MRCCEndIterator  )  [inline]
 

Definition at line 179 of file Record.h.

References fMRCC, and Anp::MRCCIterator.

00179 { return fMRCC.end(); }

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

Definition at line 216 of file Record.h.

References DataAt().

00217    {
00218       return DataAt(key);
00219    }

void Anp::Record::Print std::ostream &  o = std::cout  )  const
 

Definition at line 371 of file Record.cxx.

References Anp::EventIter, fEvent, fHeader, fTrack, GetNEvents(), GetNShowers(), GetNStdHeps(), GetNStrips(), GetNTracks(), GetNTruths(), Anp::Header::Print(), and Anp::TrackIter.

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

00372 {
00373    os << "Record::Print" << endl
00374       << "   NEvents  = " << GetNEvents() << endl
00375       << "   NShowers = " << GetNShowers() << endl
00376       << "   NStdHeps = " << GetNStdHeps() << endl
00377       << "   NStrips  = " << GetNStrips() << endl
00378       << "   NTracks  = " << GetNTracks() << endl
00379       << "   NTruths  = " << GetNTruths() << endl;
00380    
00381    fHeader.Print(os); 
00382    
00383    for(EventIter it = fEvent.begin(); it != fEvent.end(); ++it)
00384    {
00385       it -> Print(os);
00386    }
00387 
00388    for(TrackIter it = fTrack.begin(); it != fTrack.end(); ++it)
00389    {
00390       it -> Print(os);
00391    }
00392 }

void Anp::Record::Set const Header value  )  [inline]
 

Definition at line 141 of file Record.h.

References fHeader.

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

00141 { fHeader = value; }

ShowerIter Anp::Record::ShowerBeg  )  const [inline]
 

Definition at line 191 of file Record.h.

References fShower, and Anp::ShowerIter.

Referenced by Anp::FirstShower(), Anp::GetShower(), Anp::FillTruth::IsConsistent(), Anp::SelectFiducial::PassTruth(), Anp::SelectNC::Run(), Anp::SelectFiducial::Run(), Anp::PlotShower::Run(), Anp::PlotBasic::Run(), and Anp::FillEnergy::Run().

00191 { return fShower.begin(); }

ShowerIterator Anp::Record::ShowerBegIterator  )  [inline]
 

Definition at line 168 of file Record.h.

References fShower, and Anp::ShowerIterator.

Referenced by Anp::ApplyTrueWeights(), Anp::CleanRecord(), Anp::SelectFiducial::Run(), and Anp::FillEnergy::Run().

00168 { return fShower.begin(); }

ShowerIter Anp::Record::ShowerEnd  )  const [inline]
 

Definition at line 192 of file Record.h.

References fShower, and Anp::ShowerIter.

Referenced by Anp::FillEvent::Fill(), Anp::FirstShower(), Anp::GetShower(), Anp::GetUVAssymForQES(), Anp::FillTruth::IsConsistent(), Anp::SelectFiducial::PassTruth(), Anp::PrimaryShower(), Anp::SelectNC::Run(), Anp::SelectFiducial::Run(), Anp::PlotVtx::Run(), Anp::PlotShower::Run(), Anp::PlotBasic::Run(), and Anp::FillEnergy::Run().

00192 { return fShower.end(); }

ShowerIterator Anp::Record::ShowerEndIterator  )  [inline]
 

Definition at line 169 of file Record.h.

References fShower, and Anp::ShowerIterator.

Referenced by Anp::ApplyTrueWeights(), Anp::CleanRecord(), Anp::SelectFiducial::Run(), and Anp::FillEnergy::Run().

00169 { return fShower.end(); }

StdHepIter Anp::Record::StdHepBeg  )  const [inline]
 

Definition at line 193 of file Record.h.

References fStdhep, and Anp::StdHepIter.

Referenced by Anp::PlotTrack::FillResol(), FindStdHep(), Anp::FillTruth::IsConsistent(), Anp::PlotShortSelect::Particle(), Anp::PlotShort::Particle(), Anp::PlotData::Particle(), Anp::Draw::Read(), Anp::FillMuonId::Run(), and Anp::TrueNu::TrueNu().

00193 { return fStdhep.begin();}

StdHepIterator Anp::Record::StdHepBegIterator  )  [inline]
 

Definition at line 170 of file Record.h.

References fStdhep, and Anp::StdHepIterator.

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

00170 { return fStdhep.begin();}

StdHepIter Anp::Record::StdHepEnd  )  const [inline]
 

Definition at line 194 of file Record.h.

References fStdhep, and Anp::StdHepIter.

Referenced by Anp::PlotTrack::FillResol(), FindStdHep(), Anp::FillTruth::IsConsistent(), Anp::PlotShortSelect::Particle(), Anp::PlotShort::Particle(), Anp::PlotData::Particle(), Anp::PlotData::Plot(), Anp::Draw::Read(), Anp::FillTruth::Run(), Anp::FillMuonId::Run(), and Anp::TrueNu::TrueNu().

00194 { return fStdhep.end(); }

StdHepIterator Anp::Record::StdHepEndIterator  )  [inline]
 

Definition at line 171 of file Record.h.

References fStdhep, and Anp::StdHepIterator.

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

00171 { return fStdhep.end(); }

StripIter Anp::Record::StripBeg  )  const [inline]
 

Definition at line 195 of file Record.h.

References fStrip, and Anp::StripIter.

Referenced by Anp::SnarlAdcTab::Add(), Anp::PlotPmt::Collect(), Anp::DrawSpan::FindSpan(), Anp::FillShortVar::Get(), Anp::FillShortEvent::GetPlaneStrips(), Anp::GetStrip(), Anp::FillShortVar::GetTrackMap(), Anp::SnarlTimeTab::NewSnarl(), Anp::PlotSnarl::Run(), Anp::FillSnarl::Run(), Anp::FillNPlane::Run(), Anp::FillMuonId::Select(), and Anp::SnarlTimeTab::Set().

00195 { return fStrip.begin(); }

StripIterator Anp::Record::StripBegIterator  )  [inline]
 

Definition at line 172 of file Record.h.

References fStrip, and Anp::StripIterator.

00172 { return fStrip.begin(); }

StripIter Anp::Record::StripEnd  )  const [inline]
 

Definition at line 196 of file Record.h.

References fStrip, and Anp::StripIter.

Referenced by Anp::SnarlAdcTab::Add(), Anp::PlaneHitColl::AddOtherHit(), Anp::PlaneHitColl::AddTrackHit(), Anp::PlotPmt::Collect(), Anp::DrawSpan::FindSpan(), Anp::FillShortVar::Get(), Anp::FillShortEvent::GetPlaneStrips(), Anp::GetStrip(), Anp::FillShortVar::GetTrackMap(), Anp::SnarlTimeTab::NewSnarl(), Anp::PlotSnarl::Run(), Anp::FillSnarl::Run(), Anp::FillNPlane::Run(), Anp::FillMuonId::Select(), and Anp::SnarlTimeTab::Set().

00196 { return fStrip.end(); }

StripIterator Anp::Record::StripEndIterator  )  [inline]
 

Definition at line 173 of file Record.h.

References fStrip, and Anp::StripIterator.

00173 { return fStrip.end(); }

TrackIter Anp::Record::TrackBeg  )  const [inline]
 

Definition at line 197 of file Record.h.

References fTrack, and Anp::TrackIter.

Referenced by Anp::PlotPmt::Collect(), Anp::GetTrack(), Anp::FillTruth::IsConsistent(), Anp::LongestTrack(), Anp::SelectFiducial::PassTruth(), Anp::SelectFiducial::Run(), Anp::RunkNN::Run(), Anp::PlotVtx::Run(), Anp::PlotTrackGeom::Run(), Anp::PlotTrack::Run(), Anp::PlotPmt::Run(), Anp::PlotData::Run(), Anp::PlotBasic::Run(), and Anp::FillData::Run().

00197 { return fTrack.begin(); }

TrackIterator Anp::Record::TrackBegIterator  )  [inline]
 

Definition at line 174 of file Record.h.

References fTrack, and Anp::TrackIterator.

Referenced by Anp::ApplyTrueWeights(), Anp::CleanRecord(), Anp::SelectShort::Run(), Anp::SelectNuMu::Run(), Anp::SelectFiducial::Run(), Anp::RunkNN::Run(), Anp::PlotShort::Run(), Anp::FillTruth::Run(), Anp::FillTrackGeom::Run(), Anp::FillShortVar::Run(), Anp::FillMuonId::Run(), Anp::FillkNN::Run(), and Anp::AlgThread::Run().

00174 { return fTrack.begin(); }

TrackIter Anp::Record::TrackEnd  )  const [inline]
 

Definition at line 198 of file Record.h.

References fTrack, and Anp::TrackIter.

Referenced by Anp::RunkNN::AddData(), Anp::PlotPmt::Collect(), Anp::FillEvent::Fill(), Anp::PlotShort::FillStandard(), Anp::GetTrack(), Anp::FillTruth::IsConsistent(), Anp::LongestTrack(), Anp::SelectKinem::Pass(), Anp::SelectFiducial::PassTruth(), Anp::PlotShortSelect::Plot(), Anp::PlotData::Plot(), Anp::PlotShort::PlotStandard(), Anp::PrimaryShower(), Anp::SelectNuMu::Run(), Anp::SelectNC::Run(), Anp::SelectFiducial::Run(), Anp::RunkNN::Run(), Anp::PlotVtx::Run(), Anp::PlotTrackGeom::Run(), Anp::PlotTrack::Run(), Anp::PlotPmt::Run(), Anp::PlotEvent::Run(), Anp::PlotData::Run(), Anp::PlotBasic::Run(), Anp::FillShortEvent::Run(), Anp::FillMuonId::Run(), Anp::FillMadId::Run(), Anp::FillkNN::Run(), Anp::FillEnergy::Run(), Anp::FillData::Run(), Anp::SelectAntiNeutrino::Run1(), and Anp::SelectAntiNeutrino::Run2().

00198 { return fTrack.end(); }

TrackIterator Anp::Record::TrackEndIterator  )  [inline]
 

Definition at line 175 of file Record.h.

References fTrack, and Anp::TrackIterator.

Referenced by Anp::ApplyTrueWeights(), Anp::CleanRecord(), Anp::SelectShort::Run(), Anp::SelectNuMu::Run(), Anp::SelectFiducial::Run(), Anp::RunkNN::Run(), Anp::PlotShort::Run(), Anp::FillTruth::Run(), Anp::FillTrackGeom::Run(), Anp::FillShortVar::Run(), Anp::FillMuonId::Run(), Anp::FillkNN::Run(), and Anp::AlgThread::Run().

00175 { return fTrack.end(); }

TruthIter Anp::Record::TruthBeg  )  const [inline]
 

Definition at line 199 of file Record.h.

References fTruth, and Anp::TruthIter.

Referenced by Anp::RunkNN::AddData(), Anp::ApplyTrueWeights(), FindStdHep(), FindTruth(), Anp::FillTruth::IsConsistent(), Anp::PlotData::Plot(), Anp::PrintRecordTruth(), Anp::StudyFiducial::Run(), Anp::SelectTrue::Run(), Anp::SelectReson::Run(), Anp::SelectFlux::Run(), Anp::SelectFiducial::Run(), Anp::SelectCount::Run(), Anp::PlotVtx::Run(), Anp::PlotShortSelect::Run(), Anp::PlotPur::Run(), Anp::PlotFlux::Run(), Anp::PlotEff::Run(), Anp::FillShortEvent::Run(), and Anp::FillFlux::Run().

00199 { return fTruth.begin(); }

TruthIterator Anp::Record::TruthBegIterator  )  [inline]
 

Definition at line 176 of file Record.h.

References fTruth, and Anp::TruthIterator.

Referenced by Anp::SelectFlux::Run(), Anp::SelectFiducial::Run(), Anp::PlotTruth::Run(), and Anp::FillFlux::Run().

00176 { return fTruth.begin(); }

TruthIter Anp::Record::TruthEnd  )  const [inline]
 

Definition at line 200 of file Record.h.

References fTruth, and Anp::TruthIter.

Referenced by Anp::RunkNN::AddData(), Anp::ApplyTrueWeights(), Anp::FillFlux::Fill(), Anp::PlotShort::FillStandard(), FindStdHep(), FindTruth(), Anp::FillTruth::IsConsistent(), Anp::PlotShort::Plot(), Anp::PlotData::Plot(), Anp::PlotShort::PlotStandard(), Anp::PrintRecordTruth(), Anp::RecordStore::PrintTruth(), Anp::StudyFiducial::Run(), Anp::SelectTrue::Run(), Anp::SelectReson::Run(), Anp::SelectFlux::Run(), Anp::SelectFiducial::Run(), Anp::SelectCount::Run(), Anp::PlotVtx::Run(), Anp::PlotTruth::Run(), Anp::PlotShortSelect::Run(), Anp::PlotPur::Run(), Anp::PlotFlux::Run(), Anp::PlotEff::Run(), Anp::FillShortEvent::Run(), Anp::FillFlux::Run(), Anp::SelectTrue::Select(), and Anp::StdHepTab::Set().

00200 { return fTruth.end(); }

TruthIterator Anp::Record::TruthEndIterator  )  [inline]
 

Definition at line 177 of file Record.h.

References fTruth, and Anp::TruthIterator.

Referenced by Anp::SelectFlux::Run(), Anp::SelectFiducial::Run(), Anp::PlotTruth::Run(), and Anp::FillFlux::Run().

00177 { return fTruth.end(); }


Member Data Documentation

DataVec Anp::Record::fData [private]
 

Definition at line 135 of file Record.h.

Referenced by Add(), Clear(), DataAt(), DataBeg(), DataEnd(), and KeyExists().

std::vector<Anp::Event> Anp::Record::fEvent [private]
 

Definition at line 127 of file Record.h.

Referenced by Add(), Clear(), Erase(), EventBeg(), EventBegIterator(), EventEnd(), EventEndIterator(), GetNEvents(), and Print().

Header Anp::Record::fHeader [private]
 

Definition at line 134 of file Record.h.

Referenced by Clear(), FindStdHep(), FindTruth(), Print(), and Set().

std::vector<Anp::MRCCInfo> Anp::Record::fMRCC [private]
 

Definition at line 133 of file Record.h.

Referenced by Add(), Clear(), Erase(), GetMRCCSize(), MRCCBeg(), MRCCBegIterator(), MRCCEnd(), and MRCCEndIterator().

std::vector<Anp::Shower> Anp::Record::fShower [private]
 

Definition at line 128 of file Record.h.

Referenced by Add(), Clear(), Erase(), GetNShowers(), ShowerBeg(), ShowerBegIterator(), ShowerEnd(), and ShowerEndIterator().

std::vector<Anp::StdHep> Anp::Record::fStdhep [private]
 

Definition at line 129 of file Record.h.

Referenced by Add(), Clear(), Erase(), FindStdHep(), GetNStdHeps(), StdHepBeg(), StdHepBegIterator(), StdHepEnd(), and StdHepEndIterator().

std::vector<Anp::Strip> Anp::Record::fStrip [private]
 

Definition at line 130 of file Record.h.

Referenced by Add(), Clear(), Erase(), GetNStrips(), StripBeg(), StripBegIterator(), StripEnd(), and StripEndIterator().

std::vector<Anp::Track> Anp::Record::fTrack [private]
 

Definition at line 131 of file Record.h.

Referenced by Add(), Clear(), Erase(), GetNTracks(), Print(), TrackBeg(), TrackBegIterator(), TrackEnd(), and TrackEndIterator().

std::vector<Anp::Truth> Anp::Record::fTruth [private]
 

Definition at line 132 of file Record.h.

Referenced by Add(), Clear(), Erase(), GetNTruths(), TruthBeg(), TruthBegIterator(), TruthEnd(), and TruthEndIterator().


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