CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
edm::MixingWorker< T > Class Template Reference

#include <MixingWorker.h>

Inheritance diagram for edm::MixingWorker< T >:
edm::MixingWorkerBase

Public Member Functions

virtual void addPileups (const EventPrincipal &ep, ModuleCallingContext const *, unsigned int eventNr)
 
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 ()
 
 MixingWorker (int minBunch, int maxBunch, int bunchSpace, std::string subdet, std::string label, std::string labelCF, int maxNbSources, InputTag &tag, InputTag &tagCF)
 
virtual void put (edm::Event &e)
 
virtual void reload (const edm::EventSetup &setup)
 
virtual void setBcrOffset ()
 
virtual void setSourceOffset (const unsigned int s)
 
void setTof ()
 
virtual ~MixingWorker ()
 
- Public Member Functions inherited from edm::MixingWorkerBase
 MixingWorkerBase ()
 
virtual ~MixingWorkerBase ()
 

Private Attributes

int bunchSpace_
 
CrossingFrame< T > * crFrame_
 
std::string const label_
 
std::string const labelCF_
 
int maxBunch_
 
unsigned int const maxNbSources_
 
int minBunch_
 
PCrossingFrame< T > * secSourceCF_
 
std::string const subdet_
 
InputTag tag_
 
InputTag tagSignal_
 

Detailed Description

template<class T>
class edm::MixingWorker< T >

Definition at line 40 of file MixingWorker.h.

Constructor & Destructor Documentation

template<class T >
edm::MixingWorker< T >::MixingWorker ( )
inlineexplicit

standard constructor

Definition at line 45 of file MixingWorker.h.

References edm::MixingWorker< T >::tag_, and edm::MixingWorker< T >::tagSignal_.

45  :
46  minBunch_(-5),
47  maxBunch_(3),
48  bunchSpace_(75),
49  subdet_(std::string(" ")),
50  label_(std::string(" ")),
51  labelCF_(std::string(" ")),
52  maxNbSources_(5) {
53  tag_=InputTag();
54  tagSignal_=InputTag();
55  }
std::string const labelCF_
Definition: MixingWorker.h:144
std::string const label_
Definition: MixingWorker.h:143
std::string const subdet_
Definition: MixingWorker.h:142
unsigned int const maxNbSources_
Definition: MixingWorker.h:145
template<class T >
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 
)
inline

Definition at line 58 of file MixingWorker.h.

61  :
63  minBunch_(minBunch),
64  maxBunch_(maxBunch),
65  bunchSpace_(bunchSpace),
66  subdet_(subdet),
67  label_(label),
68  labelCF_(labelCF),
69  maxNbSources_(maxNbSources),
70  tag_(tag),
71  tagSignal_(tagCF)
72  {
73  }
std::string const labelCF_
Definition: MixingWorker.h:144
std::string const label_
Definition: MixingWorker.h:143
std::string const subdet_
Definition: MixingWorker.h:142
unsigned int const maxNbSources_
Definition: MixingWorker.h:145
template<class T >
virtual edm::MixingWorker< T >::~MixingWorker ( )
inlinevirtual

Default destructor

Definition at line 76 of file MixingWorker.h.

76 {;}

Member Function Documentation

template<typename T >
void MixingWorker::addPileups ( const EventPrincipal ep,
ModuleCallingContext const *  mcc,
unsigned int  eventNr 
)
virtual

Implements edm::MixingWorkerBase.

Definition at line 154 of file MixingWorker.h.

References LogDebug.

154  {
155  boost::shared_ptr<Wrapper<std::vector<T> > const> shPtr = getProductByTag<std::vector<T> >(ep, tag_, mcc);
156  if (shPtr) {
157  LogDebug("MixingModule") << shPtr->product()->size() << " pileup objects added, eventNr " << eventNr;
158  crFrame_->setPileupPtr(shPtr);
159  crFrame_->addPileups(*shPtr->product());
160  }
161  }
#define LogDebug(id)
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:149
template<class T >
virtual void edm::MixingWorker< T >::addSignals ( const edm::Event e)
inlinevirtual

Implements edm::MixingWorkerBase.

Definition at line 109 of file MixingWorker.h.

References edm::MixingWorker< T >::crFrame_, edm::Event::getByLabel(), edm::EventBase::id(), LogDebug, mergeVDriftHistosByStation::name, edm::Handle< T >::product(), and edm::MixingWorker< T >::tag_.

109  {
110  edm::Handle<std::vector<T> > result_t;
111  bool got = e.getByLabel(tag_,result_t);
112  if (got) {
113  LogDebug("MixingModule") <<" adding " << result_t.product()->size()<<" signal objects for "<<typeid(T).name()<<" with "<<tag_;
114  crFrame_->addSignals(result_t.product(),e.id());
115  } else {
116  LogInfo("MixingModule") <<"!!!!!!! Did not get any signal data for "<<typeid(T).name()<<", with "<<tag_;
117  }
118  }
#define LogDebug(id)
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:149
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
T const * product() const
Definition: Handle.h:81
edm::EventID id() const
Definition: EventBase.h:56
long double T
template<class T >
virtual bool edm::MixingWorker< T >::checkSignal ( const edm::Event e)
inlinevirtual

Steps in BMixingModule::produce

Implements edm::MixingWorkerBase.

Definition at line 90 of file MixingWorker.h.

References edm::InputTag::encode(), edm::Event::getByLabel(), edm::InputTag::instance(), edm::InputTag::label(), mergeVDriftHistosByStation::name, lumiQTWidget::t, and edm::MixingWorker< T >::tag_.

