36 #include <Math/VectorUtil.h> 54 <<
"This extractor " << (
typeid(
this).
name()) <<
" is not made for tracks";
108 : etMin_(par.getParameter<double>(
"etMin")),
109 energyMin_(par.getParameter<double>(
"energyMin")),
110 extRadius_(par.getParameter<double>(
"extRadius")),
111 intRadius_(par.getParameter<double>(
"intRadius")),
112 intStrip_(par.getParameter<double>(
"intStrip")),
113 barrelEcalHitsTag_(par.getParameter<
edm::
InputTag>(
"barrelEcalHits")),
114 endcapEcalHitsTag_(par.getParameter<
edm::
InputTag>(
"endcapEcalHits")),
119 fakeNegativeDeposit_(par.getParameter<
bool>(
"subtractSuperClusterEnergy")),
120 tryBoth_(par.getParameter<
bool>(
"tryBoth")),
121 vetoClustered_(par.getParameter<
bool>(
"vetoClustered")),
128 const std::vector<std::string> flagnamesEB = par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEB");
130 const std::vector<std::string> flagnamesEE = par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEE");
132 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
134 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
136 const std::vector<std::string> severitynamesEB =
137 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEB");
139 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
141 const std::vector<std::string> severitynamesEE =
142 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEE");
144 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
147 throw cms::Exception(
"Configuration Error") <<
"EgammaRecHitExtractor: " 148 <<
"If you use 'subtractSuperClusterEnergy', you *must* set " 149 "'intRadius' to ZERO; it does not make sense, otherwise.";
152 if (isoVariable ==
"et") {
154 }
else if (isoVariable ==
"energy") {
158 <<
"EgammaRecHitExtractor: isolationVariable '" << isoVariable <<
"' not known. " 159 <<
" Supported values are 'et', 'energy'. ";
165 <<
"If you have configured 'barrelRecHits' == 'endcapRecHits', so I'm switching 'tryBoth' to FALSE.";
192 Direction candDir(caloPosition.eta(), caloPosition.phi());
195 double sinTheta =
sin(2 * atan(
exp(-sc->eta())));
199 double fakeEnergy = -sc->rawEnergy();
205 bool inBarrel =
sameTag_ || (
abs(sc->eta()) < 1.479);
225 GlobalPoint caloPosition(sc->position().x(), sc->position().y(), sc->position().z());
228 double caloeta = caloPosition.eta();
229 double calophi = caloPosition.phi();
232 std::vector<std::pair<DetId, float> >::const_iterator rhIt;
234 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin(), end = chosen.end();
i != end; ++
i) {
236 if (
j !=
hits.end()) {
247 bool isClustered =
false;
248 for (
auto bcIt = sc->clustersBegin(); bcIt != sc->clustersEnd(); ++bcIt) {
249 for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
250 if (rhIt->first == *
i)
263 std::vector<int>::const_iterator sit;
292 && fabs(
eta - caloeta) >
intStrip_ && (
eta - caloeta) * (
eta - caloeta) + phiDiff * phiDiff >
r2) {
constexpr double deltaPhi(double phi1, double phi2)
std::set< DetId > DetIdSet
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void setVeto(const Veto &aVeto)
Set veto.
const std::string metname
T get() const
get a component
Sin< T >::type sin(const T &t)
std::vector< Track > TrackCollection
collection of Tracks
std::vector< EcalRecHit >::const_iterator const_iterator
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
virtual DetIdSet getCells(const GlobalPoint &r, double dR) const
Get a list of all cells within a dR of the given cell.
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Abs< T >::type abs(const T &t)
XYZPointD XYZPoint
point in space with cartesian internal representation
static int position[264][3]
#define DEFINE_EDM_PLUGIN(factory, type, name)
Log< level::Warning, false > LogWarning
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly