CMS 3D CMS Logo

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 (const edm::EventSetup &setup) 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 40 of file MixingWorker.h.

Constructor & Destructor Documentation

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

standard constructor

Definition at line 43 of file MixingWorker.h.

44  : minBunch_(-5),
45  maxBunch_(3),
46  bunchSpace_(75),
47  subdet_(std::string(" ")),
48  label_(std::string(" ")),
49  labelCF_(std::string(" ")),
50  maxNbSources_(5),
51  makePCrossingFrame_(false),
52  tag_(),
53  tagSignal_(),
54  allTags_(),
55  crFrame_(nullptr) {}
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
bool const makePCrossingFrame_
Definition: MixingWorker.h:178
std::string const labelCF_
Definition: MixingWorker.h:176
std::vector< InputTag > allTags_
Definition: MixingWorker.h:181
std::string const label_
Definition: MixingWorker.h:175
std::string const subdet_
Definition: MixingWorker.h:174
unsigned int const maxNbSources_
Definition: MixingWorker.h:177
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 58 of file MixingWorker.h.

68  : MixingWorkerBase(),
71  bunchSpace_(bunchSpace),
72  subdet_(subdet),
73  label_(label),
74  labelCF_(labelCF),
75  maxNbSources_(maxNbSources),
76  makePCrossingFrame_(makePCrossingFrame),
77  tag_(tag),
78  tagSignal_(tagCF),
79  allTags_(),
80  crFrame_(nullptr) {}
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
bool const makePCrossingFrame_
Definition: MixingWorker.h:178
std::string const labelCF_
Definition: MixingWorker.h:176
char const * label
std::vector< InputTag > allTags_
Definition: MixingWorker.h:181
std::string const label_
Definition: MixingWorker.h:175
std::string const subdet_
Definition: MixingWorker.h:174
unsigned int const maxNbSources_
Definition: MixingWorker.h:177
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 83 of file MixingWorker.h.

93  : MixingWorkerBase(),
96  bunchSpace_(bunchSpace),
97  subdet_(subdet),
98  label_(label),
99  labelCF_(labelCF),
100  maxNbSources_(maxNbSources),
101  makePCrossingFrame_(false),
102  tag_(tag),
103  tagSignal_(tagCF),
104  allTags_(tags),
105  crFrame_(nullptr) {}
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
bool const makePCrossingFrame_
Definition: MixingWorker.h:178
std::string const labelCF_
Definition: MixingWorker.h:176
char const * label
std::vector< InputTag > allTags_
Definition: MixingWorker.h:181
std::string const label_
Definition: MixingWorker.h:175
std::string const subdet_
Definition: MixingWorker.h:174
unsigned int const maxNbSources_
Definition: MixingWorker.h:177
template<class T >
edm::MixingWorker< T >::~MixingWorker ( )
inlineoverride

Default destructor

Definition at line 108 of file MixingWorker.h.

108 { ; }

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

References edm::MixingWorker< T >::crFrame_, SiStripBadComponentsDQMServiceTemplate_cfg::ep, LogDebug, and edm::MixingWorker< T >::tag_.

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

187  {
188  std::shared_ptr<Wrapper<std::vector<T> > const> shPtr = getProductByTag<std::vector<T> >(ep, tag_, mcc);
189  if (shPtr) {
190  LogDebug("MixingModule") << shPtr->product()->size() << " pileup objects added, eventNr " << eventNr;
191  crFrame_->setPileupPtr(shPtr);
192  crFrame_->addPileups(*shPtr->product());
193  }
194  }
#define LogDebug(id)
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
template<class T >
void edm::MixingWorker< T >::addSignals ( const edm::Event e)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 139 of file MixingWorker.h.

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

