Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

marlin::SimpleFastMCProcessor Class Reference

#include <SimpleFastMCProcessor.h>

Inheritance diagram for marlin::SimpleFastMCProcessor:

marlin::Processor List of all members.

Public Member Functions

virtual ProcessornewProcessor ()
 SimpleFastMCProcessor ()
virtual void init ()
virtual void processRunHeader (LCRunHeader *run)
virtual void processEvent (LCEvent *evt)
virtual void check (LCEvent *evt)
virtual void end ()
virtual const std::string & type () const
virtual const std::string & name () const
virtual StringParametersparameters ()
virtual void printDescription ()
virtual void printDescriptionXML (std::ostream &stream=std::cout)
virtual void printParameters ()
const std::string & description ()
bool isFirstEvent ()
std::string getLCIOInType (const std::string &colName)
std::string getLCIOOutType (const std::string &colName)
bool isInputCollectionName (const std::string &parameterName)
bool isOutputCollectionName (const std::string &parameterName)

Protected Member Functions

void setReturnValue (bool val)
void setReturnValue (const std::string &name, bool val)
template<class T>
void registerProcessorParameter (const std::string &name, const std::string &description, T &parameter, const T &defaultVal, int setSize=0)
void registerInputCollection (const std::string &type, const std::string &name, const std::string &description, std::string &parameter, const std::string &defaultVal, int setSize=0)
void registerOutputCollection (const std::string &type, const std::string &name, const std::string &description, std::string &parameter, const std::string &defaultVal, int setSize=0)
void registerInputCollections (const std::string &type, const std::string &name, const std::string &description, StringVec &parameter, const StringVec &defaultVal, int setSize=0)
template<class T>
void registerOptionalParameter (const std::string &name, const std::string &description, T &parameter, const T &defaultVal, int setSize=0)
bool parameterSet (const std::string &name)

Protected Attributes

std::string _inputCollectionName
float _momentumCut
FloatVec _initChargedRes
FloatVec _initPhotonRes
FloatVec _initNeutralHadronRes
IRecoParticleFactory_factory
int _nRun
int _nEvt
std::string _description
std::string _typeName
std::string _processorName
StringParameters_parameters
ProcParamMap _map
bool _isFirstEvent
LCIOTypeMap _inTypeMap
LCIOTypeMap _outTypeMap

Detailed Description

A simple smearing "Monte Carlo" processor. It creates ReconstructedParticles from MCParticles according to the resolution that is specified for the particle type, one of: The resolutions for charged particles are given as delta(1/P) for a certain polar angle range (mapped to [0.,pi/2.]), e.g.
ChargedResolution   .7e-5   0.   3.141593/2.
sets the resolution for all charged particles to 0.7*10^-5.
Specifying different resolutions for different polar angle ranges allows to mimic degrading detector performance in the very forward region.
The energy of the charged ReconstructedParticles is set from the "measured" momentum using the energy momentum relation for electrons and muons and assuming the pion mass for all other charged tracks.
The resolutions for neutral particles are given as A and B for a certain polar angle range, where dE/E = A "+" B / sqrt(E/GeV), e.g.
NeutralHadronResolution   0.03   .30   0.   3.141593/2.
sets the resolution for all neutral hadrons to 3% "+" 30% / sqrt( E /GeV ). The resolution for gammas is specified in PhotonResolution
No ReconstructedParticles are created if there is no resolution defined at that polar angle, e.g.
PhotonResolution   .7e-5   0.083   3.141593/2.
effectively limits the acceptance region for photons to theta > 83mrad.

A collection of LCRelations, called "MCTruthMapping" holds the relation between the ReconstructedParticles and their proper MCParticles.

Input - Prerequisites

A collection of MCParticles (the MCPArticle collection).

Output

