CMS 3D CMS Logo

MuIsoDepositCopyProducer.cc
Go to the documentation of this file.
2 
3 // Framework
8 
10 
11 
12 
14 
16 #include <string>
17 
18 using namespace edm;
19 using namespace std;
20 using namespace reco;
21 
22 
25  theConfig(par),
26  theInputTags(par.getParameter<std::vector<edm::InputTag> >("inputTags")),
27  theDepositNames(par.getParameter<std::vector<std::string> >("depositNames"))
28 
29 {
30  LogDebug("RecoMuon|MuonIsolation")<<" MuIsoDepositCopyProducer CTOR";
31  if (theInputTags.size() != theDepositNames.size()){
32  throw cms::Exception("MuIsoDepositCopyProducer constructor")<<"the sizes of input/output vectors don't match";
33  }
34 
35  for (unsigned int i = 0; i < theDepositNames.size(); ++i){
37  if (!theDepositNames[i].empty()) alias += "_" + theDepositNames[i];
38  produces<reco::IsoDepositMap>(theDepositNames[i]).setBranchAlias(alias);
39  }
40  for (unsigned int iDep = 0; iDep < theInputTags.size(); ++iDep)
41  theInputTokens.push_back(consumes<reco::IsoDepositMap>(theInputTags.at(iDep)));
42 
43 }
44 
47  LogDebug("RecoMuon/MuIsoDepositCopyProducer")<<" MuIsoDepositCopyProducer DTOR";
48 }
49 
52  std::string metname = "RecoMuon|MuonIsolationProducers|MuIsoDepositCopyProducer";
53 
54  LogDebug(metname)<<" Muon Deposit producing..."
55  <<" BEGINING OF EVENT " <<"================================";
56 
57  LogTrace(metname)<<" Taking the inputs: ";
58 
59  for (unsigned int iDep = 0; iDep < theInputTokens.size(); ++iDep){
61  event.getByToken(theInputTokens[iDep], inDep);
62 
63  event.put(std::make_unique<reco::IsoDepositMap>(*inDep), theDepositNames[iDep]);
64  }
65 
66  LogTrace(metname) <<" END OF EVENT " <<"================================";
67 }
68 
#define LogDebug(id)
T getParameter(std::string const &) const
std::vector< edm::EDGetTokenT< reco::IsoDepositMap > > theInputTokens
const std::string metname
void produce(edm::Event &, const edm::EventSetup &) override
data making method
std::vector< std::string > theDepositNames
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
#define LogTrace(id)
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