46 #include "TDirectory.h"
81 :
debug_(iConfig.getUntrackedParameter<bool>(
"Debug",
false)),
92 descriptions.
add(
"isolatedParticlesGeneratedJets", desc);
108 std::vector<std::vector<const reco::GenParticle *> > genJetConstituents(genJets->size());
111 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
114 double genJetE = genJet.
energy();
115 double genJetPt = genJet.
pt();
116 double genJetEta = genJet.
eta();
117 double genJetPhi = genJet.
phi();
119 if (genJetPt > 30.0 &&
std::abs(genJetEta) < 3.0) {
122 std::vector<const reco::GenParticle *> genJetConstituents = jetMatching.
getGenParticles((*genJets)[iGenJet]);
123 std::vector<double> v_trkP, v_trkPt, v_trkEta, v_trkPhi, v_trkPdg, v_trkCharge;
126 edm::LogVerbatim(
"IsoTrack") <<
"Jet(pt,Eta,Phi) " << genJetPt <<
" " << genJetEta <<
" " << genJetPhi;
127 for (
unsigned int ic = 0; ic < genJetConstituents.size(); ic++) {
129 edm::LogVerbatim(
"IsoTrack") <<
"p,pt,eta,phi " << genJetConstituents[ic]->p() <<
" "
130 << genJetConstituents[ic]->pt() <<
" " << genJetConstituents[ic]->eta() <<
" "
131 << genJetConstituents[ic]->phi();
133 v_trkP.push_back(genJetConstituents[ic]->
p());
134 v_trkPt.push_back(genJetConstituents[ic]->
pt());
135 v_trkEta.push_back(genJetConstituents[ic]->
eta());
136 v_trkPhi.push_back(genJetConstituents[ic]->
phi());
137 v_trkPdg.push_back(genJetConstituents[ic]->pdgId());
138 v_trkCharge.push_back(genJetConstituents[ic]->
charge());
161 unsigned int indx = 0;
162 reco::GenParticleCollection::const_iterator ig = genParticles->begin();
163 for (; ig != genParticles->end(); ++ig, ++indx) {
164 edm::LogVerbatim(
"IsoTrack") <<
"Track " << indx <<
" Status " << ig->status() <<
" charge " << ig->charge()
165 <<
" pdgId " << ig->pdgId() <<
" mass " << ig->mass() <<
" P " << ig->momentum()
166 <<
" E " << ig->energy() <<
" Origin " << ig->vertex();
194 t_gjetN =
new std::vector<int>();
195 t_gjetE =
new std::vector<double>();
196 t_gjetPt =
new std::vector<double>();
200 t_jetTrkP =
new std::vector<std::vector<double> >();
201 t_jetTrkPt =
new std::vector<std::vector<double> >();
202 t_jetTrkEta =
new std::vector<std::vector<double> >();
203 t_jetTrkPhi =
new std::vector<std::vector<double> >();
204 t_jetTrkPdg =
new std::vector<std::vector<double> >();
207 tree_->Branch(
"t_gjetN",
"std::vector<int>", &t_gjetN);
208 tree_->Branch(
"t_gjetE",
"std::vector<double>", &t_gjetE);
209 tree_->Branch(
"t_gjetPt",
"std::vector<double>", &t_gjetPt);
210 tree_->Branch(
"t_gjetEta",
"std::vector<double>", &t_gjetEta);
211 tree_->Branch(
"t_gjetPhi",
"std::vector<double>", &t_gjetPhi);
213 tree_->Branch(
"t_jetTrkP",
"std::vector<vector<double> >", &t_jetTrkP);
214 tree_->Branch(
"t_jetTrkPt",
"std::vector<vector<double> >", &t_jetTrkPt);
215 tree_->Branch(
"t_jetTrkEta",
"std::vector<vector<double> >", &t_jetTrkEta);
216 tree_->Branch(
"t_jetTrkPhi",
"std::vector<vector<double> >", &t_jetTrkPhi);
217 tree_->Branch(
"t_jetTrkPdg",
"std::vector<vector<double> >", &t_jetTrkPdg);
218 tree_->Branch(
"t_jetTrkCharge",
"std::vector<vector<double> >", &t_jetTrkCharge);
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< std::vector< double > > * t_jetTrkEta
double pt() const final
transverse momentum
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< double > * t_gjetPt
std::vector< double > * t_gjetEta
std::vector< GenJet > GenJetCollection
collection of GenJet objects
T * make(const Args &...args) const
make new ROOT object
std::vector< std::vector< double > > * t_jetTrkCharge
~IsolatedParticlesGeneratedJets() override
std::vector< double > * t_gjetE
std::vector< std::vector< double > > * t_jetTrkPdg
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< std::vector< double > > * t_jetTrkPhi
Abs< T >::type abs(const T &t)
std::vector< int > * t_gjetN
Jets made from MC generator particles.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::GenJetCollection > tok_jets_
std::vector< std::vector< double > > * t_jetTrkP
std::vector< double > * t_gjetPhi
const edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< std::vector< double > > * t_jetTrkPt
double phi() const final
momentum azimuthal angle
IsolatedParticlesGeneratedJets(const edm::ParameterSet &)
double energy() const final
energy
double eta() const final
momentum pseudorapidity