46 #include "TDirectory.h" 96 descriptions.
add(
"isolatedParticlesGeneratedJets",desc);
113 std::vector <std::vector <const reco::GenParticle*> > genJetConstituents (genJets->size());
116 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
119 double genJetE = genJet.
energy();
120 double genJetPt = genJet.
pt();
121 double genJetEta = genJet.
eta();
122 double genJetPhi = genJet.
phi();
124 if( genJetPt> 30.0 &&
std::abs(genJetEta)<3.0 ) {
128 std::vector <const reco::GenParticle*> genJetConstituents = jetMatching.
getGenParticles ((*genJets) [iGenJet]);
129 std::vector<double> v_trkP, v_trkPt, v_trkEta, v_trkPhi, v_trkPdg, v_trkCharge;
133 << genJetEta <<
" " << genJetPhi;
134 for(
unsigned int ic=0; ic<genJetConstituents.size(); ic++) {
138 << genJetConstituents[ic]->p() <<
" " 139 << genJetConstituents[ic]->pt() <<
" " 140 << genJetConstituents[ic]->eta() <<
" " 141 << genJetConstituents[ic]->phi();
143 v_trkP.push_back(genJetConstituents[ic]->
p());
144 v_trkPt.push_back(genJetConstituents[ic]->
pt());
145 v_trkEta.push_back(genJetConstituents[ic]->
eta());
146 v_trkPhi.push_back(genJetConstituents[ic]->
phi());
147 v_trkPdg.push_back(genJetConstituents[ic]->
pdgId());
148 v_trkCharge.push_back(genJetConstituents[ic]->
charge());
171 unsigned int indx = 0;
172 reco::GenParticleCollection::const_iterator ig = genParticles->begin();
173 for (; ig!= genParticles->end(); ++ig,++indx) {
175 << ig->status() <<
" charge " 176 << ig->charge() <<
" pdgId " << ig->pdgId()
177 <<
" mass " << ig->mass() <<
" P " 178 << ig->momentum() <<
" E " << ig->energy()
179 <<
" Origin " << ig->vertex();
211 t_gjetN =
new std::vector<int> ();
212 t_gjetE =
new std::vector<double>();
213 t_gjetPt =
new std::vector<double>();
217 t_jetTrkP =
new std::vector<std::vector<double> >();
218 t_jetTrkPt =
new std::vector<std::vector<double> >();
219 t_jetTrkEta =
new std::vector<std::vector<double> >();
220 t_jetTrkPhi =
new std::vector<std::vector<double> >();
221 t_jetTrkPdg =
new std::vector<std::vector<double> >();
224 tree_->Branch(
"t_gjetN",
"std::vector<int>", &t_gjetN);
225 tree_->Branch(
"t_gjetE",
"std::vector<double>", &t_gjetE);
226 tree_->Branch(
"t_gjetPt",
"std::vector<double>", &t_gjetPt);
227 tree_->Branch(
"t_gjetEta",
"std::vector<double>", &t_gjetEta);
228 tree_->Branch(
"t_gjetPhi",
"std::vector<double>", &t_gjetPhi);
230 tree_->Branch(
"t_jetTrkP",
"std::vector<vector<double> >", &t_jetTrkP);
231 tree_->Branch(
"t_jetTrkPt",
"std::vector<vector<double> >", &t_jetTrkPt);
232 tree_->Branch(
"t_jetTrkEta",
"std::vector<vector<double> >", &t_jetTrkEta);
233 tree_->Branch(
"t_jetTrkPhi",
"std::vector<vector<double> >", &t_jetTrkPhi);
234 tree_->Branch(
"t_jetTrkPdg",
"std::vector<vector<double> >", &t_jetTrkPdg);
235 tree_->Branch(
"t_jetTrkCharge",
"std::vector<vector<double> >", &t_jetTrkCharge);
static const std::string kSharedResource
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< std::vector< double > > * t_jetTrkEta
double eta() const final
momentum pseudorapidity
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > * t_gjetPt
std::vector< double > * t_gjetEta
std::vector< GenJet > GenJetCollection
collection of GenJet objects
double pt() const final
transverse momentum
T * make(const Args &...args) const
make new ROOT object
std::vector< std::vector< double > > * t_jetTrkPdg
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
~IsolatedParticlesGeneratedJets() override
std::vector< double > * t_gjetE
#define DEFINE_FWK_MODULE(type)
std::vector< std::vector< double > > * t_jetTrkPhi
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
double energy() const final
energy
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_jetTrkPt
std::vector< std::vector< double > > * t_jetTrkCharge
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_jetTrkP
double phi() const final
momentum azimuthal angle
IsolatedParticlesGeneratedJets(const edm::ParameterSet &)