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::Track &track) const override
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) 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::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
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 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 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 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(const edm::ParameterSet &par, edm::ConsumesCollector &&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")),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::BasicClusterCollection > basicClusterToken_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterToken_
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects

◆ ~EgammaEcalExtractor()

EgammaEcalExtractor::~EgammaEcalExtractor ( )
override

Definition at line 85 of file EgammaEcalExtractor.cc.

85 {}

Member Function Documentation

◆ deposit() [1/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.

References Exception, and Skims_PA_cff::name.

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

◆ deposit() [2/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.

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

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 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
AlgoId algo() const
algorithm identifier
Definition: CaloCluster.h:190
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:82
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:88
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:184
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:19
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:91
edm::EDGetTokenT< reco::BasicClusterCollection > basicClusterToken_
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:132
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterToken_
double energy() const
cluster energy
Definition: CaloCluster.h:149
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:79
static int position[264][3]
Definition: ReadPGInfo.cc:289
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181

◆ 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.