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_
 
const std::string label_
 
const std::string labelCF_
 
const bool makePCrossingFrame_
 
int maxBunch_
 
unsigned const int maxNbSources_
 
int minBunch_
 
const std::string 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

◆ MixingWorker() [1/3]

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) {}

◆ MixingWorker() [2/3]

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) {}

◆ MixingWorker() [3/3]

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) {}

◆ ~MixingWorker()

template<class T >
edm::MixingWorker< T >::~MixingWorker ( )
inlineoverride

Default destructor

Definition at line 108 of file MixingWorker.h.

108 { ; }

Member Function Documentation

◆ addPileups()

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

Implements edm::MixingWorkerBase.

Definition at line 188 of file MixingWorker.h.

188  {
189  std::shared_ptr<Wrapper<std::vector<T> > const> shPtr = getProductByTag<std::vector<T> >(ep, tag_, mcc);
190  if (shPtr) {
191  LogDebug("MixingModule") << shPtr->product()->size() << " pileup objects added, eventNr " << eventNr;
192  crFrame_->setPileupPtr(shPtr);
193  crFrame_->addPileups(*shPtr->product());
194  }
195  }

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, and LogDebug.

◆ addSignals()

template<class T >
void edm::MixingWorker< T >::addSignals ( const edm::Event e)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 140 of file MixingWorker.h.

140  {
141  edm::Handle<std::vector<T> > result_t;
142  bool got = e.getByLabel(tag_, result_t);
143  if (got) {
144  LogDebug("MixingModule") << " adding " << result_t.product()->size() << " signal objects for "
145  << typeid(T).name() << " with " << tag_;
146  crFrame_->addSignals(result_t.product(), e.id());
147  } else {
148  LogInfo("MixingModule") << "!!!!!!! Did not get any signal data for " << typeid(T).name() << ", with " << tag_;
149  }
150  }

References edm::MixingWorker< T >::crFrame_, MillePedeFileConverter_cfg::e, LogDebug, Skims_PA_cff::name, edm::Handle< T >::product(), and edm::MixingWorker< T >::tag_.

◆ checkSignal()

template<class T >
bool edm::MixingWorker< T >::checkSignal ( const edm::Event e)
inlineoverridevirtual

Steps in BMixingModule::produce

Implements edm::MixingWorkerBase.

Definition at line 122 of file MixingWorker.h.

122  {
123  bool got;
124  InputTag t;
125  edm::Handle<std::vector<T> > result_t;
126  got = e.getByLabel(tag_, result_t);
127  t = InputTag(tag_.label(), tag_.instance());
128 
129  if (got)
130  LogInfo("MixingModule") << " Will create a CrossingFrame for " << typeid(T).name()
131  << " with InputTag= " << t.encode();
132 
133  return got;
134  }

References MillePedeFileConverter_cfg::e, HLT_FULL_cff::InputTag, edm::InputTag::instance(), edm::InputTag::label(), Skims_PA_cff::name, submitPVValidationJobs::t, and edm::MixingWorker< T >::tag_.

◆ copyPCrossingFrame()

template<class T >
void MixingWorker::copyPCrossingFrame ( const PCrossingFrame< T > *  PCF)
virtual

Definition at line 209 of file MixingWorker.h.

209  {
210  crFrame_->setBunchRange(PCF->getBunchRange());
211  crFrame_->setBunchSpace(PCF->getBunchSpace());
212  crFrame_->setMaxNbSources(PCF->getMaxNbSources());
213  crFrame_->setSubDet(PCF->getSubDet());
214  crFrame_->setPileupOffsetsBcr(PCF->getPileupOffsetsBcr());
215  crFrame_->setPileupOffsetsSource(PCF->getPileupOffsetsSource());
216  crFrame_->setPileups(PCF->getPileups());
217 
218  // For playback option
219  crFrame_->setPileupFileNr(PCF->getPileupFileNr());
220  crFrame_->setIdFirstPileup(PCF->getIdFirstPileup());
221  }

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().

◆ createnewEDProduct()

template<class T >
void edm::MixingWorker< T >::createnewEDProduct ( )
inlineoverridevirtual

◆ put()

template<class T >
void edm::MixingWorker< T >::put ( edm::Event e)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 159 of file MixingWorker.h.

159  {
160  if (makePCrossingFrame_) {
161  e.put(std::make_unique<PCrossingFrame<T> >(*crFrame_), label_);
162  }
163  e.put(std::move(crFrame_), label_);
164  LogDebug("MixingModule") << " CF was put for type " << typeid(T).name() << " with " << label_;
165  }

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

◆ reload()

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.

111  {
112  // TODO for esConsumes migration: assume for now this function is mostly unused
113  //get the required parameters from DB.
114  // watch the label/tag
116  setup.get<MixingRcd>().get(config);
117  minBunch_ = config->minBunch();
118  maxBunch_ = config->maxBunch();
119  bunchSpace_ = config->bunchSpace();
120  }

