CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
InputGenJetsParticleSelector.cc File Reference
#include "InputGenJetsParticleSelector.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include <memory>
#include "CommonTools/CandUtils/interface/pdgIdUtils.h"

Go to the source code of this file.

Functions

 DEFINE_FWK_MODULE (InputGenJetsParticleSelector)
 
static void invalidateTree (InputGenJetsParticleSelector::ParticleBitmap &invalid, const InputGenJetsParticleSelector::ParticleVector &p, const reco::GenParticle *particle)
 
static unsigned int partIdx (const InputGenJetsParticleSelector::ParticleVector &p, const reco::GenParticle *particle)
 

Function Documentation

DEFINE_FWK_MODULE ( InputGenJetsParticleSelector  )
static void invalidateTree ( InputGenJetsParticleSelector::ParticleBitmap invalid,
const InputGenJetsParticleSelector::ParticleVector p,
const reco::GenParticle particle 
)
static

Definition at line 129 of file InputGenJetsParticleSelector.cc.

References reco::CompositeRefCandidateT< D >::daughter(), i, customizeTrackingMonitorSeedNumber::idx, npart, reco::CompositeRefCandidateT< D >::numberOfDaughters(), and partIdx().

Referenced by InputGenJetsParticleSelector::produce().

132 {
133  unsigned int npart=particle->numberOfDaughters();
134  if (!npart) return;
135 
136  for (unsigned int i=0;i<npart;++i){
137  unsigned int idx=partIdx(p,dynamic_cast<const reco::GenParticle*>(particle->daughter(i)));
138  if (invalid[idx])
139  continue;
140  invalid[idx] = true;
141  //cout<<"Invalidated: ["<<setw(4)<<idx<<"] With pt:"<<particle->daughter(i)->pt()<<endl;
142  invalidateTree(invalid, p, dynamic_cast<const reco::GenParticle*>(particle->daughter(i)));
143  }
144 }
int i
Definition: DBlmapReader.cc:9
double npart
Definition: HydjetWrapper.h:45
static void invalidateTree(InputGenJetsParticleSelector::ParticleBitmap &invalid, const InputGenJetsParticleSelector::ParticleVector &p, const reco::GenParticle *particle)
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::GenParticle *particle)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static unsigned int partIdx ( const InputGenJetsParticleSelector::ParticleVector p,
const reco::GenParticle particle 
)
static

Definition at line 115 of file InputGenJetsParticleSelector.cc.

References pos.

Referenced by InputGenJetsParticleSelector::fromResonance(), invalidateTree(), and InputGenJetsParticleSelector::testPartonChildren().

118 {
119  InputGenJetsParticleSelector::ParticleVector::const_iterator pos =
120  std::lower_bound(p.begin(), p.end(), particle);
121  if (pos == p.end() || *pos != particle)
122  throw cms::Exception("CorruptedData")
123  << "reco::GenEvent corrupted: Unlisted particles"
124  " in decay tree." << std::endl;
125 
126  return pos - p.begin();
127 }