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
reco::tau::RecoTauPiZeroStripPlugin Class Reference
Inheritance diagram for reco::tau::RecoTauPiZeroStripPlugin:
reco::tau::RecoTauPiZeroBuilderPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin

Public Member Functions

virtual void beginEvent ()
 Hook called at the beginning of the event. More...
 
return_type operator() (const reco::PFJet &jet) const
 Build a collection of piZeros from objects in the input jet. More...
 
 RecoTauPiZeroStripPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauPiZeroStripPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauPiZeroBuilderPlugin
 RecoTauPiZeroBuilderPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauPiZeroBuilderPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauEventHolderPlugin
const edm::Eventevt () const
 
const edm::EventSetupevtSetup () const
 
 RecoTauEventHolderPlugin (const edm::ParameterSet &pset)
 
void setup (const edm::Event &, const edm::EventSetup &)
 
virtual ~RecoTauEventHolderPlugin ()
 
- Public Member Functions inherited from reco::tau::RecoTauNamedPlugin
const std::string & name () const
 
 RecoTauNamedPlugin (const edm::ParameterSet &pset)
 
virtual ~RecoTauNamedPlugin ()
 

Private Attributes

double etaAssociationDistance_
 
std::vector< int > inputPdgIds_
 
AddFourMomenta p4Builder_
 
double phiAssociationDistance_
 
edm::InputTag pvSrc_
 
RecoTauQualityCuts qcuts_
 

Additional Inherited Members

- Public Types inherited from reco::tau::RecoTauPiZeroBuilderPlugin
typedef boost::ptr_vector
< RecoTauPiZero
PiZeroVector
 
typedef std::auto_ptr
< PiZeroVector
return_type
 

Detailed Description

Definition at line 32 of file RecoTauPiZeroStripPlugin.cc.

Constructor & Destructor Documentation

reco::tau::RecoTauPiZeroStripPlugin::RecoTauPiZeroStripPlugin ( const edm::ParameterSet pset)
explicit

Definition at line 53 of file RecoTauPiZeroStripPlugin.cc.

References etaAssociationDistance_, edm::ParameterSet::getParameter(), inputPdgIds_, phiAssociationDistance_, and pvSrc_.

55  qcuts_(pset.getParameter<edm::ParameterSet>("qualityCuts"))
56 {
57  pvSrc_ = pset.getParameter<edm::InputTag>("primaryVertexSrc");
58  inputPdgIds_ = pset.getParameter<std::vector<int> >(
59  "stripCandidatesParticleIds");
61  "stripEtaAssociationDistance");
63  "stripPhiAssociationDistance");
64 }
T getParameter(std::string const &) const
RecoTauPiZeroBuilderPlugin(const edm::ParameterSet &pset)
virtual reco::tau::RecoTauPiZeroStripPlugin::~RecoTauPiZeroStripPlugin ( )
inlinevirtual

Definition at line 35 of file RecoTauPiZeroStripPlugin.cc.

35 {}

Member Function Documentation

void reco::tau::RecoTauPiZeroStripPlugin::beginEvent ( )
virtual

Hook called at the beginning of the event.

Reimplemented from reco::tau::RecoTauPiZeroBuilderPlugin.

Definition at line 67 of file RecoTauPiZeroStripPlugin.cc.

References reco::tau::RecoTauEventHolderPlugin::evt(), edm::Event::getByLabel(), pvSrc_, qcuts_, and reco::tau::RecoTauQualityCuts::setPV().

67  {
69  evt()->getByLabel(pvSrc_, pvHandle);
70  if (pvHandle->size()) {
71  qcuts_.setPV(reco::VertexRef(pvHandle, 0));
72  }
73 }
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
RecoTauPiZeroStripPlugin::return_type reco::tau::RecoTauPiZeroStripPlugin::operator() ( const reco::PFJet ) const
virtual

Build a collection of piZeros from objects in the input jet.

Implements reco::tau::RecoTauPiZeroBuilderPlugin.

Definition at line 75 of file RecoTauPiZeroStripPlugin.cc.

