#include <HectorProducer.h>
Public Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
HectorProducer (edm::ParameterSet const &p) | |
default constructor | |
void | produce (edm::Event &iEvent, const edm::EventSetup &es) |
this method will do the user analysis | |
virtual | ~HectorProducer () |
default destructor | |
Private Attributes | |
int | eventsAnalysed |
just to count events that have been analysed | |
HepMC::GenEvent * | evt_ |
Hector * | hector |
bool | m_FP420Transport |
std::string | m_InTag |
bool | m_verbosity |
bool | m_ZDCTransport |
Definition at line 20 of file HectorProducer.h.
HectorProducer::HectorProducer | ( | edm::ParameterSet const & | p | ) |
default constructor
Definition at line 24 of file HectorProducer.cc.
References edm::ParameterSet::getParameter(), hector, m_FP420Transport, m_InTag, m_verbosity, and m_ZDCTransport.
: eventsAnalysed(0) { // TransportHector m_InTag = parameters.getParameter<std::string>("HepMCProductLabel") ; m_verbosity = parameters.getParameter<bool>("Verbosity"); m_FP420Transport = parameters.getParameter<bool>("FP420Transport"); m_ZDCTransport = parameters.getParameter<bool>("ZDCTransport"); produces<edm::HepMCProduct>(); produces<edm::LHCTransportLinkContainer>(); hector = new Hector(parameters, m_verbosity, m_FP420Transport, m_ZDCTransport); }
HectorProducer::~HectorProducer | ( | ) | [virtual] |
default destructor
Definition at line 44 of file HectorProducer.cc.
References eventsAnalysed, LogDebug, and m_verbosity.
{ if(m_verbosity) { LogDebug("HectorSetup") << "Delete HectorProducer" << "Number of events analysed: " << eventsAnalysed; } }
virtual void HectorProducer::beginJob | ( | void | ) | [inline, virtual] |
virtual void HectorProducer::endJob | ( | void | ) | [inline, virtual] |
void HectorProducer::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | es | ||
) | [virtual] |
this method will do the user analysis
Implements edm::EDProducer.
Definition at line 53 of file HectorProducer.cc.
References Hector::add(), Hector::addPartToHepMC(), Hector::clear(), Hector::clearApertureFlags(), eventsAnalysed, evt_, Exception, Hector::filterD1(), Hector::filterFP420(), Hector::filterZDC(), edm::Event::getByLabel(), Hector::getCorrespondenceMap(), hector, i, LogDebug, m_FP420Transport, m_InTag, m_verbosity, m_ZDCTransport, and edm::Event::put().
{ using namespace edm; using namespace std; eventsAnalysed++; Handle<HepMCProduct> HepMCEvt; iEvent.getByLabel( m_InTag, HepMCEvt ) ; if ( !HepMCEvt.isValid() ) { throw cms::Exception("InvalidReference") << "Invalid reference to HepMCProduct\n"; } if ( HepMCEvt.provenance()->moduleLabel() == "LHCTransport" ) { throw cms::Exception("LogicError") << "HectorTrasported HepMCProduce already exists\n"; } evt_ = new HepMC::GenEvent( *HepMCEvt->GetEvent() ); hector->clearApertureFlags(); if(m_FP420Transport) { hector->clear(); hector->add( evt_ ,es); hector->filterFP420(); } if(m_ZDCTransport) { hector->clear(); hector->add( evt_ ,es); hector->filterZDC(); hector->clear(); hector->add( evt_ ,es); hector->filterD1(); } evt_ = hector->addPartToHepMC( evt_ ); if (m_verbosity) { evt_->print(); } auto_ptr<HepMCProduct> NewProduct(new HepMCProduct()) ; NewProduct->addHepMCData( evt_ ) ; iEvent.put( NewProduct ) ; auto_ptr<LHCTransportLinkContainer> NewCorrespondenceMap(new edm::LHCTransportLinkContainer() ); edm::LHCTransportLinkContainer thisLink(hector->getCorrespondenceMap()); (*NewCorrespondenceMap).swap(thisLink); if ( m_verbosity ) { for ( unsigned int i = 0; i < (*NewCorrespondenceMap).size(); i++) LogDebug("HectorEventProcessing") << "Hector correspondence table: " << (*NewCorrespondenceMap)[i]; } iEvent.put( NewCorrespondenceMap ); }
int HectorProducer::eventsAnalysed [private] |
just to count events that have been analysed
Definition at line 29 of file HectorProducer.h.
Referenced by produce(), and ~HectorProducer().
HepMC::GenEvent* HectorProducer::evt_ [private] |
Definition at line 30 of file HectorProducer.h.
Referenced by produce().
Hector* HectorProducer::hector [private] |
Definition at line 31 of file HectorProducer.h.
Referenced by HectorProducer(), and produce().
bool HectorProducer::m_FP420Transport [private] |
Definition at line 35 of file HectorProducer.h.
Referenced by HectorProducer(), and produce().
std::string HectorProducer::m_InTag [private] |
Definition at line 33 of file HectorProducer.h.
Referenced by HectorProducer(), and produce().
bool HectorProducer::m_verbosity [private] |
Definition at line 34 of file HectorProducer.h.
Referenced by HectorProducer(), produce(), and ~HectorProducer().
bool HectorProducer::m_ZDCTransport [private] |
Definition at line 36 of file HectorProducer.h.
Referenced by HectorProducer(), and produce().