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

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  }

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

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  }

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

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  }

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

◆ copyPCrossingFrame()

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

Definition at line 208 of file MixingWorker.h.

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  }

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

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

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  //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  }

References edm::MixingWorker< T >::bunchSpace_, looper::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 153 of file MixingWorker.h.

153 { 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 154 of file MixingWorker.h.

154 { 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 203 of file MixingWorker.h.

203  {
204  ;
205  }

Member Data Documentation

◆ allTags_

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

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

◆ makePCrossingFrame_

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

Definition at line 178 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 177 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 174 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 180 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:179
edm::MixingWorker::tagSignal_
InputTag tagSignal_
Definition: MixingWorker.h:180
PCrossingFrame
Definition: CrossingFrame.h:28
edm::MixingWorker::maxBunch_
int maxBunch_
Definition: MixingWorker.h:172
edm::MixingWorker::labelCF_
const std::string labelCF_
Definition: MixingWorker.h:176
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:174
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:178
edm::MixingWorker::crFrame_
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:183
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
PCrossingFrame::getPileupFileNr
unsigned int getPileupFileNr() const
Definition: PCrossingFrame.h:40
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
looper.config
config
Definition: looper.py:291
OrderedSet.t
t
Definition: OrderedSet.py:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::get
T const & get(Event const &event, InputTag const &tag) noexcept(false)
Definition: Event.h:669
edm::MixingWorker::bunchSpace_
int bunchSpace_
Definition: MixingWorker.h:173
edm::MixingWorker::minBunch_
int minBunch_
Definition: MixingWorker.h:171
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:175
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::MixingWorker::allTags_
std::vector< InputTag > allTags_
Definition: MixingWorker.h:181
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:177
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