Parameters:
ChargedResolution Resolution of charged particles in polar angle range: d(1/P) th_min th_max
InputCollectionName Name of the MCParticle input collection
MomentumCut No reconstructed particles are produced for smaller momenta (in [GeV])
NeutralHadronResolution Resolution dE/E=A+B/sqrt(E/GeV) of neutral hadrons in polar angle range: A B th_min th_max
PhotonResolution Resolution dE/E=A+B/sqrt(E/GeV) of photons in polar angle range: A B th_min th_max
Author:
F. Gaede, DESY
Version:
Id
SimpleFastMCProcessor.h,v 1.3 2005/10/11 12:56:28 gaede Exp

Definition at line 67 of file SimpleFastMCProcessor.h.


Constructor & Destructor Documentation

marlin::SimpleFastMCProcessor::SimpleFastMCProcessor  ) 
 

Definition at line 44 of file SimpleFastMCProcessor.cc.

References _initChargedRes, _initNeutralHadronRes, _initPhotonRes, _inputCollectionName, _momentumCut, EVENT::FloatVec, marlin::Processor::registerInputCollection(), and marlin::Processor::registerProcessorParameter().


Member Function Documentation

void marlin::SimpleFastMCProcessor::check LCEvent evt  )  [virtual]
 

Creates some checkplots.

Reimplemented from marlin::Processor.

Definition at line 176 of file SimpleFastMCProcessor.cc.

References EVENT::LCEvent::getCollection(), EVENT::LCCollection::getElementAt(), EVENT::MCParticle::getEnergy(), EVENT::ReconstructedParticle::getEnergy(), EVENT::MCParticle::getMomentum(), EVENT::ReconstructedParticle::getMomentum(), EVENT::LCCollection::getNumberOfElements(), UTIL::LCRelationNavigator::getRelatedToObjects(), EVENT::ReconstructedParticle::getType(), marlin::Processor::isFirstEvent(), and EVENT::LCObjectVec.

const std::string& marlin::Processor::description  )  [inline, inherited]
 

Description of processor.

Definition at line 126 of file Processor.h.

Referenced by marlin::CMProcessor::CMProcessor(), marlin::Processor::printDescription(), and marlin::Processor::printDescriptionXML().

void marlin::SimpleFastMCProcessor::end  )  [virtual]
 

Called after data processing for clean up.

Reimplemented from marlin::Processor.

Definition at line 306 of file SimpleFastMCProcessor.cc.

References _nEvt, _nRun, and marlin::Processor::name().

std::string marlin::Processor::getLCIOInType const std::string &  colName  )  [inherited]
 

Return the LCIO input type for the collection colName - empty string if colName is not a registered collection name

Definition at line 231 of file Processor.cc.

References marlin::Processor::_inTypeMap, and marlin::Processor::isInputCollectionName().

Referenced by marlin::CCProcessor::addColsFromParam(), and marlin::XMLFixCollTypes::parse().

std::string marlin::Processor::getLCIOOutType const std::string &  colName  )  [inherited]
 

Return the LCIO output type for the collection colName - empty string if colName is not a registered collection name

Definition at line 240 of file Processor.cc.

References marlin::Processor::_outTypeMap, and marlin::Processor::isOutputCollectionName().

Referenced by marlin::CCProcessor::addColsFromParam(), and marlin::XMLFixCollTypes::parse().

void marlin::SimpleFastMCProcessor::init  )  [virtual]
 

Initializes ...

Reimplemented from marlin::Processor.

Definition at line 105 of file SimpleFastMCProcessor.cc.

References _factory, _initChargedRes, _initNeutralHadronRes, _initPhotonRes, _momentumCut, _nEvt, _nRun, marlin::CHARGED, marlin::NEUTRAL_HADRON, marlin::PHOTON, and marlin::Processor::printParameters().

bool marlin::Processor::isFirstEvent  )  [inline, inherited]
 

True if first event in processEvent(evt) - use this e.g. to initialize histograms etc.

Definition at line 131 of file Processor.h.

Referenced by check(), and marlin::StdHepReader::readDataSource().

bool marlin::Processor::isInputCollectionName const std::string &  parameterName  )  [inherited]
 

True if the given parameter defines an LCIO input collection, i.e. the type has been defined with setLCIOInType().

Definition at line 249 of file Processor.cc.

