CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Attributes
egammaisolation::EgammaEcalExtractor Class Reference

#include <EgammaEcalExtractor.h>

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 39 of file EgammaEcalExtractor.h.

Constructor & Destructor Documentation

◆ EgammaEcalExtractor() [1/2]

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

Definition at line 41 of file EgammaEcalExtractor.h.

41 : EgammaEcalExtractor(par, iC) {}

◆ EgammaEcalExtractor() [2/2]

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

Definition at line 42 of file EgammaEcalExtractor.h.

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

◆ ~EgammaEcalExtractor()

EgammaEcalExtractor::~EgammaEcalExtractor ( )
override

Definition at line 23 of file EgammaEcalExtractor.cc.

23 {}

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 25 of file EgammaEcalExtractor.cc.

27  {
28  edm::Handle<reco::SuperClusterCollection> superClusterCollectionH;
29  edm::Handle<reco::BasicClusterCollection> basicClusterCollectionH;
30  ev.getByToken(superClusterToken_, superClusterCollectionH);
31  ev.getByToken(basicClusterToken_, basicClusterCollectionH);
32 
34  math::XYZPoint position = sc->position();
35  // match the photon hybrid supercluster with those with Algo==0 (island)
36  double delta1 = 1000.;
37  double deltacur = 1000.;
38  const reco::SuperCluster *matchedsupercluster = nullptr;
39  bool MATCHEDSC = false;
40 
41  Direction candDir(position.eta(), position.phi());
42  reco::IsoDeposit deposit(candDir);
43  deposit.setVeto(reco::IsoDeposit::Veto(candDir, 0)); // no veto is needed for this deposit
44  deposit.addCandEnergy(sc->energy() * sin(2 * atan(exp(-sc->eta()))));
45 
46  for (reco::SuperClusterCollection::const_iterator scItr = superClusterCollectionH->begin();
47  scItr != superClusterCollectionH->end();
48  ++scItr) {
49  const reco::SuperCluster *supercluster = &(*scItr);
50 
51  if (supercluster->seed()->algo() == 0) {
52  deltacur = ROOT::Math::VectorUtil::DeltaR(supercluster->position(), position);
53  if (deltacur < delta1) {
54  delta1 = deltacur;
55  matchedsupercluster = supercluster;
56  MATCHEDSC = true;
57  }
58  }
59  }
60 
61  const reco::BasicCluster *cluster = nullptr;
62 
63  //loop over basic clusters
64  for (reco::BasicClusterCollection::const_iterator cItr = basicClusterCollectionH->begin();
65  cItr != basicClusterCollectionH->end();
66  ++cItr) {
67  cluster = &(*cItr);
68  // double ebc_bcchi2 = cluster->chi2();
69  int ebc_bcalgo = cluster->algo();
70  double ebc_bce = cluster->energy();
71  double ebc_bceta = cluster->eta();
72  double ebc_bcet = ebc_bce * sin(2 * atan(exp(ebc_bceta)));
73  double newDelta = 0.;
74 
75  if (ebc_bcet > etMin_ && ebc_bcalgo == 0) {
76  // if (ebc_bcchi2 < 30.) {
77 
78  if (MATCHEDSC || !scmatch_) { //skip selection if user wants to fill all superclusters
79  bool inSuperCluster = false;
80 
81  if (scmatch_) { // only try the matching if needed
82  reco::CaloCluster_iterator theEclust = matchedsupercluster->clustersBegin();
83  // loop over the basic clusters of the matched supercluster
84  for (; theEclust != matchedsupercluster->clustersEnd(); ++theEclust) {
85  if ((**theEclust) == (*cluster))
86  inSuperCluster = true;
87  }
88  }
89  if (!inSuperCluster || !scmatch_) { //skip selection if user wants to fill all superclusters
90  newDelta = ROOT::Math::VectorUtil::DeltaR(cluster->position(), position);
91  if (newDelta < conesize_) {
92  deposit.addDeposit(Direction(cluster->eta(), cluster->phi()), ebc_bcet);
93  }
94  }
95  }
96  // } // matches ebc_bcchi2
97  } // matches ebc_bcet && ebc_bcalgo
98  }
99 
100  // std::cout << "Will return ecalIsol = " << ecalIsol << std::endl;
101  return deposit;
102 }

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 55 of file EgammaEcalExtractor.h.

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

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 53 of file EgammaEcalExtractor.h.

53  {
54  }

Member Data Documentation

◆ basicClusterToken_

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

Definition at line 74 of file EgammaEcalExtractor.h.

◆ conesize_

double egammaisolation::EgammaEcalExtractor::conesize_
private

Definition at line 71 of file EgammaEcalExtractor.h.

◆ etMin_

double egammaisolation::EgammaEcalExtractor::etMin_
private

Definition at line 70 of file EgammaEcalExtractor.h.

◆ scmatch_

bool egammaisolation::EgammaEcalExtractor::scmatch_
private

Definition at line 72 of file EgammaEcalExtractor.h.

◆ superClusterToken_

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

Definition at line 75 of file EgammaEcalExtractor.h.

reco::CaloCluster::phi
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
egammaisolation::EgammaEcalExtractor::etMin_
double etMin_
Definition: EgammaEcalExtractor.h:70
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.h:55
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.h:41
edm::Handle
Definition: AssociativeIterator.h:50
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:49
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.h:74
egammaisolation::EgammaEcalExtractor::superClusterToken_
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterToken_
Definition: EgammaEcalExtractor.h:75
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
egammaisolation::EgammaEcalExtractor::scmatch_
bool scmatch_
Definition: EgammaEcalExtractor.h:72
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:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
reco::IsoDeposit
Definition: IsoDeposit.h:49
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.h:71