47 |
|
// ntuple storage classes |
48 |
|
#include "TCJet.h" |
49 |
|
#include "TCPrimaryVtx.h" |
50 |
+ |
#include "TCGenJet.h" |
51 |
|
|
52 |
|
// Need for HLT trigger info: |
53 |
|
#include "FWCore/Common/interface/TriggerNames.h" |
106 |
|
TFile* ntupleFile; |
107 |
|
|
108 |
|
TClonesArray* jet_ak5PF; |
109 |
< |
TClonesArray* jetP4_ak5Gen; |
109 |
> |
TClonesArray* jet_ak5Gen; |
110 |
|
TClonesArray* primaryVtx; |
111 |
|
|
112 |
|
bool doGenJets_; |
410 |
|
|
411 |
|
if(myJet.pt() > 5){ |
412 |
|
|
413 |
< |
new ((*jetP4_ak5Gen)[genCount]) TLorentzVector(myJet.px(), myJet.py(), myJet.pz(), myJet.energy()); |
413 |
> |
TCGenJet* jetCon = new ((*jet_ak5Gen)[genCount]) TCGenJet; |
414 |
> |
|
415 |
> |
jetCon->SetP4(myJet.px(), myJet.py(), myJet.pz(), myJet.energy()); |
416 |
> |
|
417 |
> |
jetCon->SetHadEnergy(myJet.hadEnergy()); |
418 |
> |
jetCon->SetEmEnergy(myJet.emEnergy()); |
419 |
> |
jetCon->SetInvEnergy(myJet.invisibleEnergy()); |
420 |
> |
jetCon->SetAuxEnergy(myJet.auxiliaryEnergy()); |
421 |
> |
jetCon->SetNumConstit(myJet.getGenConstituents().size()); |
422 |
|
|
423 |
|
const reco::GenParticle *myGenParticle = myJet.getGenConstituent(0); |
424 |
|
const reco::Candidate *myMother = myGenParticle->mother(); |
427 |
|
for(int iter = 0; nGrandMas != 0; ++iter) |
428 |
|
{ |
429 |
|
myMother = myMother->mother(); |
430 |
< |
nGrandMas = myMother->mother()->numberOfMothers(); |
430 |
> |
nGrandMas = myMother->mother()->numberOfMothers(); |
431 |
|
} |
432 |
|
//cout<<myJet.print()<<endl; |
433 |
< |
cout<<"Jet flavor: "<< myMother->pdgId()<<endl; |
433 |
> |
//cout<<"Jet flavor: "<< myMother->pdgId()<<endl; |
434 |
> |
jetCon->SetJetFlavor(myMother->pdgId()); |
435 |
|
++genCount; |
436 |
|
|
437 |
|
} |
512 |
|
|
513 |
|
jet_ak5PF->Clear(); |
514 |
|
primaryVtx->Clear(); |
515 |
< |
jetP4_ak5Gen->Clear(); |
515 |
> |
jet_ak5Gen->Clear(); |
516 |
|
|
517 |
|
} |
518 |
|
|
534 |
|
p1_nVtcs = new TProfile("p1_nVtcs", "<N> per run", 5200.0, 132300.0, 137500.0, 0.0, 6.0); |
535 |
|
|
536 |
|
jet_ak5PF = new TClonesArray("TCJet"); |
537 |
< |
jetP4_ak5Gen = new TClonesArray("TLorentzVector"); |
537 |
> |
jet_ak5Gen = new TClonesArray("TCGenJet"); |
538 |
|
primaryVtx = new TClonesArray("TCPrimaryVtx"); |
539 |
|
|
540 |
|
|
541 |
|
sTree->Branch("jet_ak5PF",&jet_ak5PF, 6400, 0); |
542 |
< |
sTree->Branch("jetP4_ak5Gen",&jetP4_ak5Gen, 6400, 0); |
542 |
> |
sTree->Branch("jet_ak5Gen",&jet_ak5Gen, 6400, 0); |
543 |
|
sTree->Branch("primaryVtx",&primaryVtx, 6400, 0); |
544 |
|
|
545 |
|
sTree->Branch("eventNumber",&eventNumber, "eventNumber/I"); |