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 <memory>
9 
10 namespace edm {
11  template <>
12  void MixingWorker<HepMCProduct>::addPileups(const EventPrincipal& ep, ModuleCallingContext const* mcc, unsigned int eventNr) {
13  // HepMCProduct does not come as a vector....
14  for(InputTag const& tag : allTags_) {
15  std::shared_ptr<Wrapper<HepMCProduct> const> shPtr = getProductByTag<HepMCProduct>(ep, tag, mcc);
16  if(shPtr) {
17  LogDebug("MixingModule") << "HepMC pileup objects added, eventNr " << eventNr << " Tag " << tag << std::endl;
18  crFrame_->setPileupPtr(shPtr);
19  crFrame_->addPileups(*shPtr->product());
20  break;
21  }
22  }
23  }
24 
25  template <>
27  //HepMC - here the interface is different!!!
28  bool got = false;
29  Handle<HepMCProduct> result_t;
30  for(InputTag const& tag : allTags_) {
31  got = e.getByLabel(tag, result_t);
32  if (got) {
33  LogDebug("MixingModule") << "adding HepMCProduct from signal event with " << tag;
34  crFrame_->addSignals(result_t.product(), e.id());
35  break;
36  }
37  }
38  if(!got) {
39  LogInfo("MixingModule") << "!!!!!!! Did not get any signal data for HepMCProduct with " << allTags_[0];
40  }
41  }
42 
43  template <>
45  bool got = false;
46  Handle<HepMCProduct> result_t;
47  for(InputTag const& tag : allTags_) {
48  got = e.getByLabel(tag, result_t);
49  if(got) {
50  InputTag t = InputTag(tag.label(), tag.instance());
51  LogInfo("MixingModule") <<" Will create a CrossingFrame for HepMCProduct with "
52  << " with InputTag= "<< t.encode();
53  break;
54  }
55  }
56  return got;
57  }
58 }//namespace edm
#define LogDebug(id)
Int_t id
Definition: Event.h:29
virtual void addSignals(const edm::Event &e)
Definition: MixingWorker.h:139
Definition: Event.h:16
virtual bool checkSignal(const edm::Event &e)
Definition: MixingWorker.h:120
virtual void addPileups(const EventPrincipal &ep, ModuleCallingContext const *, unsigned int eventNr)
Definition: MixingWorker.h:184