41 static const std::string metname =
"RecoMuon|MuonIsolationProducers|MuIsoDepositProducer";
42 LogDebug(metname)<<
" MuIsoDepositProducer CTOR";
50 bool readFromRecoTrack = theInputType ==
"TrackCollection";
51 bool readFromRecoMuon = theInputType ==
"MuonCollection";
52 bool readFromCandidateView = theInputType ==
"CandidateView";
53 if(readFromRecoTrack){
55 }
else if(readFromRecoMuon) {
57 }
else if (readFromCandidateView) {
60 throw cms::Exception(
"Configuration")<<
"Inconsistent configuration or failure to read Candidate-muon view";
69 .getParameter<std::vector<std::string> >(
"DepositInstanceLabels");
82 LogDebug(metname)<<
" Load extractor..."<<extractorName;
90 LogDebug(
"RecoMuon/MuIsoDepositProducer")<<
" MuIsoDepositProducer DTOR";
96 static const std::string metname =
"RecoMuon|MuonIsolationProducers|MuIsoDepositProducer";
98 LogDebug(metname)<<
" Muon Deposit producing..." 99 <<
" BEGINING OF EVENT " <<
"================================";
114 bool readFromRecoTrack =
theInputType ==
"TrackCollection";
115 bool readFromRecoMuon =
theInputType ==
"MuonCollection";
116 bool readFromCandidateView =
theInputType ==
"CandidateView";
118 if (readFromRecoMuon){
120 nMuons = muons->size();
124 if (readFromRecoTrack){
126 nMuons = tracks->size();
131 unsigned int nCands = cands->size();
134 if (nMuons != nCands)
edm::LogError(metname)<<
"Inconsistent configuration or failure to read Candidate-muon view";
140 static const unsigned int MAX_DEPS=10;
141 std::unique_ptr<reco::IsoDepositMap> depMaps[MAX_DEPS];
143 if (nDeps >10 )
LogError(metname)<<
"Unable to handle more than 10 input deposits";
144 for (
unsigned int i =0;
i<nDeps; ++
i){
145 depMaps[
i] = std::make_unique<reco::IsoDepositMap>();
153 std::vector<std::vector<IsoDeposit> > deps2D(nDeps, std::vector<IsoDeposit>(nMuons));
157 if (readFromRecoMuon){
165 if (!(*muons)[
i].combinedMuon().isNull()){
167 }
else if (!(*muons)[
i].
track().isNull()){
173 if (!(*muons)[
i].
track().isNull()){
182 }
else if (readFromRecoTrack){
191 std::vector<IsoDeposit>
deps(nDeps);
194 for (
unsigned int iDep =0; iDep<nDeps; ++iDep) {
195 deps2D[iDep][
i] = deps[iDep];
201 for (
unsigned int iDep=0; iDep < nDeps; ++iDep){
203 for (
unsigned int iMu = 0; iMu<
nMuons; ++iMu){
205 <<
" for a muon at index "<<iMu;
206 LogTrace(metname)<<deps2D[iDep][iMu].print();
213 if (readFromRecoMuon){
215 }
else if (readFromRecoTrack){
217 }
else if (readFromCandidateView){
220 edm::LogError(metname)<<
"Inconsistent configuration: unknown type requested";
229 for (
unsigned int iMap = 0; iMap < nDeps; ++iMap){
231 <<
" of size "<<depMaps[iMap]->size()
232 <<
" into edm::Event";
236 LogTrace(metname) <<
" END OF EVENT " <<
"================================";
T getParameter(std::string const &) const
bool theExtractForCandidate
std::vector< std::string > theDepositNames
MuIsoDepositProducer(const edm::ParameterSet &)
constructor
const std::string metname
#define DEFINE_FWK_MODULE(type)
bool theMultipleDepositsFlag
void insert(const H &h, I begin, I end)
~MuIsoDepositProducer() override
destructor
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
edm::EDGetToken theMuonCollectionTag
std::string theMuonTrackRefType
reco::isodeposit::IsoDepositExtractor * theExtractor
void produce(edm::Event &, const edm::EventSetup &) override
data making method
edm::ParameterSet theConfig
module configuration
unsigned int index() const
T get(const Candidate &c)