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

◆ MixingWorker() [1/3]

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

◆ 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 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

◆ 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 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

◆ ~MixingWorker()

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

Default destructor

Definition at line 105 of file MixingWorker.h.

105 { ; }

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

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, and 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)

◆ addSignals()

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_, MillePedeFileConverter_cfg::e, LogDebug, Skims_PA_cff::name, and edm::MixingWorker< T >::tag_.

132  {
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
Log< level::Info, false > LogInfo
ap_fixed< 16, 8 > result_t
long double T
#define LogDebug(id)

◆ checkSignal()

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 MillePedeFileConverter_cfg::e, HLT_2022v15_cff::InputTag, edm::InputTag::instance(), edm::InputTag::label(), Skims_PA_cff::name, submitPVValidationJobs::t, and edm::MixingWorker< T >::tag_.

114  {
115  bool got;
116  InputTag 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  }
std::string const & instance() const
Definition: InputTag.h:37
std::string const & label() const
Definition: InputTag.h:36
Log< level::Info, false > LogInfo
ap_fixed< 16, 8 > result_t
long double T

◆ copyPCrossingFrame()

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  }
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
unsigned int getPileupFileNr() const
edm::EventID getIdFirstPileup() const
std::pair< int, int > getBunchRange() const
const std::vector< std::vector< unsigned int > > & getPileupOffsetsSource() const
std::string getSubDet() const
const std::vector< unsigned int > & getPileupOffsetsBcr() const
int getBunchSpace() const
unsigned int getMaxNbSources() const
std::vector< const T * > getPileups() const

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

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

151  {
152  if (makePCrossingFrame_) {
153  e.put(std::make_unique<PCrossingFrame<T> >(*crFrame_), label_);
154  }
155  e.put(std::move(crFrame_), label_);
156  LogDebug("MixingModule") << " CF was put for type " << typeid(T).name() << " with " << label_;
157  }
std::unique_ptr< CrossingFrame< T > > crFrame_
Definition: MixingWorker.h:176
bool const makePCrossingFrame_
Definition: MixingWorker.h:171
std::string const label_
Definition: MixingWorker.h:168
long double T
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ reload()

template<class T >
void edm::MixingWorker< T >::reload ( int  minBunch,
int  maxBunch,
int  bunchSpace 
)
inlineoverridevirtual

◆ setBcrOffset()

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

◆ setSourceOffset()

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_, and alignCSCRings::s.

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

◆ setTof()

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

Implements edm::MixingWorkerBase.

Definition at line 196 of file MixingWorker.h.

196  {
197  ;
198  }

Member Data Documentation

◆ allTags_

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

Definition at line 174 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 >
std::string const edm::MixingWorker< T >::label_
private

◆ labelCF_

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

Definition at line 169 of file MixingWorker.h.

◆ makePCrossingFrame_

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

Definition at line 171 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 int const edm::MixingWorker< T >::maxNbSources_
private

Definition at line 170 of file MixingWorker.h.

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

◆ minBunch_

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

◆ subdet_

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

◆ tag_

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

◆ tagSignal_

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

Definition at line 173 of file MixingWorker.h.