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 Member Functions | Private Attributes
reco::isodeposit::OtherJetConstituentsDeltaRVeto Class Reference

#include <EventDependentAbsVetos.h>

Inheritance diagram for reco::isodeposit::OtherJetConstituentsDeltaRVeto:
reco::isodeposit::EventDependentAbsVeto reco::isodeposit::AbsVeto

Public Member Functions

virtual void centerOn (double eta, double phi)
 Set axis for matching jets. More...
 
 OtherJetConstituentsDeltaRVeto (Direction dir, const edm::InputTag &jets, double dRjet, const edm::InputTag &pfCandAssocMap, double dRconstituent)
 Create a veto specifying the input collection of the jets, the candidates, and the deltaR. More...
 
virtual void setEvent (const edm::Event &evt, const edm::EventSetup &es)
 Picks up the directions of the given candidates. More...
 
virtual bool veto (double eta, double phi, float value) const
 
virtual ~OtherJetConstituentsDeltaRVeto ()
 
- Public Member Functions inherited from reco::isodeposit::EventDependentAbsVeto
virtual ~EventDependentAbsVeto ()
 
- Public Member Functions inherited from reco::isodeposit::AbsVeto
virtual ~AbsVeto ()
 

Private Member Functions

void initialize ()
 

Private Attributes

double dR2constituent_
 
double dR2jet_
 
const edm::Eventevt_
 
std::vector< Directionitems_
 
edm::InputTag srcJets_
 
edm::InputTag srcPFCandAssocMap_
 
Direction vetoDir_
 

Detailed Description

Definition at line 59 of file EventDependentAbsVetos.h.

Constructor & Destructor Documentation

reco::isodeposit::OtherJetConstituentsDeltaRVeto::OtherJetConstituentsDeltaRVeto ( Direction  dir,
const edm::InputTag jets,
double  dRjet,
const edm::InputTag pfCandAssocMap,
double  dRconstituent 
)
inline

Create a veto specifying the input collection of the jets, the candidates, and the deltaR.

Definition at line 62 of file EventDependentAbsVetos.h.

63  : evt_(0),
64  vetoDir_(dir),
65  srcJets_(jets),
66  dR2jet_(dRjet*dRjet),
67  srcPFCandAssocMap_(pfCandAssocMap),
68  dR2constituent_(dRconstituent*dRconstituent)
69  {
70  //std::cout << "<OtherJetConstituentsDeltaRVeto::OtherJetConstituentsDeltaRVeto>:" << std::endl;
71  //std::cout << " vetoDir: eta = " << vetoDir_.eta() << ", phi = " << vetoDir_.phi() << std::endl;
72  //std::cout << " srcJets = " << srcJets_.label() << ":" << srcJets_.instance() << std::endl;
73  //std::cout << " dRjet = " << sqrt(dR2jet_) << std::endl;
74  //std::cout << " srcPFCandAssocMap = " << srcPFCandAssocMap_.label() << ":" << srcPFCandAssocMap_.instance() << std::endl;
75  //std::cout << " dRconstituent = " << sqrt(dR2constituent_) << std::endl;
76  }
dbl *** dir
Definition: mlp_gen.cc:35
virtual reco::isodeposit::OtherJetConstituentsDeltaRVeto::~OtherJetConstituentsDeltaRVeto ( )
inlinevirtual

Definition at line 79 of file EventDependentAbsVetos.h.

79 {}

Member Function Documentation

void reco::isodeposit::OtherJetConstituentsDeltaRVeto::centerOn ( double  eta,
double  phi 
)
virtual

Set axis for matching jets.

Reimplemented from reco::isodeposit::AbsVeto.

Definition at line 102 of file EventDependentAbsVetos.cc.

103 {
104  //std::cout << "<OtherJetConstituentsDeltaRVeto::centerOn>:" << std::endl;
105  //std::cout << " eta = " << eta << std::endl;
106  //std::cout << " phi = " << phi << std::endl;
107  vetoDir_ = Direction(eta,phi);
108  initialize();
109 }
T eta() const
Definition: DDAxes.h:10
void reco::isodeposit::OtherJetConstituentsDeltaRVeto::initialize ( )
private

Definition at line 66 of file EventDependentAbsVetos.cc.

References edm::RefVector< C, T, F >::begin(), reco::deltaR2(), edm::RefVector< C, T, F >::end(), customizeTrackingMonitorSeedNumber::idx, edm::Ref< C, T, F >::isNonnull(), metsig::jet, and fwrapper::jets.

