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")) {
90 bool isConfigChanged =
false;
108 char chtitle[256] =
"";
109 for (
int i=0;
i<2; ++
i) {
110 snprintf(chtitle, 255,
"Z mass [GeV/c^{2}]");
119 snprintf(chtitle, 255,
"Z high mass [GeV/c^{2}]");
142 snprintf(chtitle, 255,
"Transverse mass [GeV]" );
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 iso_sel =
false;
230 bool hlt_sel =
false;
233 bool isMu1Iso =
false;
234 bool isMu2Iso =
false;
235 bool singleTrigFlag1 =
false;
236 bool singleTrigFlag2 =
false;
244 bool trigger_fired =
false;
268 string lowestMuonUnprescaledTrig =
"";
269 bool lowestMuonUnprescaledTrigFound =
false;
271 for (
size_t ts = 0; ts< triggerNames.size() ; ts++){
272 string trig = triggerNames[ts];
273 size_t f = trig.find(
"HLT_Mu");
274 if ( (f != std::string::npos) ) {
278 bool prescaled =
false;
280 for (
unsigned int ps= 0; ps< prescaleSize; ps++){
282 if (prescaleValue != 1) prescaled =
true;
287 for (
unsigned int n=9;
n<100 ;
n++ ){
288 string lowestTrig=
"HLT_Mu";
289 string lowestTrigv0 =
"copy";
290 std::stringstream
out;
292 std::string
s = out.str();
293 lowestTrig.append(s);
294 lowestTrigv0 = lowestTrig;
295 for (
unsigned int v = 1;
v<10 ;
v++ ){
296 lowestTrig.append(
"_v");
297 std::stringstream oout;
299 std::string ss = oout.str();
300 lowestTrig.append(ss);
301 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
302 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound =
true ;
303 if (trig==lowestTrig) break ;
305 if (lowestMuonUnprescaledTrigFound)
break;
307 lowestTrig = lowestTrigv0;
308 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
310 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound =
true ;
311 if (trig==lowestTrig) break ;
313 if (lowestMuonUnprescaledTrigFound)
break;
318 unsigned int triggerIndex;
321 std::string hltPath_ = lowestMuonUnprescaledTrig;
324 if (triggerIndex < triggerResults->
size()) trigger_fired = triggerResults->accept(triggerIndex);
325 std::string L3FilterName_=
"";
333 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2 ;
336 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
342 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" << hltPath_ <<
")";
350 std::vector<reco::Particle> HLTMuMatched;
351 for (
size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
352 std::string fullname = handleTriggerEvent->filterTag(ia).encode();
355 size_t p = fullname.find_first_of(
':');
356 if ( p != std::string::npos) {
357 name = fullname.substr(0, p);
364 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
366 if (name == L3FilterName_ ) {
370 HLTMuMatched.push_back(toc[*ki].particle());
394 std::vector<reco::Muon> highPtGlbMuons;
395 std::vector<reco::Muon> highPtStaMuons;
397 for (
size_t i=0;
i<muons->size();
i++ ){
404 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
405 if (fabs(dxy)>
dxyCut_)
continue;
406 highPtGlbMuons.push_back(mu);
414 size_t nHighPtGlbMu = highPtGlbMuons.size();
415 size_t nHighPtStaMu = highPtStaMuons.size();
416 if ( hlt_sel && (nHighPtGlbMu> 0) ) {
419 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
421 if (nHighPtGlbMu>1 ){
422 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
426 for (
unsigned int j =
i+1;
j <nHighPtGlbMu ; ++
j ){
432 double mass = pair.M();
434 iso1 =
muIso ( muon1 );
435 iso2 =
muIso ( muon2 );
441 if ( (singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2) )
isZGolden1HLT_ =
true;
445 highPtGlbMuons.erase(highPtGlbMuons.begin() +
i );
446 highPtGlbMuons.erase(highPtGlbMuons.begin() +
j );
448 nHighPtGlbMu = highPtGlbMuons.size();
450 if ( isMu1Iso && isMu2Iso ){
512 const MET&
met = metCollection->at(0);
514 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
524 iso1 =
muIso ( muon1 );
526 if (!isMu1Iso)
continue;
529 if (!singleTrigFlag1)
continue;
532 double met_px = met.
px();
533 double met_py = met.
py();
536 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
538 met_px -= muon1.
px();
539 met_py -= muon1.
py();
542 double met_et = met.
pt() ;
543 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
544 double w_et = met_et+ muon1.
pt();
545 double w_px = met_px+ muon1.
px();
546 double w_py = met_py+muon1.
py();
547 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
548 massT = (massT>0) ?
sqrt(massT) : 0;
551 double acop =
M_PI - fabs(deltaphi.value());
555 if (massT<mtMin_ || massT>
mtMax_)
continue;
564 for(
unsigned int i =0 ;
i < nHighPtGlbMu ; ++
i) {
570 if (!singleTrigFlag1)
continue;
572 iso1 =
muIso ( glbMuon );
574 if (!isMu1Iso)
continue;
577 (nHighPtStaMu> 10)? nHighPtStaMu=10 : 1;
578 for (
unsigned int j =0;
j <nHighPtStaMu ; ++
j ){
584 double mass = pair.M();
585 iso2 =
muIso ( staMuon);
587 LogTrace(
"") <<
"\t... isolation value" << iso1 <<
", isolated? " << isMu1Iso ;
588 LogTrace(
"") <<
"\t... isolation value" << iso2 <<
", isolated? " << isMu2Iso ;
620 size_t nTrk = tracks->size();
621 (nTrk> 5000)? nTrk=5000 : 1;
622 for (
unsigned int j=0;
j<nTrk;
j++ ){
625 double pt2 = tk.
pt();
627 double dxy = tk.
dxy(beamSpotHandle->position());
632 double mass = pair.M();
634 iso2 =
tkIso( tk, tracks, calotower);
661 LogTrace(
"") <<
">>>> Event ACCEPTED";
663 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)
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