CMS 3D CMS Logo

MuIsoDepositCopyProducer.cc
Go to the documentation of this file.
2 
3 // Framework
7 
9 
11 #include <string>
12 
13 using namespace edm;
14 using namespace std;
15 using namespace reco;
16 
19  : theConfig(par),
20  theInputTags(par.getParameter<std::vector<edm::InputTag> >("inputTags")),
21  theDepositNames(par.getParameter<std::vector<std::string> >("depositNames"))
22 
23 {
24  LogDebug("RecoMuon|MuonIsolation") << " MuIsoDepositCopyProducer CTOR";
25  if (theInputTags.size() != theDepositNames.size()) {
26  throw cms::Exception("MuIsoDepositCopyProducer constructor") << "the sizes of input/output vectors don't match";
27  }
28 
29  for (unsigned int i = 0; i < theDepositNames.size(); ++i) {
31  if (!theDepositNames[i].empty())
32  alias += "_" + theDepositNames[i];
33  produces<reco::IsoDepositMap>(theDepositNames[i]).setBranchAlias(alias);
34  }
35  for (unsigned int iDep = 0; iDep < theInputTags.size(); ++iDep)
36  theInputTokens.push_back(consumes<reco::IsoDepositMap>(theInputTags.at(iDep)));
37 }
38 
41  LogDebug("RecoMuon/MuIsoDepositCopyProducer") << " MuIsoDepositCopyProducer DTOR";
42 }
43 
46  std::string metname = "RecoMuon|MuonIsolationProducers|MuIsoDepositCopyProducer";
47 
48  LogDebug(metname) << " Muon Deposit producing..."
49  << " BEGINING OF EVENT "
50  << "================================";
51 
52  LogTrace(metname) << " Taking the inputs: ";
53 
54  for (unsigned int iDep = 0; iDep < theInputTokens.size(); ++iDep) {
56  event.getByToken(theInputTokens[iDep], inDep);
57 
58  event.put(std::make_unique<reco::IsoDepositMap>(*inDep), theDepositNames[iDep]);
59  }
60 
61  LogTrace(metname) << " END OF EVENT "
62  << "================================";
63 }
64 
std::vector< edm::EDGetTokenT< reco::IsoDepositMap > > theInputTokens
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const std::string metname
void produce(edm::Event &, const edm::EventSetup &) override
data making method
std::vector< std::string > theDepositNames
#define LogTrace(id)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ParameterSet theConfig
module configuration
~MuIsoDepositCopyProducer() override
destructor
MuIsoDepositCopyProducer(const edm::ParameterSet &)
constructor
fixed size matrix
HLT enums.
std::vector< edm::InputTag > theInputTags
for backward compatibility: take one input module and
Definition: event.py:1
#define LogDebug(id)