139  {
140  edm::Handle<std::vector<T> > result_t;
141  bool got = e.getByLabel(tag_, result_t);
142  if (got) {
143  LogDebug("MixingModule") << " adding " << result_t.product()->size() << " signal objects for "
144  << typeid(T).name() << " with " << tag_;
145  crFrame_->addSignals(result_t.product(), e.id());
146  } else {
147  LogInfo("MixingModule") << "!!!!!!! Did not get any signal data for " << typeid(T).name() << ", with " << tag_;
148  }
149  }
#define LogDebug(id)
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
T const * product() const
Definition: Handle.h:69
edm::EventID id() const
Definition: EventBase.h:59
long double T
template<class T >
bool edm::MixingWorker< T >::checkSignal ( const edm::Event e)
inlineoverridevirtual

Steps in BMixingModule::produce

Implements edm::MixingWorkerBase.

Definition at line 121 of file MixingWorker.h.

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

121  {
122  bool got;
123  InputTag t;
124  edm::Handle<std::vector<T> > result_t;
125  got = e.getByLabel(tag_, result_t);
126  t = InputTag(tag_.label(), tag_.instance());
127 
128  if (got)
129  LogInfo("MixingModule") << " Will create a CrossingFrame for " << typeid(T).name()
130  << " with InputTag= " << t.encode();
131 
132  return got;
133  }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
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 208 of file MixingWorker.h.

References edm::MixingWorker< T >::crFrame_, 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().

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

208  {
209  crFrame_->setBunchRange(PCF->getBunchRange());
210  crFrame_->setBunchSpace(PCF->getBunchSpace());
211  crFrame_->setMaxNbSources(PCF->getMaxNbSources());
212  crFrame_->setSubDet(PCF->getSubDet());
213  crFrame_->setPileupOffsetsBcr(PCF->getPileupOffsetsBcr());
214  crFrame_->setPileupOffsetsSource(PCF->getPileupOffsetsSource());
215  crFrame_->setPileups(PCF->getPileups());
216 
217  // For playback option
218  crFrame_->setPileupFileNr(PCF->getPileupFileNr());
219  crFrame_->setIdFirstPileup(PCF->getIdFirstPileup());
220  }
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
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 158 of file MixingWorker.h.

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

158  {
159  if (makePCrossingFrame_) {
160  e.put(std::make_unique<PCrossingFrame<T> >(*crFrame_), label_);
161  }
163  LogDebug("MixingModule") << " CF was put for type " << typeid(T).name() << " with " << label_;
164  }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
bool const makePCrossingFrame_
Definition: MixingWorker.h:178
std::string const label_
Definition: MixingWorker.h:175
long double T
def move(src, dest)
Definition: eostools.py:511
template<class T >
void edm::MixingWorker< T >::reload ( const edm::EventSetup setup)
inlineoverridevirtual

Reimplemented from edm::MixingWorkerBase.

Definition at line 111 of file MixingWorker.h.

References MixingModuleConfig::bunchSpace(), edm::MixingWorker< T >::bunchSpace_, looper::config, edm::EventSetup::get(), MixingModuleConfig::maxBunch(), edm::MixingWorker< T >::maxBunch_, MixingModuleConfig::minBunch(), and edm::MixingWorker< T >::minBunch_.

111  {
112  //get the required parameters from DB.
113  // watch the label/tag
115  setup.get<MixingRcd>().get(config);
116  minBunch_ = config->minBunch();
117  maxBunch_ = config->maxBunch();
118  bunchSpace_ = config->bunchSpace();
119  }
const int & bunchSpace() const
const int & maxBunch() const
config
Definition: looper.py:291
T get() const
Definition: EventSetup.h:73
const int & minBunch() const
template<class T >
void edm::MixingWorker< T >::setBcrOffset ( )
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 153 of file MixingWorker.h.

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

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

Implements edm::MixingWorkerBase.

Definition at line 154 of file MixingWorker.h.

References edm::MixingWorker< T >::crFrame_, and edm::MixingWorker< T >::setTof().

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

Implements edm::MixingWorkerBase.

Definition at line 203 of file MixingWorker.h.

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

203  {
204  ;
205  }

Member Data Documentation

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

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

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

Definition at line 178 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 177 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 174 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 180 of file MixingWorker.h.