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

In This Package:

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
DayaBay::SimHitHeader Class Reference

Header for detector simulation hits. More...

#include <SimHitHeader.h>

Collaboration diagram for DayaBay::SimHitHeader:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map< short int,
DayaBay::SimHitCollection * > 
hc_map
 The hit collection map.

Public Member Functions

 SimHitHeader (DayaBay::SimHeader *header)
 Create with SimHeader pointer.
 SimHitHeader ()
 Default Constructor.
 ~SimHitHeader ()
 Destructor.
hc_maphitCollection ()
 Access hit collection map as non-const.
void addHitCollection (DayaBay::SimHitCollection *hc)
 Add a SimHitCollection.
std::vector< short int > hitDetectors () const
 Returns the list of detector IDs with hits in the collection.
SimHitCollectionhitsByDetector (short int detector) const
 Returns the hits for the given detector ID.
std::ostream & fillStream (std::ostream &s) const
 Print the header.
const DayaBay::SimHeaderheader () const
 Retrieve const Pointer to the SimHeader holding this SimHitHeader.
void setHeader (DayaBay::SimHeader *value)
 Update Pointer to the SimHeader holding this SimHitHeader.
const hc_maphitCollection () const
 Retrieve const Map from Detector to detected SimHitCollection.

Static Public Member Functions

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

DayaBay::SimHeaderm_header
 Pointer to the SimHeader holding this SimHitHeader.
hc_map m_hitCollection
 Map from Detector to detected SimHitCollection.

Detailed Description

Header for detector simulation hits.

Author:
bv@bnl.gov created Thu Dec 5 18:05:51 2013

Definition at line 42 of file SimHitHeader.h.


Member Typedef Documentation

The hit collection map.

Definition at line 47 of file SimHitHeader.h.


Constructor & Destructor Documentation

DayaBay::SimHitHeader::SimHitHeader ( DayaBay::SimHeader header) [inline]

Create with SimHeader pointer.

Definition at line 50 of file SimHitHeader.h.

                                         : m_header(header),
                                              m_hitCollection() {}
DayaBay::SimHitHeader::SimHitHeader ( ) [inline]

Default Constructor.

Definition at line 54 of file SimHitHeader.h.

DayaBay::SimHitHeader::~SimHitHeader ( )

Destructor.

Definition at line 9 of file SimHitHeader.cc.

{
    m_header = 0;
    hc_map::iterator it, done = m_hitCollection.end();
    // wangzhe
    // The original line have memory leak problem
    // for (it = m_hitCollection.end(); it != done; ++it) {
    for (it = m_hitCollection.begin(); it != done; ++it) {
    // wz
        delete (it->second);
    }
    m_hitCollection.clear();
}

Member Function Documentation

DayaBay::SimHitHeader::hc_map & DayaBay::SimHitHeader::hitCollection ( )

Access hit collection map as non-const.

Definition at line 46 of file SimHitHeader.cc.

{
    return m_hitCollection;
}
void DayaBay::SimHitHeader::addHitCollection ( DayaBay::SimHitCollection hc)

Add a SimHitCollection.

Definition at line 41 of file SimHitHeader.cc.

std::vector< short int > DayaBay::SimHitHeader::hitDetectors ( ) const [inline]

Returns the list of detector IDs with hits in the collection.

Definition at line 160 of file SimHitHeader.h.

{

          hc_map::const_iterator hcIter, hcEnd = m_hitCollection.end();
          std::vector<short int> detectors;
          for(hcIter=m_hitCollection.begin(); hcIter != hcEnd; hcIter++) 
            detectors.push_back(hcIter->first);
          return detectors;
        
}
DayaBay::SimHitCollection * DayaBay::SimHitHeader::hitsByDetector ( short int  detector) const [inline]

Returns the hits for the given detector ID.

Definition at line 171 of file SimHitHeader.h.

{

          hc_map::const_iterator hcIter = m_hitCollection.find(detector);
          if(hcIter == m_hitCollection.end())
            return 0;
          return hcIter->second;
        
}
std::ostream & DayaBay::SimHitHeader::fillStream ( std::ostream &  s) const

Print the header.

Definition at line 24 of file SimHitHeader.cc.

{
    s << "{ " << "hit collections : " << std::endl;

    hc_map::const_iterator it, done = m_hitCollection.end();
    for (it = m_hitCollection.begin(); it != done; ++it) {
        DayaBay::Detector d(it->first);

        s << Site::AsString(d.site()) << "::" << d.detName() 
          << " collection: "
          << std::endl;
        it->second->fillStream(s);
    }
    s << "}";
    return s;
}
const DayaBay::SimHeader * DayaBay::SimHitHeader::header ( ) const [inline]

Retrieve const Pointer to the SimHeader holding this SimHitHeader.

Definition at line 145 of file SimHitHeader.h.

{
  return m_header;
}
void DayaBay::SimHitHeader::setHeader ( DayaBay::SimHeader value) [inline]

Update Pointer to the SimHeader holding this SimHitHeader.

Definition at line 150 of file SimHitHeader.h.

{
  m_header = value;
}
const DayaBay::SimHitHeader::hc_map & DayaBay::SimHitHeader::hitCollection ( ) const [inline]

Retrieve const Map from Detector to detected SimHitCollection.

Definition at line 155 of file SimHitHeader.h.

{
  return m_hitCollection;
}
static void* DayaBay::SimHitHeader::operator new ( size_t  size) [inline, static]

operator new

Definition at line 90 of file SimHitHeader.h.

    {
      return ( sizeof(SimHitHeader) == size ? 
               boost::singleton_pool<SimHitHeader, sizeof(SimHitHeader)>::malloc() :
               ::operator new(size) );
    }
static void* DayaBay::SimHitHeader::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

Definition at line 100 of file SimHitHeader.h.

    {
      return ::operator new (size,pObj);
    }
static void DayaBay::SimHitHeader::operator delete ( void *  p) [inline, static]

operator delete

Definition at line 106 of file SimHitHeader.h.

    {
      boost::singleton_pool<SimHitHeader, sizeof(SimHitHeader)>::is_from(p) ?
      boost::singleton_pool<SimHitHeader, sizeof(SimHitHeader)>::free(p) :
      ::operator delete(p);
    }
static void DayaBay::SimHitHeader::operator delete ( void *  p,
void *  pObj 
) [inline, static]

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

Definition at line 115 of file SimHitHeader.h.

    {
      ::operator delete (p, pObj);
    }

Member Data Documentation

Pointer to the SimHeader holding this SimHitHeader.

Definition at line 124 of file SimHitHeader.h.

Map from Detector to detected SimHitCollection.

Definition at line 125 of file SimHitHeader.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 10:05:28 for SimEvent by doxygen 1.7.4