40 std::unique_ptr<reco::isodeposit::IsoDepositExtractor>
theExtractor;
51 theMultipleDepositsFlag(par.getParameter<bool>(
"MultipleDepositsFlag")) {
52 LogDebug(
"PhysicsTools|MuonIsolation") <<
" CandIsoDepositProducer CTOR";
59 produces<reco::IsoDepositMap>();
63 throw cms::Exception(
"Configuration Error") <<
"This module supports only up to 10 deposits";
70 if (trackType ==
"fake")
72 else if (trackType ==
"best")
74 else if (trackType ==
"standAloneMuon")
76 else if (trackType ==
"combinedMuon")
78 else if (trackType ==
"trackerMuon")
80 else if (trackType ==
"track")
82 else if (trackType ==
"gsf")
84 else if (trackType ==
"candidate")
87 throw cms::Exception(
"Error") <<
"Track type " << trackType <<
" not valid.";
92 LogDebug(
"PhysicsTools/CandIsoDepositProducer") <<
" CandIsoDepositProducer DTOR";
104 throw cms::Exception(
"Error") <<
" Candidate is not RecoCandidate: can't get a real track from it!";
120 return &*rc->
track();
139 static const unsigned int MAX_DEPS = 10;
141 if (nDeps > MAX_DEPS)
142 LogError(metname) <<
"Unable to handle more than 10 input deposits";
147 size_t nMuons = hCands->size();
148 std::vector<std::vector<IsoDeposit> > deps2D(nDeps, std::vector<IsoDeposit>(nMuons));
154 for (
size_t i = 0;
i < nMuons; ++
i) {
159 <<
"Candidate #" <<
i <<
" has no bestTrack(), it will produce no deposit";
161 for (
size_t iDep = 0; iDep < nDeps; ++iDep) {
162 deps2D[iDep][
i] = emptyDep;
170 std::vector<IsoDeposit>
deps =
173 for (
unsigned int iDep = 0; iDep < nDeps; ++iDep) {
174 deps2D[iDep][
i] = deps[iDep];
181 for (
unsigned int iDep = 0; iDep < nDeps; ++iDep) {
183 for (
unsigned int iMu = 0; iMu < nMuons; ++iMu) {
185 LogTrace(metname) << deps2D[iDep][iMu].print();
189 auto depMap = std::make_unique<reco::IsoDepositMap>();
191 filler.insert(hCands, deps2D[iDep].
begin(), deps2D[iDep].
end());
192 deps2D[iDep].clear();
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
const edm::EventSetup & c
const std::string metname
#define DEFINE_FWK_MODULE(type)
edm::ParameterSet theConfig
edm::EDGetTokenT< edm::View< reco::Candidate > > theCandCollectionToken
std::vector< std::string > theDepositNames
const reco::Track * extractTrack(const reco::Candidate &cand, reco::Track *dummyStorage) const
Log< level::Error, false > LogError
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track
void produce(edm::Event &, const edm::EventSetup &) override
build deposits
virtual reco::TrackRef track() const
reference to a Track
virtual Vector momentum() const =0
spatial momentum vector
bool theMultipleDepositsFlag
virtual const Point & vertex() const =0
vertex position
virtual int charge() const =0
electric charge
T const * get() const
Returns C++ pointer to the item.
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > theExtractor
const Track * bestTrack() const override
best track pointer
CandIsoDepositProducer(const edm::ParameterSet &)
constructor with config
T getParameter(std::string const &) const
~CandIsoDepositProducer() override
destructor
Log< level::Warning, false > LogWarning
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track