67 {
68  //std::cout << "<OtherJetConstituentsDeltaRVeto::initialize>:" << std::endl;
69  //std::cout << " vetoDir: eta = " << vetoDir_.eta() << ", phi = " << vetoDir_.phi() << std::endl;
70  assert(evt_);
71  items_.clear();
73  evt_->getByLabel(srcJets_, jets);
74  typedef edm::AssociationMap<edm::OneToMany<std::vector<reco::PFJet>, std::vector<reco::PFCandidate>, unsigned int> > JetToPFCandidateAssociation;
76  evt_->getByLabel(srcPFCandAssocMap_, jetToPFCandMap);
77  double dR2min = dR2jet_;
78  reco::PFJetRef matchedJet;
79  size_t numJets = jets->size();
80  for ( size_t jetIndex = 0; jetIndex < numJets; ++jetIndex ) {
81  reco::PFJetRef jet(jets, jetIndex);
82  double dR2 = ::deltaR2(vetoDir_.eta(), vetoDir_.phi(), jet->eta(), jet->phi());
83  //std::cout << "jet #" << jetIndex << ": Pt = " << jet->pt() << ", eta = " << jet->eta() << ", phi = " << jet->phi() << " (dR = " << sqrt(dR2) << ")" << std::endl;
84  if ( dR2 < dR2min ) {
85  matchedJet = jet;
86  dR2min = dR2;
87  }
88  }
89  if ( matchedJet.isNonnull() ) {
90  edm::RefVector<reco::PFCandidateCollection> pfCandsMappedToJet = (*jetToPFCandMap)[matchedJet];
91  int idx = 0;
92  for ( edm::RefVector<reco::PFCandidateCollection>::const_iterator pfCand = pfCandsMappedToJet.begin();
93  pfCand != pfCandsMappedToJet.end(); ++pfCand ) {
94  //std::cout << "pfCand #" << idx << ": Pt = " << (*pfCand)->pt() << ", eta = " << (*pfCand)->eta() << ", phi = " << (*pfCand)->phi() << std::endl;
95  items_.push_back(Direction((*pfCand)->eta(), (*pfCand)->phi()));
96  ++idx;
97  }
98  }
99 }
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
vector< PseudoJet > jets
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:58
void reco::isodeposit::OtherJetConstituentsDeltaRVeto::setEvent ( const edm::Event evt,
const edm::EventSetup es 
)
virtual

Picks up the directions of the given candidates.

Implements reco::isodeposit::EventDependentAbsVeto.

Definition at line 60 of file EventDependentAbsVetos.cc.

61 {
62  //std::cout << "<OtherJetConstituentsDeltaRVeto::setEvent>:" << std::endl;
63  evt_ = &evt;
64 }
bool reco::isodeposit::OtherJetConstituentsDeltaRVeto::veto ( double  eta,
double  phi,
float  value 
) const
virtual

Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum This is true if the deposit is within the stored AbsVeto of any item of the source collection

Implements reco::isodeposit::AbsVeto.

Definition at line 51 of file EventDependentAbsVetos.cc.

References reco::deltaR2(), eta(), and phi.

52 {
53  for (std::vector<Direction>::const_iterator it = items_.begin(), ed = items_.end(); it != ed; ++it) {
54  if (::deltaR2(it->eta(), it->phi(), eta, phi) < dR2constituent_) return true;
55  }
56  return false;
57 }
T eta() const
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:58
Definition: DDAxes.h:10

Member Data Documentation

double reco::isodeposit::OtherJetConstituentsDeltaRVeto::dR2constituent_
private

Definition at line 100 of file EventDependentAbsVetos.h.

double reco::isodeposit::OtherJetConstituentsDeltaRVeto::dR2jet_
private

Definition at line 98 of file EventDependentAbsVetos.h.

const edm::Event* reco::isodeposit::OtherJetConstituentsDeltaRVeto::evt_
private

Definition at line 94 of file EventDependentAbsVetos.h.

std::vector<Direction> reco::isodeposit::OtherJetConstituentsDeltaRVeto::items_
private

Definition at line 101 of file EventDependentAbsVetos.h.

edm::InputTag reco::isodeposit::OtherJetConstituentsDeltaRVeto::srcJets_
private

Definition at line 97 of file EventDependentAbsVetos.h.

edm::InputTag reco::isodeposit::OtherJetConstituentsDeltaRVeto::srcPFCandAssocMap_
private

Definition at line 99 of file EventDependentAbsVetos.h.

Direction reco::isodeposit::OtherJetConstituentsDeltaRVeto::vetoDir_
private

Definition at line 96 of file EventDependentAbsVetos.h.