39 namespace reco {
namespace tau {
45 double factor =
sqrt(vec.energy()*vec.energy()-mass*
mass)/vec.P();
47 vec.px()*factor,vec.py()*factor,vec.pz()*factor,vec.energy());
91 vertexAssociator_(pset.getParameter<edm::
ParameterSet>(
"qualityCuts")),
94 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"<RecoTauPiZeroStripPlugin2::RecoTauPiZeroStripPlugin2>:" ;
110 qcuts_pset.
addParameter<
double>(
"minTrackPt",
std::min(minGammaEtStripSeed_, minGammaEtStripAdd_));
112 qcuts_pset.
addParameter<
double>(
"maxTransverseImpactParameter", 1.e+9);
114 qcuts_pset.
addParameter<
double>(
"minTrackVertexWeight", -1.);
115 qcuts_pset.
addParameter<
unsigned>(
"minTrackPixelHits", 0);
119 qcuts_pset.
addParameter<
double>(
"minGammaEt",
std::min(minGammaEtStripSeed_, minGammaEtStripAdd_));
130 if ( combineStrips_ ) {
148 std::set<size_t>& candIdsCurrentStrip,
bool& isCandAdded)
const
150 size_t numCands = cands.size();
151 for (
size_t candId = 0; candId < numCands; ++candId ) {
152 if ( (!candFlags[candId]) && candIdsCurrentStrip.find(candId) == candIdsCurrentStrip.end() ) {
156 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"--> candId = " << candId <<
" has been added." ;
160 candIdsCurrentStrip.insert(candId);
168 for ( std::set<size_t>::const_iterator candId = candIds.begin();
169 candId != candIds.end(); ++candId ) {
170 candFlags[*candId] =
true;
195 for ( PFCandPtrs::iterator cand = candsVector.
begin();
196 cand != candsVector.
end(); ++cand ) {
197 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"PFGamma (" << idx <<
"): Et = " << (*cand)->et() <<
","
198 <<
" eta = " << (*cand)->eta() <<
", phi = " << (*cand)->phi();
200 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
" --> assigning seedCandId = " << seedCands.size() ;
204 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"has Track: pt = " << candTrack->
pt() <<
" +/- " << candTrack->
ptError() <<
","
205 <<
" eta = " << candTrack->
eta() <<
", phi = " << candTrack->
phi() <<
","
206 <<
" charge = " << candTrack->
charge() ;
215 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"ECAL Et: calibrated = " << (*cand)->ecalEnergy()*
sin((*cand)->theta()) <<
","
216 <<
" raw = " << (*cand)->rawEcalEnergy()*
sin((*cand)->theta()) ;
217 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"HCAL Et: calibrated = " << (*cand)->hcalEnergy()*
sin((*cand)->theta()) <<
","
218 <<
" raw = " << (*cand)->rawHcalEnergy()*
sin((*cand)->theta()) ;
219 seedCands.push_back(*cand);
221 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
" --> assigning addCandId = " << addCands.size();
222 addCands.push_back(*cand);
224 LogTrace(
"RecoTauPiZeroStripPlugin2") ;
228 std::vector<bool> seedCandFlags(seedCands.size());
229 std::vector<bool> addCandFlags(addCands.size());
231 std::set<size_t> seedCandIdsCurrentStrip;
232 std::set<size_t> addCandIdsCurrentStrip;
235 while ( idxSeed < seedCands.size() ) {
236 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"idxSeed = " << idxSeed ;
238 seedCandIdsCurrentStrip.clear();
239 addCandIdsCurrentStrip.clear();
242 strip->addDaughter(seedCands[idxSeed]);
243 seedCandIdsCurrentStrip.insert(idxSeed);
246 int stripBuildIteration = 0;
250 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
" adding seedCands to strip..." ;
251 addCandsToStrip(*strip, seedCands, seedCandFlags, seedCandIdsCurrentStrip, isCandAdded);
252 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
" adding addCands to strip..." ;
253 addCandsToStrip(*strip, addCands, addCandFlags, addCandIdsCurrentStrip, isCandAdded);
257 ++stripBuildIteration;
261 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"Strip: Et = " << strip->et() <<
","
262 <<
" eta = " << strip->eta() <<
", phi = " << strip->phi()
263 <<
" --> building it !!" ;
266 if ( strip->daughterPtr(0).isNonnull() ) strip->setVertex(strip->daughterPtr(0)->vertex());
267 output.push_back(strip);
273 LogTrace(
"RecoTauPiZeroStripPlugin2") <<
"Strip: Et = " << strip->et() <<
","
274 <<
" eta = " << strip->eta() <<
", phi = " << strip->phi()
275 <<
" --> discarding it !!" ;
279 while ( idxSeed < seedCands.size() && seedCandFlags[idxSeed] ) {
288 output.sort(output.begin(), output.end(),
296 for ( PiZeroVector::const_iterator
first = output.begin();
298 for ( PiZeroVector::const_iterator
second =
first+1;
307 std::auto_ptr<RecoTauPiZero> combinedStrips(
315 first->daughterPtrVector()) {
316 combinedStrips->addDaughter(gamma);
319 second->daughterPtrVector()) {
320 combinedStrips->addDaughter(gamma);
323 if ( combinedStrips->daughterPtr(0).isNonnull() )
324 combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex());
326 stripCombinations.push_back(combinedStrips);
331 output.transfer(output.end(), stripCombinations);
334 return output.release();
double minGammaEtStripSeed_
T getParameter(std::string const &) const
reco::VertexRef associatedVertex(const PFJet &tau) const
InputIterator takeNElements(const InputIterator &begin, const InputIterator &end, size_t N)
Coll filterRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of PFCandidates.
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
void markCandsInStrip(std::vector< bool > &candFlags, const std::set< size_t > &candIds)
virtual ~RecoTauPiZeroStripPlugin2()
double etaAssociationDistance_
int numberOfValidHits() const
virtual const_iterator end() const
last daughter const_iterator
Sin< T >::type sin(const T &t)
double phi() const
azimuthal angle of momentum vector
void setEvent(const edm::Event &evt)
Load the vertices from the event.
RecoTauVertexAssociator vertexAssociator_
bool applyElecTrackQcuts_
Jets made from PFObjects.
virtual double eta() const
momentum pseudorapidity
bool updateStripAfterEachDaughter_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::TrackRef trackRef() const
U second(std::pair< T, U > const &p)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isNonnull() const
Checks for non-null.
double eta() const
pseudorapidity of momentum vector
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
double pt() const
track transverse momentum
void addParameter(std::string const &name, T const &value)
std::vector< int > inputPdgIds_
virtual const_iterator begin() const
first daughter const_iterator
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
double phiAssociationDistance_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Container::value_type value_type
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
RecoTauPiZeroStripPlugin2(const edm::ParameterSet &)
const edm::Event * evt() const
ParameterSet const & getParameterSet(std::string const &) const
virtual double pt() const
transverse momentum
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double minGammaEtStripAdd_
std::auto_ptr< PiZeroVector > return_type
virtual void beginEvent()
Hook called at the beginning of the event.
int maxStripBuildIterations_
double combinatoricStripMassHypo_
Particle reconstructed by the particle flow algorithm.
boost::ptr_vector< RecoTauPiZero > PiZeroVector
reco::GsfTrackRef gsfTrackRef() const
const reco::TrackBaseRef getTrack(const reco::PFCandidate &cand)
std::vector< reco::PFCandidatePtr > PFCandPtrs
void addDaughter(const CandidatePtr &)
add a daughter via a reference
int numberOfValidPixelHits() const
math::XYZPoint Point
point in the space
int charge() const
track electric charge
#define DEFINE_EDM_PLUGIN(factory, type, name)
void set(reco::Candidate &c) const
set up a candidate
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
virtual double phi() const
momentum azimuthal angle
bool isNonnull() const
Checks for non-null.
RecoTauQualityCuts * qcuts_
void addCandsToStrip(RecoTauPiZero &, PFCandPtrs &, const std::vector< bool > &, std::set< size_t > &, bool &) const
return_type operator()(const reco::PFJet &) const
Build a collection of piZeros from objects in the input jet.
AddFourMomenta p4Builder_