References marlin::Processor::_inTypeMap.

Referenced by marlin::CCProcessor::addColsFromParam(), marlin::Processor::getLCIOInType(), marlin::XMLFixCollTypes::parse(), and marlin::Processor::printDescriptionXML().

bool marlin::Processor::isOutputCollectionName const std::string &  parameterName  )  [inherited]
 

True if the given parameter defines an LCIO output collection

Definition at line 257 of file Processor.cc.

References marlin::Processor::_outTypeMap.

Referenced by marlin::CCProcessor::addColsFromParam(), marlin::Processor::getLCIOOutType(), marlin::XMLFixCollTypes::parse(), and marlin::Processor::printDescriptionXML().

virtual const std::string& marlin::Processor::name  )  const [inline, virtual, inherited]
 

Return name of this processor.

Definition at line 105 of file Processor.h.

Referenced by marlin::TestProcessor::check(), marlin::TestProcessor::end(), end(), marlin::LCIOOutputProcessor::end(), marlin::TestProcessor::init(), marlin::Processor::printDescriptionXML(), marlin::Processor::printParameters(), marlin::TestProcessor::processEvent(), marlin::TestProcessor::processRunHeader(), marlin::ProcessorMgr::setProcessorReturnValue(), marlin::SkipEventException::SkipEventException(), and marlin::StopProcessingException::StopProcessingException().

virtual Processor* marlin::SimpleFastMCProcessor::newProcessor  )  [inline, virtual]
 

Returns a new instance of the processor.

Implements marlin::Processor.

Definition at line 72 of file SimpleFastMCProcessor.h.

virtual StringParameters* marlin::Processor::parameters  )  [inline, virtual, inherited]
 

Return parameters defined for this Processor.

Definition at line 109 of file Processor.h.

Referenced by marlin::TestProcessor::init().

bool marlin::Processor::parameterSet const std::string &  name  )  [protected, inherited]
 

Tests whether the parameter has been set in the steering file

Definition at line 194 of file Processor.cc.

References marlin::Processor::_map, and marlin::ProcessorParameter::valueSet().

Referenced by marlin::LCIOOutputProcessor::dropCollections(), and marlin::LCIOOutputProcessor::init().

void marlin::Processor::printDescription  )  [virtual, inherited]
 

Print information about this processor in ASCII steering file format.

Definition at line 75 of file Processor.cc.

References marlin::Processor::_map, marlin::ProcessorParameter::defaultValue(), marlin::ProcessorParameter::description(), marlin::Processor::description(), marlin::ProcessorParameter::isOptional(), marlin::ProcessorParameter::name(), marlin::ProcessorParameter::type(), and marlin::Processor::type().

Referenced by marlin::ProcessorMgr::dumpRegisteredProcessors().

void marlin::Processor::printDescriptionXML std::ostream &  stream = std::cout  )  [virtual, inherited]
 

Print information about this processor in XML steering file format.

Definition at line 125 of file Processor.cc.

References marlin::Processor::_inTypeMap, marlin::Processor::_map, marlin::Processor::_outTypeMap, marlin::ProcessorParameter::defaultValue(), marlin::ProcessorParameter::description(), marlin::Processor::description(), marlin::Processor::isInputCollectionName(), marlin::ProcessorParameter::isOptional(), marlin::Processor::isOutputCollectionName(), marlin::ProcessorParameter::name(), marlin::Processor::name(), marlin::ProcessorParameter::type(), and marlin::Processor::type().

Referenced by marlin::ProcessorMgr::dumpRegisteredProcessorsXML().

void marlin::Processor::printParameters  )  [virtual, inherited]
 

Print the parameters and its values.

Definition at line 53 of file Processor.cc.

References marlin::Processor::_map, and marlin::Processor::name().

Referenced by marlin::StdHepReader::init(), init(), and marlin::LCIOOutputProcessor::init().

void marlin::SimpleFastMCProcessor::processEvent LCEvent evt  )  [virtual]
 

Updates all registered conditions handlers and adds the data to the event.

Reimplemented from marlin::Processor.

