/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Attributes
Context Class Reference

A tag for identifying a unique context: a place, time, and optional detector. More...

#include <Context.h>

Collaboration diagram for Context:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Context ()
 Context (const Context &other)
 Context (Site::Site_t site, SimFlag::SimFlag_t flag, const TimeStamp &time=TimeStamp(), DetectorId::DetectorId_t det=DetectorId::kUnknown)
Contextoperator= (const Context &rhs)
virtual ~Context ()
const TimeStampGetTimeStamp () const
 Get the time stamp.
SimFlag::SimFlag_t GetSimFlag () const
 Get the simflag.
Site::Site_t GetSite () const
 Get the site.
DetectorId::DetectorId_t GetDetId () const
 Get the detector type.
void SetTimeStamp (const TimeStamp &ts)
 Set the time stamp.
void SetSimFlag (SimFlag::SimFlag_t flag)
 Set the simflag.
void SetSite (Site::Site_t site)
 Set the site.
void SetDetId (DetectorId::DetectorId_t det)
virtual std::string AsString (const char *option="") const
virtual bool IsValid () const

Protected Attributes

Site::Site_t mSite
SimFlag::SimFlag_t mSimFlag
TimeStamp mTimeStamp
DetectorId::DetectorId_t mDetId

Detailed Description

A tag for identifying a unique context: a place, time, and optional detector.

A context is defined as a timestamp, a site, what kind of data (MC or real)

Author:
Nathaniel Tagg
Version:
Revision:
1.4
Date:
Date:
2007/03/07 22:49:11

Created on: 2006.10.12

Definition at line 34 of file Context.h.


Constructor & Destructor Documentation

Context::Context ( )

Definition at line 16 of file Context.cc.

    : mSite(Site::kUnknown)
    , mSimFlag(SimFlag::kUnknown)
    , mTimeStamp(0,0)
    , mDetId(DetectorId::kUnknown)
{
    // Default constructor (unknown detector, simflag, timestamp=now)
}
Context::Context ( const Context other)

Definition at line 38 of file Context.cc.

{
    *this = other;
}
Context::Context ( Site::Site_t  site,
SimFlag::SimFlag_t  flag,
const TimeStamp time = TimeStamp(),
DetectorId::DetectorId_t  det = DetectorId::kUnknown 
)

Definition at line 26 of file Context.cc.

    : mSite(site)
    , mSimFlag(flag)
    , mTimeStamp(time)
    , mDetId(det)
{  
}
virtual Context::~Context ( ) [inline, virtual]

Definition at line 47 of file Context.h.

{};

Member Function Documentation

Context & Context::operator= ( const Context rhs)

Definition at line 43 of file Context.cc.

{
    if (this == &rhs) return *this;

    mSite = rhs.GetSite();
    mSimFlag = rhs.GetSimFlag();
    mTimeStamp = rhs.GetTimeStamp();
    mDetId = rhs.GetDetId();

    return *this;
}
const TimeStamp& Context::GetTimeStamp ( ) const [inline]

Get the time stamp.

Definition at line 50 of file Context.h.

{ return mTimeStamp; }
SimFlag::SimFlag_t Context::GetSimFlag ( ) const [inline]

Get the simflag.

Definition at line 53 of file Context.h.

{ return mSimFlag; }
Site::Site_t Context::GetSite ( ) const [inline]

Get the site.

Definition at line 56 of file Context.h.

{ return mSite; }
DetectorId::DetectorId_t Context::GetDetId ( ) const [inline]

Get the detector type.

Definition at line 59 of file Context.h.

{ return mDetId; }
void Context::SetTimeStamp ( const TimeStamp ts) [inline]

Set the time stamp.

Definition at line 63 of file Context.h.

{ mTimeStamp = ts; }
void Context::SetSimFlag ( SimFlag::SimFlag_t  flag) [inline]

Set the simflag.

Definition at line 66 of file Context.h.

{ mSimFlag = flag; }
void Context::SetSite ( Site::Site_t  site) [inline]

Set the site.

Definition at line 69 of file Context.h.

{ mSite = site; }
void Context::SetDetId ( DetectorId::DetectorId_t  det) [inline]

Definition at line 72 of file Context.h.

{ mDetId = det; }
std::string Context::AsString ( const char *  option = "") const [virtual]

Return a formatted string of the contents of this object.

Definition at line 72 of file Context.cc.

{

    std::stringstream ss;
    ss << Site::AsString(mSite) << ", " 
       << SimFlag::AsString(mSimFlag) << ", "
       << mTimeStamp.AsString(option) << ", "
       << DetectorId::AsString(mDetId);

    return ss.str();
}
bool Context::IsValid ( ) const [virtual]

Definition at line 86 of file Context.cc.

{
    // Return true if this was initialized by default ctor
    // we can only test site, detector, simflag
    // 
    if( (mTimeStamp.GetSec()>0)
        && mSimFlag !=SimFlag::kUnknown
        && mSite != Site::kUnknown 
        )
        return false;
    return true;      
}

Member Data Documentation

Definition at line 80 of file Context.h.

Definition at line 81 of file Context.h.

Definition at line 82 of file Context.h.

Definition at line 83 of file Context.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:40 for Context by doxygen 1.7.4