12 return a.pt() > b.pt();
19 return a.
pt() > b.
pt();
26 return a.
pt() > b.
pt();
33 return a.
pt() > b.
pt();
55 MomentumMC[NumberMCParticles]=
p;
56 TransverseMomentumMC[NumberMCParticles]=
pt;
57 EtaMC[NumberMCParticles]=
eta;
58 PhiMC[NumberMCParticles]=
phi;
63 MomentumTK[NumberTracks]=
p;
64 TransverseMomentumTK[NumberTracks]=
pt;
65 EtaTK[NumberTracks]=
eta;
66 PhiTK[NumberTracks]=
phi;
71 MomentumIJ[NumberInclusiveJet]=
p;
72 TransverseMomentumIJ[NumberInclusiveJet]=
pt;
73 EtaIJ[NumberInclusiveJet]=
eta;
74 PhiIJ[NumberInclusiveJet]=
phi;
79 MomentumCJ[NumberChargedJet]=
p;
80 TransverseMomentumCJ[NumberChargedJet]=
pt;
81 EtaCJ[NumberChargedJet]=
eta;
82 PhiCJ[NumberChargedJet]=
phi;
87 MomentumTJ[NumberTracksJet]=
p;
88 TransverseMomentumTJ[NumberTracksJet]=
pt;
89 EtaTJ[NumberTracksJet]=
eta;
90 PhiTJ[NumberTracksJet]=
phi;
95 MomentumEHJ[NumberCaloJet]=
p;
96 TransverseMomentumEHJ[NumberCaloJet]=
pt;
97 EtaEHJ[NumberCaloJet]=
eta;
98 PhiEHJ[NumberCaloJet]=
phi;
117 triggerResultsToken = consumes<edm::TriggerResults>(pset.
getParameter<
InputTag>(
"triggerResults"));
124 NumberInclusiveJet=0;
134 AnalysisTree = fs->make<TTree>(
"AnalysisTree",
"MBUE Analysis Tree ");
136 AnalysisTree->Branch(
"EventKind",&EventKind,
"EventKind/I");
141 AnalysisTree->Branch(
"NumberMCParticles",&NumberMCParticles,
"NumberMCParticles/I");
142 AnalysisTree->Branch(
"MomentumMC",MomentumMC,
"MomentumMC[NumberMCParticles]/F");
143 AnalysisTree->Branch(
"TransverseMomentumMC",TransverseMomentumMC,
"TransverseMomentumMC[NumberMCParticles]/F");
144 AnalysisTree->Branch(
"EtaMC",EtaMC,
"EtaMC[NumberMCParticles]/F");
145 AnalysisTree->Branch(
"PhiMC",PhiMC,
"PhiMC[NumberMCParticles]/F");
148 AnalysisTree->Branch(
"NumberTracks",&NumberTracks,
"NumberTracks/I");
149 AnalysisTree->Branch(
"MomentumTK",MomentumTK,
"MomentumTK[NumberTracks]/F");
150 AnalysisTree->Branch(
"TrasverseMomentumTK",TransverseMomentumTK,
"TransverseMomentumTK[NumberTracks]/F");
151 AnalysisTree->Branch(
"EtaTK",EtaTK,
"EtaTK[NumberTracks]/F");
152 AnalysisTree->Branch(
"PhiTK",PhiTK,
"PhiTK[NumberTracks]/F");
155 AnalysisTree->Branch(
"NumberInclusiveJet",&NumberInclusiveJet,
"NumberInclusiveJet/I");
156 AnalysisTree->Branch(
"MomentumIJ",MomentumIJ,
"MomentumIJ[NumberInclusiveJet]/F");
157 AnalysisTree->Branch(
"TrasverseMomentumIJ",TransverseMomentumIJ,
"TransverseMomentumIJ[NumberInclusiveJet]/F");
158 AnalysisTree->Branch(
"EtaIJ",EtaIJ,
"EtaIJ[NumberInclusiveJet]/F");
159 AnalysisTree->Branch(
"PhiIJ",PhiIJ,
"PhiIJ[NumberInclusiveJet]/F");
162 AnalysisTree->Branch(
"NumberChargedJet",&NumberChargedJet,
"NumberChargedJet/I");
163 AnalysisTree->Branch(
"MomentumCJ",MomentumCJ,
"MomentumCJ[NumberChargedJet]/F");
164 AnalysisTree->Branch(
"TrasverseMomentumCJ",TransverseMomentumCJ,
"TransverseMomentumCJ[NumberChargedJet]/F");
165 AnalysisTree->Branch(
"EtaCJ",EtaCJ,
"EtaCJ[NumberChargedJet]/F");
166 AnalysisTree->Branch(
"PhiCJ",PhiCJ,
"PhiCJ[NumberChargedJet]/F");
169 AnalysisTree->Branch(
"NumberTracksJet",&NumberTracksJet,
"NumberTracksJet/I");
170 AnalysisTree->Branch(
"MomentumTJ",MomentumTJ,
"MomentumTJ[NumberTracksJet]/F");
171 AnalysisTree->Branch(
"TrasverseMomentumTJ",TransverseMomentumTJ,
"TransverseMomentumTJ[NumberTracksJet]/F");
172 AnalysisTree->Branch(
"EtaTJ",EtaTJ,
"EtaTJ[NumberTracksJet]/F");
173 AnalysisTree->Branch(
"PhiTJ",PhiTJ,
"PhiTJ[NumberTracksJet]/F");
176 AnalysisTree->Branch(
"NumberCaloJet",&NumberCaloJet,
"NumberCaloJet/I");
177 AnalysisTree->Branch(
"MomentumEHJ",MomentumEHJ,
"MomentumEHJ[NumberCaloJet]/F");
178 AnalysisTree->Branch(
"TrasverseMomentumEHJ",TransverseMomentumEHJ,
"TransverseMomentumEHJ[NumberCaloJet]/F");
179 AnalysisTree->Branch(
"EtaEHJ",EtaEHJ,
"EtaEHJ[NumberCaloJet]/F");
180 AnalysisTree->Branch(
"PhiEHJ",PhiEHJ,
"PhiEHJ[NumberCaloJet]/F");
187 MonteCarlo =
new TClonesArray(
"TLorentzVector", 10000);
188 AnalysisTree->Branch(
"MonteCarlo",
"TClonesArray", &MonteCarlo, 128000, 0);
190 Track =
new TClonesArray(
"TLorentzVector", 10000);
191 AnalysisTree->Branch(
"Track",
"TClonesArray", &
Track, 128000, 0);
193 InclusiveJet =
new TClonesArray(
"TLorentzVector", 10000);
194 AnalysisTree->Branch(
"InclusiveJet",
"TClonesArray", &InclusiveJet, 128000, 0);
196 ChargedJet =
new TClonesArray(
"TLorentzVector", 10000);
197 AnalysisTree->Branch(
"ChargedJet",
"TClonesArray", &ChargedJet, 128000, 0);
199 TracksJet =
new TClonesArray(
"TLorentzVector", 10000);
200 AnalysisTree->Branch(
"TracksJet",
"TClonesArray", &TracksJet, 128000, 0);
202 CalorimeterJet =
new TClonesArray(
"TLorentzVector", 10000);
203 AnalysisTree->Branch(
"CalorimeterJet",
"TClonesArray", &CalorimeterJet, 128000, 0);
205 acceptedTriggers =
new TClonesArray(
"TObjString", 10000);
206 AnalysisTree->Branch(
"acceptedTriggers",
"TClonesArray", &acceptedTriggers, 128000, 0);
217 acceptedTriggers->Clear();
218 unsigned int iAcceptedTriggers( 0 );
227 const unsigned int n_TriggerResults(
triggerResults.product()->size() );
228 for (
unsigned int itrig( 0 ); itrig < n_TriggerResults; ++itrig )
239 new((*acceptedTriggers)[iAcceptedTriggers]) TObjString( (triggerNames.
triggerName( itrig )).c_str() );
252 e.
getByToken( chgGenPartCollToken, CandHandleMC );
253 e.
getByToken( chgJetCollToken , ChgGenJetsHandle );
254 e.
getByToken( genJetCollToken , GenJetsHandle );
256 const HepMC::GenEvent* Evt = EvtHandle->GetEvent() ;
258 EventKind = Evt->signal_process_id();
260 std::vector<math::XYZTLorentzVector> GenPart;
261 std::vector<GenJet> ChgGenJetContainer;
262 std::vector<GenJet> GenJetContainer;
265 ChgGenJetContainer.clear();
266 GenJetContainer.clear();
268 InclusiveJet->Clear();
272 if (ChgGenJetsHandle->size()){
274 for ( GenJetCollection::const_iterator it(ChgGenJetsHandle->begin()), itEnd(ChgGenJetsHandle->end());
277 ChgGenJetContainer.push_back(*it);
280 std::stable_sort(ChgGenJetContainer.begin(),ChgGenJetContainer.end(),
GenJetSort());
282 std::vector<GenJet>::const_iterator it(ChgGenJetContainer.begin()), itEnd(ChgGenJetContainer.end());
283 for (
int iChargedJet(0); it != itEnd; ++it, ++iChargedJet)
285 fillChargedJet(it->p(),it->pt(),it->eta(),it->phi());
286 new((*ChargedJet)[iChargedJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
292 if (GenJetsHandle->size()){
294 for ( GenJetCollection::const_iterator it(GenJetsHandle->begin()), itEnd(GenJetsHandle->end());
297 GenJetContainer.push_back(*it);
300 std::stable_sort(GenJetContainer.begin(),GenJetContainer.end(),
GenJetSort());
302 std::vector<GenJet>::const_iterator it(GenJetContainer.begin()), itEnd(GenJetContainer.end());
303 for (
int iInclusiveJet(0); it != itEnd; ++it, ++iInclusiveJet)
305 fillInclusiveJet(it->p(),it->pt(),it->eta(),it->phi());
306 new((*InclusiveJet)[iInclusiveJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
312 if (CandHandleMC->size()){
314 for (vector<GenParticle>::const_iterator it(CandHandleMC->begin()), itEnd(CandHandleMC->end());
317 GenPart.push_back(it->p4());
320 std::stable_sort(GenPart.begin(),GenPart.end(),
GreaterPt());
322 std::vector<math::XYZTLorentzVector>::const_iterator it(GenPart.begin()), itEnd(GenPart.end());
323 for(
int iMonteCarlo(0); it != itEnd; ++it, ++iMonteCarlo )
325 fillMCParticles(it->P(),it->Pt(),it->Eta(),it->Phi());
326 new((*MonteCarlo)[iMonteCarlo]) TLorentzVector(it->Px(), it->Py(), it->Pz(), it->E());
335 e.
getByToken( tracksCollToken , CandHandleRECO );
336 e.
getByToken( recoCaloJetCollToken, RecoCaloJetsHandle );
337 e.
getByToken( tracksJetCollToken , TracksJetsHandle );
339 std::vector<math::XYZTLorentzVector> Tracks;
340 std::vector<BasicJet> TracksJetContainer;
341 std::vector<CaloJet> RecoCaloJetContainer;
344 TracksJetContainer.clear();
345 RecoCaloJetContainer.clear();
349 CalorimeterJet->Clear();
351 if(RecoCaloJetsHandle->size())
353 for(CaloJetCollection::const_iterator it(RecoCaloJetsHandle->begin()), itEnd(RecoCaloJetsHandle->end());
356 RecoCaloJetContainer.push_back(*it);
358 std::stable_sort(RecoCaloJetContainer.begin(),RecoCaloJetContainer.end(),
CaloJetSort());
360 std::vector<CaloJet>::const_iterator it(RecoCaloJetContainer.begin()), itEnd(RecoCaloJetContainer.end());
361 for(
int iCalorimeterJet(0); it != itEnd; ++it, ++iCalorimeterJet)
363 fillCaloJet(it->p(),it->pt(),it->eta(),it->phi());
364 new((*CalorimeterJet)[iCalorimeterJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
368 if(TracksJetsHandle->size())
370 for(BasicJetCollection::const_iterator it(TracksJetsHandle->begin()), itEnd(TracksJetsHandle->end());
373 TracksJetContainer.push_back(*it);
375 std::stable_sort(TracksJetContainer.begin(),TracksJetContainer.end(),
BasicJetSort());
377 std::vector<BasicJet>::const_iterator it(TracksJetContainer.begin()), itEnd(TracksJetContainer.end());
378 for(
int iTracksJet(0); it != itEnd; ++it, ++iTracksJet)
380 fillTracksJet(it->p(),it->pt(),it->eta(),it->phi());
381 new((*TracksJet)[iTracksJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
385 if(CandHandleRECO->size())
387 for(CandidateCollection::const_iterator it(CandHandleRECO->begin()), itEnd(CandHandleRECO->end());
390 Tracks.push_back(it->p4());
392 std::stable_sort(Tracks.begin(),Tracks.end(),
GreaterPt());
394 std::vector<math::XYZTLorentzVector>::const_iterator it( Tracks.begin()), itEnd(Tracks.end());
395 for(
int iTracks(0); it != itEnd; ++it, ++iTracks)
397 fillTracks(it->P(),it->Pt(),it->Eta(),it->Phi());
398 new ((*Track)[iTracks]) TLorentzVector(it->Px(), it->Py(), it->Pz(), it->E());
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void fillTracks(float, float, float, float)
Jets made from CaloTowers.
virtual float pt() const
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool operator()(const CaloJet &a, const CaloJet &b)
void fillTracksJet(float, float, float, float)
void fillChargedJet(float, float, float, float)
bool operator()(const math::XYZTLorentzVector &a, const math::XYZTLorentzVector &b)
void fillInclusiveJet(float, float, float, float)
Jets made from CaloTowers.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Jets made from MC generator particles.
void fillCaloJet(float, float, float, float)
std::string const & triggerName(unsigned int index) const
static std::string const triggerResults("TriggerResults")
bool operator()(const BasicJet &a, const BasicJet &b)
AnalysisRootpleProducer(const edm::ParameterSet &)
bool operator()(const GenJet &a, const GenJet &b)
void fillMCParticles(float, float, float, float)