36 using namespace muonisolation;
41 theMuonCollectionLabel(par.getParameter<
InputTag>(
"inputMuonCollection")),
42 optOutputIsoDeposits(par.getParameter<bool>(
"OutputMuIsoDeposits")),
43 useCaloIso(par.existsAs<bool>(
"UseCaloIso") ?
44 par.getParameter<bool>(
"UseCaloIso") :
true),
45 useRhoCorrectedCaloDeps(par.existsAs<bool>(
"UseRhoCorrectedCaloDeposits") ?
46 par.getParameter<bool>(
"UseRhoCorrectedCaloDeposits") :
false),
47 theCaloDepsLabel(par.existsAs<
InputTag>(
"CaloDepositsLabel") ?
48 par.getParameter<
InputTag>(
"CaloDepositsLabel") :
49 InputTag(
"hltL3CaloMuonCorrectedIsolations")),
53 printDebug (par.getParameter<bool>(
"printDebug"))
55 LogDebug(
"RecoMuon|L3MuonCombinedRelativeIsolationProducer")<<
" L3MuonCombinedRelativeIsolationProducer CTOR";
61 produces<reco::IsoDepositMap>(
"trkIsoDeposits");
63 produces<reco::IsoDepositMap>(
"caloIsoDeposits");
65 produces<edm::ValueMap<double> >(
"combinedRelativeIsoDeposits");
67 produces<edm::ValueMap<bool> >();
96 if (cutsName ==
"SimpleCuts") {
103 (cutsName==
"L3NominalEfficiencyCuts_PXLS" )
104 || (cutsName==
"L3NominalEfficiencyCuts_TRKS") ) {
108 LogError(
"L3MuonCombinedRelativeIsolationProducer::beginJob")
109 <<
"cutsName: "<<cutsPSet<<
" is not recognized:"
110 <<
" theCuts not set!";
122 LogDebug(
"RecoMuon|L3MuonCombinedRelativeIsolationProducer")<<
" L3MuonCombinedRelativeIsolationProducer DTOR";
130 desc.
add<
bool>(
"UseRhoCorrectedCaloDeposits",
false);
131 desc.
add<
bool>(
"UseCaloIso",
true);
134 desc.
add<
bool>(
"OutputMuIsoDeposits",
true);
135 desc.
add<
double>(
"TrackPt_Min",-1.0);
136 desc.
add<
bool>(
"printDebug",
false);
139 cutsPSet.
add<std::vector<double> >(
"ConeSizes",std::vector<double>(1, 0.24));
140 cutsPSet.add<
std::string>(
"ComponentName",
"SimpleCuts");
141 cutsPSet.add<std::vector<double> >(
"Thresholds",std::vector<double>(1, 0.1));
142 cutsPSet.add<
int>(
"maxNTracks",-1);
143 cutsPSet.add<std::vector<double> >(
"EtaBounds",std::vector<double>(1, 2.411));
144 cutsPSet.add<
bool>(
"applyCutsORmaxNTracks",
false);
149 trkExtractorPSet.
add<
double>(
"Chi2Prob_Min", -1.0);
150 trkExtractorPSet.add<
double>(
"Chi2Ndof_Max", 1.0E64);
151 trkExtractorPSet.add<
double>(
"Diff_z",0.2);
153 trkExtractorPSet.add<
double>(
"ReferenceRadius",6.0);
155 trkExtractorPSet.add<
std::string>(
"ComponentName",
"PixelTrackExtractor");
156 trkExtractorPSet.add<
double>(
"DR_Max",0.24);
157 trkExtractorPSet.add<
double>(
"Diff_r",0.1);
158 trkExtractorPSet.add<
bool>(
"VetoLeadingTrack",
true);
159 trkExtractorPSet.add<
double>(
"DR_VetoPt",0.025);
160 trkExtractorPSet.add<
double>(
"DR_Veto",0.01);
161 trkExtractorPSet.add<
unsigned int>(
"NHits_Min",0);
162 trkExtractorPSet.add<
double>(
"Pt_Min",-1.0);
163 trkExtractorPSet.addUntracked<
std::string>(
"DepositLabel",
"PXLS");
164 trkExtractorPSet.add<
std::string>(
"BeamlineOption",
"BeamSpotFromEvent");
165 trkExtractorPSet.add<
bool>(
"PropagateTracksToRadius",
true);
166 trkExtractorPSet.add<
double>(
"PtVeto_Min",2.0);
171 caloExtractorPSet.
add<
double>(
"DR_Veto_H",0.1);
172 caloExtractorPSet.add<
bool>(
"Vertex_Constraint_Z",
false);
173 caloExtractorPSet.add<
double>(
"Threshold_H",0.5);
174 caloExtractorPSet.add<
std::string>(
"ComponentName",
"CaloExtractor");
175 caloExtractorPSet.add<
double>(
"Threshold_E",0.2);
176 caloExtractorPSet.add<
double>(
"DR_Max",0.24);
177 caloExtractorPSet.add<
double>(
"DR_Veto_E",0.07);
178 caloExtractorPSet.add<
double>(
"Weight_E",1.5);
179 caloExtractorPSet.add<
bool>(
"Vertex_Constraint_XY",
false);
180 caloExtractorPSet.addUntracked<
std::string>(
"DepositLabel",
"EcalPlusHcal");
182 caloExtractorPSet.add<
double>(
"Weight_H",1.0);
185 descriptions.
add(
"hltL3MuonIsolations", desc);
193 <<
" BEGINING OF EVENT " <<
"================================" <<std::endl;
217 unsigned int nMuons = muons->size();
219 IsoDeposit::Vetos trkVetos(nMuons);
220 std::vector<IsoDeposit> trkDeps(nMuons);
227 IsoDeposit::Vetos caloVetos;
228 std::vector<IsoDeposit> caloDeps;
229 std::vector<float> caloCorrDeps;
232 caloCorrDeps.resize(nMuons, 0.);
235 caloVetos.resize(nMuons);
236 caloDeps.resize(nMuons);
239 std::vector<double> combinedRelativeDeps(nMuons, 0.);
240 std::vector<bool> combinedRelativeIsos(nMuons,
false);
242 for (
unsigned int i=0;
i<nMuons;
i++) {
248 trkVetos[
i] = trkDeps[
i].
veto();
251 caloCorrDeps[
i] = (*caloDepWithCorrMap)[candref];
255 caloVetos[
i] = caloDeps[
i].
veto();
270 for(
unsigned int iMu=0; iMu < nMuons; ++iMu){
280 <<
"CUTDEBUG: Muon pt = " << mu->pt() << std::endl
281 <<
"CUTDEBUG: minEta = " << cut.
etaRange.
min() << std::endl
282 <<
"CUTDEBUG: maxEta = " << cut.
etaRange.
max() << std::endl
283 <<
"CUTDEBUG: consize = " << cut.
conesize << std::endl
284 <<
"CUTDEBUG: thresho = " << cut.
threshold << std::endl;
290 double caloIsoSum = 0.;
292 caloIsoSum = caloCorrDeps[iMu];
293 if(caloIsoSum<0.) caloIsoSum = 0.;
294 if(
printDebug)
std::cout <<
"Rho-corrected calo deposit (min. 0) = " << caloIsoSum << std::endl;
297 const IsoDeposit & caloDeposit = caloDeps[iMu];
302 double trkIsoSum = trkIsoSumAndCount.first;
303 int count = trkIsoSumAndCount.second;
305 double muPt = mu->pt();
306 if( muPt<1. ) muPt = 1.;
307 double combinedRelativeDeposit = ((trkIsoSum + caloIsoSum ) / muPt);
310 if (
printDebug)
std::cout <<
" trk dep in cone: " << trkIsoSum <<
" with count "<<count <<std::endl
311 <<
" calo dep in cone: " << caloIsoSum << std::endl
312 <<
" muPt: " << muPt << std::endl
313 <<
" relIso: " <<combinedRelativeDeposit << std::endl
314 <<
" is isolated: "<<result << std::endl;
316 combinedRelativeIsos[iMu] =
result;
318 combinedRelativeDeps[iMu] = combinedRelativeDeposit;
327 depFillerTrk.
insert(muons, trkDeps.begin(), trkDeps.end());
329 event.put(trkDepMap,
"trkIsoDeposits");
333 depFillerCalo.
insert(muons, caloDeps.begin(), caloDeps.end());
334 depFillerCalo.
fill();
335 event.put(caloDepMap,
"caloIsoDeposits");
340 depFillerCombRel.
insert(muons, combinedRelativeDeps.begin(), combinedRelativeDeps.end());
341 depFillerCombRel.
fill();
342 event.put(combinedRelativeDepMap,
"combinedRelativeIsoDeposits");
346 isoFiller.
insert(muons, combinedRelativeIsos.begin(), combinedRelativeIsos.end());
348 event.put(comboIsoDepMap);
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theMuonCollectionToken
T getParameter(std::string const &) const
edm::InputTag theMuonCollectionLabel
const Veto & veto() const
Get veto area.
edm::EDGetTokenT< edm::ValueMap< float > > theCaloDepsToken
const std::string metname
bool theApplyCutsORmaxNTracks
apply or not the maxN cut on top of the sumPt (or nominall eff) < cuts
void insert(const H &h, I begin, I end)
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
std::string print() const
muonisolation::Range< double > etaRange
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterSet descriptions.
virtual void produce(edm::Event &, const edm::EventSetup &)
Produce isolation maps.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
muonisolation::Cuts theCuts
virtual ~L3MuonCombinedRelativeIsolationProducer()
destructor
ParameterDescriptionBase * add(U const &iLabel, T const &value)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
muonisolation::Cuts cuts() const
L3MuonCombinedRelativeIsolationProducer(const edm::ParameterSet &)
constructor with config
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool useCaloIso
flag to include or exclude calo iso from calculation
bool optOutputIsoDeposits
edm::InputTag theCaloDepsLabel
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
volatile std::atomic< bool > shutdown_flag false
reco::isodeposit::IsoDepositExtractor * trkExtractor
bool useRhoCorrectedCaloDeps
edm::ParameterSet theConfig
T get(const Candidate &c)
reco::isodeposit::IsoDepositExtractor * caloExtractor