CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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

void addPileups (const EventPrincipal &ep, ModuleCallingContext const *, unsigned int eventNr) override
 
void addSignals (const edm::Event &e) override
 
bool checkSignal (const edm::Event &e) override
 
virtual void copyPCrossingFrame (const PCrossingFrame< T > *PCF)
 
void createnewEDProduct () override
 
 MixingWorker ()
 
 MixingWorker (int minBunch, int maxBunch, int bunchSpace, std::string subdet, std::string label, std::string labelCF, int maxNbSources, InputTag &tag, InputTag &tagCF, bool makePCrossingFrame=false)
 
 MixingWorker (int minBunch, int maxBunch, int bunchSpace, std::string subdet, std::string label, std::string labelCF, int maxNbSources, InputTag &tag, InputTag &tagCF, std::vector< InputTag > const &tags)
 
void put (edm::Event &e) override
 
void reload (int minBunch, int maxBunch, int bunchSpace) override
 
void setBcrOffset () override
 
void setSourceOffset (const unsigned int s) override
 
void setTof () override
 
 ~MixingWorker () override
 
- Public Member Functions inherited from edm::MixingWorkerBase
 MixingWorkerBase ()
 
virtual ~MixingWorkerBase ()
 

Private Attributes

std::vector< InputTagallTags_
 
int bunchSpace_
 
std::unique_ptr< CrossingFrame
< T > > 
crFrame_
 
std::string const label_
 
std::string const labelCF_
 
bool const makePCrossingFrame_
 
int maxBunch_
 
unsigned int const maxNbSources_
 
int minBunch_
 
std::string const subdet_
 
InputTag tag_
 
InputTag tagSignal_
 

Detailed Description

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

Definition at line 37 of file MixingWorker.h.

Constructor & Destructor Documentation

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

standard constructor

Definition at line 40 of file MixingWorker.h.

41  : minBunch_(-5),
42  maxBunch_(3),
43  bunchSpace_(75),
44  subdet_(std::string(" ")),
45  label_(std::string(" ")),
46  labelCF_(std::string(" ")),
47  maxNbSources_(5),
48  makePCrossingFrame_(false),
49  tag_(),
50  tagSignal_(),
51  allTags_(),
52  crFrame_(nullptr) {}
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
bool const makePCrossingFrame_
Definition: MixingWorker.h:171
std::string const labelCF_
Definition: MixingWorker.h:169
std::vector< InputTag > allTags_
Definition: MixingWorker.h:174
std::string const label_
Definition: MixingWorker.h:168
std::string const subdet_
Definition: MixingWorker.h:167
unsigned int const maxNbSources_
Definition: MixingWorker.h:170
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,
bool  makePCrossingFrame = false 
)
inline

Definition at line 55 of file MixingWorker.h.

65  : MixingWorkerBase(),
68  bunchSpace_(bunchSpace),
69  subdet_(subdet),
70  label_(label),
71  labelCF_(labelCF),
72  maxNbSources_(maxNbSources),
73  makePCrossingFrame_(makePCrossingFrame),
74  tag_(tag),
75  tagSignal_(tagCF),
76  allTags_(),
77  crFrame_(nullptr) {}
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
bool const makePCrossingFrame_
Definition: MixingWorker.h:171
std::string const labelCF_
Definition: MixingWorker.h:169
char const * label
std::vector< InputTag > allTags_
Definition: MixingWorker.h:174
std::string const label_
Definition: MixingWorker.h:168
std::string const subdet_
Definition: MixingWorker.h:167
unsigned int const maxNbSources_
Definition: MixingWorker.h:170
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,
std::vector< InputTag > const &  tags 
)
inline

Definition at line 80 of file MixingWorker.h.

90  : MixingWorkerBase(),
93  bunchSpace_(bunchSpace),
94  subdet_(subdet),
95  label_(label),
96  labelCF_(labelCF),
97  maxNbSources_(maxNbSources),
98  makePCrossingFrame_(false),
99  tag_(tag),
100  tagSignal_(tagCF),
101  allTags_(tags),
102  crFrame_(nullptr) {}
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
bool const makePCrossingFrame_
Definition: MixingWorker.h:171
std::string const labelCF_
Definition: MixingWorker.h:169
char const * label
std::vector< InputTag > allTags_
Definition: MixingWorker.h:174
std::string const label_
Definition: MixingWorker.h:168
std::string const subdet_
Definition: MixingWorker.h:167
unsigned int const maxNbSources_
Definition: MixingWorker.h:170
template<class T >
edm::MixingWorker< T >::~MixingWorker ( )
inlineoverride

Default destructor

Definition at line 105 of file MixingWorker.h.

105 { ; }

Member Function Documentation

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

Implements edm::MixingWorkerBase.

Definition at line 180 of file MixingWorker.h.

References LogDebug.

