Anp::PlotBasic Class Reference

#include <PlotBasic.h>

Inheritance diagram for Anp::PlotBasic:
Anp::AlgEvent Anp::AlgSnarl Anp::Base Anp::Base

List of all members.

Public Member Functions

 PlotBasic ()
virtual ~PlotBasic ()
bool Run (Record &record)
bool Run (Event &event, const Record &record, bool pass)
void Config (const Registry &reg)
void Set (TDirectory *dir)
void End (const DataBlock &)

Private Types

typedef std::map< std::string,
Anp::Handle< Anp::HistBasic > > 
PlotMap

Private Member Functions

bool Fill (const std::string &input, const Basic &basic, double weight)

Private Attributes

std::string fDirName
std::string fInput
TDirectory * fDir
PlotMap fMap

Detailed Description

Definition at line 68 of file PlotBasic.h.


Member Typedef Documentation

typedef std::map<std::string, Anp::Handle<Anp::HistBasic> > Anp::PlotBasic::PlotMap [private]

Definition at line 91 of file PlotBasic.h.


Constructor & Destructor Documentation

Anp::PlotBasic::PlotBasic (  ) 

Definition at line 156 of file PlotBasic.cxx.

00157    :fDirName("basic"),
00158     fInput("all"),
00159     fDir(0)
00160 {
00161 }

Anp::PlotBasic::~PlotBasic (  )  [virtual]

Definition at line 164 of file PlotBasic.cxx.

00165 {
00166 }


Member Function Documentation

void Anp::PlotBasic::Config ( const Registry reg  )  [virtual]

Reimplemented from Anp::AlgEvent.

Definition at line 222 of file PlotBasic.cxx.

References fDirName, fInput, Registry::Get(), and Registry::KeyExists().

00223 {
00224    const char *value_char = 0;
00225    if(reg.Get("PlotBasicDirName", value_char) && value_char)
00226    {
00227       fDirName = value_char;
00228    }
00229 
00230    value_char = 0;
00231    if(reg.Get("PlotBasicInput", value_char) && value_char)
00232    {
00233       fInput = value_char;
00234    }
00235 
00236    if(reg.KeyExists("PrintConfig"))
00237    {
00238       cout << "PlotBasic::Config" << endl
00239            << "   DirName = " << fDirName << endl
00240            << "   Input = " << fInput << endl;
00241    }
00242 }

void Anp::PlotBasic::End ( const DataBlock  )  [virtual]

Reimplemented from Anp::AlgEvent.

Definition at line 251 of file PlotBasic.cxx.

References fDir, and fMap.

00252 {
00253    fMap.clear();
00254    fDir = 0;
00255 }

bool Anp::PlotBasic::Fill ( const std::string &  input,
const Basic basic,
double  weight 
) [private]

Referenced by Run().

bool Anp::PlotBasic::Run ( Event event,
const Record record,
bool  pass 
) [virtual]

Implements Anp::AlgEvent.

Definition at line 191 of file PlotBasic.cxx.

References Fill(), Anp::FirstShower(), Anp::Event::GetBasic(), Anp::LongestTrack(), Anp::PrimaryShower(), Anp::Record::ShowerEnd(), Anp::Record::TrackEnd(), and Anp::Event::Weight().

00192 {
00193    if(!pass)
00194    {
00195       return true;
00196    }
00197 
00198    PlotBasic::Fill("event", event.GetBasic(), event.Weight());
00199 
00200    const TrackIter itrack = Anp::LongestTrack(event, record);
00201    if(itrack != record.TrackEnd())
00202    {
00203       PlotBasic::Fill("event_track", itrack -> GetBasic(), event.Weight());
00204    }   
00205 
00206    const ShowerIter ishower_1st = Anp::FirstShower(event, record);
00207    if(ishower_1st != record.ShowerEnd())
00208    {
00209       PlotBasic::Fill("event_shower_1st", ishower_1st -> GetBasic(), event.Weight());
00210    }
00211    
00212    const ShowerIter ishower_prm = Anp::PrimaryShower(event, record);
00213    if(ishower_prm != record.ShowerEnd())
00214    {
00215       PlotBasic::Fill("event_shower_prm", ishower_prm -> GetBasic(), event.Weight());
00216    } 
00217 
00218    return true;
00219 }

bool Anp::PlotBasic::Run ( Record record  )  [virtual]

Implements Anp::AlgSnarl.

Definition at line 169 of file PlotBasic.cxx.

References Anp::Record::EventBegIterator(), Anp::Record::EventEndIterator(), Fill(), Anp::Record::ShowerBeg(), Anp::Record::ShowerEnd(), Anp::Record::TrackBeg(), and Anp::Record::TrackEnd().

00170 {
00171 
00172    for(EventIterator ievent = record.EventBegIterator(); ievent != record.EventEndIterator(); ++ievent)
00173    {      
00174       PlotBasic::Run(*ievent, record, true);
00175    }
00176 
00177    for(TrackIter itrack = record.TrackBeg(); itrack != record.TrackEnd(); ++itrack)
00178    {
00179       Fill("tracks", itrack -> GetBasic(), itrack -> Weight());
00180    }
00181 
00182    for(ShowerIter ishower = record.ShowerBeg(); ishower != record.ShowerEnd(); ++ishower)
00183    {
00184       Fill("showers", ishower -> GetBasic(), ishower -> Weight());
00185    }
00186 
00187    return true;
00188 }

void Anp::PlotBasic::Set ( TDirectory *  dir  )  [virtual]

Reimplemented from Anp::AlgEvent.

Definition at line 245 of file PlotBasic.cxx.

References fDir, fDirName, and Anp::GetDir().

00246 {
00247    fDir = Anp::GetDir(fDirName, dir); 
00248 }


Member Data Documentation

TDirectory* Anp::PlotBasic::fDir [private]

Definition at line 98 of file PlotBasic.h.

Referenced by End(), and Set().

std::string Anp::PlotBasic::fDirName [private]

Definition at line 95 of file PlotBasic.h.

Referenced by Config(), and Set().

std::string Anp::PlotBasic::fInput [private]

Definition at line 96 of file PlotBasic.h.

Referenced by Config().

Definition at line 100 of file PlotBasic.h.

Referenced by End().


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

Generated on 16 Jan 2018 for loon by  doxygen 1.6.1