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::Candidate *particle)
 
static unsigned int partIdx (const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *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::Candidate particle 
)
static

Definition at line 146 of file InputGenJetsParticleSelector.cc.

References reco::Candidate::daughter(), i, customizeTrackingMonitorSeedNumber::idx, npart, reco::Candidate::numberOfDaughters(), and partIdx().

Referenced by InputGenJetsParticleSelector::produce().

149 {
150  unsigned int npart=particle->numberOfDaughters();
151  if (!npart) return;
152 
153  for (unsigned int i=0;i<npart;++i){
154  unsigned int idx=partIdx(p,particle->daughter(i));
155  if (invalid[idx])
156  continue;
157  invalid[idx] = true;
158  //cout<<"Invalidated: ["<<setw(4)<<idx<<"] With pt:"<<particle->daughter(i)->pt()<<endl;
159  invalidateTree(invalid, p, particle->daughter(i));
160  }
161 }
int i
Definition: DBlmapReader.cc:9
static unsigned int partIdx(const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
double npart
Definition: HydjetWrapper.h:44
virtual size_type numberOfDaughters() const =0
number of daughters
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
static void invalidateTree(InputGenJetsParticleSelector::ParticleBitmap &invalid, const InputGenJetsParticleSelector::ParticleVector &p, const reco::Candidate *particle)
static unsigned int partIdx ( const InputGenJetsParticleSelector::ParticleVector p,
const reco::Candidate particle 
)
static

Definition at line 133 of file InputGenJetsParticleSelector.cc.

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

135 {
136  InputGenJetsParticleSelector::ParticleVector::const_iterator pos =
137  std::lower_bound(p.begin(), p.end(), particle);
138  if (pos == p.end() || *pos != particle)
139  throw cms::Exception("CorruptedData")
140  << "reco::GenEvent corrupted: Unlisted particles"
141  " in decay tree." << std::endl;
142 
143  return pos - p.begin();
144 }
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