| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DayaBay::TagHeader Class Reference

Associate a tag and data to one or more other HeaderObjects. More...

#include <TagHeader.h>

Inheritance diagram for DayaBay::TagHeader:

[legend]
Collaboration diagram for DayaBay::TagHeader:
[legend]
List of all members.

Public Types

 Unknown = 0
 Generic
 AdEvent
 Positron
 Neutron
 Radiation
 MuonFragment
 Muon
 MuonShower
 MuonDecay
 AdCoincidence
 IBD
enum  TagType {
  Unknown = 0, Generic, AdEvent, Positron,
  Neutron, Radiation, MuonFragment, Muon,
  MuonShower, MuonDecay, AdCoincidence, IBD
}
 The type of candidate event this tag is indicating. More...
typedef std::vector< IHeader * > Vector
typedef std::vector< const
IHeader * > 
ConstVector

Public Member Functions

virtual const std::string & defLoc () const
 TagHeader ()
 Default Constructor.
virtual ~TagHeader ()
 Default Destructor.
virtual const CLIDclID () const
virtual std::ostream & fillStream (std::ostream &s) const
 Fill the ASCII output stream.
template<class TDTYPE>
TDTYPE * dataAs () const
 Return the tag data as given type.
std::string tagName () const
 Return the tag type as a string.
std::vector< const DayaBay::TagHeader * > taggedHeaders (const TagType &tagType) const
 Return the tagged input headers by tag type.
const TagTypetagID () const
 Retrieve const Tag ID.
void setTagID (const TagType &value)
 Update Tag ID.
bool isA () const
 Retrieve const Does this event satisfy the tag?
void setIsA (bool value)
 Update Does this event satisfy the tag?
const DayaBay::TagDatadata () const
 Retrieve const Data about this tag.
void setData (DayaBay::TagData *value)
 Update Data about this tag.
virtual const std::string & defLoc ()
void setInputHeaders (const std::vector< const DayaBay::IHeader * > &iheaders)
void addInputHeader (const DayaBay::IHeader *iheader)
const TimeStamptimeStamp () const
void setTimeStamp (const TimeStamp &ts)
const std::vector< const DayaBay::IHeader * > findHeaders (const CLID &clid) const
const Contextcontext () const
void setContext (const Context &value)
int execNumber () const
void setExecNumber (int value)
const std::vector< unsigned
long > & 
randomState () const
void setRandomState (const std::vector< unsigned long > &value)
const std::vector< const DayaBay::IHeader * > & inputHeaders () const
const DayaBay::JobIdjobId () const
void setJobId (const DayaBay::JobId &value)
virtual void setOutputAddress (const GenericAddress *roa)
virtual void setInputAddress (const GenericAddress *ria)
virtual const TimeStampearliest () const
void setEarliest (const TimeStamp &value)
virtual const TimeStamplatest () const
void setLatest (const TimeStamp &value)
virtual const GenericAddressoutputAddress () const
virtual const GenericAddressinputAddress () const
void setRegistry (IRegistry *pRegistry)
IRegistryregistry () const
LinkManagerlinkMgr () const
unsigned char version () const
void setVersion (unsigned char vsn)
unsigned long refCount () const
virtual unsigned long addRef ()
virtual unsigned long release ()
const std::string & name () const
virtual StreamBufferserialize (StreamBuffer &s)
virtual StreamBufferserialize (StreamBuffer &s) const

Static Public Member Functions

static const std::string & defaultLocation ()
 Give access to default location from class scope.
static const CLIDclassID ()
static void * operator new (size_t size)
 operator new
