37 #include "HepMC/GenParticle.h"
38 #include "HepMC/GenVertex.h"
97 tree_->Branch(
"Generator",
"L1Analysis::L1AnalysisGeneratorDataFormat", &
l1GenData_, 32000, 3);
128 reco::GenJetCollection::const_iterator jetItr = genJets->begin();
129 reco::GenJetCollection::const_iterator jetEnd = genJets->end();
130 for( ; jetItr != jetEnd ; ++jetItr) {
138 edm::LogWarning(
"MissingProduct") <<
"Gen jets not found. Branch will not be filled" << std::endl;
147 for(
size_t i = 0;
i < genParticles->size(); ++
i) {
155 for(
unsigned int i=0;
i<nMo;++
i){
163 int parentID = -10000;
165 for(
unsigned int i=0;
i<nMo;++
i){
166 int thisParentID = dynamic_cast
170 int hundredsIndex =
abs(thisParentID)/100;
171 int thousandsIndex =
abs(thisParentID)/1000;
172 if ( ((
abs(thisParentID) >= 23) &&
173 (
abs(thisParentID) <= 25)) ||
174 (
abs(thisParentID) == 6) ||
175 (hundredsIndex == 5) ||
176 (hundredsIndex == 4) ||
177 (thousandsIndex == 5) ||
178 (thousandsIndex == 4)
180 parentID = thisParentID;
182 if ((parentID == -10000) && (nMo > 0))
183 parentID = dynamic_cast
187 if ((parentID != p.
pdgId()) &&
215 if (!puInfoCollection.
isValid()) {
216 throw cms::Exception(
"ProductNotValid") <<
"pileupInfoSource not valid";
220 std::vector<PileupSummaryInfo>::const_iterator puItr = puInfoCollection->begin();
221 std::vector<PileupSummaryInfo>::const_iterator puEnd = puInfoCollection->end();
222 for( ; puItr != puEnd; ++puItr) {
223 int bx = puItr->getBunchCrossing();
T getUntrackedParameter(std::string const &, T const &) const
virtual double energy() const final
energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupInfoToken_
#define DEFINE_FWK_MODULE(type)
virtual double phi() const final
momentum azimuthal angle
T * make(const Args &...args) const
make new ROOT object
virtual int status() const final
status word
edm::Service< TFileService > fs_
virtual size_t numberOfMothers() const
number of mothers
edm::EDGetTokenT< reco::GenJetCollection > genJetToken_
edm::EDGetTokenT< reco::GenParticleCollection > genParticleToken_
Abs< T >::type abs(const T &t)
L1GenTreeProducer(const edm::ParameterSet &)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual int pdgId() const final
PDG identifier.
virtual double eta() const final
momentum pseudorapidity
virtual void beginJob(void)
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
L1Analysis::L1AnalysisGeneratorDataFormat * l1GenData_
virtual double pt() const final
transverse momentum