195 bool rec_sel =
false;
196 bool iso_sel =
false;
197 bool hlt_sel =
false;
198 bool met_sel =
false;
199 bool all_sel =
false;
207 unsigned int muonCollectionSize = muonCollection->size();
218 unsigned int nmuonsForZ1 = 0;
219 unsigned int nmuonsForZ2 = 0;
221 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
222 const Muon& mu = muonCollection->at(
i);
225 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
227 if (fabs(dxy)>1) { cosmic=
true;
break;}
232 for (
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
233 const Muon& mu2 = muonCollection->at(
j);
253 const MET&
met = metCollection->at(0);
254 double met_et = met.
pt();
255 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met.
px() <<
", " << met.
py() <<
" [GeV]";
261 LogError(
"") <<
">>> Vertex collection does not exist !!!";
264 unsigned int vertexCollectionSize = vertexCollection->size();
269 for (
unsigned int i=0;
i<vertexCollectionSize;
i++) {
270 const Vertex& vertex = vertexCollection->at(
i);
271 if (vertex.
isValid()) nvvertex++;
276 bool trigger_fired =
false;
284 for (
unsigned int i=0;
i<triggerResults->size();
i++)
287 size_t found = trigName.find(
"HLT_Mu");
288 if ( found == std::string::npos)
continue;
290 bool prescaled=
false;
293 if (prescaleValue != 1) prescaled =
true;
295 if(prescaled)
continue;
297 if( triggerResults->accept(
i) ) trigger_fired=
true;
312 unsigned int jetCollectionSize = jetCollection->size();
314 for (
unsigned int i=0;
i<jetCollectionSize;
i++) {
315 const Jet&
jet = jetCollection->at(
i);
316 double minDistance=99999;
317 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
318 const Muon& mu = muonCollection->at(
i);
320 if (minDistance>distance) minDistance=distance;
322 if (minDistance<0.3)
continue;
325 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
326 LogTrace(
"") <<
">>> Number of jets above " <<
eJetMin_ <<
" [GeV]: " << njets;
333 bool hlt_hist_done =
false;
334 bool met_hist_done =
false;
335 bool nz1_hist_done =
false;
336 bool nz2_hist_done =
false;
337 bool njets_hist_done =
false;
338 bool pv_hist_done =
false;
339 bool charge_hist_done =
false;
342 const int NFLAGS = 11;
343 bool muon_sel[NFLAGS];
346 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
347 for (
int j=0;
j<NFLAGS; ++
j) {
351 const Muon& mu = muonCollection->at(
i);
356 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
363 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;;
364 if (pt>
ptCut_) muon_sel[0] =
true;
365 if (fabs(eta)<
etaCut_) muon_sel[1] =
true;
370 double dxy = gm->dxy(beamSpotHandle->position());
371 double normalizedChi2 = gm->normalizedChi2();
372 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
373 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
374 int muonHits = gm->hitPattern().numberOfValidMuonHits();
377 LogTrace(
"") <<
"\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy <<
" [cm], " << normalizedChi2 <<
", " << trackerHits <<
", " << mu.
isTrackerMuon();
378 if (fabs(dxy)<
dxyCut_) muon_sel[2] =
true;
404 if (isovar<
isoCut03_) muon_sel[4] =
true;
406 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << muon_sel[6];
411 if (trigger_fired) muon_sel[5] =
true;
418 double w_et = met_et+mu.
pt();
419 double w_px = met.
px()+mu.
px();
420 double w_py = met.
py()+mu.
py();
422 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
423 massT = (massT>0) ?
sqrt(massT) : 0;
425 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py <<
" [GeV]";
432 double acop = deltaphi.value();
433 if (acop<0) acop = - acop;
435 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
436 if (acop<
acopCut_) muon_sel[8] =
true;
440 if (nmuonsForZ1<1 || nmuonsForZ2<2) muon_sel[9] =
true;
441 if (njets<=
nJetMax_) muon_sel[10] =
true;
444 int flags_passed = 0;
445 bool rec_sel_this =
true;
446 bool iso_sel_this =
true;
447 bool hlt_sel_this =
true;
448 bool met_sel_this =
true;
449 bool all_sel_this =
true;
450 for (
int j=0;
j<NFLAGS; ++
j) {
451 if (muon_sel[
j]) flags_passed += 1;
452 if (j<4 && !muon_sel[j]) rec_sel_this =
false;
453 if (j<5 && !muon_sel[j]) iso_sel_this =
false;
454 if (j<6 && !muon_sel[j]) hlt_sel_this =
false;
455 if (j<8 && !muon_sel[j]) met_sel_this =
false;
456 if (!muon_sel[j]) all_sel_this =
false;
460 if (rec_sel_this) rec_sel =
true;
462 if (iso_sel_this) iso_sel =
true;
464 if (hlt_sel_this) hlt_sel =
true;
466 if (met_sel_this) met_sel =
true;
468 if (all_sel_this) all_sel =
true;
471 if (flags_passed >= (NFLAGS-1)) {
472 if (!muon_sel[0] || flags_passed==NFLAGS)
474 if (!muon_sel[1] || flags_passed==NFLAGS)
476 if (!muon_sel[2] || flags_passed==NFLAGS)
478 if (!muon_sel[3] || flags_passed==NFLAGS)
480 if (!muon_sel[4] || flags_passed==NFLAGS)
482 if (!muon_sel[5] || flags_passed==NFLAGS)
484 hlt_hist_done =
true;
485 if (!muon_sel[6] || flags_passed==NFLAGS)
487 if (!muon_sel[7] || flags_passed==NFLAGS)
489 met_hist_done =
true;
490 if (!muon_sel[8] || flags_passed==NFLAGS)
492 if (!muon_sel[9] || flags_passed==NFLAGS)
494 nz1_hist_done =
true;
495 if (!muon_sel[9] || flags_passed==NFLAGS)
497 nz2_hist_done =
true;
498 if (!muon_sel[10] || flags_passed==NFLAGS) {
500 njets_hist_done =
true;
501 if( flags_passed==NFLAGS ) {
505 pv_hist_done=
true; charge_hist_done=
true;
511 if ( muon4Z && !muon_sel[9]){
514 for (
unsigned int j=
i+1; j<muonCollectionSize; j++) {
515 const Muon& mu2 = muonCollection->at(j);
517 if (mu2.
charge() * charge != -1 )
continue;
519 double eta2=mu2.
eta();
if (fabs(eta2)>
etaCut_)
continue;
MonitorElement * met_before_
virtual double p() const
magnitude of momentum vector
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
float sumPt
sum-pt of tracks
virtual double et() const
transverse energy
MonitorElement * npvs_before_
virtual TrackRef innerTrack() const
MonitorElement * njets_before_
MonitorElement * dxy_before_
MonitorElement * trig_before_
MonitorElement * trig_after_
bool isTrackerMuon() const
MonitorElement * muoncharge_before_
Base class for all types of Jets.
bool isValid() const
Tells whether the vertex is valid.
bool isGlobalMuon() const
MonitorElement * acop_before_
MonitorElement * goodewkmuon_before_
virtual double eta() const
momentum pseudorapidity
MonitorElement * eta_after_
MonitorElement * pt_before_
MonitorElement * iso_before_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * npvs_after_
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
MonitorElement * njets_after_
bool isNull() const
Checks for null.
MonitorElement * dimuonmass_after_
HLTConfigProvider hltConfigProvider_
virtual int charge() const
electric charge
MonitorElement * mt_after_
MonitorElement * goodewkmuon_after_
MonitorElement * muoncharge_after_
MonitorElement * mt_before_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * eta_before_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
static const char *const trigNames[]
double normalizedChi2Cut_
MonitorElement * nz1_after_
MonitorElement * pt_after_
MonitorElement * iso_after_
virtual double px() const
x coordinate of momentum vector
MonitorElement * nz2_after_
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
MonitorElement * nz2_before_
virtual double pz() const
z coordinate of momentum vector
MonitorElement * dxy_after_
unsigned int prescaleSize() const
MonitorElement * met_after_
virtual double phi() const
momentum azimuthal angle
MonitorElement * nz1_before_
virtual double py() const
y coordinate of momentum vector
MonitorElement * dimuonmass_before_
const MuonIsolation & isolationR03() const
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
MonitorElement * ptmuonZ_after_
MonitorElement * acop_after_