test
CMS 3D CMS Logo

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

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

Private Attributes

std::vector< InputTagallTags_
 
int bunchSpace_
 
CrossingFrame< T > * crFrame_
 
std::string const label_
 
std::string const labelCF_
 
int maxBunch_
 
unsigned int const maxNbSources_
 
int minBunch_
 
PCrossingFrame< T > * secSourceCF_
 
std::string const subdet_
 
InputTag tag_
 
InputTag tagSignal_
 

Detailed Description

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

Definition at line 41 of file MixingWorker.h.

Constructor & Destructor Documentation

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

standard constructor

Definition at line 46 of file MixingWorker.h.

46  :
47  minBunch_(-5),
48  maxBunch_(3),
49  bunchSpace_(75),
50  subdet_(std::string(" ")),
51  label_(std::string(" ")),
52  labelCF_(std::string(" ")),
53  maxNbSources_(5),
54  tag_(),
55  tagSignal_(),
56  allTags_(),
57  crFrame_(nullptr),
58  secSourceCF_(nullptr)
59  {
60  }
std::string const labelCF_
Definition: MixingWorker.h:173
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
std::vector< InputTag > allTags_
Definition: MixingWorker.h:177
PCrossingFrame< T > * secSourceCF_
Definition: MixingWorker.h:180
std::string const label_
Definition: MixingWorker.h:172
std::string const subdet_
Definition: MixingWorker.h:171
unsigned int const maxNbSources_
Definition: MixingWorker.h:174
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 
)
inline

Definition at line 63 of file MixingWorker.h.

66  :
68  minBunch_(minBunch),
69  maxBunch_(maxBunch),
70  bunchSpace_(bunchSpace),
71  subdet_(subdet),
72  label_(label),
73  labelCF_(labelCF),
74  maxNbSources_(maxNbSources),
75  tag_(tag),
76  tagSignal_(tagCF),
77  allTags_(),
78  crFrame_(nullptr),
79  secSourceCF_(nullptr)
80  {
81  }
std::string const labelCF_
Definition: MixingWorker.h:173
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
std::vector< InputTag > allTags_
Definition: MixingWorker.h:177
PCrossingFrame< T > * secSourceCF_
Definition: MixingWorker.h:180
std::string const label_
Definition: MixingWorker.h:172
std::string const subdet_
Definition: MixingWorker.h:171
unsigned int const maxNbSources_
Definition: MixingWorker.h:174
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 84 of file MixingWorker.h.

88  :
90  minBunch_(minBunch),
91  maxBunch_(maxBunch),
92  bunchSpace_(bunchSpace),
93  subdet_(subdet),
94  label_(label),
95  labelCF_(labelCF),
96  maxNbSources_(maxNbSources),
97  tag_(tag),
98  tagSignal_(tagCF),
99  allTags_(tags),
100  crFrame_(nullptr),
101  secSourceCF_(nullptr)
102  {
103  }
std::string const labelCF_
Definition: MixingWorker.h:173
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
tuple tags
Definition: o2o.py:248
std::vector< InputTag > allTags_
Definition: MixingWorker.h:177
PCrossingFrame< T > * secSourceCF_
Definition: MixingWorker.h:180
std::string const label_
Definition: MixingWorker.h:172
std::string const subdet_
Definition: MixingWorker.h:171
unsigned int const maxNbSources_
Definition: MixingWorker.h:174
template<class T >
virtual edm::MixingWorker< T >::~MixingWorker ( )
inlinevirtual

Default destructor

Definition at line 106 of file MixingWorker.h.

106 {;}

Member Function Documentation

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

Implements edm::MixingWorkerBase.

Definition at line 184 of file MixingWorker.h.

References LogDebug.

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

Implements edm::MixingWorkerBase.

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

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 "<<typeid(T).name()<<" with "<<tag_;
144  crFrame_->addSignals(result_t.product(),e.id());
145  } else {
146  LogInfo("MixingModule") <<"!!!!!!! Did not get any signal data for "<<typeid(T).name()<<", with "<<tag_;
147  }
148  }
#define LogDebug(id)
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
T const * product() const
Definition: Handle.h:81
edm::EventID id() const
Definition: EventBase.h:59
long double T
template<class T >
virtual bool edm::MixingWorker< T >::checkSignal ( const edm::Event e)
inlinevirtual

Steps in BMixingModule::produce

Implements edm::MixingWorkerBase.

Definition at line 120 of file MixingWorker.h.

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

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

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

Implements edm::MixingWorkerBase.

Definition at line 157 of file MixingWorker.h.

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

157  {
158  std::auto_ptr<CrossingFrame<T> > pOut(crFrame_);
159  e.put(pOut,label_);
160  LogDebug("MixingModule") <<" CF was put for type "<<typeid(T).name()<<" with "<<label_;
161  }
#define LogDebug(id)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
std::string const label_
Definition: MixingWorker.h:172
long double T
template<class T >
virtual void edm::MixingWorker< T >::reload ( const edm::EventSetup setup)
inlinevirtual

Reimplemented from edm::MixingWorkerBase.

Definition at line 110 of file MixingWorker.h.

References edm::MixingWorker< T >::bunchSpace_, mps_alisetup::config, edm::EventSetup::get(), edm::MixingWorker< T >::maxBunch_, and edm::MixingWorker< T >::minBunch_.

110  {
111  //get the required parameters from DB.
112  // watch the label/tag
114  setup.get<MixingRcd>().get(config);
115  minBunch_=config->minBunch();
116  maxBunch_=config->maxBunch();
117  bunchSpace_=config->bunchSpace();
118  }
const T & get() const
Definition: EventSetup.h:56
template<class T >
virtual void edm::MixingWorker< T >::setBcrOffset ( )
inlinevirtual

Implements edm::MixingWorkerBase.

Definition at line 152 of file MixingWorker.h.

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

152 {crFrame_->setBcrOffset();}
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
template<class T >
virtual void edm::MixingWorker< T >::setSourceOffset ( const unsigned int  s)
inlinevirtual

Implements edm::MixingWorkerBase.

Definition at line 153 of file MixingWorker.h.

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

153 {crFrame_->setSourceOffset(s);}
CrossingFrame< T > * crFrame_
Definition: MixingWorker.h:179
template<class T >
void MixingWorker::setTof ( )
virtual

Implements edm::MixingWorkerBase.

Definition at line 198 of file MixingWorker.h.

198 {;}

Member Data Documentation

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

Definition at line 177 of file MixingWorker.h.

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

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

Definition at line 174 of file MixingWorker.h.

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

template<class T >
int edm::MixingWorker< T >::minBunch_
private
template<class T >
PCrossingFrame<T>* edm::MixingWorker< T >::secSourceCF_
private

Definition at line 180 of file MixingWorker.h.

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

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