static void * operator new (size_t size, void *pObj)
 placement operator new it is needed by libstdc++ 3.2.3 (e.g.
static void operator delete (void *p)
 operator delete
static void operator delete (void *p, void *pObj)
 placement operator delete not sure if really needed, but it does not harm

Private Attributes

TagType m_tagID
 Tag ID.
bool m_isA
 Does this event satisfy the tag?
DayaBay::TagDatam_data
 Data about this tag.

Friends

friend friend std::ostream & operator<< (std::ostream &s, const DataObject &obj)

Detailed Description

Associate a tag and data to one or more other HeaderObjects.

Author:
bv@bnl.gov created Mon Apr 11 03:31:26 2011

Definition at line 49 of file TagHeader.h.


Member Enumeration Documentation

enum DayaBay::TagHeader::TagType

The type of candidate event this tag is indicating.

Enumerator:
Unknown 
Generic 
AdEvent 
Positron 
Neutron 
Radiation 
MuonFragment 
Muon 
MuonShower 
MuonDecay 
AdCoincidence 
IBD 

Definition at line 58 of file TagHeader.h.

00058                 { Unknown = 0,   // Undefined, indicates error
00059                   Generic,       // Generic Tag
00060                   AdEvent,       // An event in the AD
00061                   Positron,      // A positron
00062                   Neutron,       // A neutron capture
00063                   Radiation,     // An event due to a radioactive decay
00064                   MuonFragment,  // Event due to passage of a muon through a detector
00065                   Muon,          // One or more MuonFragments
00066                   MuonShower,    // A MuonTrack and one or more other things
00067                   MuonDecay,     // A MuonTrack and Michele electron
00068                   AdCoincidence, // Time-correlated AD events
00069                   IBD            // Set of inverse beta decay events
00070       };


Constructor & Destructor Documentation

DayaBay::TagHeader::TagHeader (  )  [inline]

Default Constructor.

Definition at line 73 of file TagHeader.h.

00073                 : m_tagID(Unknown),
00074                   m_isA(false),
00075                   m_data(0) {}

virtual DayaBay::TagHeader::~TagHeader (  )  [inline, virtual]

Default Destructor.

Definition at line 78 of file TagHeader.h.

00078 {}


Member Function Documentation

static const std::string& DayaBay::TagHeader::defaultLocation (  )  [inline, static]

Give access to default location from class scope.

Reimplemented from DayaBay::HeaderObject.

Definition at line 54 of file TagHeader.h.

00054 { return TagHeaderLocation::Default; }

virtual const std::string& DayaBay::TagHeader::defLoc (  )  const [inline, virtual]

Reimplemented from DayaBay::HeaderObject.

Definition at line 55 of file TagHeader.h.

00055 { return TagHeaderLocation::Default; }

const CLID & DayaBay::TagHeader::clID (  )  const [inline, virtual]

Reimplemented from DayaBay::HeaderObject.

Definition at line 196 of file TagHeader.h.

00197 {
00198   return DayaBay::TagHeader::classID();
00199 }

const CLID & DayaBay::TagHeader::classID (  )  [inline, static]

Reimplemented from DayaBay::HeaderObject.

Definition at line 201 of file TagHeader.h.

00202 {
00203   return CLID_TagHeader;
00204 }

std::ostream & DayaBay::TagHeader::fillStream ( std::ostream &  s  )  const [inline, virtual]

Fill the ASCII output stream.

Reimplemented from DayaBay::HeaderObject.

Definition at line 206 of file TagHeader.h.

00207 {
00208   char l_isA = (m_isA) ? 'T' : 'F';
00209   HeaderObject::fillStream(s);
00210   s << "{ " << "tagID : " << m_tagID << std::endl
00211             << "isA :   " << l_isA << std::endl
00212             << "data :  " << m_data << std::endl << " }";
00213   return s;
00214 }

template<class TDTYPE>
TDTYPE * DayaBay::TagHeader::dataAs (  )  const [inline]

Return the tag data as given type.

Definition at line 248 of file TagHeader.h.

00249 {
00250     return dynamic_cast<TDTYPE*>(m_data);
00251 }

std::string DayaBay::TagHeader::tagName (  )  const

Return the tag type as a string.

Definition at line 6 of file TagHeader.cc.

00007 {
00008     stringstream ss;
00009     ss << *this;
00010     return ss.str();
00011 }

std::vector< const DayaBay::TagHeader * > DayaBay::TagHeader::taggedHeaders ( const TagType tagType  )  const

Return the tagged input headers by tag type.

Definition at line 13 of file TagHeader.cc.

00015 {
00016   // Find all input headers of the requested tag type
00017   std::vector<const DayaBay::TagHeader*> tagHeaders;
00018   const std::vector<const DayaBay::IHeader*>& inputHeaders = 
00019     this->inputHeaders();
00020   for(unsigned int idx=0; idx<inputHeaders.size(); idx++){
00021     const DayaBay::TagHeader* tagHeader = 
00022       dynamic_cast<const DayaBay::TagHeader*>(inputHeaders[idx]);
00023     if(tagHeader && tagHeader->tagID()==tagType){
00024       tagHeaders.push_back(tagHeader);
00025     }
00026   }
00027   return tagHeaders;
00028 }

const DayaBay::TagHeader::TagType & DayaBay::TagHeader::tagID (  )  const [inline]

Retrieve const Tag ID.

Definition at line 217 of file TagHeader.h.

00218 {
00219   return m_tagID;
00220 }

void DayaBay::TagHeader::setTagID ( const TagType value  )  [inline]

Update Tag ID.

Definition at line 222 of file TagHeader.h.

00223 {
00224   m_tagID = value;
00225 }

bool DayaBay::TagHeader::isA (  )  const [inline]

Retrieve const Does this event satisfy the tag?

Definition at line 227 of file TagHeader.h.

00228 {
00229   return m_isA;
00230 }

void DayaBay::TagHeader::setIsA ( bool  value  )  [inline]

Update Does this event satisfy the tag?

Definition at line 232 of file TagHeader.h.

00233 {
00234   m_isA = value;
00235 }

const DayaBay::TagData * DayaBay::TagHeader::data (  )  const [inline]

Retrieve const Data about this tag.

Definition at line 237 of file TagHeader.h.

00238 {
00239   return m_data;
00240 }

void DayaBay::TagHeader::setData ( DayaBay::TagData value  )  [inline]

Update Data about this tag.

Definition at line 242 of file TagHeader.h.

00243 {
00244   m_data = value;
00245 }

static void* DayaBay::TagHeader::operator new ( size_t  size  )  [inline, static]

operator new

Reimplemented from DayaBay::HeaderObject.

Definition at line 124 of file TagHeader.h.

00125     {
00126       return ( sizeof(TagHeader) == size ? 
00127                boost::singleton_pool<TagHeader, sizeof(TagHeader)>::malloc() :
00128                ::operator new(size) );
00129     }

static void* DayaBay::TagHeader::operator new ( size_t  size,
void *  pObj 
) [inline, static]

placement operator new it is needed by libstdc++ 3.2.3 (e.g.

in std::vector) it is not needed in libstdc++ >= 3.4

Reimplemented from DayaBay::HeaderObject.

Definition at line 134 of file TagHeader.h.

00135     {
00136       return ::operator new (size,pObj);
00137     }

static void DayaBay::TagHeader::operator delete ( void *  p  )  [inline, static]

operator delete

Reimplemented from DayaBay::HeaderObject.

Definition at line 140 of file TagHeader.h.

00141     {
00142       boost::singleton_pool<TagHeader, sizeof(TagHeader)>::is_from(p) ?
00143       boost::singleton_pool<TagHeader, sizeof(TagHeader)>::free(p) :
00144       ::operator delete(p);
00145     }

static void DayaBay::TagHeader::operator delete ( void *  p,
void *  pObj 
) [inline, static]

placement operator delete not sure if really needed, but it does not harm

Reimplemented from DayaBay::HeaderObject.

Definition at line 149 of file TagHeader.h.

00150     {
00151       ::operator delete (p, pObj);
00152     }


Member Data Documentation

TagType DayaBay::TagHeader::m_tagID [private]

Tag ID.

Definition at line 158 of file TagHeader.h.

bool DayaBay::TagHeader::m_isA [private]

Does this event satisfy the tag?

Definition at line 159 of file TagHeader.h.

DayaBay::TagData* DayaBay::TagHeader::m_data [private]

Data about this tag.

Definition at line 160 of file TagHeader.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 Mon Apr 11 20:19:59 2011 for TagEvent by doxygen 1.4.7