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")),
61 const std::vector<std::string> flagnamesEB =
62 par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEB");
64 const std::vector<std::string> flagnamesEE =
65 par.
getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEE");
68 StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
71 StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
73 const std::vector<std::string> severitynamesEB =
74 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEB");
77 StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
79 const std::vector<std::string> severitynamesEE =
80 par.
getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEE");
83 StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
86 throw cms::Exception(
"Configuration Error") <<
"EgammaRecHitExtractor: " <<
87 "If you use 'subtractSuperClusterEnergy', you *must* set 'intRadius' to ZERO; it does not make sense, otherwise.";
90 if (isoVariable ==
"et") {
92 }
else if (isoVariable ==
"energy") {
95 throw cms::Exception(
"Configuration Error") <<
"EgammaRecHitExtractor: isolationVariable '" << isoVariable <<
"' not known. " 96 <<
" Supported values are 'et', 'energy'. ";
101 edm::LogWarning(
"EgammaRecHitExtractor") <<
"If you have configured 'barrelRecHits' == 'endcapRecHits', so I'm switching 'tryBoth' to FALSE.";
141 Direction candDir(caloPosition.eta(), caloPosition.phi());
144 double sinTheta =
sin(2*atan(
exp(-sc->eta())));
145 deposit.addCandEnergy(sc->energy() * (
useEt_ ? sinTheta : 1.0)) ;
148 double fakeEnergy = -sc->rawEnergy();
150 deposit.addDeposit(candDir, fakeEnergy * (
useEt_ ? sinTheta : 1.0));
154 bool inBarrel =
sameTag_ || (
abs(sc->eta()) < 1.479 );
156 collect(deposit, sc, barrelgeom, caloGeom, *barrelEcalRecHitsH, sevLevel,
true);
160 collect(deposit, sc, endcapgeom, caloGeom, *endcapEcalRecHitsH, sevLevel,
false);
175 GlobalPoint caloPosition(sc->position().x(), sc->position().y() , sc->position().z());
178 double caloeta=caloPosition.eta();
179 double calophi=caloPosition.phi();
182 std::vector< std::pair<DetId, float> >::const_iterator rhIt;
185 for (CaloSubdetectorGeometry::DetIdSet::const_iterator
i = chosen.begin(),
end = chosen.end() ;
i !=
end; ++
i) {
187 if (j != hits.
end()) {
189 double eta = position.
eta();
190 double phi = position.
phi();
191 double energy = j->energy();
192 double et = energy*position.
perp()/position.
mag();
199 bool isClustered =
false;
201 for(rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
202 if( rhIt->first == *
i ) isClustered =
true;
203 if( isClustered )
break;
205 if( isClustered )
break;
208 if(isClustered)
continue;
211 std::vector<int>::const_iterator sit;
223 std::vector<int>::const_iterator vit;
249 && (eta-caloeta)*(eta-caloeta) + phiDiff*phiDiff >
r2 ) {
constexpr double deltaPhi(double phi1, double phi2)
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::set< DetId > DetIdSet
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
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)
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.
Abs< T >::type abs(const T &t)
const_iterator end() const
XYZPointD XYZPoint
point in space with cartesian internal representation
et
define resolution functions of each parameter
iterator find(key_type k)
static int position[264][3]
T get() const
get a component
T const * product() const