#include <MixingWorker.h>
Public Member Functions | |
virtual void | addPileups (const int bcr, EventPrincipal *ep, unsigned int eventNr, int vertexoffset) |
virtual void | addSignals (const edm::Event &e) |
virtual bool | checkSignal (const edm::Event &e) |
virtual void | copyPCrossingFrame (const PCrossingFrame< T > *PCF) |
virtual void | createnewEDProduct () |
MixingWorker (int minBunch, int maxBunch, int bunchSpace, std::string subdet, std::string label, std::string labelCF, int maxNbSources, InputTag &tag, InputTag &tagCF, bool mixProdStep2) | |
MixingWorker () | |
virtual void | put (edm::Event &e) |
virtual void | setBcrOffset () |
virtual void | setSourceOffset (const unsigned int s) |
void | setTof () |
virtual | ~MixingWorker () |
Private Attributes | |
CrossingFrame< T > * | crFrame_ |
bool | mixProdStep2_ |
PCrossingFrame< T > * | secSourceCF_ |
Definition at line 35 of file MixingWorker.h.
edm::MixingWorker< T >::MixingWorker | ( | ) | [inline, explicit] |
edm::MixingWorker< T >::MixingWorker | ( | int | minBunch, |
int | maxBunch, | ||
int | bunchSpace, | ||
std::string | subdet, | ||
std::string | label, | ||
std::string | labelCF, | ||
int | maxNbSources, | ||
InputTag & | tag, | ||
InputTag & | tagCF, | ||
bool | mixProdStep2 | ||
) | [inline] |
Definition at line 43 of file MixingWorker.h.
References edm::MixingWorker< T >::mixProdStep2_.
: MixingWorkerBase(minBunch,maxBunch,bunchSpace,subdet,label,labelCF,maxNbSources,tag,tagCF,mixProdStep2) { mixProdStep2_ = mixProdStep2; }
virtual edm::MixingWorker< T >::~MixingWorker | ( | ) | [inline, virtual] |
void MixingWorker::addPileups | ( | const int | bcr, |
EventPrincipal * | ep, | ||
unsigned int | eventNr, | ||
int | vertexoffset | ||
) | [virtual] |
Implements edm::MixingWorkerBase.
Definition at line 136 of file MixingWorker.h.
References LogDebug.
{ if (!mixProdStep2_){ // default version // valid for CaloHits boost::shared_ptr<Wrapper<std::vector<T> > const> shPtr = edm::getProductByTag<std::vector<T> >(*ep, tag_); if (shPtr) { LogDebug("MixingModule") <<shPtr->product()->size()<<" pileup objects added, eventNr "<<eventNr; crFrame_->addPileups(bcr,const_cast< std::vector<T> * >(shPtr->product()),eventNr); } } else { boost::shared_ptr<Wrapper<PCrossingFrame<T> > const> shPtr = getProductByTag<PCrossingFrame<T> >(*ep, tag_); if (shPtr){ secSourceCF_ = const_cast<PCrossingFrame<T> * >(shPtr->product()); LogDebug("MixingModule") << "Add PCrossingFrame<T> eventNr " << secSourceCF_->getEventID(); copyPCrossingFrame(secSourceCF_); } else LogDebug("MixingModule") << "Could not get the PCrossingFrame<T>!"; } }
virtual void edm::MixingWorker< T >::addSignals | ( | const edm::Event & | e | ) | [inline, virtual] |
Implements edm::MixingWorkerBase.
Definition at line 98 of file MixingWorker.h.
References edm::MixingWorker< T >::crFrame_, edm::Event::getByLabel(), edm::EventBase::id(), LogDebug, edm::MixingWorker< T >::mixProdStep2_, AlCaRecoCosmics_cfg::name, edm::Handle< T >::product(), edm::MixingWorkerBase::tag_, and edm::MixingWorkerBase::tagSignal_.
{ if (mixProdStep2_){ edm::Handle<std::vector<T> > result_t; bool got = e.getByLabel(tagSignal_,result_t); if (got) { LogDebug("MixingModule") <<" adding " << result_t.product()->size()<<" signal objects for "<<typeid(T).name()<<" with "<<tagSignal_; crFrame_->addSignals(result_t.product(),e.id()); } else LogInfo("MixingModule") <<"!!!!!!! Did not get any signal data for "<<typeid(T).name()<<", with "<<tagSignal_; } else{ // Default version edm::Handle<std::vector<T> > result_t; bool got = e.getByLabel(tag_,result_t); if (got) { LogDebug("MixingModule") <<" adding " << result_t.product()->size()<<" signal objects for "<<typeid(T).name()<<" with "<<tag_; crFrame_->addSignals(result_t.product(),e.id()); } else LogInfo("MixingModule") <<"!!!!!!! Did not get any signal data for "<<typeid(T).name()<<", with "<<tag_; } }
virtual bool edm::MixingWorker< T >::checkSignal | ( | const edm::Event & | e | ) | [inline, virtual] |
Implements edm::MixingWorkerBase.
Definition at line 69 of file MixingWorker.h.
References edm::InputTag::encode(), edm::Event::getByLabel(), edm::InputTag::instance(), edm::InputTag::label(), edm::MixingWorker< T >::mixProdStep2_, AlCaRecoCosmics_cfg::name, matplotRender::t, edm::MixingWorkerBase::tag_, and edm::MixingWorkerBase::tagSignal_.
{ bool got; InputTag t; edm::Handle<std::vector<T> > result_t; if (mixProdStep2_){ got = e.getByLabel(tagSignal_,result_t); t = InputTag(tagSignal_.label(),tagSignal_.instance()); } else{ got = e.getByLabel(tag_,result_t); t = InputTag(tag_.label(),tag_.instance()); } if (got) LogInfo("MixingModule") <<" Will create a CrossingFrame for "<< typeid(T).name() << " with InputTag= "<< t.encode(); return got; }
void MixingWorker::copyPCrossingFrame | ( | const PCrossingFrame< T > * | PCF | ) | [virtual] |
Definition at line 183 of file MixingWorker.h.
References PCrossingFrame< T >::getBunchRange(), PCrossingFrame< T >::getBunchSpace(), PCrossingFrame< T >::getIdFirstPileup(), PCrossingFrame< T >::getMaxNbSources(), PCrossingFrame< T >::getPileupFileNr(), PCrossingFrame< T >::getPileupOffsetsBcr(), PCrossingFrame< T >::getPileupOffsetsSource(), PCrossingFrame< T >::getPileups(), and PCrossingFrame< T >::getSubDet().
{ crFrame_->setBunchRange(PCF->getBunchRange()); crFrame_->setBunchSpace(PCF->getBunchSpace()); crFrame_->setMaxNbSources(PCF->getMaxNbSources()); crFrame_->setSubDet(PCF->getSubDet()); crFrame_->setPileupOffsetsBcr(PCF->getPileupOffsetsBcr()); crFrame_->setPileupOffsetsSource(PCF->getPileupOffsetsSource()); crFrame_->setPileups(PCF->getPileups()); // For playback option crFrame_->setPileupFileNr(PCF->getPileupFileNr()); crFrame_->setIdFirstPileup(PCF->getIdFirstPileup()); }
virtual void edm::MixingWorker< T >::createnewEDProduct | ( | ) | [inline, virtual] |
Implements edm::MixingWorkerBase.
Definition at line 90 of file MixingWorker.h.
References edm::MixingWorkerBase::bunchSpace_, edm::MixingWorker< T >::crFrame_, edm::MixingWorkerBase::maxBunch_, edm::MixingWorkerBase::maxNbSources_, edm::MixingWorkerBase::minBunch_, and edm::MixingWorkerBase::subdet_.
virtual void edm::MixingWorker< T >::put | ( | edm::Event & | e | ) | [inline, virtual] |
Implements edm::MixingWorkerBase.
Definition at line 56 of file MixingWorker.h.
References edm::MixingWorker< T >::crFrame_, edm::MixingWorkerBase::label_, edm::MixingWorkerBase::labelCF_, LogDebug, edm::MixingWorker< T >::mixProdStep2_, AlCaRecoCosmics_cfg::name, and edm::Event::put().
{ std::auto_ptr<CrossingFrame<T> > pOut(crFrame_); if (!mixProdStep2_){ e.put(pOut,label_); LogDebug("MixingModule") <<" CF was put for type "<<typeid(T).name()<<" with "<<label_; } else { e.put(pOut,labelCF_); LogDebug("MixingModule") <<" CF was put for type "<<typeid(T).name()<<" with "<<labelCF_; } }
virtual void edm::MixingWorker< T >::setBcrOffset | ( | ) | [inline, virtual] |
Implements edm::MixingWorkerBase.
Definition at line 94 of file MixingWorker.h.
References edm::MixingWorker< T >::crFrame_.
{crFrame_->setBcrOffset();}
virtual void edm::MixingWorker< T >::setSourceOffset | ( | const unsigned int | s | ) | [inline, virtual] |
Implements edm::MixingWorkerBase.
Definition at line 95 of file MixingWorker.h.
References edm::MixingWorker< T >::crFrame_.
void MixingWorker::setTof | ( | ) | [virtual] |
CrossingFrame<T>* edm::MixingWorker< T >::crFrame_ [private] |
Definition at line 128 of file MixingWorker.h.
Referenced by edm::MixingWorker< T >::addSignals(), edm::MixingWorker< T >::createnewEDProduct(), edm::MixingWorker< T >::put(), edm::MixingWorker< T >::setBcrOffset(), and edm::MixingWorker< T >::setSourceOffset().
bool edm::MixingWorker< T >::mixProdStep2_ [private] |
Reimplemented from edm::MixingWorkerBase.
Definition at line 131 of file MixingWorker.h.
Referenced by edm::MixingWorker< T >::addSignals(), edm::MixingWorker< T >::checkSignal(), edm::MixingWorker< T >::MixingWorker(), and edm::MixingWorker< T >::put().
PCrossingFrame<T>* edm::MixingWorker< T >::secSourceCF_ [private] |
Definition at line 129 of file MixingWorker.h.