References reco::deltaPhi(), etaAssociationDistance_, reco::tau::RecoTauQualityCuts::filterRefs(), reco::RecoTauPiZero::kStrips, convertSQLitetoXML_cfg::output, p4Builder_, reco::tau::pfGammas(), phiAssociationDistance_, qcuts_, AddFourMomenta::set(), and strip().

76  {
77  // Get list of gamma candidates
78  typedef std::vector<reco::PFCandidatePtr> PFCandPtrs;
79  typedef PFCandPtrs::iterator PFCandIter;
81 
82  // Get the candidates passing our quality cuts
83  //PFCandPtrs candsVector = qcuts_.filterRefs(pfCandidates(jet, inputPdgIds_));
84  PFCandPtrs candsVector = qcuts_.filterRefs(pfGammas(jet));
85 
86  // Convert to stl::list to allow fast deletions
87  typedef std::list<reco::PFCandidatePtr> PFCandPtrList;
88  typedef std::list<reco::PFCandidatePtr>::iterator PFCandPtrListIter;
89  PFCandPtrList cands;
90  cands.insert(cands.end(), candsVector.begin(), candsVector.end());
91 
92  while (cands.size() > 0) {
93  // Seed this new strip, and delete it from future strips
94  PFCandidatePtr seed = cands.front();
95  cands.pop_front();
96 
97  // Add a new candidate to our collection using this seed
98  std::auto_ptr<RecoTauPiZero> strip(new RecoTauPiZero(
99  *seed, RecoTauPiZero::kStrips));
100  strip->addDaughter(seed);
101 
102  // Find all other objects in the strip
103  PFCandPtrListIter stripCand = cands.begin();
104  while(stripCand != cands.end()) {
105  if( fabs(strip->eta() - (*stripCand)->eta()) < etaAssociationDistance_
106  && fabs(deltaPhi(*strip, **stripCand)) < phiAssociationDistance_ ) {
107  // Add candidate to strip
108  strip->addDaughter(*stripCand);
109  // Update the strips four momenta
110  p4Builder_.set(*strip);
111  // Delete this candidate from future strips and move on to
112  // the next potential candidate
113  stripCand = cands.erase(stripCand);
114  } else {
115  // This candidate isn't compatabile - just move to the next candidate
116  ++stripCand;
117  }
118  }
119  output.push_back(strip);
120  }
121  return output.release();
122 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
std::vector< PFCandidatePtr > pfGammas(const PFJet &jet, bool sort=true)
Extract all pfGammas from a PFJet.
std::vector< reco::PFCandidatePtr > PFCandPtrs
Coll filterRefs(const Coll &refcoll) const
Filter a ref vector of PFCandidates.
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
boost::ptr_vector< RecoTauPiZero > PiZeroVector
PFCandPtrs::iterator PFCandIter
void set(reco::Candidate &c) const
set up a candidate
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate

Member Data Documentation

double reco::tau::RecoTauPiZeroStripPlugin::etaAssociationDistance_
private

Definition at line 47 of file RecoTauPiZeroStripPlugin.cc.

Referenced by operator()(), and RecoTauPiZeroStripPlugin().

std::vector<int> reco::tau::RecoTauPiZeroStripPlugin::inputPdgIds_
private

Definition at line 46 of file RecoTauPiZeroStripPlugin.cc.

Referenced by RecoTauPiZeroStripPlugin().

AddFourMomenta reco::tau::RecoTauPiZeroStripPlugin::p4Builder_
private

Definition at line 50 of file RecoTauPiZeroStripPlugin.cc.

Referenced by operator()().

double reco::tau::RecoTauPiZeroStripPlugin::phiAssociationDistance_
private

Definition at line 48 of file RecoTauPiZeroStripPlugin.cc.

Referenced by operator()(), and RecoTauPiZeroStripPlugin().

edm::InputTag reco::tau::RecoTauPiZeroStripPlugin::pvSrc_
private

Definition at line 43 of file RecoTauPiZeroStripPlugin.cc.

Referenced by beginEvent(), and RecoTauPiZeroStripPlugin().

RecoTauQualityCuts reco::tau::RecoTauPiZeroStripPlugin::qcuts_
private

Definition at line 44 of file RecoTauPiZeroStripPlugin.cc.

Referenced by beginEvent(), and operator()().