CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &c) const
 
 EgammaEcalExtractor (const edm::ParameterSet &par)
 
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
 
virtual ~EgammaEcalExtractor ()
 
- 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::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

edm::InputTag basicClusterTag_
 
double conesize_
 
double etMin_
 
bool scmatch_
 
edm::InputTag superClusterTag_
 

Detailed Description

Definition at line 39 of file EgammaEcalExtractor.h.

Constructor & Destructor Documentation

egammaisolation::EgammaEcalExtractor::EgammaEcalExtractor ( const edm::ParameterSet par)
inline

Definition at line 41 of file EgammaEcalExtractor.h.

41  :
42  etMin_(par.getParameter<double>("etMin")),
43  conesize_(par.getParameter<double>("extRadius")),
44  scmatch_(par.getParameter<bool>("superClusterMatch")),
45  basicClusterTag_(par.getParameter<edm::InputTag>("basicClusters")),
46  superClusterTag_(par.getParameter<edm::InputTag>("superClusters")) { }
T getParameter(std::string const &) const
EgammaEcalExtractor::~EgammaEcalExtractor ( )
virtual

Definition at line 23 of file EgammaEcalExtractor.cc.

23 {}

Member Function Documentation

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

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

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 52 of file EgammaEcalExtractor.h.

References edm::hlt::Exception, and mergeVDriftHistosByStation::name.

52  {
53  throw cms::Exception("Configuration Error") << "This extractor " << (typeid(this).name()) << " is not made for tracks";
54  }
reco::IsoDeposit EgammaEcalExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const
virtual

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(), funct::exp(), reco::Candidate::get(), edm::Event::getByLabel(), reco::CaloCluster::position(), position, reco::SuperCluster::seed(), and funct::sin().

25  {
26  edm::Handle<reco::SuperClusterCollection> superClusterCollectionH;
27  edm::Handle<reco::BasicClusterCollection> basicClusterCollectionH;
28  ev.getByLabel(superClusterTag_, superClusterCollectionH);
29  ev.getByLabel(basicClusterTag_, 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=0;
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= 0;
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:123
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:75
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Exp< T >::type exp(const T &t)
Definition: Exp.h:22
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
Definition: IsoDeposit.cc:23
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
Definition: IsoDeposit.h:134
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:65
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:62
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:241
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:68
virtual void egammaisolation::EgammaEcalExtractor::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
inlinevirtual

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

51 { }

Member Data Documentation

edm::InputTag egammaisolation::EgammaEcalExtractor::basicClusterTag_
private

Definition at line 67 of file EgammaEcalExtractor.h.

double egammaisolation::EgammaEcalExtractor::conesize_
private

Definition at line 64 of file EgammaEcalExtractor.h.

double egammaisolation::EgammaEcalExtractor::etMin_
private

Definition at line 63 of file EgammaEcalExtractor.h.

bool egammaisolation::EgammaEcalExtractor::scmatch_
private

Definition at line 65 of file EgammaEcalExtractor.h.

edm::InputTag egammaisolation::EgammaEcalExtractor::superClusterTag_
private

Definition at line 68 of file EgammaEcalExtractor.h.