CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuIsoDepositCopyProducer.cc
Go to the documentation of this file.
2 
3 // Framework
8 
10 
12 
14 #include <string>
15 
16 using namespace edm;
17 using namespace std;
18 using namespace reco;
19 
22  : theConfig(par),
23  theInputTags(par.getParameter<std::vector<edm::InputTag> >("inputTags")),
24  theDepositNames(par.getParameter<std::vector<std::string> >("depositNames"))
25 
26 {
27  LogDebug("RecoMuon|MuonIsolation") << " MuIsoDepositCopyProducer CTOR";
28  if (theInputTags.size() != theDepositNames.size()) {
29  throw cms::Exception("MuIsoDepositCopyProducer constructor") << "the sizes of input/output vectors don't match";
30  }
31 
32  for (unsigned int i = 0; i < theDepositNames.size(); ++i) {
34  if (!theDepositNames[i].empty())
35  alias += "_" + theDepositNames[i];
36  produces<reco::IsoDepositMap>(theDepositNames[i]).setBranchAlias(alias);
37  }
38  for (unsigned int iDep = 0; iDep < theInputTags.size(); ++iDep)
39  theInputTokens.push_back(consumes<reco::IsoDepositMap>(theInputTags.at(iDep)));
40 }
41 
44  LogDebug("RecoMuon/MuIsoDepositCopyProducer") << " MuIsoDepositCopyProducer DTOR";
45 }
46 
49  std::string metname = "RecoMuon|MuonIsolationProducers|MuIsoDepositCopyProducer";
50 
51  LogDebug(metname) << " Muon Deposit producing..."
52  << " BEGINING OF EVENT "
53  << "================================";
54 
55  LogTrace(metname) << " Taking the inputs: ";
56 
57  for (unsigned int iDep = 0; iDep < theInputTokens.size(); ++iDep) {
59  event.getByToken(theInputTokens[iDep], inDep);
60 
61  event.put(std::make_unique<reco::IsoDepositMap>(*inDep), theDepositNames[iDep]);
62  }
63 
64  LogTrace(metname) << " END OF EVENT "
65  << "================================";
66 }
67 
std::vector< edm::EDGetTokenT< reco::IsoDepositMap > > theInputTokens
const std::string metname
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
data making method
std::vector< std::string > theDepositNames
#define LogTrace(id)
edm::ParameterSet theConfig
module configuration
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
~MuIsoDepositCopyProducer() override
destructor
MuIsoDepositCopyProducer(const edm::ParameterSet &)
constructor
std::vector< edm::InputTag > theInputTags
for backward compatibility: take one input module and
#define LogDebug(id)