13 return a.pt() > b.pt();
22 return a.
pt() > b.
pt();
43 MomentumMC[NumberMCParticles]=
p;
44 TransverseMomentumMC[NumberMCParticles]=
pt;
45 EtaMC[NumberMCParticles]=
eta;
46 PhiMC[NumberMCParticles]=phi;
52 MomentumIJ[NumberInclusiveJet]=
p;
53 TransverseMomentumIJ[NumberInclusiveJet]=
pt;
54 EtaIJ[NumberInclusiveJet]=
eta;
55 PhiIJ[NumberInclusiveJet]=phi;
61 MomentumCJ[NumberChargedJet]=
p;
62 TransverseMomentumCJ[NumberChargedJet]=
pt;
63 EtaCJ[NumberChargedJet]=
eta;
64 PhiCJ[NumberChargedJet]=phi;
85 AnalysisTree = fs->make<TTree>(
"AnalysisTree",
"MBUE Analysis Tree ");
88 AnalysisTree->Branch(
"EventKind",&EventKind,
"EventKind/I");
93 AnalysisTree->Branch(
"NumberMCParticles",&NumberMCParticles,
"NumberMCParticles/I");
94 AnalysisTree->Branch(
"MomentumMC",MomentumMC,
"MomentumMC[NumberMCParticles]/F");
95 AnalysisTree->Branch(
"TransverseMomentumMC",TransverseMomentumMC,
"TransverseMomentumMC[NumberMCParticles]/F");
96 AnalysisTree->Branch(
"EtaMC",EtaMC,
"EtaMC[NumberMCParticles]/F");
97 AnalysisTree->Branch(
"PhiMC",PhiMC,
"PhiMC[NumberMCParticles]/F");
100 AnalysisTree->Branch(
"NumberInclusiveJet",&NumberInclusiveJet,
"NumberInclusiveJet/I");
101 AnalysisTree->Branch(
"MomentumIJ",MomentumIJ,
"MomentumIJ[NumberInclusiveJet]/F");
102 AnalysisTree->Branch(
"TrasverseMomentumIJ",TransverseMomentumIJ,
"TransverseMomentumIJ[NumberInclusiveJet]/F");
103 AnalysisTree->Branch(
"EtaIJ",EtaIJ,
"EtaIJ[NumberInclusiveJet]/F");
104 AnalysisTree->Branch(
"PhiIJ",PhiIJ,
"PhiIJ[NumberInclusiveJet]/F");
107 AnalysisTree->Branch(
"NumberChargedJet",&NumberChargedJet,
"NumberChargedJet/I");
108 AnalysisTree->Branch(
"MomentumCJ",MomentumCJ,
"MomentumCJ[NumberChargedJet]/F");
109 AnalysisTree->Branch(
"TrasverseMomentumCJ",TransverseMomentumCJ,
"TransverseMomentumCJ[NumberChargedJet]/F");
110 AnalysisTree->Branch(
"EtaCJ",EtaCJ,
"EtaCJ[NumberChargedJet]/F");
111 AnalysisTree->Branch(
"PhiCJ",PhiCJ,
"PhiCJ[NumberChargedJet]/F");
118 MonteCarlo =
new TClonesArray(
"TLorentzVector", 10000);
119 AnalysisTree->Branch(
"MonteCarlo",
"TClonesArray", &MonteCarlo, 128000, 0);
121 InclusiveJet =
new TClonesArray(
"TLorentzVector", 10000);
122 AnalysisTree->Branch(
"InclusiveJet",
"TClonesArray", &InclusiveJet, 128000, 0);
124 ChargedJet =
new TClonesArray(
"TLorentzVector", 10000);
125 AnalysisTree->Branch(
"ChargedJet",
"TClonesArray", &ChargedJet, 128000, 0);
133 e.
getByToken( chgGenPartCollToken, CandHandleMC );
134 e.
getByToken( chgJetCollToken , ChgGenJetsHandle );
135 e.
getByToken( genJetCollToken , GenJetsHandle );
137 const HepMC::GenEvent* Evt = EvtHandle->GetEvent() ;
139 EventKind = Evt->signal_process_id();
141 std::vector<math::XYZTLorentzVector>
GenPart;
142 std::vector<GenJet> ChgGenJetContainer;
143 std::vector<GenJet> GenJetContainer;
146 ChgGenJetContainer.clear();
147 GenJetContainer.clear();
150 InclusiveJet->Clear();
153 if (!ChgGenJetsHandle->empty()){
155 for ( GenJetCollection::const_iterator it(ChgGenJetsHandle->begin()), itEnd(ChgGenJetsHandle->end());
158 ChgGenJetContainer.push_back(*it);
161 std::stable_sort(ChgGenJetContainer.begin(),ChgGenJetContainer.end(),
GenJetSort());
163 std::vector<GenJet>::const_iterator it(ChgGenJetContainer.begin()), itEnd(ChgGenJetContainer.end());
164 for (
int iChargedJet(0); it != itEnd; ++it, ++iChargedJet)
166 fillChargedJet(it->p(),it->pt(),it->eta(),it->phi());
167 new((*ChargedJet)[iChargedJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
171 if (!GenJetsHandle->empty()){
173 for ( GenJetCollection::const_iterator it(GenJetsHandle->begin()), itEnd(GenJetsHandle->end());
176 GenJetContainer.push_back(*it);
179 std::stable_sort(GenJetContainer.begin(),GenJetContainer.end(),
GenJetSort());
181 std::vector<GenJet>::const_iterator it(GenJetContainer.begin()), itEnd(GenJetContainer.end());
182 for (
int iInclusiveJet(0); it != itEnd; ++it, ++iInclusiveJet)
184 fillInclusiveJet(it->p(),it->pt(),it->eta(),it->phi());
185 new((*InclusiveJet)[iInclusiveJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
189 if (!CandHandleMC->empty()){
191 for (vector<GenParticle>::const_iterator it(CandHandleMC->begin()), itEnd(CandHandleMC->end());
194 GenPart.push_back(it->p4());
197 std::stable_sort(GenPart.begin(),GenPart.end(),
GreaterPt());
199 std::vector<math::XYZTLorentzVector>::const_iterator it(GenPart.begin()), itEnd(GenPart.end());
200 for(
int iMonteCarlo(0); it != itEnd; ++it, ++iMonteCarlo )
202 fillMCParticles(it->P(),it->Pt(),it->Eta(),it->Phi());
203 new((*MonteCarlo)[iMonteCarlo]) TLorentzVector(it->Px(), it->Py(), it->Pz(), it->E());
void fillMCParticles(float, float, float, float)
T getUntrackedParameter(std::string const &, T const &) const
void fillChargedJet(float, float, float, float)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double pt() const final
transverse momentum
bool operator()(const math::XYZTLorentzVector &a, const math::XYZTLorentzVector &b)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
AnalysisRootpleProducerOnlyMC(const edm::ParameterSet &)
Jets made from MC generator particles.
bool operator()(const GenJet &a, const GenJet &b)
void analyze(const edm::Event &, const edm::EventSetup &) override
void fillInclusiveJet(float, float, float, float)