test
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, edm::ConsumesCollector &&iC)
 
 EgammaEcalExtractor (const edm::ParameterSet &par, edm::ConsumesCollector &iC)
 
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 void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

edm::EDGetTokenT
< reco::BasicClusterCollection
basicClusterToken_
 
double conesize_
 
double etMin_
 
bool scmatch_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
superClusterToken_
 

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.

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

References Exception, and mergeVDriftHistosByStation::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
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(), HLT_25ns10e33_v2_cff::DeltaR, create_public_lumi_plots::exp, reco::Candidate::get(), edm::Event::getByToken(), 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.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=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:126
void setVeto(const Veto &aVeto)
Set veto.
Definition: IsoDeposit.h:80
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
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
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
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
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:78
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 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.