90  {
91  bool got;
92  InputTag t;
93  edm::Handle<std::vector<T> > result_t;
94  got = e.getByLabel(tag_,result_t);
95  t = InputTag(tag_.label(),tag_.instance());
96 
97  if (got)
98  LogInfo("MixingModule") <<" Will create a CrossingFrame for "<< typeid(T).name()
99  << " with InputTag= "<< t.encode();
100 
101  return got;
102  }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
std::string const & label() const
Definition: InputTag.h:42
long double T
std::string const & instance() const
Definition: InputTag.h:43
template<class T >
void MixingWorker::copyPCrossingFrame ( const PCrossingFrame< T > *  PCF)
virtual

Definition at line 171 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().

172  {
173  crFrame_->setBunchRange(PCF->getBunchRange());
174  crFrame_->setBunchSpace(PCF->getBunchSpace());
175  crFrame_->setMaxNbSources(PCF->getMaxNbSources());
176  crFrame_->setSubDet(PCF->getSubDet());
177  crFrame_->setPileupOffsetsBcr(PCF->getPileupOffsetsBcr());
178  crFrame_->setPileupOffsetsSource(PCF->getPileupOffsetsSource());
179  crFrame_->setPileups(PCF->getPileups());
180 
181  // For playback option
182  crFrame_->setPileupFileNr(PCF->getPileupFileNr());
183  crFrame_->setIdFirstPileup(PCF->getIdFirstPileup());
184  }
int getBunchSpace() const
unsigned int getPileupFileNr() const
edm::EventID getIdFirstPileup() const
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:149
std::string getSubDet() const
unsigned int getMaxNbSources() const
std::pair< int, int > getBunchRange() const
std::vector< unsigned int > getPileupOffsetsBcr() const
std::vector< const T * > getPileups() const
std::vector< std::vector< unsigned int > > getPileupOffsetsSource() const
template<class T >
virtual void edm::MixingWorker< T >::createnewEDProduct ( )
inlinevirtual
template<class T >
virtual void edm::MixingWorker< T >::put ( edm::Event e)
inlinevirtual

Implements edm::MixingWorkerBase.

Definition at line 127 of file MixingWorker.h.

References edm::MixingWorker< T >::crFrame_, edm::MixingWorker< T >::label_, LogDebug, mergeVDriftHistosByStation::name, and edm::Event::put().

127  {
128  std::auto_ptr<CrossingFrame<T> > pOut(crFrame_);
129  e.put(pOut,label_);
130  LogDebug("MixingModule") <<" CF was put for type "<<typeid(T).name()<<" with "<<label_;
131  }
#define LogDebug(id)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:149
std::string const label_
Definition: MixingWorker.h:143
long double T
template<class T >
virtual void edm::MixingWorker< T >::reload ( const edm::EventSetup setup)
inlinevirtual

Reimplemented from edm::MixingWorkerBase.

Definition at line 80 of file MixingWorker.h.

References edm::MixingWorker< T >::bunchSpace_, HDQMDatabaseProducer::config, edm::EventSetup::get(), edm::MixingWorker< T >::maxBunch_, and edm::MixingWorker< T >::minBunch_.

80  {
81  //get the required parameters from DB.
82  // watch the label/tag
84  setup.get<MixingRcd>().get(config);
85  minBunch_=config->minBunch();
86  maxBunch_=config->maxBunch();
87  bunchSpace_=config->bunchSpace();
88  }
const T & get() const
Definition: EventSetup.h:55
template<class T >
virtual void edm::MixingWorker< T >::setBcrOffset ( )
inlinevirtual

Implements edm::MixingWorkerBase.

Definition at line 122 of file MixingWorker.h.

References edm::MixingWorker< T >::crFrame_.

122 {crFrame_->setBcrOffset();}
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:149
template<class T >
virtual void edm::MixingWorker< T >::setSourceOffset ( const unsigned int  s)
inlinevirtual

Implements edm::MixingWorkerBase.

Definition at line 123 of file MixingWorker.h.

References edm::MixingWorker< T >::crFrame_.

123 {crFrame_->setSourceOffset(s);}
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:149
template<class T >
void MixingWorker::setTof ( )
virtual

Implements edm::MixingWorkerBase.

Definition at line 168 of file MixingWorker.h.

168 {;}

Member Data Documentation

template<class T >
int edm::MixingWorker< T >::bunchSpace_
private
template<class T >
CrossingFrame<T>* edm::MixingWorker< T >::crFrame_
private
template<class T >
std::string const edm::MixingWorker< T >::label_
private
template<class T >
std::string const edm::MixingWorker< T >::labelCF_
private

Definition at line 144 of file MixingWorker.h.

template<class T >
int edm::MixingWorker< T >::maxBunch_
private
template<class T >
unsigned int const edm::MixingWorker< T >::maxNbSources_
private

Definition at line 145 of file MixingWorker.h.

Referenced by edm::MixingWorker< T >::createnewEDProduct().

template<class T >
int edm::MixingWorker< T >::minBunch_
private
template<class T >
PCrossingFrame<T>* edm::MixingWorker< T >::secSourceCF_
private

Definition at line 150 of file MixingWorker.h.

template<class T >
std::string const edm::MixingWorker< T >::subdet_
private

Definition at line 142 of file MixingWorker.h.

Referenced by edm::MixingWorker< T >::createnewEDProduct().

template<class T >
InputTag edm::MixingWorker< T >::tag_
private
template<class T >
InputTag edm::MixingWorker< T >::tagSignal_
private

Definition at line 147 of file MixingWorker.h.

Referenced by edm::MixingWorker< T >::MixingWorker().