/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 | Static Public Member Functions | Private Attributes
GenPruneTool Class Reference

#include <GenPruneTool.h>

Inheritance diagram for GenPruneTool:
Inheritance graph
[legend]
Collaboration diagram for GenPruneTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GenPruneTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~GenPruneTool ()
StatusCode prune (DayaBay::GenHeader *genHeader)
 Modify the event.
StatusCode setMaxVertices (int MaxVertices)
virtual StatusCode initialize ()
virtual StatusCode finalize ()

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Retrieve interface ID.

Private Attributes

int m_maxVertices
 Property: MaxVertices.

Detailed Description

Definition at line 16 of file GenPruneTool.h.


Constructor & Destructor Documentation

GenPruneTool::GenPruneTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 7 of file GenPruneTool.cc.

    : GaudiTool(type,name,parent)
{
  declareInterface< IGenPruneTool >(this) ;

  declareProperty("MaxVertices", m_maxVertices = -1,
                  "Negative: no touch. Otherwise, the number of vertices must be <= the MaxVertices");
}
GenPruneTool::~GenPruneTool ( ) [virtual]

Definition at line 18 of file GenPruneTool.cc.

{}

Member Function Documentation

StatusCode GenPruneTool::prune ( DayaBay::GenHeader genHeader) [virtual]

Modify the event.

Implements IGenPruneTool.

Definition at line 32 of file GenPruneTool.cc.

{
  if (m_maxVertices < 0) return StatusCode::SUCCESS;

  HepMC::GenEvent* event = genHeader->event();
  if (!event) {
    debug() << "GenHeader has null event, my work here is already done" << endreq;
    return StatusCode::SUCCESS;
  }

  int nverts = genHeader->event()->vertices_size();
  if (nverts <= m_maxVertices) {
    debug() << "GenHeader has " << nverts << " <= " << m_maxVertices
            << ", my work here is already done."
            << endreq;
    return StatusCode::SUCCESS;
  }

  genHeader->setEvent(0);
  debug() << "nullified GenHeader's event pointer" << endreq;
  return StatusCode::SUCCESS;
}
StatusCode GenPruneTool::setMaxVertices ( int  MaxVertices) [inline, virtual]

Implements IGenPruneTool.

Definition at line 29 of file GenPruneTool.h.

                                               {
      m_maxVertices = MaxVertices;
      return StatusCode::SUCCESS;
    }
StatusCode GenPruneTool::initialize ( ) [virtual]

Definition at line 21 of file GenPruneTool.cc.

{
  return StatusCode::SUCCESS;
}
StatusCode GenPruneTool::finalize ( ) [virtual]

Definition at line 26 of file GenPruneTool.cc.

{
  return StatusCode::SUCCESS;
}
const InterfaceID & IGenPruneTool::interfaceID ( ) [static, inherited]

Retrieve interface ID.

Definition at line 8 of file IGenPruneTool.cc.

{
  return IID_IGenPruneTool;
}

Member Data Documentation

Property: MaxVertices.

The maximum number of vertices allowed to remain in the GenEvent. A value less than zero will be interpreted as to not touch the data. For non-negative values, if the number of vertices are less than or equal to the MaxVertices the GenHeader is left along, otherwise the GenEvent is deleted and GenHeader's pointer to GenEvent is zeroed.

Definition at line 47 of file GenPruneTool.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:08:03 for DybTool by doxygen 1.7.4