Definition at line 140 of file SimpleFastMCProcessor.cc.

References _factory, _inputCollectionName, _nEvt, EVENT::LCEvent::addCollection(), IMPL::LCCollectionVec::addElement(), UTIL::LCRelationNavigator::addRelation(), UTIL::LCRelationNavigator::createLCCollection(), marlin::IRecoParticleFactory::createReconstructedParticle(), EVENT::LCEvent::getCollection(), EVENT::MCParticle::getDaughters(), EVENT::LCCollection::getElementAt(), EVENT::LCCollection::getNumberOfElements(), and IMPL::LCCollectionVec::setDefault().

void marlin::SimpleFastMCProcessor::processRunHeader LCRunHeader run  )  [virtual]
 

Called for every run.

Reimplemented from marlin::Processor.

Definition at line 135 of file SimpleFastMCProcessor.cc.

References _nRun.

void marlin::Processor::registerInputCollection const std::string &  type,
const std::string &  name,
const std::string &  description,
std::string &  parameter,
const std::string &  defaultVal,
int  setSize = 0
[inline, protected, inherited]
 

Specialization of registerProcessorParameter() for a parameter that defines an input collection - can be used fo checking the consistency of the steering file.

Definition at line 195 of file Processor.h.

Referenced by SimpleFastMCProcessor().

void marlin::Processor::registerInputCollections const std::string &  type,
const std::string &  name,
const std::string &  description,
StringVec parameter,
const StringVec defaultVal,
int  setSize = 0
[inline, protected, inherited]
 

Specialization of registerProcessorParameter() for a parameter that defines one or several input collections - can be used fo checking the consistency of the steering file.

Definition at line 223 of file Processor.h.

template<class T>
void marlin::Processor::registerOptionalParameter const std::string &  name,
const std::string &  description,
T &  parameter,
const T &  defaultVal,
int  setSize = 0
[inline, protected, inherited]
 

Same as registerProcessorParameter except that the parameter is optional. The value of the parameter will still be set to the default value, which is used to print an example steering line. Use parameterSet() to check whether it actually has been set in the steering file.

Definition at line 241 of file Processor.h.

Referenced by marlin::LCIOOutputProcessor::LCIOOutputProcessor().

void marlin::Processor::registerOutputCollection const std::string &  type,
const std::string &  name,
const std::string &  description,
std::string &  parameter,
const std::string &  defaultVal,
int  setSize = 0
[inline, protected, inherited]
 

Specialization of registerProcessorParameter() for a parameter that defines an output collection - can be used fo checking the consistency of the steering file.

Definition at line 209 of file Processor.h.

template<class T>
void marlin::Processor::registerProcessorParameter const std::string &  name,
const std::string &  description,
T &  parameter,
const T &  defaultVal,
int  setSize = 0
[inline, protected, inherited]
 

Register a steering variable for this processor - call in constructor of processor. The default value has to be of the _same_ type as the parameter, e.g.
float _cut ;
...
registerProcessorParameter( "Cut", "cut...", _cut , float( 3.141592 ) ) ;
as implicit conversions don't work for templates.
The optional parameter setSize is used for formating the printout of parameters. This can be used if the parameter values are expected to come in sets of fixed size.

Definition at line 181 of file Processor.h.

Referenced by LoadSettingsProcessor::construct(), tpc_tracking::LoadPadGeometryProcessor::construct(), marlin::LCIOOutputProcessor::LCIOOutputProcessor(), SimpleFastMCProcessor(), and marlin::StdHepReader::StdHepReader().

void marlin::Processor::setReturnValue const std::string &  name,
bool  val
[protected, inherited]
 

Set a named return value for this processor - typically at end of processEvent() The value can be used in a condition in the steering file referred to by ProcessorName.name of the processor.

Definition at line 261 of file Processor.cc.

void marlin::Processor::setReturnValue bool  val  )  [protected, inherited]
 

Set the return value for this processor - typically at end of processEvent(). The value can be used in a condition in the steering file referred to by the name of the processor.

Definition at line 222 of file Processor.cc.

