35 using namespace isodeposit;
39 trigTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"TrigTag", edm::
InputTag(
"TriggerResults::HLT"))),
41 trigEvToken_(consumes<trigger::TriggerEvent>(
42 cfg.getUntrackedParameter<edm::
InputTag> (
"triggerEvent"))),
44 cfg.getUntrackedParameter<edm::
InputTag> (
"offlineBeamSpot", edm::
InputTag(
"offlineBeamSpot")))),
46 cfg.getUntrackedParameter<edm::
InputTag>(
"muons"))),
48 cfg.getUntrackedParameter<edm::
InputTag>(
"tracks"))),
50 cfg.getUntrackedParameter<edm::
InputTag>(
"calotower"))),
52 cfg.getUntrackedParameter<edm::
InputTag> (
"metTag"))),
53 metIncludesMuons_(cfg.getUntrackedParameter<bool> (
"METIncludesMuons")),
59 ptMuCut_(cfg.getUntrackedParameter<double>(
"ptMuCut")),
60 etaMuCut_(cfg.getUntrackedParameter<double>(
"etaMuCut")),
61 isRelativeIso_(cfg.getUntrackedParameter<bool>(
"IsRelativeIso")),
62 isCombinedIso_(cfg.getUntrackedParameter<bool>(
"IsCombinedIso")),
63 isoCut03_(cfg.getUntrackedParameter<double>(
"IsoCut03")),
65 ptThreshold_(cfg.getUntrackedParameter<double>(
"ptThreshold")),
67 maxDPtRel_(cfg.getUntrackedParameter<double>(
"maxDPtRel")),
68 maxDeltaR_(cfg.getUntrackedParameter<double>(
"maxDeltaR")),
69 mtMin_(cfg.getUntrackedParameter<double>(
"mtMin")),
70 mtMax_(cfg.getUntrackedParameter<double>(
"mtMax")),
71 acopCut_(cfg.getUntrackedParameter<double>(
"acopCut")),
72 dxyCut_(cfg.getUntrackedParameter<double>(
"DxyCut")) {
101 bool isConfigChanged =
false;
162 for (
size_t i=0;
i< tracks->size(); ++
i){
164 double elemPt = elem.
pt();
166 double elemVx = elem.
vx();
167 double elemVy = elem.
vy();
168 double elemD0 =
sqrt( elemVx * elemVx + elemVy * elemVy );
169 if ( elemD0 > 0.2 )
continue;
170 double dz = fabs( elem.
vz() - tk.
vz());
171 if ( dz > 0.1)
continue;
176 if ( (dR < 0.01) || (dR > 0.3) )
continue;
184 if ( (dR < 0.1) || (dR > 0.3) )
continue;
185 ptSum += it->emEnergy();
186 ptSum += it->hadEnergy();
196 size_t dim = HLTMu.size();
198 if (dim==0)
return false;
199 for (
size_t k =0;
k< dim;
k++ ) {
200 if ( (
deltaR(HLTMu[
k], mu) < DR) && (fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt()<DPtRel)){
214 LogVerbatim(
"") <<
"\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
215 LogVerbatim(
"") <<
"Total numer of events analyzed: " <<
nall <<
" [events]";
216 LogVerbatim(
"") <<
"Total numer of events selected: " <<
nsel <<
" [events]";
219 LogVerbatim(
"") <<
"Passing 2 HLT match criteria: " <<
n2hlt <<
" [events] " ;
220 LogVerbatim(
"") <<
"Passing 1 HLT match criteria: " <<
n1hlt <<
" [events] " ;
224 LogVerbatim(
"") <<
">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
229 bool hlt_sel =
false;
232 bool isMu1Iso =
false;
233 bool isMu2Iso =
false;
234 bool singleTrigFlag1 =
false;
235 bool singleTrigFlag2 =
false;
243 bool trigger_fired =
false;
267 string lowestMuonUnprescaledTrig =
"";
268 bool lowestMuonUnprescaledTrigFound =
false;
270 for (
size_t ts = 0; ts< triggerNames.size() ; ts++){
271 string trig = triggerNames[ts];
272 size_t f = trig.find(
"HLT_Mu");
273 if ( (f != std::string::npos) ) {
277 bool prescaled =
false;
279 for (
unsigned int ps= 0; ps< prescaleSize; ps++){
281 if (prescaleValue != 1) prescaled =
true;
286 for (
unsigned int n=9;
n<100 ;
n++ ){
287 string lowestTrig=
"HLT_Mu";
288 string lowestTrigv0 =
"copy";
289 std::stringstream
out;
292 lowestTrig.append(s);
293 lowestTrigv0 = lowestTrig;
294 for (
unsigned int v = 1;
v<10 ;
v++ ){
295 lowestTrig.append(
"_v");
296 std::stringstream oout;
299 lowestTrig.append(ss);
300 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
301 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound =
true ;
302 if (trig==lowestTrig) break ;
304 if (lowestMuonUnprescaledTrigFound)
break;
306 lowestTrig = lowestTrigv0;
307 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
309 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound =
true ;
310 if (trig==lowestTrig) break ;
312 if (lowestMuonUnprescaledTrigFound)
break;
317 unsigned int triggerIndex;
323 if (triggerIndex < triggerResults->
size()) trigger_fired = triggerResults->accept(triggerIndex);
332 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2 ;
335 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
341 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" << hltPath_ <<
")";
349 std::vector<reco::Particle> HLTMuMatched;
350 for (
size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
351 std::string fullname = handleTriggerEvent->filterTag(ia).encode();
354 size_t p = fullname.find_first_of(
':');
355 if ( p != std::string::npos) {
356 name = fullname.substr(0, p);
363 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
365 if (name == L3FilterName_ ) {
369 HLTMuMatched.push_back(toc[*ki].particle());
393 std::vector<reco::Muon> highPtGlbMuons;
394 std::vector<reco::Muon> highPtStaMuons;
396 for (
size_t i=0;
i<muons->size();
i++ ){
403 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
404 if (fabs(dxy)>
dxyCut_)
continue;
405 highPtGlbMuons.push_back(mu);
413 size_t nHighPtGlbMu = highPtGlbMuons.size();
414 size_t nHighPtStaMu = highPtStaMuons.size();
415 if ( hlt_sel && (nHighPtGlbMu> 0) ) {
418 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
420 if (nHighPtGlbMu>1 ){
421 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
425 for (
unsigned int j =
i+1;
j <nHighPtGlbMu ; ++
j ){
431 double mass = pair.M();
433 iso1 =
muIso ( muon1 );
434 iso2 =
muIso ( muon2 );
440 if ( (singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2) )
isZGolden1HLT_ =
true;
444 highPtGlbMuons.erase(highPtGlbMuons.begin() +
i );
445 highPtGlbMuons.erase(highPtGlbMuons.begin() +
j );
447 nHighPtGlbMu = highPtGlbMuons.size();
449 if ( isMu1Iso && isMu2Iso ){
510 const MET&
met = metCollection->at(0);
512 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
522 iso1 =
muIso ( muon1 );
524 if (!isMu1Iso)
continue;
527 if (!singleTrigFlag1)
continue;
530 double met_px = met.
px();
531 double met_py = met.
py();
534 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
536 met_px -= muon1.
px();
537 met_py -= muon1.
py();
540 double met_et = met.
pt() ;
541 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
542 double w_et = met_et+ muon1.
pt();
543 double w_px = met_px+ muon1.
px();
544 double w_py = met_py+muon1.
py();
545 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
546 massT = (massT>0) ?
sqrt(massT) : 0;
549 double acop =
M_PI - fabs(deltaphi.value());
553 if (massT<mtMin_ || massT>
mtMax_)
continue;
562 for(
unsigned int i =0 ;
i < nHighPtGlbMu ; ++
i) {
568 if (!singleTrigFlag1)
continue;
570 iso1 =
muIso ( glbMuon );
572 if (!isMu1Iso)
continue;
575 (nHighPtStaMu> 10)? nHighPtStaMu=10 : 1;
576 for (
unsigned int j =0;
j <nHighPtStaMu ; ++
j ){
582 double mass = pair.M();
583 iso2 =
muIso ( staMuon);
585 LogTrace(
"") <<
"\t... isolation value" << iso1 <<
", isolated? " << isMu1Iso ;
586 LogTrace(
"") <<
"\t... isolation value" << iso2 <<
", isolated? " << isMu2Iso ;
618 size_t nTrk = tracks->size();
619 (nTrk> 5000)? nTrk=5000 : 1;
620 for (
unsigned int j=0;
j<nTrk;
j++ ){
623 double pt2 = tk.
pt();
625 double dxy = tk.
dxy(beamSpotHandle->position());
630 double mass = pair.M();
632 iso2 =
tkIso( tk, tracks, calotower);
659 LogTrace(
"") <<
">>>> Event ACCEPTED";
661 LogTrace(
"") <<
">>>> Event REJECTED";
MonitorElement * highMass1HLT_
double p() const
momentum vector magnitude
tuple met
____________________________________________________________________________||
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
float sumPt
sum-pt of tracks
virtual float pt() const
transverse momentum
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void endRun(const edm::Run &, const edm::EventSetup &)
virtual float phi() const
momentum azimuthal angle
unsigned int nEvWithHighPtMu
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< Track > TrackCollection
collection of Tracks
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * highMassIsBothGlbTrkThanW_
bool isGlobalMuon() const
double phi() const
azimuthal angle of momentum vector
MonitorElement * highMassGlbTrk_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
MonitorElement * massNotIso_
double px() const
x coordinate of momentum vector
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
bool isStandAloneMuon() const
MonitorElement * highMassGlbSta_
EwkMuLumiMonitorDQM(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > trigToken_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
MonitorElement * mass1HLT_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
double eta() const
pseudorapidity of momentum vector
MonitorElement * massIsBothGlbTrkThanW_
MonitorElement * massGlbTrk_
bool IsMuMatchedToHLTMu(const reco::Muon &, const std::vector< reco::Particle > &, double, double)
double tkIso(const reco::Track &, edm::Handle< reco::TrackCollection >, edm::Handle< CaloTowerCollection >)
virtual float eta() const
momentum pseudorapidity
double pt() const
track transverse momentum
virtual int charge() const
electric charge
edm::EDGetTokenT< CaloTowerCollection > caloTowerToken_
MonitorElement * highMassNotIso_
edm::EDGetTokenT< reco::TrackCollection > trackToken_
static std::string const triggerResults
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
double pz() const
z coordinate of momentum vector
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
double vz() const
z coordinate of the reference point on track
double outerEta() const
pseudorapidity of the momentum vector at the outermost hit position
MonitorElement * massGlbSta_
virtual double px() const
x coordinate of momentum vector
double muIso(const reco::Muon &)
std::vector< size_type > Keys
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
HLTConfigProvider hltConfigProvider_
double vy() const
y coordinate of the reference point on track
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * mass2HLT_
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_
unsigned int prescaleSize() const
MonitorElement * highMass2HLT_
int charge() const
track electric charge
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
double outerPhi() const
azimuthal angle of the momentum vector at the outermost hit position
tuple size
Write out results.
virtual double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)
double py() const
y coordinate of momentum vector
const MuonIsolation & isolationR03() const
double vx() const
x coordinate of the reference point on track