Get the analysis.
252 if (!HLTresults.
isValid())
return;
257 std::vector<std::string> eleTrigPathNames;
258 std::vector<std::string> muTrigPathNames;
264 bool passed_electron_HLT =
false;
265 bool passed_muon_HLT =
false;
266 for (
unsigned int i = 0;
i < HLTresults->size();
i++) {
269 for (
unsigned int index = 0;
276 passed_electron_HLT = HLTresults->accept(
i);
280 for (
unsigned int index = 0;
287 passed_muon_HLT = HLTresults->accept(
i);
293 if (!(passed_electron_HLT || passed_muon_HLT))
return;
299 if (!vertexHandle.
isValid())
return;
301 VertexCollection::const_iterator
v = vertexCollection.begin();
302 int vertex_number = vertexCollection.size();
303 double vertex_chi2 = v->normalizedChi2();
304 double vertex_d0 =
sqrt(v->x() * v->x() + v->y() * v->y());
305 double vertex_numTrks = v->tracksSize();
306 double vertex_sumTrks = 0.0;
310 vertex_curTrack != v->tracks_end(); vertex_curTrack++)
311 vertex_sumTrks += (*vertex_curTrack)->pt();
317 if (!caloMETCollection.
isValid())
return;
318 float missing_et = caloMETCollection->begin()->et();
319 float met_phi = caloMETCollection->begin()->phi();
325 if (!electronCollection.
isValid())
return;
328 float electron_et = -8.0;
329 float electron_eta = -8.0;
330 float electron_phi = -8.0;
331 float electron2_et = -9.0;
332 float electron2_eta = -9.0;
333 float electron2_phi = -9.0;
334 float ee_invMass = -9.0;
335 TLorentzVector e1, e2;
339 if (passed_electron_HLT) {
340 for (reco::GsfElectronCollection::const_iterator recoElectron =
341 electronCollection->begin();
342 recoElectron != electronCollection->end(); recoElectron++) {
344 if (recoElectron->et() < 20 || fabs(recoElectron->eta()) > 2.5)
continue;
347 if (recoElectron->deltaPhiSuperClusterTrackAtVtx() > 0.58 ||
348 recoElectron->deltaEtaSuperClusterTrackAtVtx() > 0.01 ||
349 recoElectron->sigmaIetaIeta() > 0.027)
352 if (recoElectron->et() > electron_et) {
355 electron2_eta = electron_eta;
356 electron2_phi = electron_phi;
359 electron_eta = recoElectron->eta();
360 electron_phi = recoElectron->phi();
361 e1 = TLorentzVector(recoElectron->momentum().x(),
362 recoElectron->momentum().y(),
363 recoElectron->momentum().z(), recoElectron->p());
364 }
else if (recoElectron->et() > electron2_et) {
365 electron2_et = recoElectron->et();
366 electron2_eta = recoElectron->eta();
367 electron2_phi = recoElectron->phi();
368 e2 = TLorentzVector(recoElectron->momentum().x(),
369 recoElectron->momentum().y(),
370 recoElectron->momentum().z(), recoElectron->p());
373 if (electron2_et > 0.0) {
374 TLorentzVector pair = e1 + e2;
375 ee_invMass = pair.M();
384 if (!muonCollection.
isValid())
return;
387 float mm_invMass = -9.0;
388 float muon_pt = -9.0;
389 float muon_eta = -9.0;
390 float muon_phi = -9.0;
391 float muon2_pt = -9.0;
392 float muon2_eta = -9.0;
393 float muon2_phi = -9.0;
394 TLorentzVector m1, m2;
396 if (passed_muon_HLT) {
397 for (reco::MuonCollection::const_iterator recoMuon =
398 muonCollection->begin();
399 recoMuon != muonCollection->end(); recoMuon++) {
401 if (recoMuon->pt() < 20 || !recoMuon->isGlobalMuon())
continue;
403 if (recoMuon->globalTrack()->normalizedChi2() > 10)
continue;
405 if (recoMuon->pt() > muon_pt) {
407 muon2_eta = muon_eta;
408 muon2_phi = muon_phi;
409 muon_pt = recoMuon->pt();
410 muon_eta = recoMuon->eta();
411 muon_phi = recoMuon->phi();
412 m1 = TLorentzVector(recoMuon->momentum().x(), recoMuon->momentum().y(),
413 recoMuon->momentum().z(), recoMuon->p());
414 }
else if (recoMuon->pt() > muon2_pt) {
415 muon2_pt = recoMuon->pt();
416 muon2_eta = recoMuon->eta();
417 muon2_phi = recoMuon->phi();
418 m2 = TLorentzVector(recoMuon->momentum().x(), recoMuon->momentum().y(),
419 recoMuon->momentum().z(), recoMuon->p());
423 if (muon2_pt > 0.0) {
424 TLorentzVector pair = m1 + m2;
425 mm_invMass = pair.M();
435 if (!PFJetCollection.
isValid())
return;
437 unsigned int muonCollectionSize = muonCollection->size();
439 unsigned int PFJetCollectionSize = PFJetCollection->size();
443 float jet_et = -80.0;
444 float jet_pt = -80.0;
445 float jet_eta = -80.0;
446 float jet_phi = -80.0;
447 float jet2_et = -90.0;
448 float jet2_eta = -90.0;
449 float jet2_phi = -90.0;
461 for (
unsigned int i = 0;
i < PFJetCollectionSize;
i++) {
462 const Jet&
jet = PFJetCollection->at(
i);
464 double minDistance = 99999;
465 for (
unsigned int j = 0;
j < muonCollectionSize;
j++) {
466 const Muon&
mu = muonCollection->at(
j);
469 if (minDistance > distance) minDistance = distance;
471 if (minDistance < 0.3)
477 if (electron_et > 0.0 && fabs(jet.
eta() - electron_eta) < 0.2 &&
480 if (electron2_et > 0.0 && fabs(jet.
eta() - electron2_eta) < 0.2 &&
505 if (jet.
et() > jet_et) {
517 }
else if (jet.
et() > jet2_et) {
522 jet2_eta = jet.
eta();
523 jet2_phi = jet.
phi();
533 bool fill_e1 =
false;
534 bool fill_e2 =
false;
535 bool fill_m1 =
false;
536 bool fill_m2 =
false;
537 bool fill_met =
false;
540 if (ee_invMass > 0.0) {
547 if (mm_invMass > 0.0) {
555 if (electron_et > 0.0 && missing_et > 20.0) {
556 float dphiW = fabs(met_phi - electron_phi);
557 float W_mt_e =
sqrt(2 * missing_et * electron_et * (1 -
cos(dphiW)));
564 if (muon_pt > 0.0 && missing_et > 20.0) {
565 float dphiW = fabs(met_phi - muon_phi);
566 float W_mt_m =
sqrt(2 * missing_et * muon_pt * (1 -
cos(dphiW)));
572 if (jet_et > -10.0) {
581 if (jet_eta > -50.) {
585 if (jet_phi > -10.) {
589 if (jet2_et > -10.0) {
597 if (jet2_eta > -50.) {
601 if (jet2_phi > -10.) {
605 if (fill_e1 || fill_m1) {
MonitorElement * h_e1_phi
MonitorElement * h_vertex_d0
std::vector< std::string > theMuonTriggerPathToPass_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
edm::EDGetTokenT< edm::View< reco::Jet > > thePFJetCollectionToken_
virtual float pt() const
transverse momentum
MonitorElement * h_jet2_phi
virtual double et() const
transverse energy
MonitorElement * h_m1_phi
MonitorElement * h_m_invWMass
edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsToken_
MonitorElement * h_e1_eta
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h_vertex_numTrks
virtual float phi() const
momentum azimuthal angle
Base class for all types of Jets.
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
MonitorElement * h_mumu_invMass
MonitorElement * h_jet_eta
MonitorElement * h_jet_phi
MonitorElement * h_e2_eta
MonitorElement * h_m2_phi
MonitorElement * h_e_invWMass
std::vector< std::string > theElecTriggerPathToPass_
MonitorElement * h_vertex_sumTrks
virtual float eta() const
momentum pseudorapidity
Cos< T >::type cos(const T &t)
MonitorElement * h_m1_eta
MonitorElement * h_m2_eta
edm::EDGetTokenT< edm::View< reco::MET > > theCaloMETCollectionToken_
MonitorElement * h_vertex_chi2
static const char *const trigNames[]
MonitorElement * h_ee_invMass
T const * product() const
MonitorElement * h_e2_phi
std::string const & triggerName(unsigned int index) const
MonitorElement * h_jet_et
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::EDGetTokenT< reco::GsfElectronCollection > theElectronCollectionLabel_
MonitorElement * h_met_phi
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
MonitorElement * h_jet_pt
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * h_vertex_number
edm::EDGetTokenT< reco::VertexCollection > theVertexToken_
MonitorElement * h_jet_count
MonitorElement * h_jet2_et
MonitorElement * h_jet2_eta