/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
SimPruneTool Class Reference

Prune the SimHeader in various fun ways. More...

#include <SimPruneTool.h>

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

List of all members.

Public Member Functions

 SimPruneTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~SimPruneTool ()
virtual StatusCode visit (DayaBay::RegistrationSequence &rs)

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Attributes

std::string m_location
 Property: Location of the SimHeader that will have its hits pruned.

Detailed Description

Prune the SimHeader in various fun ways.

Brett Viren <bv@bnl.gov> Mon Feb 14 13:47:56 2011

Definition at line 23 of file SimPruneTool.h.


Constructor & Destructor Documentation

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

Definition at line 11 of file SimPruneTool.cc.

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

    declareProperty("Location", m_location = SimHeader::defaultLocation(),
                    "Location of SimHeader that gets its hits pruned.");
}
SimPruneTool::~SimPruneTool ( ) [virtual]

Definition at line 22 of file SimPruneTool.cc.

{
}

Member Function Documentation

StatusCode SimPruneTool::visit ( DayaBay::RegistrationSequence rs) [virtual]

Implements IRegSeqVisitor.

Definition at line 26 of file SimPruneTool.cc.

{
    debug () << "visit() with " << rs.size() << " registrations" << endreq;

    // vector<ObjectReg>
    IRegistrationSequence::Registrations regs = rs.registrations();
    for (size_t ind=0; ind<regs.size(); ++ind) {
        ObjectReg& objreg = regs[ind];

        const string& path = objreg.path();
        if (path != m_location) continue;

        DataObject* dobj = objreg.object();
        if (!dobj) continue;

        SimHeader* sh = dynamic_cast<SimHeader*>(dobj);
        if (!sh) {
            error() << "Data object at \"" << path << "\" not a SimHeader" << endreq;
            return StatusCode::FAILURE;
        }

        const SimHitHeader* chits = sh->hits();
        if (!chits) {
            debug() << "No SimHitHeader, my job is already done" << endreq;
            return StatusCode::SUCCESS;
        }
        SimHitHeader* shits = const_cast<SimHitHeader*>(chits);
        debug() << "Pruning " << shits->hitCollection().size() << " hit collections" << endreq;
        sh->setHits(0);
        delete shits;       // One usually uses TP for this operation.

        break;
    }

    return StatusCode::SUCCESS;
}

Member Data Documentation

std::string SimPruneTool::m_location [private]

Property: Location of the SimHeader that will have its hits pruned.

Definition at line 43 of file SimPruneTool.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