CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
edm::HiMixingWorker< T > Class Template Reference
Inheritance diagram for edm::HiMixingWorker< T >:
edm::HiMixingWorkerBase

Public Member Functions

void addSignals (edm::Event &e)
 
template<>
void addSignals (edm::Event &e)
 
 HiMixingWorker (std::string &object, std::vector< InputTag > &tags, std::string &label)
 
 ~HiMixingWorker ()
 
- Public Member Functions inherited from edm::HiMixingWorkerBase
 HiMixingWorkerBase ()
 
 HiMixingWorkerBase (std::string &object, std::vector< InputTag > &tags, std::string &label)
 
virtual ~HiMixingWorkerBase ()
 

Additional Inherited Members

- Public Attributes inherited from edm::HiMixingWorkerBase
std::string label_
 
std::string object_
 
std::vector< InputTagtags_
 

Detailed Description

template<class T>
class edm::HiMixingWorker< T >

Definition at line 91 of file HiMixingModule.cc.

Constructor & Destructor Documentation

template<class T >
edm::HiMixingWorker< T >::HiMixingWorker ( std::string &  object,
std::vector< InputTag > &  tags,
std::string &  label 
)
inline

Definition at line 93 of file HiMixingModule.cc.

93 : HiMixingWorkerBase(object,tags, label) {;}
tuple tags
Definition: o2o.py:248
template<class T >
edm::HiMixingWorker< T >::~HiMixingWorker ( )
inline

Definition at line 94 of file HiMixingModule.cc.

94 {;}

Member Function Documentation

template<class T >
void edm::HiMixingWorker< T >::addSignals ( edm::Event e)
inlinevirtual

Implements edm::HiMixingWorkerBase.

Definition at line 95 of file HiMixingModule.cc.

References edm::Event::getByLabel(), edm::EventBase::id(), and edm::Event::put().

95  {
96  std::vector<Handle<std::vector<T> > > handles;
97  bool get = true;
98  for(size_t itag = 0; itag < tags_.size(); ++itag){
99  LogInfo("HiEmbedding")<<"itag "<<itag;
100  LogInfo("HiEmbedding")<<"label "<<tags_[itag].label();
101  LogInfo("HiEmbedding")<<"instance "<<tags_[itag].instance();
102  Handle<std::vector<T> > hand;
103  handles.push_back(hand);
104  get = get && e.getByLabel(tags_[itag],handles[itag]);
105  if(!get) LogWarning("Product inconsistency")<<"One of the sub-events is missing the product with type "
106  <<object_
107  <<", instance "
108  <<tags_[itag].instance()
109  <<" whereas the other one is fine.";
110  }
111 
112  if(get){
113  std::auto_ptr<CrossingFrame<T> > crFrame(new CrossingFrame<T>() );
114  crFrame->addSignals(handles[0].product(),e.id());
115  for(size_t itag = 1; itag < tags_.size(); ++itag){
116  crFrame->addPileups(0,const_cast< std::vector<T> * >(handles[itag].product()),itag);
117  }
118  e.put(crFrame,label_);
119  }
120  }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::vector< InputTag > tags_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::EventID id() const
Definition: EventBase.h:56
template<>
void edm::HiMixingWorker< HepMCProduct >::addSignals ( edm::Event e)
virtual

Implements edm::HiMixingWorkerBase.

Definition at line 124 of file HiMixingModule.cc.

References edm::Event::getByLabel(), edm::EventBase::id(), and edm::Event::put().

124  {
125 
126  std::vector<Handle<HepMCProduct> > handles;
127  bool get = true;
128  for(size_t itag = 0; itag< tags_.size(); ++itag){
130  handles.push_back(hand);
131  get = get && e.getByLabel(tags_[itag],handles[itag]);
132  if(!get) LogWarning("Product inconsistency")<<"One of the sub-events is missing the product with type "
133  <<object_
134  <<", instance "
135  <<tags_[itag].instance()
136  <<" whereas the other one is fine.";
137  }
138 
139  if(get){
140  std::auto_ptr<CrossingFrame<HepMCProduct> > crFrame(new CrossingFrame<HepMCProduct>() );
141  crFrame->addSignals(handles[0].product(),e.id());
142  for(size_t itag = 1; itag < tags_.size(); ++itag){
143  crFrame->addPileups(0, const_cast<HepMCProduct *>(handles[itag].product()),itag);
144  }
145  e.put(crFrame,label_);
146  }
147 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
std::vector< InputTag > tags_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::EventID id() const
Definition: EventBase.h:56