Get the analysis.
238 if (!HLTresults.
isValid())
return;
243 std::vector<std::string> eleTrigPathNames;
244 std::vector<std::string> muTrigPathNames;
250 bool passed_electron_HLT =
false;
251 bool passed_muon_HLT =
false;
252 for (
unsigned int i = 0;
i < HLTresults->
size();
i++) {
255 for (
unsigned int index = 0;
262 passed_electron_HLT = HLTresults->
accept(
i);
266 for (
unsigned int index = 0;
273 passed_muon_HLT = HLTresults->
accept(
i);
279 if (!(passed_electron_HLT || passed_muon_HLT))
return;
285 if (!vertexHandle.
isValid())
return;
287 VertexCollection::const_iterator
v = vertexCollection.begin();
288 int vertex_number = vertexCollection.size();
289 double vertex_chi2 = v->normalizedChi2();
290 double vertex_d0 =
sqrt(v->x() * v->x() + v->y() * v->y());
291 double vertex_numTrks = v->tracksSize();
292 double vertex_sumTrks = 0.0;
296 vertex_curTrack != v->tracks_end(); vertex_curTrack++)
297 vertex_sumTrks += (*vertex_curTrack)->pt();
303 if (!caloMETCollection.
isValid())
return;
304 float missing_et = caloMETCollection->begin()->et();
305 float met_phi = caloMETCollection->begin()->phi();
311 if (!electronCollection.
isValid())
return;
314 float electron_et = -8.0;
315 float electron_eta = -8.0;
316 float electron_phi = -8.0;
317 float electron2_et = -9.0;
318 float electron2_eta = -9.0;
319 float electron2_phi = -9.0;
320 float ee_invMass = -9.0;
321 TLorentzVector e1, e2;
325 if (passed_electron_HLT) {
326 for (reco::GsfElectronCollection::const_iterator recoElectron =
327 electronCollection->begin();
328 recoElectron != electronCollection->end(); recoElectron++) {
330 if (recoElectron->et() < 20 || fabs(recoElectron->eta()) > 2.5)
continue;
333 if (recoElectron->deltaPhiSuperClusterTrackAtVtx() > 0.58 ||
334 recoElectron->deltaEtaSuperClusterTrackAtVtx() > 0.01 ||
335 recoElectron->sigmaIetaIeta() > 0.027)
338 if (recoElectron->et() > electron_et) {
341 electron2_eta = electron_eta;
342 electron2_phi = electron_phi;
345 electron_eta = recoElectron->eta();
346 electron_phi = recoElectron->phi();
347 e1 = TLorentzVector(recoElectron->momentum().x(),
348 recoElectron->momentum().y(),
349 recoElectron->momentum().z(), recoElectron->p());
350 }
else if (recoElectron->et() > electron2_et) {
351 electron2_et = recoElectron->et();
352 electron2_eta = recoElectron->eta();
353 electron2_phi = recoElectron->phi();
354 e2 = TLorentzVector(recoElectron->momentum().x(),
355 recoElectron->momentum().y(),
356 recoElectron->momentum().z(), recoElectron->p());
359 if (electron2_et > 0.0) {
360 TLorentzVector pair = e1 + e2;
361 ee_invMass = pair.M();
370 if (!muonCollection.
isValid())
return;
373 float mm_invMass = -9.0;
374 float muon_pt = -9.0;
375 float muon_eta = -9.0;
376 float muon_phi = -9.0;
377 float muon2_pt = -9.0;
378 float muon2_eta = -9.0;
379 float muon2_phi = -9.0;
380 TLorentzVector m1, m2;
382 if (passed_muon_HLT) {
383 for (reco::MuonCollection::const_iterator
recoMuon =
384 muonCollection->begin();
389 if (
recoMuon->globalTrack()->normalizedChi2() > 10)
continue;
393 muon2_eta = muon_eta;
394 muon2_phi = muon_phi;
400 }
else if (
recoMuon->pt() > muon2_pt) {
409 if (muon2_pt > 0.0) {
410 TLorentzVector pair = m1 + m2;
411 mm_invMass = pair.M();
421 if (!PFJetCollection.
isValid())
return;
423 unsigned int muonCollectionSize = muonCollection->size();
425 unsigned int PFJetCollectionSize = PFJetCollection->size();
429 float jet_et = -80.0;
430 float jet_pt = -80.0;
431 float jet_eta = -80.0;
432 float jet_phi = -80.0;
433 float jet2_et = -90.0;
434 float jet2_eta = -90.0;
435 float jet2_phi = -90.0;
447 for (
unsigned int i = 0;
i < PFJetCollectionSize;
i++) {
448 const Jet&
jet = PFJetCollection->at(
i);
450 double minDistance = 99999;
451 for (
unsigned int j = 0; j < muonCollectionSize; j++) {
452 const Muon&
mu = muonCollection->at(j);
455 if (minDistance > distance) minDistance =
distance;
457 if (minDistance < 0.3)
463 if (electron_et > 0.0 && fabs(jet.
eta() - electron_eta) < 0.2 &&
466 if (electron2_et > 0.0 && fabs(jet.
eta() - electron2_eta) < 0.2 &&
491 if (jet.
et() > jet_et) {
503 }
else if (jet.
et() > jet2_et) {
508 jet2_eta = jet.
eta();
509 jet2_phi = jet.
phi();
519 bool fill_e1 =
false;
520 bool fill_e2 =
false;
521 bool fill_m1 =
false;
522 bool fill_m2 =
false;
523 bool fill_met =
false;
526 if (ee_invMass > 0.0) {
533 if (mm_invMass > 0.0) {
541 if (electron_et > 0.0 && missing_et > 20.0) {
542 float dphiW = fabs(met_phi - electron_phi);
543 float W_mt_e =
sqrt(2 * missing_et * electron_et * (1 -
cos(dphiW)));
550 if (muon_pt > 0.0 && missing_et > 20.0) {
551 float dphiW = fabs(met_phi - muon_phi);
552 float W_mt_m =
sqrt(2 * missing_et * muon_pt * (1 -
cos(dphiW)));
558 if (jet_et > -10.0) {
567 if (jet_eta > -50.) {
571 if (jet_phi > -10.) {
575 if (jet2_et > -10.0) {
583 if (jet2_eta > -50.) {
587 if (jet2_phi > -10.) {
591 if (fill_e1 || fill_m1) {
MonitorElement * h_e1_phi
MonitorElement * h_vertex_d0
std::vector< std::string > theMuonTriggerPathToPass_
double eta() const final
momentum pseudorapidity
edm::EDGetTokenT< edm::View< reco::Jet > > thePFJetCollectionToken_
MonitorElement * h_jet2_phi
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
bool accept() const
Has at least one path accepted the event?
double pt() const final
transverse momentum
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
double et() const final
transverse energy
unsigned int size() const
Get number of paths stored.
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
double phi() const final
momentum azimuthal angle
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override