14 #include <Math/VectorUtil.h>
20 using namespace egammaisolation;
21 using namespace reco::isodeposit;
28 ev.
getByLabel(superClusterTag_, superClusterCollectionH);
29 ev.
getByLabel(basicClusterTag_, basicClusterCollectionH);
35 double deltacur=1000.;
37 bool MATCHEDSC =
false;
39 Direction candDir(position.eta(), position.phi());
42 deposit.addCandEnergy(sc->energy()*
sin(2*atan(
exp(-sc->eta()))));
44 for(reco::SuperClusterCollection::const_iterator scItr = superClusterCollectionH->begin(); scItr != superClusterCollectionH->end(); ++scItr){
48 if(supercluster->
seed()->algo() == 0){
49 deltacur = ROOT::Math::VectorUtil::DeltaR(supercluster->
position(),
position);
50 if (deltacur < delta1) {
52 matchedsupercluster = supercluster;
61 for(reco::BasicClusterCollection::const_iterator cItr = basicClusterCollectionH->begin(); cItr != basicClusterCollectionH->end(); ++cItr){
65 int ebc_bcalgo = cluster->algo();
66 double ebc_bce = cluster->energy();
67 double ebc_bceta = cluster->eta();
68 double ebc_bcet = ebc_bce*
sin(2*atan(
exp(ebc_bceta)));
71 if (ebc_bcet > etMin_ && ebc_bcalgo == 0) {
74 if(MATCHEDSC || !scmatch_ ){
75 bool inSuperCluster =
false;
80 for(;theEclust != matchedsupercluster->
clustersEnd(); ++theEclust) {
81 if ((**theEclust) == (*cluster) ) inSuperCluster =
true;
84 if (!inSuperCluster || !scmatch_ ) {
85 newDelta=ROOT::Math::VectorUtil::DeltaR(cluster->position(),
position);
86 if(newDelta < conesize_) {
87 deposit.addDeposit(
Direction(cluster->eta(), cluster->phi()), ebc_bcet);
const math::XYZPoint & position() const
cluster centroid position
Sin< T >::type sin(const T &t)
Exp< T >::type exp(const T &t)
static int position[TOTALCHAMBERS][3]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
XYZPointD XYZPoint
point in space with cartesian internal representation
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
T get() const
get a component
const CaloClusterPtr & seed() const
seed BasicCluster
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents