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;
144 for(
size_t i = 0;
i < genParticles->size(); ++
i) {
152 for(
unsigned int i=0;
i<nMo;++
i){
160 int parentID = -10000;
162 for(
unsigned int i=0;
i<nMo;++
i){
163 int thisParentID = dynamic_cast
167 int hundredsIndex =
abs(thisParentID)/100;
168 int thousandsIndex =
abs(thisParentID)/1000;
169 if ( ((
abs(thisParentID) >= 23) &&
170 (
abs(thisParentID) <= 25)) ||
171 (
abs(thisParentID) == 6) ||
172 (hundredsIndex == 5) ||
173 (hundredsIndex == 4) ||
174 (thousandsIndex == 5) ||
175 (thousandsIndex == 4)
177 parentID = thisParentID;
179 if ((parentID == -10000) && (nMo > 0))
180 parentID = dynamic_cast
184 if ((parentID != p.
pdgId()) &&
210 if (!puInfoCollection.
isValid()) {
211 throw cms::Exception(
"ProductNotValid") <<
"pileupInfoSource not valid";
215 std::vector<PileupSummaryInfo>::const_iterator puItr = puInfoCollection->begin();
216 std::vector<PileupSummaryInfo>::const_iterator puEnd = puInfoCollection->end();
217 for( ; puItr != puEnd; ++puItr) {
218 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