186 vector<reco::Particle> Triggered_muons;
190 const int N_TriggerPaths = hltPaths.size();
194 bool Fired_Signal_Trigger[ 10] = {
false};
195 bool Fired_Control_Trigger[10] = {
false};
197 double DilepMass = 0.;
199 double deltaR_Trig = 1000.;
200 double deltaR_Reco = 0.;
201 double deltaR_Match = 0.;
205 double vertex_X = 100.;
206 double vertex_Y = 100.;
207 double vertex_Z = 100.;
228 for(
unsigned int i_Trig = 0; i_Trig < trigResults->size(); ++i_Trig ) {
230 if(trigResults->accept(i_Trig)) {
234 for(
int i = 0;
i < N_TriggerPaths;
i++ ) {
242 for(
int j = 0;
j < N_SignalPaths; ++
j ) {
248 for(
int k = 0;
k < N_ControlPaths; ++
k ) {
280 if( filterIndex >= triggerEvent->sizeFilters() ) {
288 if( filterIndex < triggerEvent->sizeFilters() ) {
290 const Keys &
keys = triggerEvent->filterKeys( filterIndex );
294 for(
size_t j = 0;
j < keys.size();
j++ ) {
303 Triggered_muons.push_back( foundObject.
particle() );
307 if( Triggered_muons.size() == 2 ) {
340 int numberTracks = primaryVertex.
tracksSize();
342 bool fake = primaryVertex.
isFake();
346 if( !fake && numberTracks > 3 ) {
348 vertex_X = primaryVertex.
x();
349 vertex_Y = primaryVertex.
y();
350 vertex_Z = primaryVertex.
z();
363 reco::MuonCollection::const_iterator
muon;
379 for(muon = muons->begin(); muon!= muons->end(); ++
muon) {
381 float N_muons = muons->size();
382 float Q_muon = muon->charge();
386 double track_X = 100.;
387 double track_Y = 100.;
388 double track_Z = 100.;
390 double N_PixelHits = 0.;
391 double N_TrackerHits = 0.;
393 if( muon->isGlobalMuon() && muon->isTrackerMuon() ) {
397 track_X = track->vx();
398 track_Y = track->vy();
399 track_Z = track->vz();
400 N_PixelHits = track->hitPattern().numberOfValidPixelHits();
401 N_TrackerHits = track->hitPattern().numberOfValidTrackerHits();
415 if( N_PixelHits < 1. )
continue;
416 if( N_TrackerHits < 11. )
continue;
422 double muonCombRelIso = 1.;
424 if ( muon->pt() != 0. )
425 muonCombRelIso = ( muIso03.
emEt + muIso03.
hadEt + muIso03.
hoEt + muIso03.
sumPt ) / muon->pt();
432 Isolated_muons.push_back(*muon);
441 if( Isolated_muons.size() > 1 ) {
447 for(
int i = 0; i < (static_cast<int>(Isolated_muons.size()) - 1); ++
i ) {
449 for(
int j =
i+1; j < static_cast<int>(Isolated_muons.size()); ++
j ) {
451 reco::MuonCollection::const_reference mu1 = Isolated_muons.at(
i);
452 reco::MuonCollection::const_reference mu2 = Isolated_muons.at(
j);
454 DilepMass =
sqrt( (mu1.energy()+mu2.energy())*(mu1.energy()+mu2.energy())
455 - (mu1.px()+mu2.px())*(mu1.px()+mu2.px())
456 - (mu1.py()+mu2.py())*(mu1.py()+mu2.py())
457 - (mu1.pz()+mu2.pz())*(mu1.pz()+mu2.pz())
460 if( DilepMass < 1. ) {
464 Isolated_muons.erase(Isolated_muons.begin()+
i);
475 if( mu1.charge()*mu2.charge() < 0. ) {
496 for(
int k = 0;
k < N_SignalPaths; ++
k ) {
509 if( Isolated_muons.size() == 2 && Triggered_muons.size() > 0 ) {
511 deltaR_Reco =
deltaR( mu1.eta(), mu1.phi(), mu2.eta(), mu2.phi() );
514 if( deltaR_Reco > 2.*DR && deltaR_Trig > 2.*DR ) {
516 for(
int i = 0; i < static_cast<int>(Isolated_muons.size()); ++
i ) {
518 for(
int j = 0; j < static_cast<int>(Triggered_muons.size()); ++
j ) {
523 deltaR_Match =
deltaR( Trigger_mu.
eta(), Trigger_mu.
phi(), Reco_mu.
eta(), Reco_mu.
phi() );
526 if( deltaR_Match < DR) {
529 Matched_muons.push_back(Reco_mu);
546 if( Matched_muons.size() == 1 ) {
548 reco::MuonCollection::const_reference matched_mu1 = Matched_muons.at(0);
557 if( Matched_muons.size() == 2 ) {
559 reco::MuonCollection::const_reference matched_mu1 = Matched_muons.at(0);
560 reco::MuonCollection::const_reference matched_mu2 = Matched_muons.at(1);
588 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
double eta() const
momentum pseudorapidity
std::vector< Muon > MuonCollection
collection of Muon objects
Single trigger physics object (e.g., an isolated muon)
MonitorElement * DeltaR_Trig
double phi() const
momentum azimuthal angle
MonitorElement * DeltaPhiMuonsRC
MonitorElement * DeltaR_Match
MonitorElement * MuonEfficiency_pT_trig
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
MonitorElement * TriggerEfficiencies_sig
MonitorElement * PtMuons_LOGX
edm::InputTag triggerEvent_
MonitorElement * TriggerEfficiencies_trig
Abs< T >::type abs(const T &t)
double z() const
y coordinate
edm::InputTag triggerFilter_
MonitorElement * CombRelIso03
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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
int pdgId() const
PDG identifier.
MonitorElement * DeltaEtaMuonsWC
MonitorElement * MuonEfficiency_pT_LOGX_sig
std::vector< std::string > hltPaths_sig_
MonitorElement * Trigger_Match
size_t tracksSize() const
number of tracks