188 vector<reco::Particle> Triggered_muons;
192 const int N_TriggerPaths = hltPaths.size();
196 bool Fired_Signal_Trigger[ 10] = {
false};
197 bool Fired_Control_Trigger[10] = {
false};
199 double DilepMass = 0.;
201 double deltaR_Trig = 1000.;
202 double deltaR_Reco = 0.;
203 double deltaR_Match = 0.;
207 double vertex_X = 100.;
208 double vertex_Y = 100.;
209 double vertex_Z = 100.;
230 for(
unsigned int i_Trig = 0; i_Trig < trigResults->size(); ++i_Trig ) {
232 if(trigResults->accept(i_Trig)) {
236 for(
int i = 0;
i < N_TriggerPaths;
i++ ) {
244 for(
int j = 0;
j < N_SignalPaths; ++
j ) {
250 for(
int k = 0;
k < N_ControlPaths; ++
k ) {
282 if( filterIndex >= triggerEvent->sizeFilters() ) {
290 if( filterIndex < triggerEvent->sizeFilters() ) {
292 const Keys &
keys = triggerEvent->filterKeys( filterIndex );
296 for(
size_t j = 0;
j < keys.size();
j++ ) {
305 Triggered_muons.push_back( foundObject.
particle() );
309 if( Triggered_muons.size() == 2 ) {
342 int numberTracks = primaryVertex.
tracksSize();
344 bool fake = primaryVertex.
isFake();
348 if( !fake && numberTracks > 3 ) {
350 vertex_X = primaryVertex.
x();
351 vertex_Y = primaryVertex.
y();
352 vertex_Z = primaryVertex.
z();
365 reco::MuonCollection::const_iterator
muon;
381 for(muon = muons->begin(); muon!= muons->end(); ++
muon) {
383 float N_muons = muons->size();
384 float Q_muon = muon->charge();
388 double track_X = 100.;
389 double track_Y = 100.;
390 double track_Z = 100.;
392 double N_PixelHits = 0.;
393 double N_TrackerHits = 0.;
395 if( muon->isGlobalMuon() && muon->isTrackerMuon() ) {
399 track_X = track->vx();
400 track_Y = track->vy();
401 track_Z = track->vz();
402 N_PixelHits = track->hitPattern().numberOfValidPixelHits();
403 N_TrackerHits = track->hitPattern().numberOfValidTrackerHits();
417 if( N_PixelHits < 1. )
continue;
418 if( N_TrackerHits < 11. )
continue;
424 double muonCombRelIso = 1.;
426 if ( muon->pt() != 0. )
427 muonCombRelIso = ( muIso03.
emEt + muIso03.
hadEt + muIso03.
hoEt + muIso03.
sumPt ) / muon->pt();
434 Isolated_muons.push_back(*muon);
443 if( Isolated_muons.size() > 1 ) {
449 for(
int i = 0; i < (static_cast<int>(Isolated_muons.size()) - 1); ++
i ) {
451 for(
int j =
i+1; j < static_cast<int>(Isolated_muons.size()); ++
j ) {
453 reco::MuonCollection::const_reference mu1 = Isolated_muons.at(
i);
454 reco::MuonCollection::const_reference mu2 = Isolated_muons.at(
j);
456 DilepMass =
sqrt( (mu1.energy()+mu2.energy())*(mu1.energy()+mu2.energy())
457 - (mu1.px()+mu2.px())*(mu1.px()+mu2.px())
458 - (mu1.py()+mu2.py())*(mu1.py()+mu2.py())
459 - (mu1.pz()+mu2.pz())*(mu1.pz()+mu2.pz())
462 if( DilepMass < 1. ) {
466 Isolated_muons.erase(Isolated_muons.begin()+
i);
477 if( mu1.charge()*mu2.charge() < 0. ) {
498 for(
int k = 0;
k < N_SignalPaths; ++
k ) {
511 if( Isolated_muons.size() == 2 && Triggered_muons.size() > 0 ) {
513 deltaR_Reco =
deltaR( mu1.eta(), mu1.phi(), mu2.eta(), mu2.phi() );
516 if( deltaR_Reco > 2.*DR && deltaR_Trig > 2.*DR ) {
518 for(
int i = 0; i < static_cast<int>(Isolated_muons.size()); ++
i ) {
520 for(
int j = 0; j < static_cast<int>(Triggered_muons.size()); ++
j ) {
525 deltaR_Match =
deltaR( Trigger_mu.
eta(), Trigger_mu.
phi(), Reco_mu.
eta(), Reco_mu.
phi() );
528 if( deltaR_Match < DR) {
531 Matched_muons.push_back(Reco_mu);
548 if( Matched_muons.size() == 1 ) {
550 reco::MuonCollection::const_reference matched_mu1 = Matched_muons.at(0);
559 if( Matched_muons.size() == 2 ) {
561 reco::MuonCollection::const_reference matched_mu1 = Matched_muons.at(0);
562 reco::MuonCollection::const_reference matched_mu2 = Matched_muons.at(1);
590 if( mu1.charge()*mu2.charge() > 0. ) {
MonitorElement * PixelHits_muons
std::vector< std::string > hltPaths_trig_
MonitorElement * MuonEfficiency_pT_sig
MonitorElement * PhiMuons
MonitorElement * MuonEfficiency_phi_trig
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * NMuons_iso
MonitorElement * MuonEfficiency_phi_sig
MonitorElement * TrackerHits_muons
std::vector< std::string > hltPaths_L3_
float sumPt
sum-pt of tracks
MonitorElement * DeltaR_Reco
MonitorElement * MuonEfficiency_pT_LOGX_trig
MonitorElement * DiMuonMassWC
MonitorElement * NMuons_charge
MonitorElement * DiMuonMassWC_LOGX
MonitorElement * DeltaPhiMuonsWC
double y() const
y coordinate
reco::Particle particle(reco::Particle::Charge q=0, const reco::Particle::Point &vertex=reco::Particle::Point(0, 0, 0), int status=0, bool integerCharge=true) const
MonitorElement * MuonEfficiency_eta_trig
MonitorElement * EtaMuons
MonitorElement * DiMuonMassRC_LOGX
MonitorElement * Vz_muons
MonitorElement * DeltaEtaMuonsRC
MonitorElement * VxVy_muons
virtual double eta() const
momentum pseudorapidity
int pdgId() const
PDG identifier.
std::vector< Muon > MuonCollection
collection of Muon objects
Single trigger physics object (e.g., an isolated muon)
MonitorElement * DeltaR_Trig
MonitorElement * DeltaPhiMuonsRC
MonitorElement * DeltaR_Match
MonitorElement * MuonEfficiency_pT_trig
double phi() const
momentum azimuthal angle
MonitorElement * TriggerEfficiencies_sig
MonitorElement * PtMuons_LOGX
edm::InputTag triggerEvent_
MonitorElement * TriggerEfficiencies_trig
double z() const
y coordinate
edm::InputTag triggerFilter_
MonitorElement * CombRelIso03
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
edm::InputTag triggerResults_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
double x() const
x coordinate
MonitorElement * MuonEfficiency_eta_sig
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
MonitorElement * DiMuonMassRC
MonitorElement * DeltaEtaMuonsWC
MonitorElement * MuonEfficiency_pT_LOGX_sig
std::vector< std::string > hltPaths_sig_
MonitorElement * Trigger_Match
double eta() const
momentum pseudorapidity
virtual double phi() const
momentum azimuthal angle
size_t tracksSize() const
number of tracks