CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
egammaisolation::EgammaEcalExtractor Class Reference
Inheritance diagram for egammaisolation::EgammaEcalExtractor:
reco::isodeposit::IsoDepositExtractor

Public Member Functions

reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
 
 EgammaEcalExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
 EgammaEcalExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &iC)
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks) override
 
 ~EgammaEcalExtractor () override
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

edm::EDGetTokenT< reco::BasicClusterCollectionbasicClusterToken_
 
double conesize_
 
double etMin_
 
bool scmatch_
 
edm::EDGetTokenT< reco::SuperClusterCollectionsuperClusterToken_
 

Detailed Description

Definition at line 37 of file EgammaEcalExtractor.cc.

Constructor & Destructor Documentation

◆ EgammaEcalExtractor() [1/2]

egammaisolation::EgammaEcalExtractor::EgammaEcalExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 39 of file EgammaEcalExtractor.cc.

39 : EgammaEcalExtractor(par, iC) {}

◆ EgammaEcalExtractor() [2/2]

egammaisolation::EgammaEcalExtractor::EgammaEcalExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector iC 
)
inline

Definition at line 40 of file EgammaEcalExtractor.cc.

41  : etMin_(par.getParameter<double>("etMin")),
42  conesize_(par.getParameter<double>("extRadius")),
43  scmatch_(par.getParameter<bool>("superClusterMatch")),

◆ ~EgammaEcalExtractor()

EgammaEcalExtractor::~EgammaEcalExtractor ( )
override

Definition at line 85 of file EgammaEcalExtractor.cc.

85 {}

Member Function Documentation

◆ deposit() [1/2]

reco::IsoDeposit EgammaEcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const
overridevirtual

make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 87 of file EgammaEcalExtractor.cc.

89  {
91  math::XYZPoint position = sc->position();
92  // match the photon hybrid supercluster with those with Algo==0 (island)
93  double delta1 = 1000.;
94  double deltacur = 1000.;
95  const reco::SuperCluster* matchedsupercluster = nullptr;
96  bool MATCHEDSC = false;
97 
98  Direction candDir(position.eta(), position.phi());
99  reco::IsoDeposit deposit(candDir);
100  deposit.setVeto(reco::IsoDeposit::Veto(candDir, 0)); // no veto is needed for this deposit
101  deposit.addCandEnergy(sc->energy() * sin(2 * atan(exp(-sc->eta()))));
102 
103  for (auto const& scItr : ev.get(superClusterToken_)) {
104  const reco::SuperCluster* supercluster = &scItr;
105 
106  if (supercluster->seed()->algo() == 0) {
107  deltacur = ROOT::Math::VectorUtil::DeltaR(supercluster->position(), position);
108  if (deltacur < delta1) {
109  delta1 = deltacur;
110  matchedsupercluster = supercluster;
111  MATCHEDSC = true;
112  }
113  }
114  }
115 
116  const reco::BasicCluster* cluster = nullptr;
117 
118  //loop over basic clusters
119  for (auto const& cItr : ev.get(basicClusterToken_)) {
120  cluster = &cItr;
121  // double ebc_bcchi2 = cluster->chi2();
122  int ebc_bcalgo = cluster->algo();
123  double ebc_bce = cluster->energy();
124  double ebc_bceta = cluster->eta();
125  double ebc_bcet = ebc_bce * sin(2 * atan(exp(ebc_bceta)));
126  double newDelta = 0.;
127 
128  if (ebc_bcet > etMin_ && ebc_bcalgo == 0) {
129  // if (ebc_bcchi2 < 30.) {
130 
131  if (MATCHEDSC || !scmatch_) { //skip selection if user wants to fill all superclusters
132  bool inSuperCluster = false;
133 
134  if (scmatch_) { // only try the matching if needed
135  reco::CaloCluster_iterator theEclust = matchedsupercluster->clustersBegin();
136  // loop over the basic clusters of the matched supercluster
137  for (; theEclust != matchedsupercluster->clustersEnd(); ++theEclust) {
138  if ((**theEclust) == (*cluster))
139  inSuperCluster = true;
140  }
141  }
142  if (!inSuperCluster || !scmatch_) { //skip selection if user wants to fill all superclusters
143  newDelta = ROOT::Math::VectorUtil::DeltaR(cluster->position(), position);
144  if (newDelta < conesize_) {
145  deposit.addDeposit(Direction(cluster->eta(), cluster->phi()), ebc_bcet);
146  }
147  }
148  }
149  // } // matches ebc_bcchi2
150  } // matches ebc_bcet && ebc_bcalgo
151  }
152 
153  // std::cout << "Will return ecalIsol = " << ecalIsol << std::endl;
154  return deposit;
155 }

