37 #include <Math/VectorUtil.h>
55 <<
"This extractor " << (
typeid(
this).
name()) <<
" is not made for tracks";
107 : etMin_(par.getParameter<double>(
"etMin")),
108 energyMin_(par.getParameter<double>(
"energyMin")),
109 extRadius_(par.getParameter<double>(
"extRadius")),
110 intRadius_(par.getParameter<double>(
"intRadius")),
111 intStrip_(par.getParameter<double>(
"intStrip")),
112 barrelEcalHitsTag_(par.getParameter<
edm::
InputTag>(
"barrelEcalHits")),
113 endcapEcalHitsTag_(par.getParameter<
edm::
InputTag>(
"endcapEcalHits")),
116 fakeNegativeDeposit_(par.getParameter<
bool>(
"subtractSuperClusterEnergy")),
117 tryBoth_(par.getParameter<
bool>(
"tryBoth")),
118 vetoClustered_(par.getParameter<
bool>(
"vetoClustered")),
125 const std::vector<std::string> flagnamesEB = par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEB");
127 const std::vector<std::string> flagnamesEE = par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEE");
129 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
131 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
133 const std::vector<std::string> severitynamesEB =
134 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEB");
136 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
138 const std::vector<std::string> severitynamesEE =
139 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEE");
141 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
144 throw cms::Exception(
"Configuration Error") <<
"EgammaRecHitExtractor: "
145 <<
"If you use 'subtractSuperClusterEnergy', you *must* set "
146 "'intRadius' to ZERO; it does not make sense, otherwise.";
149 if (isoVariable ==
"et") {
151 }
else if (isoVariable ==
"energy") {
155 <<
"EgammaRecHitExtractor: isolationVariable '" << isoVariable <<
"' not known. "
156 <<
" Supported values are 'et', 'energy'. ";
162 <<
"If you have configured 'barrelRecHits' == 'endcapRecHits', so I'm switching 'tryBoth' to FALSE.";
194 Direction candDir(caloPosition.eta(), caloPosition.phi());
197 double sinTheta =
sin(2 * atan(
exp(-sc->eta())));
201 double fakeEnergy = -sc->rawEnergy();
207 bool inBarrel =
sameTag_ || (
abs(sc->eta()) < 1.479);
227 GlobalPoint caloPosition(sc->position().x(), sc->position().y(), sc->position().z());
230 double caloeta = caloPosition.eta();
231 double calophi = caloPosition.phi();
234 std::vector<std::pair<DetId, float> >::const_iterator rhIt;
236 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin(),
end = chosen.end();
i !=
end; ++
i) {
238 if (
j !=
hits.end()) {
249 bool isClustered =
false;
250 for (
auto bcIt = sc->clustersBegin(); bcIt != sc->clustersEnd(); ++bcIt) {
251 for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
252 if (rhIt->first == *
i)
265 std::vector<int>::const_iterator sit;
294 && fabs(
eta - caloeta) >
intStrip_ && (
eta - caloeta) * (
eta - caloeta) + phiDiff * phiDiff >
r2) {