180  {
181  std::shared_ptr<Wrapper<std::vector<T> > const> shPtr = getProductByTag<std::vector<T> >(ep, tag_, mcc);
182  if (shPtr) {
183  LogDebug("MixingModule") << shPtr->product()->size() << " pileup objects added, eventNr " << eventNr;
184  crFrame_->setPileupPtr(shPtr);
185  crFrame_->addPileups(*shPtr->product());
186  }
187  }
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
#define LogDebug(id)
template<class T >
void edm::MixingWorker< T >::addSignals ( const edm::Event e)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

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

132  {
133  edm::Handle<std::vector<T> > result_t;
134  bool got = e.getByLabel(tag_, result_t);
135  if (got) {
136  LogDebug("MixingModule") << " adding " << result_t.product()->size() << " signal objects for "
137  << typeid(T).name() << " with " << tag_;
138  crFrame_->addSignals(result_t.product(), e.id());
139  } else {
140  LogInfo("MixingModule") << "!!!!!!! Did not get any signal data for " << typeid(T).name() << ", with " << tag_;
141  }
142  }
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
Log< level::Info, false > LogInfo
T const * product() const
Definition: Handle.h:70
edm::EventID id() const
Definition: EventBase.h:59
long double T
#define LogDebug(id)
template<class T >
bool edm::MixingWorker< T >::checkSignal ( const edm::Event e)
inlineoverridevirtual

Steps in BMixingModule::produce

Implements edm::MixingWorkerBase.

Definition at line 114 of file MixingWorker.h.

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

114  {
115  bool got;
116  InputTag t;
117  edm::Handle<std::vector<T> > result_t;
118  got = e.getByLabel(tag_, result_t);
119  t = InputTag(tag_.label(), tag_.instance());
120 
121  if (got)
122  LogInfo("MixingModule") << " Will create a CrossingFrame for " << typeid(T).name()
123  << " with InputTag= " << t.encode();
124 
125  return got;
126  }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
Log< level::Info, false > LogInfo
std::string const & label() const
Definition: InputTag.h:36
long double T
std::string const & instance() const
Definition: InputTag.h:37
template<class T >
void MixingWorker::copyPCrossingFrame ( const PCrossingFrame< T > *  PCF)
virtual

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

201  {
202  crFrame_->setBunchRange(PCF->getBunchRange());
203  crFrame_->setBunchSpace(PCF->getBunchSpace());
204  crFrame_->setMaxNbSources(PCF->getMaxNbSources());
205  crFrame_->setSubDet(PCF->getSubDet());
206  crFrame_->setPileupOffsetsBcr(PCF->getPileupOffsetsBcr());
207  crFrame_->setPileupOffsetsSource(PCF->getPileupOffsetsSource());
208  crFrame_->setPileups(PCF->getPileups());
209 
210  // For playback option
211  crFrame_->setPileupFileNr(PCF->getPileupFileNr());
212  crFrame_->setIdFirstPileup(PCF->getIdFirstPileup());
213  }
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
int getBunchSpace() const
unsigned int getPileupFileNr() const
std::vector< const T * > getPileups() const
edm::EventID getIdFirstPileup() const
std::string getSubDet() const
unsigned int getMaxNbSources() const
std::pair< int, int > getBunchRange() const
const std::vector< unsigned int > & getPileupOffsetsBcr() const
template<class T >
void edm::MixingWorker< T >::createnewEDProduct ( )
inlineoverridevirtual
template<class T >
void edm::MixingWorker< T >::put ( edm::Event e)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 151 of file MixingWorker.h.

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

151  {
152  if (makePCrossingFrame_) {
153  e.put(std::make_unique<PCrossingFrame<T> >(*crFrame_), label_);
154  }
156  LogDebug("MixingModule") << " CF was put for type " << typeid(T).name() << " with " << label_;
157  }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
bool const makePCrossingFrame_
Definition: MixingWorker.h:171
def move
Definition: eostools.py:511
std::string const label_
Definition: MixingWorker.h:168
long double T
#define LogDebug(id)
template<class T >
void edm::MixingWorker< T >::reload ( int  minBunch,
int  maxBunch,
int  bunchSpace 
)
inlineoverridevirtual
template<class T >
void edm::MixingWorker< T >::setBcrOffset ( )
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 146 of file MixingWorker.h.

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

146 { crFrame_->setBcrOffset(); }
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
template<class T >
void edm::MixingWorker< T >::setSourceOffset ( const unsigned int  s)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 147 of file MixingWorker.h.

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

147 { crFrame_->setSourceOffset(s); }
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
template<class T >
void MixingWorker::setTof ( )
overridevirtual

Implements edm::MixingWorkerBase.

Definition at line 196 of file MixingWorker.h.

196  {
197  ;
198  }

Member Data Documentation

template<class T >
std::vector<InputTag> edm::MixingWorker< T >::allTags_
private

Definition at line 174 of file MixingWorker.h.

template<class T >
int edm::MixingWorker< T >::bunchSpace_
private
template<class T >
std::unique_ptr<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 169 of file MixingWorker.h.

template<class T >
bool const edm::MixingWorker< T >::makePCrossingFrame_
private

Definition at line 171 of file MixingWorker.h.

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

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

Definition at line 170 of file MixingWorker.h.

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

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

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