Referenced by marlin::TestProcessor::processEvent().

virtual const std::string& marlin::Processor::type  )  const [inline, virtual, inherited]
 

Return type name for the processor (as set in constructor).

Definition at line 101 of file Processor.h.

Referenced by marlin::Processor::printDescription(), marlin::Processor::printDescriptionXML(), and marlin::ProcessorMgr::registerProcessor().


Member Data Documentation

std::string marlin::Processor::_description [protected, inherited]
 

Describes what the processor does. Set in constructor.

Definition at line 306 of file Processor.h.

IRecoParticleFactory* marlin::SimpleFastMCProcessor::_factory [protected]
 

The particle factory

Definition at line 117 of file SimpleFastMCProcessor.h.

Referenced by init(), and processEvent().

FloatVec marlin::SimpleFastMCProcessor::_initChargedRes [protected]
 

Resolutions of charged particles

Definition at line 108 of file SimpleFastMCProcessor.h.

Referenced by init(), and SimpleFastMCProcessor().

FloatVec marlin::SimpleFastMCProcessor::_initNeutralHadronRes [protected]
 

Resolutions of photons

Definition at line 114 of file SimpleFastMCProcessor.h.

Referenced by init(), and SimpleFastMCProcessor().

FloatVec marlin::SimpleFastMCProcessor::_initPhotonRes [protected]
 

Resolutions of photons

Definition at line 111 of file SimpleFastMCProcessor.h.

Referenced by init(), and SimpleFastMCProcessor().

std::string marlin::SimpleFastMCProcessor::_inputCollectionName [protected]
 

Input collection name

Definition at line 102 of file SimpleFastMCProcessor.h.

Referenced by processEvent(), and SimpleFastMCProcessor().

LCIOTypeMap marlin::Processor::_inTypeMap [protected, inherited]
 

Definition at line 313 of file Processor.h.

Referenced by marlin::Processor::getLCIOInType(), marlin::Processor::isInputCollectionName(), marlin::Processor::printDescriptionXML(), and marlin::Processor::setLCIOInType().

bool marlin::Processor::_isFirstEvent [protected, inherited]
 

Definition at line 312 of file Processor.h.

ProcParamMap marlin::Processor::_map [protected, inherited]
 

Definition at line 311 of file Processor.h.

Referenced by marlin::Processor::parameterSet(), marlin::Processor::printDescription(), marlin::Processor::printDescriptionXML(), marlin::Processor::printParameters(), and marlin::Processor::updateParameters().

float marlin::SimpleFastMCProcessor::_momentumCut [protected]
 

Momentum cut in GeV

Definition at line 105 of file SimpleFastMCProcessor.h.

Referenced by init(), and SimpleFastMCProcessor().

int marlin::SimpleFastMCProcessor::_nEvt [protected]
 

Definition at line 120 of file SimpleFastMCProcessor.h.

Referenced by end(), init(), and processEvent().

int marlin::SimpleFastMCProcessor::_nRun [protected]
 

Definition at line 119 of file SimpleFastMCProcessor.h.

Referenced by end(), init(), and processRunHeader().

LCIOTypeMap marlin::Processor::_outTypeMap [protected, inherited]
 

Definition at line 314 of file Processor.h.

Referenced by marlin::Processor::getLCIOOutType(), marlin::Processor::isOutputCollectionName(), marlin::Processor::printDescriptionXML(), and marlin::Processor::setLCIOOutType().

StringParameters* marlin::Processor::_parameters [protected, inherited]
 

Definition at line 309 of file Processor.h.

Referenced by marlin::Processor::setParameters(), marlin::Processor::updateParameters(), and marlin::Processor::~Processor().

std::string marlin::Processor::_processorName [protected, inherited]
 

Definition at line 308 of file Processor.h.

std::string marlin::Processor::_typeName [protected, inherited]
 

Definition at line 307 of file Processor.h.


The documentation for this class was generated from the following files:
Generated on Sun Jun 3 06:32:31 2007 for A TPC Tracking Environment by  doxygen 1.3.9.1