36 static const std::string metname =
"RecoMuon|MuonIsolationProducers|MuIsoDepositProducer";
37 LogDebug(metname) <<
" MuIsoDepositProducer CTOR";
45 bool readFromRecoTrack = theInputType ==
"TrackCollection";
46 bool readFromRecoMuon = theInputType ==
"MuonCollection";
47 bool readFromCandidateView = theInputType ==
"CandidateView";
48 if (readFromRecoTrack) {
50 }
else if (readFromRecoMuon) {
52 }
else if (readFromCandidateView) {
55 throw cms::Exception(
"Configuration") <<
"Inconsistent configuration or failure to read Candidate-muon view";
62 .getParameter<std::vector<std::string>>(
"DepositInstanceLabels");
75 LogDebug(metname) <<
" Load extractor..." << extractorName;
80 LogDebug(
"RecoMuon/MuIsoDepositProducer") <<
" MuIsoDepositProducer DTOR";
85 static const std::string metname =
"RecoMuon|MuonIsolationProducers|MuIsoDepositProducer";
87 LogDebug(metname) <<
" Muon Deposit producing..." 88 <<
" BEGINING OF EVENT " 89 <<
"================================";
94 LogTrace(metname) <<
" Taking the muons: " 103 bool readFromRecoTrack =
theInputType ==
"TrackCollection";
104 bool readFromRecoMuon =
theInputType ==
"MuonCollection";
105 bool readFromCandidateView =
theInputType ==
"CandidateView";
107 if (readFromRecoMuon) {
109 nMuons = muons->size();
112 if (readFromRecoTrack) {
114 nMuons = tracks->size();
119 unsigned int nCands = cands->size();
122 if (nMuons != nCands)
123 edm::LogError(metname) <<
"Inconsistent configuration or failure to read Candidate-muon view";
129 static const unsigned int MAX_DEPS = 10;
130 std::unique_ptr<reco::IsoDepositMap> depMaps[MAX_DEPS];
133 LogError(metname) <<
"Unable to handle more than 10 input deposits";
134 for (
unsigned int i = 0;
i < nDeps; ++
i) {
135 depMaps[
i] = std::make_unique<reco::IsoDepositMap>();
142 std::vector<std::vector<IsoDeposit>> deps2D(nDeps, std::vector<IsoDeposit>(nMuons));
144 for (
unsigned int i = 0;
i <
nMuons; ++
i) {
146 if (readFromRecoMuon) {
154 if (!(*muons)[
i].combinedMuon().isNull()) {
156 }
else if (!(*muons)[
i].
track().isNull()) {
162 if (!(*muons)[
i].
track().isNull()) {
171 }
else if (readFromRecoTrack) {
177 deps2D[0][
i] =
theExtractor->deposit(event, eventSetup, (*cands)[
i]);
179 deps2D[0][
i] =
theExtractor->deposit(event, eventSetup, muRef);
182 std::vector<IsoDeposit>
deps(nDeps);
184 deps =
theExtractor->deposits(event, eventSetup, (*cands)[
i]);
186 deps =
theExtractor->deposits(event, eventSetup, muRef);
187 for (
unsigned int iDep = 0; iDep < nDeps; ++iDep) {
188 deps2D[iDep][
i] = deps[iDep];
194 for (
unsigned int iDep = 0; iDep < nDeps; ++iDep) {
196 for (
unsigned int iMu = 0; iMu <
nMuons; ++iMu) {
198 LogTrace(metname) << deps2D[iDep][iMu].print();
205 if (readFromRecoMuon) {
207 }
else if (readFromRecoTrack) {
209 }
else if (readFromCandidateView) {
212 edm::LogError(metname) <<
"Inconsistent configuration: unknown type requested";
220 for (
unsigned int iMap = 0; iMap < nDeps; ++iMap) {
222 << depMaps[iMap]->size() <<
" into edm::Event";
226 LogTrace(metname) <<
" END OF EVENT " 227 <<
"================================";
T getParameter(std::string const &) const
bool theExtractForCandidate
std::vector< std::string > theDepositNames
MuIsoDepositProducer(const edm::ParameterSet &)
constructor
const std::string metname
bool theMultipleDepositsFlag
void insert(const H &h, I begin, I end)
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > theExtractor
~MuIsoDepositProducer() override
destructor
#define DEFINE_FWK_MODULE(type)
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
edm::EDGetToken theMuonCollectionTag
std::string theMuonTrackRefType
void produce(edm::Event &, const edm::EventSetup &) override
data making method
unsigned int index() const