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

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)
 
static const
edm::ParameterSetDescriptionFillerPluginFactory::PMaker
< edm::ParameterSetDescriptionFiller
< InputGenJetsParticleSelector > > 
s_filler__LINE__ ("InputGenJetsParticleSelector")
 
static const
edm::MakerPluginFactory::PMaker
< edm::WorkerMaker
< InputGenJetsParticleSelector > > 
s_maker__LINE__ ("InputGenJetsParticleSelector")
 

Function Documentation

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

Definition at line 135 of file InputGenJetsParticleSelector.cc.

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

Referenced by InputGenJetsParticleSelector::produce().

138 {
139  unsigned int npart=particle->numberOfDaughters();
140  if (!npart) return;
141 
142  for (unsigned int i=0;i<npart;++i){
143  unsigned int idx=partIdx(p,dynamic_cast<const reco::GenParticle*>(particle->daughter(i)));
144  if (invalid[idx])
145  continue;
146  invalid[idx] = true;
147  //cout<<"Invalidated: ["<<setw(4)<<idx<<"] With pt:"<<particle->daughter(i)->pt()<<endl;
148  invalidateTree(invalid, p, dynamic_cast<const reco::GenParticle*>(particle->daughter(i)));
149  }
150 }
int i
Definition: DBlmapReader.cc:9
double npart
Definition: HydjetWrapper.h:44
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 122 of file InputGenJetsParticleSelector.cc.

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

124 {
125  InputGenJetsParticleSelector::ParticleVector::const_iterator pos =
126  std::lower_bound(p.begin(), p.end(), particle);
127  if (pos == p.end() || *pos != particle)
128  throw cms::Exception("CorruptedData")
129  << "reco::GenEvent corrupted: Unlisted particles"
130  " in decay tree." << std::endl;
131 
132  return pos - p.begin();
133 }
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< InputGenJetsParticleSelector > > s_filler__LINE__ ( "InputGenJetsParticleSelector"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< InputGenJetsParticleSelector > > s_maker__LINE__ ( "InputGenJetsParticleSelector"  )
static