Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

Analyze Class Reference

#include <Analyze.h>

Inheritance diagram for Analyze:

Inheritance graph
[legend]
Collaboration diagram for Analyze:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Analyze (std::string name="Generic count")
 Analyze (const Tuple &t, const std::string &item_name, const std::string &cut_name="")
 Analyze (const TupleItem &item, const std::string &cut_name="")
virtual ~Analyze ()
bool operator() ()
unsigned count () const
unsigned seen () const
float item () const
const std::string & name () const
const char * getName ()
const char * getItem ()
void set_name (std::string newname)
void set_tuple_item (const Tuple &t, std::string item_name)
virtual void report (std::ostream &out)
virtual void clear ()

Static Public Member Functions

void separator (std::ostream &out, char='-')
std::string make_label (const std::string &)
bool showperc ()
void showperc (bool s)

Private Member Functions

virtual bool apply ()

Private Attributes

unsigned m_count
const TupleItemm_tupleItem
std::string m_name
unsigned m_seen

Static Private Attributes

bool s_showperc = false

Constructor & Destructor Documentation

Analyze::Analyze std::string  name = "Generic count"  )  [inline]
 

Definition at line 15 of file Analyze.h.

References m_count, m_name, m_seen, m_tupleItem, and name().

Referenced by AnalysisList::AnalysisList().

00015                                             : m_count(0),m_tupleItem(0),m_name(name)
00016                                                 , m_seen(0) {}

Analyze::Analyze const Tuple t,
const std::string &  item_name,
const std::string &  cut_name = ""
 

Definition at line 12 of file Analyze.cxx.

References set_tuple_item().

00013 : m_count(0), m_name(name), m_seen(0) 
00014 {
00015    set_tuple_item(t,itemname);
00016 }

Analyze::Analyze const TupleItem item,
const std::string &  cut_name = ""
 

Definition at line 18 of file Analyze.cxx.

00019 : m_count(0), m_tupleItem(&item), m_name(name), m_seen(0) {}

virtual Analyze::~Analyze  )  [inline, virtual]
 

Definition at line 21 of file Analyze.h.

00021 {}


Member Function Documentation

virtual bool Analyze::apply  )  [inline, private, virtual]
 

Reimplemented in AnalysisList, Cal2Dfrac, SurplusHit, XtalRatio, CalFitNrm, NumVetos, CutWithEthresh, Cut, EnergyAnalysis, Summation, FOMelapsed, EventSize, FOMtrig1Cal, WriteTuple, FOMaccepted, LayerGroup, Level1, MultiPSF, PSFanalysis, AbsValueCut, and Statistic.

Definition at line 51 of file Analyze.h.

Referenced by operator()().

00051 { return true; }

virtual void Analyze::clear  )  [inline, virtual]
 

Reimplemented in AnalysisList, Level1, PSFanalysis, and Statistic.

Definition at line 39 of file Analyze.h.

References m_count.

Referenced by PSFanalysis::clear(), Level1::clear(), and AnalysisList::clear().

00039 {m_count=0;}

unsigned Analyze::count  )  const [inline]
 

Reimplemented in PSFanalysis.

Definition at line 26 of file Analyze.h.

References m_count.

Referenced by Summation::average(), FOMtrigrate::report(), and report().

00026 { return m_count; }

const char * Analyze::getItem  ) 
 

Definition at line 50 of file Analyze.cxx.

References item(), m_tupleItem, and TupleItem::name().

00051 {
00052     const char* pItem = 0;
00053 
00054     if (m_tupleItem)
00055     {
00056         std::string item(m_tupleItem->name());
00057         pItem = item.data();
00058     }
00059 
00060     return pItem;
00061 }

const char* Analyze::getName  )  [inline]
 

Definition at line 31 of file Analyze.h.

References m_name.

00031 { return m_name.data();}

float Analyze::item  )  const [inline]
 

Definition at line 28 of file Analyze.h.

References m_tupleItem, and TupleItem::value().

Referenced by Statistic::apply(), AbsValueCut::apply(), PSFanalysis::apply(), MultiPSF::apply(), Level1::apply(), LayerGroup::apply(), FOMtrig1Cal::apply(), Summation::apply(), EnergyAnalysis::apply(), Cut::apply(), NumVetos::apply(), CalFitNrm::apply(), XtalRatio::apply(), SurplusHit::apply(), Cal2Dfrac::apply(), and getItem().

00028 { return m_tupleItem->value();}

string Analyze::make_label const std::string &   )  [static]
 

Definition at line 31 of file Analyze.cxx.

