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 41 of file MixingWorker.h.

Constructor & Destructor Documentation

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

standard constructor

Definition at line 46 of file MixingWorker.h.

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

46  :
47  minBunch_(-5),
48  maxBunch_(3),
49  bunchSpace_(75),
50  subdet_(std::string(" ")),
51  label_(std::string(" ")),
52  labelCF_(std::string(" ")),
53  maxNbSources_(5) {
54  tag_=InputTag();
56  }
std::string const labelCF_
Definition: MixingWorker.h:145
std::string const label_
Definition: MixingWorker.h:144
std::string const subdet_
Definition: MixingWorker.h:143
unsigned int const maxNbSources_
Definition: MixingWorker.h:146
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 59 of file MixingWorker.h.

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

Default destructor

Definition at line 77 of file MixingWorker.h.

77 {;}

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 155 of file MixingWorker.h.

References LogDebug.

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

Implements edm::MixingWorkerBase.

Definition at line 110 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_.

110  {
111  edm::Handle<std::vector<T> > result_t;
112  bool got = e.getByLabel(tag_,result_t);
113  if (got) {
114  LogDebug("MixingModule") <<" adding " << result_t.product()->size()<<" signal objects for "<<typeid(T).name()<<" with "<<tag_;
115  crFrame_->addSignals(result_t.product(),e.id());
116  } else {
117  LogInfo("MixingModule") <<"!!!!!!! Did not get any signal data for "<<typeid(T).name()<<", with "<<tag_;
118  }
119  }
#define LogDebug(id)
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:150
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:413
T const * product() const
Definition: Handle.h:81
edm::EventID id() const
Definition: EventBase.h:60
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 91 of file MixingWorker.h.

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

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

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

173  {
174  crFrame_->setBunchRange(PCF->getBunchRange());
175  crFrame_->setBunchSpace(PCF->getBunchSpace());
176  crFrame_->setMaxNbSources(PCF->getMaxNbSources());
177  crFrame_->setSubDet(PCF->getSubDet());
178  crFrame_->setPileupOffsetsBcr(PCF->getPileupOffsetsBcr());
179  crFrame_->setPileupOffsetsSource(PCF->getPileupOffsetsSource());
180  crFrame_->setPileups(PCF->getPileups());
181 
182  // For playback option
183  crFrame_->setPileupFileNr(PCF->getPileupFileNr());
184  crFrame_->setIdFirstPileup(PCF->getIdFirstPileup());
185  }
int getBunchSpace() const
unsigned int getPileupFileNr() const
edm::EventID getIdFirstPileup() const
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:150
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 128 of file MixingWorker.h.

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

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

Reimplemented from edm::MixingWorkerBase.

Definition at line 81 of file MixingWorker.h.

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

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

Implements edm::MixingWorkerBase.

Definition at line 123 of file MixingWorker.h.

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

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

Implements edm::MixingWorkerBase.

Definition at line 124 of file MixingWorker.h.

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

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

Implements edm::MixingWorkerBase.

Definition at line 169 of file MixingWorker.h.

169 {;}

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 145 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 146 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 151 of file MixingWorker.h.

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

Definition at line 143 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 148 of file MixingWorker.h.

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