13 #include <Math/VectorUtil.h>
42 : etMin_(par.getParameter<double>(
"etMin")),
43 energyMin_(par.getParameter<double>(
"energyMin")),
44 extRadius_(par.getParameter<double>(
"extRadius")),
45 intRadius_(par.getParameter<double>(
"intRadius")),
46 intStrip_(par.getParameter<double>(
"intStrip")),
47 barrelEcalHitsTag_(par.getParameter<
edm::
InputTag>(
"barrelEcalHits")),
48 endcapEcalHitsTag_(par.getParameter<
edm::
InputTag>(
"endcapEcalHits")),
51 fakeNegativeDeposit_(par.getParameter<
bool>(
"subtractSuperClusterEnergy")),
52 tryBoth_(par.getParameter<
bool>(
"tryBoth")),
53 vetoClustered_(par.getParameter<
bool>(
"vetoClustered")),
60 const std::vector<std::string> flagnamesEB = par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEB");
62 const std::vector<std::string> flagnamesEE = par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEE");
64 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
66 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
68 const std::vector<std::string> severitynamesEB =
69 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEB");
71 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
73 const std::vector<std::string> severitynamesEE =
74 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEE");
76 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
79 throw cms::Exception(
"Configuration Error") <<
"EgammaRecHitExtractor: "
80 <<
"If you use 'subtractSuperClusterEnergy', you *must* set "
81 "'intRadius' to ZERO; it does not make sense, otherwise.";
84 if (isoVariable ==
"et") {
86 }
else if (isoVariable ==
"energy") {
90 <<
"EgammaRecHitExtractor: isolationVariable '" << isoVariable <<
"' not known. "
91 <<
" Supported values are 'et', 'energy'. ";
97 <<
"If you have configured 'barrelRecHits' == 'endcapRecHits', so I'm switching 'tryBoth' to FALSE.";
137 Direction candDir(caloPosition.eta(), caloPosition.phi());
140 double sinTheta =
sin(2 * atan(
exp(-sc->eta())));
144 double fakeEnergy = -sc->rawEnergy();
150 bool inBarrel =
sameTag_ || (
abs(sc->eta()) < 1.479);
152 collect(
deposit, sc, barrelgeom, caloGeom, *barrelEcalRecHitsH, sevLevel,
true);
156 collect(
deposit, sc, endcapgeom, caloGeom, *endcapEcalRecHitsH, sevLevel,
false);
170 GlobalPoint caloPosition(sc->position().x(), sc->position().y(), sc->position().z());
173 double caloeta = caloPosition.eta();
174 double calophi = caloPosition.phi();
177 std::vector<std::pair<DetId, float> >::const_iterator rhIt;
179 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin(),
end = chosen.end();
i !=
end; ++
i) {
181 if (
j !=
hits.end()) {
192 bool isClustered =
false;
194 for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
195 if (rhIt->first == *
i)
208 std::vector<int>::const_iterator sit;
237 && fabs(
eta - caloeta) >
intStrip_ && (
eta - caloeta) * (
eta - caloeta) + phiDiff * phiDiff >
r2) {