37 using namespace isodeposit;
41 trigTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"TrigTag", edm::
InputTag(
"TriggerResults::HLT"))),
42 trigEv_(cfg.getUntrackedParameter<edm::
InputTag> (
"triggerEvent")),
43 muonTag_(cfg.getUntrackedParameter<edm::
InputTag>(
"muons")),
44 trackTag_(cfg.getUntrackedParameter<edm::
InputTag>(
"tracks")),
45 caloTowerTag_(cfg.getUntrackedParameter<edm::
InputTag>(
"calotower")),
46 metTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"metTag")),
47 metIncludesMuons_(cfg.getUntrackedParameter<bool> (
"METIncludesMuons")),
53 ptMuCut_(cfg.getUntrackedParameter<double>(
"ptMuCut")),
54 etaMuCut_(cfg.getUntrackedParameter<double>(
"etaMuCut")),
55 isRelativeIso_(cfg.getUntrackedParameter<bool>(
"IsRelativeIso")),
56 isCombinedIso_(cfg.getUntrackedParameter<bool>(
"IsCombinedIso")),
57 isoCut03_(cfg.getUntrackedParameter<double>(
"IsoCut03")),
59 ptThreshold_(cfg.getUntrackedParameter<double>(
"ptThreshold")),
61 maxDPtRel_(cfg.getUntrackedParameter<double>(
"maxDPtRel")),
62 maxDeltaR_(cfg.getUntrackedParameter<double>(
"maxDeltaR")),
63 mtMin_(cfg.getUntrackedParameter<double>(
"mtMin")),
64 mtMax_(cfg.getUntrackedParameter<double>(
"mtMax")),
65 acopCut_(cfg.getUntrackedParameter<double>(
"acopCut")),
66 dxyCut_(cfg.getUntrackedParameter<double>(
"DxyCut")) {
95 bool isConfigChanged =
false;
156 for (
size_t i=0;
i< tracks->size(); ++
i){
158 double elemPt = elem.
pt();
160 double elemVx = elem.
vx();
161 double elemVy = elem.
vy();
162 double elemD0 =
sqrt( elemVx * elemVx + elemVy * elemVy );
163 if ( elemD0 > 0.2 )
continue;
164 double dz = fabs( elem.
vz() - tk.
vz());
165 if ( dz > 0.1)
continue;
170 if ( (dR < 0.01) || (dR > 0.3) )
continue;
178 if ( (dR < 0.1) || (dR > 0.3) )
continue;
179 ptSum += it->emEnergy();
180 ptSum += it->hadEnergy();
190 size_t dim = HLTMu.size();
192 if (dim==0)
return false;
193 for (
size_t k =0;
k< dim;
k++ ) {
194 if ( (
deltaR(HLTMu[
k], mu) < DR) && (fabs(HLTMu[k].pt() - mu.
pt())/ HLTMu[k].pt()<DPtRel)){
208 LogVerbatim(
"") <<
"\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
209 LogVerbatim(
"") <<
"Total numer of events analyzed: " <<
nall <<
" [events]";
210 LogVerbatim(
"") <<
"Total numer of events selected: " <<
nsel <<
" [events]";
213 LogVerbatim(
"") <<
"Passing 2 HLT match criteria: " <<
n2hlt <<
" [events] " ;
214 LogVerbatim(
"") <<
"Passing 1 HLT match criteria: " <<
n1hlt <<
" [events] " ;
218 LogVerbatim(
"") <<
">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
223 bool hlt_sel =
false;
226 bool isMu1Iso =
false;
227 bool isMu2Iso =
false;
228 bool singleTrigFlag1 =
false;
229 bool singleTrigFlag2 =
false;
237 bool trigger_fired =
false;
261 string lowestMuonUnprescaledTrig =
"";
262 bool lowestMuonUnprescaledTrigFound =
false;
264 for (
size_t ts = 0; ts< triggerNames.size() ; ts++){
265 string trig = triggerNames[ts];
266 size_t f = trig.find(
"HLT_Mu");
267 if ( (f != std::string::npos) ) {
271 bool prescaled =
false;
273 for (
unsigned int ps= 0; ps< prescaleSize; ps++){
275 if (prescaleValue != 1) prescaled =
true;
280 for (
unsigned int n=9;
n<100 ;
n++ ){
281 string lowestTrig=
"HLT_Mu";
282 string lowestTrigv0 =
"copy";
283 std::stringstream
out;
285 std::string
s = out.str();
286 lowestTrig.append(s);
287 lowestTrigv0 = lowestTrig;
288 for (
unsigned int v = 1;
v<10 ;
v++ ){
289 lowestTrig.append(
"_v");
290 std::stringstream oout;
292 std::string ss = oout.str();
293 lowestTrig.append(ss);
294 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
295 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound =
true ;
296 if (trig==lowestTrig) break ;
298 if (lowestMuonUnprescaledTrigFound)
break;
300 lowestTrig = lowestTrigv0;
301 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
303 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound =
true ;
304 if (trig==lowestTrig) break ;
306 if (lowestMuonUnprescaledTrigFound)
break;
311 unsigned int triggerIndex;
314 std::string hltPath_ = lowestMuonUnprescaledTrig;
317 if (triggerIndex < triggerResults->
size()) trigger_fired = triggerResults->accept(triggerIndex);
318 std::string L3FilterName_=
"";
326 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2 ;
329 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
335 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" << hltPath_ <<
")";
343 std::vector<reco::Particle> HLTMuMatched;
344 for (
size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
345 std::string fullname = handleTriggerEvent->filterTag(ia).encode();
348 size_t p = fullname.find_first_of(
':');
349 if ( p != std::string::npos) {
350 name = fullname.substr(0, p);
357 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
359 if (name == L3FilterName_ ) {
363 HLTMuMatched.push_back(toc[*ki].particle());
387 std::vector<reco::Muon> highPtGlbMuons;
388 std::vector<reco::Muon> highPtStaMuons;
390 for (
size_t i=0;
i<muons->size();
i++ ){
397 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
398 if (fabs(dxy)>
dxyCut_)
continue;
399 highPtGlbMuons.push_back(mu);
407 size_t nHighPtGlbMu = highPtGlbMuons.size();
408 size_t nHighPtStaMu = highPtStaMuons.size();
409 if ( hlt_sel && (nHighPtGlbMu> 0) ) {
412 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
414 if (nHighPtGlbMu>1 ){
415 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
419 for (
unsigned int j =
i+1;
j <nHighPtGlbMu ; ++
j ){
425 double mass = pair.M();
427 iso1 =
muIso ( muon1 );
428 iso2 =
muIso ( muon2 );
434 if ( (singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2) )
isZGolden1HLT_ =
true;
438 highPtGlbMuons.erase(highPtGlbMuons.begin() +
i );
439 highPtGlbMuons.erase(highPtGlbMuons.begin() +
j );
441 nHighPtGlbMu = highPtGlbMuons.size();
443 if ( isMu1Iso && isMu2Iso ){
504 const MET&
met = metCollection->at(0);
506 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
516 iso1 =
muIso ( muon1 );
518 if (!isMu1Iso)
continue;
521 if (!singleTrigFlag1)
continue;
524 double met_px = met.
px();
525 double met_py = met.
py();
528 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
530 met_px -= muon1.
px();
531 met_py -= muon1.
py();
534 double met_et = met.
pt() ;
535 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
536 double w_et = met_et+ muon1.
pt();
537 double w_px = met_px+ muon1.
px();
538 double w_py = met_py+muon1.
py();
539 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
540 massT = (massT>0) ?
sqrt(massT) : 0;
543 double acop =
M_PI - fabs(deltaphi.value());
547 if (massT<mtMin_ || massT>
mtMax_)
continue;
556 for(
unsigned int i =0 ;
i < nHighPtGlbMu ; ++
i) {
562 if (!singleTrigFlag1)
continue;
564 iso1 =
muIso ( glbMuon );
566 if (!isMu1Iso)
continue;
569 (nHighPtStaMu> 10)? nHighPtStaMu=10 : 1;
570 for (
unsigned int j =0;
j <nHighPtStaMu ; ++
j ){
576 double mass = pair.M();
577 iso2 =
muIso ( staMuon);
579 LogTrace(
"") <<
"\t... isolation value" << iso1 <<
", isolated? " << isMu1Iso ;
580 LogTrace(
"") <<
"\t... isolation value" << iso2 <<
", isolated? " << isMu2Iso ;
612 size_t nTrk = tracks->size();
613 (nTrk> 5000)? nTrk=5000 : 1;
614 for (
unsigned int j=0;
j<nTrk;
j++ ){
617 double pt2 = tk.
pt();
619 double dxy = tk.
dxy(beamSpotHandle->position());
624 double mass = pair.M();
626 iso2 =
tkIso( tk, tracks, calotower);
653 LogTrace(
"") <<
">>>> Event ACCEPTED";
655 LogTrace(
"") <<
">>>> Event REJECTED";
MonitorElement * highMass1HLT_
double p() const
momentum vector magnitude
double tkIso(reco::Track, edm::Handle< reco::TrackCollection >, edm::Handle< CaloTowerCollection >)
bool IsMuMatchedToHLTMu(const reco::Muon &, std::vector< reco::Particle >, double, double)
float sumPt
sum-pt of tracks
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual TrackRef innerTrack() const
virtual void endRun(const edm::Run &, const edm::EventSetup &)
unsigned int nEvWithHighPtMu
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * highMassIsBothGlbTrkThanW_
bool isGlobalMuon() const
double phi() const
azimuthal angle of momentum vector
MonitorElement * highMassGlbTrk_
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 &)
virtual double eta() const
momentum pseudorapidity
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_
edm::InputTag caloTowerTag_
double pt() const
track transverse momentum
virtual int charge() const
electric charge
MonitorElement * highMassNotIso_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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 &)
virtual double pt() const
transverse momentum
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_
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 double phi() const
momentum azimuthal angle
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