Referenced by Statistic::report(), PSFanalysis::report(), MultiPSF::report(), FigureOfMerit::report(), FOMnacdtiles::report(), FOMncsixtals::report(), FOMnsistrips::report(), EventSize::report(), FOMevtsize::report(), FOMtrigrate::report(), FOMelapsed::report(), EnergyAnalysis::report(), and report().

00032 {
00033     const unsigned col = 24;
00034     string      namestr(in);
00035     if (namestr.length() < col)  namestr.insert(namestr.begin(),col - namestr.length(),' ');
00036     namestr += " : ";
00037     return  namestr ;
00038 }

const std::string& Analyze::name  )  const [inline]
 

Definition at line 29 of file Analyze.h.

References m_name.

Referenced by Analyze(), Cut::parse(), Statistic::report(), Level1::report(), FOMnacdtiles::report(), FOMncsixtals::report(), FOMnsistrips::report(), EventSize::report(), FOMevtsize::report(), FOMelapsed::report(), report(), AnalysisList::report(), and Statistic::Statistic().

00029 { return m_name; }

bool Analyze::operator()  )  [inline]
 

Definition at line 23 of file Analyze.h.

References apply(), m_count, and m_seen.

00023 { bool b = apply(); if (b) m_count++; m_seen++; return b; }

void Analyze::report std::ostream &  out  )  [virtual]
 

Reimplemented in AnalysisList, EnergyAnalysis, FOMelapsed, FOMtrigrate, FOMevtsize, EventSize, FOMnsistrips, FOMncsixtals, FOMnacdtiles, FOMFront, FOMBack, LayerGroup, Level1, MultiPSF, PSFanalysis, and Statistic.

Definition at line 21 of file Analyze.cxx.

References count(), make_label(), name(), seen(), and showperc().

Referenced by MultiPSF::report(), Level1::report(), and LayerGroup::report().

00022 {
00023     out << endl << make_label(name());    
00024     out << setw(6) << count();
00025     if (showperc()) {
00026         float   cnt = static_cast<float>(count()), sen = static_cast<float>(seen());
00027         out << "   |   " << setprecision(3) << ((sen == 0.) ? 0. : 100.*cnt/sen) << '%';
00028     }
00029 }

unsigned Analyze::seen  )  const [inline]
 

Definition at line 27 of file Analyze.h.

References m_seen.

Referenced by report().

00027 { return m_seen; }

void Analyze::separator std::ostream &  out,
char  = '-'
[static]
 

Definition at line 40 of file Analyze.cxx.

Referenced by Statistic::report(), MultiPSF::report(), Level1::report(), FigureOfMerit::report(), FOMBack::report(), FOMFront::report(), EventSize::report(), and AnalysisList::report().

00041 {
00042     out << "\n" << string(55, s );
00043 }

void Analyze::set_name std::string  newname  )  [inline]
 

Definition at line 34 of file Analyze.h.

References m_name.

Referenced by AbsValueCut::AbsValueCut(), Cut::Cut(), Cut::parse(), and Statistic::Statistic().

00034 {m_name=newname;}

void Analyze::set_tuple_item const Tuple t,
std::string  item_name
 

Definition at line 45 of file Analyze.cxx.

References m_tupleItem, and Tuple::tupleItem().

Referenced by Analyze(), Cut::parse(), and Statistic::Statistic().

00046 {
00047     m_tupleItem = t.tupleItem(item_name);
00048 }

void Analyze::showperc bool  s  )  [inline, static]
 

Definition at line 47 of file Analyze.h.

References s_showperc.

00047 { s_showperc = s; }

bool Analyze::showperc  )  [inline, static]
 

Definition at line 45 of file Analyze.h.

References s_showperc.

Referenced by main(), and report().

00045 { return s_showperc; }


Member Data Documentation

unsigned Analyze::m_count [private]
 

Definition at line 55 of file Analyze.h.

Referenced by Analyze(), clear(), count(), and operator()().

std::string Analyze::m_name [private]
 

Definition at line 57 of file Analyze.h.

Referenced by Analyze(), getName(), name(), and set_name().

unsigned Analyze::m_seen [private]
 

Definition at line 59 of file Analyze.h.

Referenced by Analyze(), operator()(), and seen().

const TupleItem* Analyze::m_tupleItem [private]
 

Definition at line 56 of file Analyze.h.

Referenced by Analyze(), getItem(), item(), and set_tuple_item().

bool Analyze::s_showperc = false [static, private]
 

Definition at line 8 of file Analyze.cxx.

Referenced by showperc().


The documentation for this class was generated from the following files:
Generated on Wed Nov 26 20:31:11 2008 by doxygen 1.3.3