CMS 3D CMS Logo

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

Constructor & Destructor Documentation

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

Definition at line 42 of file EgammaEcalExtractor.h.

42  :
43  EgammaEcalExtractor(par, iC) {}
EgammaEcalExtractor(const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
egammaisolation::EgammaEcalExtractor::EgammaEcalExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector iC 
)
inline

Definition at line 44 of file EgammaEcalExtractor.h.

References ~EgammaEcalExtractor().

44  :
45  etMin_(par.getParameter<double>("etMin")),
46  conesize_(par.getParameter<double>("extRadius")),
47  scmatch_(par.getParameter<bool>("superClusterMatch")),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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 ( )
override

Definition at line 23 of file EgammaEcalExtractor.cc.

Referenced by EgammaEcalExtractor().

23 {}

Member Function Documentation

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.

References EnergyCorrector::c, ev, Exception, and dataset::name.

55  {
56  throw cms::Exception("Configuration Error") << "This extractor " << (typeid(this).name()) << " is not made for tracks";
57  }
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.

References reco::SuperCluster::clustersBegin(), reco::SuperCluster::clustersEnd(), HiRegitMuonDetachedTripletStep_cff::DeltaR, JetChargeProducer_cfi::exp, reco::Candidate::get(), edm::Event::getByToken(), reco::CaloCluster::position(), position, SimDataFormats::CaloAnalysis::sc, reco::SuperCluster::seed(), and funct::sin().

25  {
26  edm::Handle<reco::SuperClusterCollection> superClusterCollectionH;
27  edm::Handle<reco::BasicClusterCollection> basicClusterCollectionH;
28  ev.getByToken(superClusterToken_, superClusterCollectionH);
29  ev.getByToken(basicClusterToken_, basicClusterCollectionH);
30 
32  math::XYZPoint position = sc->position();
33  // match the photon hybrid supercluster with those with Algo==0 (island)
34  double delta1=1000.;
35  double deltacur=1000.;
36  const reco::SuperCluster *matchedsupercluster=nullptr;
37  bool MATCHEDSC = false;
38 
39  Direction candDir(position.eta(), position.phi());
40  reco::IsoDeposit deposit(candDir );
41  deposit.setVeto( reco::IsoDeposit::Veto(candDir, 0) ); // no veto is needed for this deposit
42  deposit.addCandEnergy(sc->energy()*sin(2*atan(exp(-sc->eta()))));
43 
44  for(reco::SuperClusterCollection::const_iterator scItr = superClusterCollectionH->begin(); scItr != superClusterCollectionH->end(); ++scItr){
45 
46  const reco::SuperCluster *supercluster = &(*scItr);
47 
48  if(supercluster->seed()->algo() == 0){
49  deltacur = ROOT::Math::VectorUtil::DeltaR(supercluster->position(), position);
50  if (deltacur < delta1) {
51  delta1=deltacur;
52  matchedsupercluster = supercluster;
53  MATCHEDSC = true;
54  }
55  }
56  }
57 
58  const reco::BasicCluster *cluster= nullptr;
59 
60  //loop over basic clusters
61  for(reco::BasicClusterCollection::const_iterator cItr = basicClusterCollectionH->begin(); cItr != basicClusterCollectionH->end(); ++cItr){
62 
63  cluster = &(*cItr);
64 // double ebc_bcchi2 = cluster->chi2();
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)));
69  double newDelta = 0.;
70 
71  if (ebc_bcet > etMin_ && ebc_bcalgo == 0) {
72 // if (ebc_bcchi2 < 30.) {
73 
74  if(MATCHEDSC || !scmatch_ ){ //skip selection if user wants to fill all superclusters
75  bool inSuperCluster = false;
76 
77  if( scmatch_ ){ // only try the matching if needed
78  reco::CaloCluster_iterator theEclust = matchedsupercluster->clustersBegin();
79  // loop over the basic clusters of the matched supercluster
80  for(;theEclust != matchedsupercluster->clustersEnd(); ++theEclust) {
81  if ((**theEclust) == (*cluster) ) inSuperCluster = true;
82  }
83  }
84  if (!inSuperCluster || !scmatch_ ) { //skip selection if user wants to fill all superclusters
85  newDelta=ROOT::Math::VectorUtil::DeltaR(cluster->position(),position);
86  if(newDelta < conesize_) {
87  deposit.addDeposit( Direction(cluster->eta(), cluster->phi()), ebc_bcet);
88  }
89  }
90  }
91 // } // matches ebc_bcchi2
92  } // matches ebc_bcet && ebc_bcalgo
93 
94  }
95 
96  // std::cout << "Will return ecalIsol = " << ecalIsol << std::endl;
97  return deposit;
98 
99 }
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:131
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:80
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:23
edm::EDGetTokenT< reco::BasicClusterCollection > basicClusterToken_
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:139
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterToken_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
static int position[264][3]
Definition: ReadPGInfo.cc:509
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:75
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:66
reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:78
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 54 of file EgammaEcalExtractor.h.

54 { }

Member Data Documentation

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

Definition at line 70 of file EgammaEcalExtractor.h.

double egammaisolation::EgammaEcalExtractor::conesize_
private

Definition at line 67 of file EgammaEcalExtractor.h.

double egammaisolation::EgammaEcalExtractor::etMin_
private

Definition at line 66 of file EgammaEcalExtractor.h.

bool egammaisolation::EgammaEcalExtractor::scmatch_
private

Definition at line 68 of file EgammaEcalExtractor.h.

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

Definition at line 71 of file EgammaEcalExtractor.h.