References reco::CaloCluster::algo(), reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), electronAnalyzer_cfi::DeltaR, reco::CaloCluster::energy(), reco::CaloCluster::eta(), ev, JetChargeProducer_cfi::exp, reco::Candidate::get(), reco::CaloCluster::phi(), reco::CaloCluster::position(), position, reco::SuperCluster::seed(), and funct::sin().

◆ deposit() [2/2]

reco::IsoDeposit egammaisolation::EgammaEcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
inlineoverridevirtual

make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 53 of file EgammaEcalExtractor.cc.

55  {
56  throw cms::Exception("Configuration Error")
57  << "This extractor " << (typeid(this).name()) << " is not made for tracks";
58  }

References Exception, and Skims_PA_cff::name.

◆ fillVetos()

void egammaisolation::EgammaEcalExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
inlineoverridevirtual

fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 51 of file EgammaEcalExtractor.cc.

51  {
52  }

Member Data Documentation

◆ basicClusterToken_

edm::EDGetTokenT<reco::BasicClusterCollection> egammaisolation::EgammaEcalExtractor::basicClusterToken_
private

Definition at line 72 of file EgammaEcalExtractor.cc.

◆ conesize_

double egammaisolation::EgammaEcalExtractor::conesize_
private

Definition at line 69 of file EgammaEcalExtractor.cc.

◆ etMin_

double egammaisolation::EgammaEcalExtractor::etMin_
private

Definition at line 68 of file EgammaEcalExtractor.cc.

◆ scmatch_

bool egammaisolation::EgammaEcalExtractor::scmatch_
private

Definition at line 70 of file EgammaEcalExtractor.cc.

◆ superClusterToken_

edm::EDGetTokenT<reco::SuperClusterCollection> egammaisolation::EgammaEcalExtractor::superClusterToken_
private

Definition at line 73 of file EgammaEcalExtractor.cc.

reco::CaloCluster::phi
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
egammaisolation::EgammaEcalExtractor::etMin_
double etMin_
Definition: EgammaEcalExtractor.cc:68
reco::SuperCluster
Definition: SuperCluster.h:18
reco::IsoDeposit::addDeposit
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
egammaisolation::EgammaEcalExtractor::deposit
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
Definition: EgammaEcalExtractor.cc:53
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
edm::PtrVectorItr
Definition: PtrVector.h:51
reco::IsoDeposit::Veto
Definition: IsoDeposit.h:59
egammaisolation::EgammaEcalExtractor::EgammaEcalExtractor
EgammaEcalExtractor(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
Definition: EgammaEcalExtractor.cc:39
edm::Ref< SuperClusterCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
reco::CaloCluster
Definition: CaloCluster.h:31
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::SuperCluster::seed
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:77
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
egammaisolation::EgammaEcalExtractor::basicClusterToken_
edm::EDGetTokenT< reco::BasicClusterCollection > basicClusterToken_
Definition: EgammaEcalExtractor.cc:72
egammaisolation::EgammaEcalExtractor::superClusterToken_
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterToken_
Definition: EgammaEcalExtractor.cc:73
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
reco::SuperCluster::clustersBegin
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:86
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
reco::IsoDeposit::addCandEnergy
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
egammaisolation::EgammaEcalExtractor::scmatch_
bool scmatch_
Definition: EgammaEcalExtractor.cc:70
reco::CaloCluster::algo
AlgoId algo() const
algorithm identifier
Definition: CaloCluster.h:190
reco::isodeposit::Direction
Definition: IsoDepositDirection.h:19
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
reco::IsoDeposit
Definition: IsoDeposit.h:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::SuperCluster::clustersEnd
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:89
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
edm::InputTag
Definition: InputTag.h:15
reco::IsoDeposit::setVeto
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
egammaisolation::EgammaEcalExtractor::conesize_
double conesize_
Definition: EgammaEcalExtractor.cc:69