References edm::MixingWorker< T >::bunchSpace_, submitPVResolutionJobs::config, edm::get(), edm::MixingWorker< T >::maxBunch_, edm::MixingWorker< T >::minBunch_, and singleTopDQM_cfi::setup.

◆ setBcrOffset()

template<class T >
void edm::MixingWorker< T >::setBcrOffset ( )
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 154 of file MixingWorker.h.

154 { crFrame_->setBcrOffset(); }

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

◆ setSourceOffset()

template<class T >
void edm::MixingWorker< T >::setSourceOffset ( const unsigned int  s)
inlineoverridevirtual

Implements edm::MixingWorkerBase.

Definition at line 155 of file MixingWorker.h.

155 { crFrame_->setSourceOffset(s); }

References edm::MixingWorker< T >::crFrame_, and alignCSCRings::s.

◆ setTof()

template<class T >
void MixingWorker::setTof ( )
overridevirtual

Implements edm::MixingWorkerBase.

Definition at line 204 of file MixingWorker.h.

204  {
205  ;
206  }

Member Data Documentation

◆ allTags_

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

Definition at line 182 of file MixingWorker.h.

◆ bunchSpace_

template<class T >
int edm::MixingWorker< T >::bunchSpace_
private

◆ crFrame_

template<class T >
std::unique_ptr<CrossingFrame<T> > edm::MixingWorker< T >::crFrame_
private

◆ label_

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

◆ labelCF_

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

Definition at line 177 of file MixingWorker.h.

◆ makePCrossingFrame_

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

Definition at line 179 of file MixingWorker.h.

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

◆ maxBunch_

template<class T >
int edm::MixingWorker< T >::maxBunch_
private

◆ maxNbSources_

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

Definition at line 178 of file MixingWorker.h.

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

◆ minBunch_

template<class T >
int edm::MixingWorker< T >::minBunch_
private

◆ subdet_

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

Definition at line 175 of file MixingWorker.h.

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

◆ tag_

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

◆ tagSignal_

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

Definition at line 181 of file MixingWorker.h.

edm::MixingWorkerBase::MixingWorkerBase
MixingWorkerBase()
Definition: MixingWorkerBase.h:31
MixingRcd
Definition: MixingRcd.h:24
PCrossingFrame::getBunchSpace
int getBunchSpace() const
Definition: PCrossingFrame.h:37
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
MixingModule_cfi.maxBunch
maxBunch
Definition: MixingModule_cfi.py:42
edm::MixingWorker::tag_
InputTag tag_
Definition: MixingWorker.h:180
edm::MixingWorker::tagSignal_
InputTag tagSignal_
Definition: MixingWorker.h:181
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
PCrossingFrame
Definition: CrossingFrame.h:27
edm::MixingWorker::maxBunch_
int maxBunch_
Definition: MixingWorker.h:173
edm::MixingWorker::labelCF_
const std::string labelCF_
Definition: MixingWorker.h:177
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PCrossingFrame::getMaxNbSources
unsigned int getMaxNbSources() const
Definition: PCrossingFrame.h:38
edm::MixingWorker::subdet_
const std::string subdet_
Definition: MixingWorker.h:175
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::MixingWorker::makePCrossingFrame_
const bool makePCrossingFrame_
Definition: MixingWorker.h:179
edm::MixingWorker::crFrame_
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:184
PCrossingFrame::getPileupFileNr
unsigned int getPileupFileNr() const
Definition: PCrossingFrame.h:40
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
PCrossingFrame::getBunchRange
std::pair< int, int > getBunchRange() const
Definition: PCrossingFrame.h:46
edm::ESHandle
Definition: DTSurvey.h:22
PCrossingFrame::getPileupOffsetsBcr
const std::vector< unsigned int > & getPileupOffsetsBcr() const
Definition: PCrossingFrame.h:42
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:679
edm::MixingWorker::bunchSpace_
int bunchSpace_
Definition: MixingWorker.h:174
edm::MixingWorker::minBunch_
int minBunch_
Definition: MixingWorker.h:172
PCrossingFrame::getSubDet
std::string getSubDet() const
Definition: PCrossingFrame.h:39
PCrossingFrame::getIdFirstPileup
edm::EventID getIdFirstPileup() const
Definition: PCrossingFrame.h:41
edm::MixingWorker::label_
const std::string label_
Definition: MixingWorker.h:176
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::MixingWorker::allTags_
std::vector< InputTag > allTags_
Definition: MixingWorker.h:182
T
long double T
Definition: Basic3DVectorLD.h:48
PCrossingFrame::getPileups
std::vector< const T * > getPileups() const
Definition: PCrossingFrame.h:30
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MixingModule_cfi.minBunch
minBunch
Definition: MixingModule_cfi.py:43
triggerMatcherToHLTDebug_cfi.tags
tags
Definition: triggerMatcherToHLTDebug_cfi.py:9
edm::MixingWorker::maxNbSources_
unsigned const int maxNbSources_
Definition: MixingWorker.h:178
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
PCrossingFrame::getPileupOffsetsSource
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const
Definition: PCrossingFrame.h:43
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
label
const char * label
Definition: PFTauDecayModeTools.cc:11
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37