86 #include <Math/VectorUtil.h>
92 using namespace ROOT::Math::VectorUtil;
103 int fillAlgoritDefinition(
const Jet& );
104 int fillPhysicsDefinition(
const Jet& );
128 produces<JetMatchedPartonsCollection>();
132 if ( iConfig.
exists(
"doPriority") ) {
160 aParton.
pdgId() <<
" " <<
161 aParton.
pt() <<
" " <<
162 aParton.
eta() <<
" " <<
163 aParton.
phi() << endl;
168 for (
size_t j = 0;
j < jets_h->size();
j++) {
182 if(theMappedPartonPhy>=0) pPH =
particles->at( theMappedPartonPhy );
183 if(theMappedPartonAlg>=0) pAL =
particles->at( theMappedPartonAlg );
185 (*jetMatchedPartons)[jets_h->refAt(j)]=
MatchedPartons(pHV,pN2,pN3,pPH,pAL);
188 iEvent.
put( jetMatchedPartons );
217 int tempParticle = -1;
218 int tempPartonHighestPt = -1;
219 int tempNearest = -1;
222 bool foundPriority =
false;
243 for(
size_t m = 0;
m !=
particles->size() && !foundPriority; ++
m ) {
250 int ipdgId = aParton.
pdgId();
256 double dist =
DeltaR( theJet.
p4(), aParton.
p4() );
259 foundPriority =
true;
266 foundPriority =
false;
274 if( !foundPriority && aParton.
status() != 3 ) {
275 double dist =
DeltaR( theJet.
p4(), aParton.
p4() );
281 if( tempParticle == -1 && (
abs( aParton.
pdgId() ) == 4 ) ) tempParticle =
m;
282 if(
abs( aParton.
pdgId() ) == 5 ) tempParticle =
m;
283 if( aParton.
pt() > maxPt ) {
284 maxPt = aParton.
pt();
285 tempPartonHighestPt =
m;
291 if ( foundPriority ) {
299 if ( tempParticle == -1 ) tempParticle = tempPartonHighestPt;
328 float TheBiggerConeSize = 0.7;
329 int tempParticle = -1;
331 int tempNearest = -1;
333 bool foundPriority =
false;
335 vector<const reco::Candidate *> theContaminations;
336 theContaminations.clear();
357 for(
size_t m = 0;
m !=
particles->size() && !foundPriority; ++
m ) {
365 int ipdgId = aParticle.
pdgId();
371 double dist =
DeltaR( theJet.
p4(), aParticle.
p4() );
374 foundPriority =
true;
381 foundPriority =
false;
385 if ( !foundPriority ) {
388 bool isAParton =
false;
395 flavour == 21 ) isAParton =
true;
396 if(!isAParton)
continue;
397 double dist =
DeltaR( theJet.
p4(), aParticle.
p4() );
398 if( aParticle.
status() == 3 && dist < minDr ) {
412 flavour == 21 )
continue;
413 if( dist < TheBiggerConeSize ) theContaminations.push_back( &aParticle );
420 if ( !foundPriority ) {
423 if(nInTheCone != 1)
return -1;
424 if(theContaminations.size() == 0 )
return tempParticle;
427 vector<const Candidate *>::const_iterator itCont = theContaminations.begin();
428 for( ; itCont != theContaminations.end(); itCont++ ) {
429 int contaminatingFlavour =
abs( (*itCont)->pdgId() );
430 if( (*itCont)->numberOfMothers()>0 && (*itCont)->mother(0) ==
particles->at(tempParticle).get() )
continue;
431 if( initialPartonFlavour == 4 ) {
432 if( contaminatingFlavour == 4 )
continue;
T getParameter(std::string const &) const
virtual int pdgId() const
PDG identifier.
virtual void produce(edm::Event &, const edm::EventSetup &)
int fillPhysicsDefinition(const Jet &)
virtual double pt() const =0
transverse momentum
#define DEFINE_FWK_MODULE(type)
virtual int status() const
status word
Base class for all types of Jets.
virtual int status() const =0
status word
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual double eta() const
momentum pseudorapidity
int fillAlgoritDefinition(const Jet &)
virtual size_type numberOfDaughters() const =0
number of daughters
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Handle< GenParticleRefVector > particles
JetPartonMatcher(const edm::ParameterSet &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual int pdgId() const =0
PDG identifier.
vector< int > priorityList
virtual double pt() const
transverse momentum
double coneSizeToAssociate
int flavour(const Candidate &part)
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
edm::InputTag m_ParticleSrc
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector