CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MixingWorker.cc
Go to the documentation of this file.
6 #include "MixingWorker.h"
7 
8 #include "boost/shared_ptr.hpp"
9 
10 namespace edm {
11  template <>
12  void MixingWorker<HepMCProduct>::addPileups(const EventPrincipal& ep,unsigned int eventNr) {
13  // HepMCProduct does not come as a vector....
14  boost::shared_ptr<Wrapper<HepMCProduct> const> shPtr = getProductByTag<HepMCProduct>(ep, tag_);
15  if (shPtr) {
16  LogDebug("MixingModule") <<"HepMC pileup objects added, eventNr "<<eventNr << " Tag " << tag_ << std::endl;
17  crFrame_->setPileupPtr(shPtr);
18  crFrame_->addPileups(*shPtr->product());
19  }
20  }
21 
22  template <>
24  //HepMC - here the interface is different!!!
25  Handle<HepMCProduct> result_t;
26  bool got = e.getByLabel(tag_,result_t);
27  if (got) {
28  LogDebug("MixingModule") <<" adding HepMCProduct from signal event with "<<tag_;
29  crFrame_->addSignals(result_t.product(),e.id());
30  } else {
31  LogInfo("MixingModule") <<"!!!!!!! Did not get any signal data for HepMCProduct with "<<tag_;
32  }
33  }
34 
35  template <>
37  bool got;
38  InputTag t;
39 
40  Handle<HepMCProduct> result_t;
41  got = e.getByLabel(tag_,result_t);
42  t = InputTag(tag_.label(),tag_.instance());
43 
44  if (got) {
45  LogInfo("MixingModule") <<" Will create a CrossingFrame for HepMCProduct with "
46  << " with InputTag= "<< t.encode();
47  }
48 
49  return got;
50  }
51 
52 }//namespace edm
#define LogDebug(id)
virtual void addPileups(const EventPrincipal &ep, unsigned int eventNr)
Definition: MixingWorker.h:154
virtual void addSignals(const edm::Event &e)
Definition: MixingWorker.h:109
virtual bool checkSignal(const edm::Event &e)
Definition: MixingWorker.h:90