49 std::vector <std::vector <const reco::GenParticle*> > genJetConstituents (genJets->size());
52 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
55 double genJetE = genJet.
energy();
56 double genJetPt = genJet.
pt();
57 double genJetEta = genJet.
eta();
58 double genJetPhi = genJet.
phi();
60 if( genJetPt> 30.0 &&
std::abs(genJetEta)<3.0 ) {
64 std::vector <const reco::GenParticle*> genJetConstituents = jetMatching.
getGenParticles ((*genJets) [iGenJet]);
66 std::vector<double> v_trkP, v_trkPt, v_trkEta, v_trkPhi, v_trkPdg, v_trkCharge;
68 if(
debug)
std::cout<<
"Jet(pt,Eta,Phi) "<<genJetPt<<
" "<<genJetEta<<
" "<<genJetPhi <<std::endl;
69 for(
unsigned int ic=0; ic<genJetConstituents.size(); ic++) {
72 std::cout <<
"p,pt,eta,phi "<<genJetConstituents[ic]->p()<<
" "<<genJetConstituents[ic]->pt()
73 <<
" "<<genJetConstituents[ic]->eta()<<
" "<<genJetConstituents[ic]->phi()
77 v_trkP.push_back(genJetConstituents[ic]->
p());
78 v_trkPt.push_back(genJetConstituents[ic]->pt());
79 v_trkEta.push_back(genJetConstituents[ic]->
eta());
80 v_trkPhi.push_back(genJetConstituents[ic]->
phi());
81 v_trkPdg.push_back(genJetConstituents[ic]->
pdgId());
82 v_trkCharge.push_back(genJetConstituents[ic]->
charge());
104 unsigned int indx = 0;
105 for(reco::GenParticleCollection::const_iterator ig = genParticles->begin(); ig!= genParticles->end(); ++ig,++indx) {
108 std::cout <<
"Track " << indx <<
" Status " << ig->status() <<
" charge "
109 << ig->charge() <<
" pdgId " << ig->pdgId() <<
" mass "
110 << ig->mass() <<
" P " << ig->momentum() <<
" E "
111 << ig->energy() <<
" Origin " << ig->vertex() << std::endl;
143 t_gjetN =
new std::vector<int> ();
144 t_gjetE =
new std::vector<double>();
145 t_gjetPt =
new std::vector<double>();
149 t_jetTrkP =
new std::vector<std::vector<double> >();
150 t_jetTrkPt =
new std::vector<std::vector<double> >();
151 t_jetTrkEta =
new std::vector<std::vector<double> >();
152 t_jetTrkPhi =
new std::vector<std::vector<double> >();
153 t_jetTrkPdg =
new std::vector<std::vector<double> >();
156 tree->Branch(
"t_gjetN",
"vector<int>", &t_gjetN);
157 tree->Branch(
"t_gjetE",
"vector<double>", &t_gjetE);
158 tree->Branch(
"t_gjetPt",
"vector<double>", &t_gjetPt);
159 tree->Branch(
"t_gjetEta",
"vector<double>", &t_gjetEta);
160 tree->Branch(
"t_gjetPhi",
"vector<double>", &t_gjetPhi);
162 tree->Branch(
"t_jetTrkP",
"vector<vector<double> >", &t_jetTrkP);
163 tree->Branch(
"t_jetTrkPt",
"vector<vector<double> >", &t_jetTrkPt);
164 tree->Branch(
"t_jetTrkEta",
"vector<vector<double> >", &t_jetTrkEta);
165 tree->Branch(
"t_jetTrkPhi",
"vector<vector<double> >", &t_jetTrkPhi);
166 tree->Branch(
"t_jetTrkPdg",
"vector<vector<double> >", &t_jetTrkPdg);
167 tree->Branch(
"t_jetTrkCharge",
"vector<vector<double> >", &t_jetTrkCharge);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
~IsolatedParticlesGeneratedJets()
std::vector< std::vector< double > > * t_jetTrkEta
#define DEFINE_FWK_MODULE(type)
std::vector< double > * t_gjetPt
std::vector< double > * t_gjetEta
std::vector< std::vector< double > > * t_jetTrkPdg
virtual double eta() const
momentum pseudorapidity
virtual double energy() const
energy
std::vector< double > * t_gjetE
std::vector< std::vector< double > > * t_jetTrkPhi
std::vector< int > * t_gjetN
Jets made from MC generator particles.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< std::vector< double > > * t_jetTrkPt
std::vector< std::vector< double > > * t_jetTrkCharge
std::vector< double > * t_gjetPhi
virtual double pt() const
transverse momentum
edm::Service< TFileService > fs
T * make() const
make new ROOT object
std::vector< std::vector< double > > * t_jetTrkP
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual double phi() const
momentum azimuthal angle
IsolatedParticlesGeneratedJets(const edm::ParameterSet &)