33 using namespace muonisolation;
38 theMuonCollectionLabel(par.getParameter<
InputTag>(
"inputMuonCollection")),
39 optOutputIsoDeposits(par.getParameter<bool>(
"OutputMuIsoDeposits")),
41 LogDebug(
"RecoMuon|L3MuonIsolationProducer") <<
" L3MuonIsolationProducer CTOR";
46 produces<reco::IsoDepositMap>();
47 produces<edm::ValueMap<bool>>();
56 theExtractor = std::unique_ptr<reco::isodeposit::IsoDepositExtractor>{
65 if (cutsName ==
"SimpleCuts") {
71 (cutsName ==
"L3NominalEfficiencyCuts_PXLS") || (cutsName ==
"L3NominalEfficiencyCuts_TRKS")) {
74 LogError(
"L3MuonIsolationProducer::beginJob") <<
"cutsName: " << cutsPSet <<
" is not recognized:"
75 <<
" theCuts not set!";
86 LogDebug(
"RecoMuon|L3MuonIsolationProducer") <<
" L3MuonIsolationProducer DTOR";
92 LogDebug(metname) <<
" L3 Muon Isolation producing..."
93 <<
" BEGINING OF EVENT "
94 <<
"================================";
101 auto depMap = std::make_unique<reco::IsoDepositMap>();
102 auto isoMap = std::make_unique<edm::ValueMap<bool>>();
107 unsigned int nMuons = muons->size();
109 IsoDeposit::Vetos vetos(nMuons);
111 std::vector<IsoDeposit>
deps(nMuons);
112 std::vector<bool> isos(nMuons,
false);
114 for (
unsigned int i = 0;
i < nMuons;
i++) {
117 vetos[
i] = deps[
i].veto();
128 for (
unsigned int iMu = 0; iMu < nMuons; ++iMu) {
137 double value = sumAndCount.first;
138 int count = sumAndCount.second;
140 bool result = (value < cut.threshold);
143 LogTrace(metname) <<
"deposit in cone: " << value <<
"with count " << count <<
" is isolated: " <<
result;
153 depFiller.
insert(muons, deps.begin(), deps.end());
158 isoFiller.
insert(muons, isos.begin(), isos.end());
162 LogTrace(metname) <<
" END OF EVENT "
163 <<
"================================";
edm::InputTag theMuonCollectionLabel
muonisolation::Cuts theCuts
const std::string metname
double optOutputIsoDeposits
void insert(const H &h, I begin, I end)
~L3MuonIsolationProducer() override
destructor
Log< level::Error, false > LogError
std::string print() const
bool theApplyCutsORmaxNTracks
apply or not the maxN cut on top of the sumPt (or nominall eff) < cuts
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theMuonCollectionToken
L3MuonIsolationProducer(const edm::ParameterSet &)
constructor with config
muonisolation::Cuts cuts() const
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > theExtractor
T getParameter(std::string const &) const
std::pair< double, int > depositAndCountWithin(double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const
Get deposit.
std::string print() const
void produce(edm::Event &, const edm::EventSetup &) override
Produce isolation maps.
edm::ParameterSet theConfig