48 std::vector <std::vector <const reco::GenParticle*> > genJetConstituents (genJets->size());
51 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
54 double genJetE = genJet.
energy();
55 double genJetPt = genJet.
pt();
56 double genJetEta = genJet.
eta();
57 double genJetPhi = genJet.
phi();
59 if( genJetPt> 30.0 &&
std::abs(genJetEta)<3.0 ) {
63 std::vector <const reco::GenParticle*> genJetConstituents = jetMatching.
getGenParticles ((*genJets) [iGenJet]);
65 std::vector<double> v_trkP, v_trkPt, v_trkEta, v_trkPhi, v_trkPdg, v_trkCharge;
67 if(
debug)
std::cout<<
"Jet(pt,Eta,Phi) "<<genJetPt<<
" "<<genJetEta<<
" "<<genJetPhi <<std::endl;
68 for(
unsigned int ic=0; ic<genJetConstituents.size(); ic++) {
71 std::cout <<
"p,pt,eta,phi "<<genJetConstituents[ic]->p()<<
" "<<genJetConstituents[ic]->pt()
72 <<
" "<<genJetConstituents[ic]->eta()<<
" "<<genJetConstituents[ic]->phi()
76 v_trkP.push_back(genJetConstituents[ic]->
p());
77 v_trkPt.push_back(genJetConstituents[ic]->
pt());
78 v_trkEta.push_back(genJetConstituents[ic]->
eta());
79 v_trkPhi.push_back(genJetConstituents[ic]->
phi());
80 v_trkPdg.push_back(genJetConstituents[ic]->
pdgId());
81 v_trkCharge.push_back(genJetConstituents[ic]->
charge());
103 unsigned int indx = 0;
104 for(reco::GenParticleCollection::const_iterator ig = genParticles->begin(); ig!= genParticles->end(); ++ig,++indx) {
107 std::cout <<
"Track " << indx <<
" Status " << ig->status() <<
" charge "
108 << ig->charge() <<
" pdgId " << ig->pdgId() <<
" mass "
109 << ig->mass() <<
" P " << ig->momentum() <<
" E "
110 << ig->energy() <<
" Origin " << ig->vertex() << std::endl;
142 t_gjetN =
new std::vector<int> ();
143 t_gjetE =
new std::vector<double>();
144 t_gjetPt =
new std::vector<double>();
148 t_jetTrkP =
new std::vector<std::vector<double> >();
149 t_jetTrkPt =
new std::vector<std::vector<double> >();
150 t_jetTrkEta =
new std::vector<std::vector<double> >();
151 t_jetTrkPhi =
new std::vector<std::vector<double> >();
152 t_jetTrkPdg =
new std::vector<std::vector<double> >();
155 tree->Branch(
"t_gjetN",
"vector<int>", &t_gjetN);
156 tree->Branch(
"t_gjetE",
"vector<double>", &t_gjetE);
157 tree->Branch(
"t_gjetPt",
"vector<double>", &t_gjetPt);
158 tree->Branch(
"t_gjetEta",
"vector<double>", &t_gjetEta);
159 tree->Branch(
"t_gjetPhi",
"vector<double>", &t_gjetPhi);
161 tree->Branch(
"t_jetTrkP",
"vector<vector<double> >", &t_jetTrkP);
162 tree->Branch(
"t_jetTrkPt",
"vector<vector<double> >", &t_jetTrkPt);
163 tree->Branch(
"t_jetTrkEta",
"vector<vector<double> >", &t_jetTrkEta);
164 tree->Branch(
"t_jetTrkPhi",
"vector<vector<double> >", &t_jetTrkPhi);
165 tree->Branch(
"t_jetTrkPdg",
"vector<vector<double> >", &t_jetTrkPdg);
166 tree->Branch(
"t_jetTrkCharge",
"vector<vector<double> >", &t_jetTrkCharge);
virtual double energy() const GCC11_FINAL
energy
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
~IsolatedParticlesGeneratedJets()
std::vector< std::vector< double > > * t_jetTrkEta
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< double > * t_gjetPt
std::vector< double > * t_gjetEta
T * make(const Args &...args) const
make new ROOT object
edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
std::vector< std::vector< double > > * t_jetTrkPdg
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
std::vector< double > * t_gjetE
std::vector< std::vector< double > > * t_jetTrkPhi
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Abs< T >::type abs(const T &t)
std::vector< int > * t_gjetN
Jets made from MC generator particles.
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
std::vector< std::vector< double > > * t_jetTrkPt
std::vector< std::vector< double > > * t_jetTrkCharge
std::vector< double > * t_gjetPhi
edm::Service< TFileService > fs
edm::EDGetTokenT< reco::GenJetCollection > tok_jets_
std::vector< std::vector< double > > * t_jetTrkP
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual float pt() const GCC11_FINAL
transverse momentum
IsolatedParticlesGeneratedJets(const edm::ParameterSet &)