00001 #include "DQM/Physics/src/EwkMuLumiMonitorDQM.h"
00002
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 #include "DataFormats/Common/interface/Handle.h"
00006
00007 #include "FWCore/ServiceRegistry/interface/Service.h"
00008 #include "CommonTools/UtilAlgos/interface/TFileService.h"
00009
00010 #include "DQMServices/Core/interface/DQMStore.h"
00011 #include "DQMServices/Core/interface/MonitorElement.h"
00012
00013
00014
00015 #include "DataFormats/Common/interface/View.h"
00016 #include "DataFormats/Common/interface/Handle.h"
00017
00018 #include "DataFormats/RecoCandidate/interface/IsoDepositVetos.h"
00019 #include "DataFormats/RecoCandidate/interface/IsoDepositDirection.h"
00020
00021 #include "FWCore/Common/interface/TriggerNames.h"
00022 #include "FWCore/Framework/interface/Event.h"
00023 #include "DataFormats/Common/interface/TriggerResults.h"
00024 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00025 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00026 #include "DataFormats/Math/interface/deltaR.h"
00027
00028 #include "DataFormats/METReco/interface/MET.h"
00029 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00030
00031 #include "DataFormats/Math/interface/LorentzVector.h"
00032
00033
00034 using namespace edm;
00035 using namespace std;
00036 using namespace reco;
00037 using namespace isodeposit;
00038
00039 EwkMuLumiMonitorDQM::EwkMuLumiMonitorDQM( const ParameterSet & cfg ) :
00040
00041 trigTag_(cfg.getUntrackedParameter<edm::InputTag> ("TrigTag", edm::InputTag("TriggerResults::HLT"))),
00042 trigEv_(cfg.getUntrackedParameter<edm::InputTag> ("triggerEvent")),
00043 muonTag_(cfg.getUntrackedParameter<edm::InputTag>("muons")),
00044 trackTag_(cfg.getUntrackedParameter<edm::InputTag>("tracks")),
00045 caloTowerTag_(cfg.getUntrackedParameter<edm::InputTag>("calotower")),
00046 metTag_(cfg.getUntrackedParameter<edm::InputTag> ("metTag")),
00047 metIncludesMuons_(cfg.getUntrackedParameter<bool> ("METIncludesMuons")),
00048
00049
00050
00051
00052
00053 ptMuCut_(cfg.getUntrackedParameter<double>("ptMuCut")),
00054 etaMuCut_(cfg.getUntrackedParameter<double>("etaMuCut")),
00055 isRelativeIso_(cfg.getUntrackedParameter<bool>("IsRelativeIso")),
00056 isCombinedIso_(cfg.getUntrackedParameter<bool>("IsCombinedIso")),
00057 isoCut03_(cfg.getUntrackedParameter<double>("IsoCut03")),
00058
00059 ptThreshold_(cfg.getUntrackedParameter<double>("ptThreshold")),
00060
00061 maxDPtRel_(cfg.getUntrackedParameter<double>("maxDPtRel")),
00062 maxDeltaR_(cfg.getUntrackedParameter<double>("maxDeltaR")),
00063 mtMin_(cfg.getUntrackedParameter<double>("mtMin")),
00064 mtMax_(cfg.getUntrackedParameter<double>("mtMax")),
00065 acopCut_(cfg.getUntrackedParameter<double>("acopCut")),
00066 dxyCut_(cfg.getUntrackedParameter<double>("DxyCut")) {
00067
00068 isValidHltConfig_ = false;
00069
00070
00071 theDbe = Service<DQMStore>().operator->();
00072 theDbe->setCurrentFolder("Physics/EwkMuLumiMonitorDQM");
00073 init_histograms();
00074
00075 }
00076
00077
00078
00079 void EwkMuLumiMonitorDQM::beginRun(const Run& r, const EventSetup&iSetup) {
00080 nall = 0;
00081 nEvWithHighPtMu=0;
00082 nInKinRange= 0;
00083 nsel = 0;
00084 niso = 0;
00085 nhlt =0;
00086 n1hlt =0;
00087 n2hlt =0;
00088 nNotIso =0;
00089 nGlbSta =0;
00090 nGlbTrk =0;
00091 nTMass =0;
00092 nW=0;
00093
00094
00095 bool isConfigChanged = false;
00096
00097
00098 isValidHltConfig_ = hltConfigProvider_.init( r, iSetup, trigTag_.process(), isConfigChanged );
00099
00100
00101 }
00102
00103
00104 void EwkMuLumiMonitorDQM::beginJob() {
00105
00106 }
00107
00108 void EwkMuLumiMonitorDQM::init_histograms() {
00109
00110 mass2HLT_ = theDbe->book1D("Z_2HLT_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
00111 mass1HLT_ = theDbe->book1D("Z_1HLT_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
00112 massNotIso_ = theDbe->book1D("Z_NOTISO_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
00113 massGlbSta_ = theDbe->book1D("Z_GLBSTA_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
00114 massGlbTrk_ = theDbe->book1D("Z_GLBTRK_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
00115 massIsBothGlbTrkThanW_ = theDbe->book1D("Z_ISBOTHGLBTRKTHANW_MASS","Z mass [GeV/c^{2}]",200,0.,200.);
00116
00117 highMass2HLT_ = theDbe->book1D("Z_2HLT_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
00118 highMass1HLT_ = theDbe->book1D("Z_1HLT_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
00119 highMassNotIso_ = theDbe->book1D("Z_NOTISO_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
00120 highMassGlbSta_ = theDbe->book1D("Z_GLBSTA_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
00121 highMassGlbTrk_ = theDbe->book1D("Z_GLBTRK_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
00122 highMassIsBothGlbTrkThanW_ = theDbe->book1D("Z_ISBOTHGLBTRKTHANW_HIGHMASS","Z high mass [GeV/c^{2}]",2000,0.,2000.);
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 TMass_ = theDbe->book1D("TMASS","Transverse mass [GeV]",300,0.,300.);
00139
00140 }
00141
00142
00143
00144 double EwkMuLumiMonitorDQM::muIso( const reco::Muon & mu ) {
00145 double isovar = mu.isolationR03().sumPt;
00146 if (isCombinedIso_) {
00147 isovar += mu.isolationR03().emEt;
00148 isovar += mu.isolationR03().hadEt;
00149 }
00150 if (isRelativeIso_) isovar /= mu.pt();
00151 return isovar;
00152 }
00153
00154 double EwkMuLumiMonitorDQM::tkIso( const reco::Track tk, Handle< TrackCollection > tracks , Handle<CaloTowerCollection> calotower ) {
00155 double ptSum = 0;
00156 for (size_t i=0; i< tracks->size(); ++i){
00157 const reco::Track & elem = tracks->at(i);
00158 double elemPt = elem.pt();
00159
00160 double elemVx = elem.vx();
00161 double elemVy = elem.vy();
00162 double elemD0 = sqrt( elemVx * elemVx + elemVy * elemVy );
00163 if ( elemD0 > 0.2 ) continue;
00164 double dz = fabs( elem.vz() - tk.vz());
00165 if ( dz > 0.1) continue;
00166
00167 if ( elemPt < ptThreshold_ ) continue;
00168 double dR = deltaR( elem.eta(), elem.phi(), tk.eta(), tk.phi() );
00169
00170 if ( (dR < 0.01) || (dR > 0.3) ) continue;
00171 ptSum += elemPt;
00172 }
00173 if (isCombinedIso_) {
00174
00175 for (CaloTowerCollection::const_iterator it=calotower->begin(); it!=calotower->end();++it ){
00176 double dR = deltaR( it->eta(), it->phi(),tk.outerEta(), tk.outerPhi() );
00177
00178 if ( (dR < 0.1) || (dR > 0.3) ) continue;
00179 ptSum += it->emEnergy();
00180 ptSum += it->hadEnergy();
00181 }
00182 }
00183 if (isRelativeIso_) ptSum /= tk.pt();
00184 return ptSum;
00185 }
00186
00187
00188
00189 bool EwkMuLumiMonitorDQM::IsMuMatchedToHLTMu ( const reco::Muon & mu, std::vector<reco::Particle> HLTMu , double DR, double DPtRel ) {
00190 size_t dim = HLTMu.size();
00191 size_t nPass=0;
00192 if (dim==0) return false;
00193 for (size_t k =0; k< dim; k++ ) {
00194 if ( (deltaR(HLTMu[k], mu) < DR) && (fabs(HLTMu[k].pt() - mu.pt())/ HLTMu[k].pt()<DPtRel)){
00195 nPass++ ;
00196 }
00197 }
00198 return (nPass>0);
00199 }
00200
00201
00202
00203 void EwkMuLumiMonitorDQM::endJob() {
00204 }
00205
00206 void EwkMuLumiMonitorDQM::endRun(const Run& r, const EventSetup&) {
00207
00208 LogVerbatim("") << "\n>>>>>> Z/W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
00209 LogVerbatim("") << "Total numer of events analyzed: " << nall << " [events]";
00210 LogVerbatim("") << "Total numer of events selected: " << nsel << " [events]";
00211
00212 LogVerbatim("") << "Passing HLT criteria: " << nhlt << " [events] " ;
00213 LogVerbatim("") << "Passing 2 HLT match criteria: " << n2hlt << " [events] " ;
00214 LogVerbatim("") << "Passing 1 HLT match criteria: " << n1hlt << " [events] " ;
00215 LogVerbatim("") << "Passing Not Iso criteria: " << nNotIso << " [events] " ;
00216 LogVerbatim("") << "Passing GlbSta criteria: " << nGlbSta << " [events] " ;
00217 LogVerbatim("") << "Passing W criteria: " << nTMass << " [events] " ;
00218 LogVerbatim("") << ">>>>>> Z/W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
00219 }
00220
00221 void EwkMuLumiMonitorDQM::analyze (const Event & ev, const EventSetup &) {
00222 nall++;
00223 bool hlt_sel = false;
00224 double iso1=-1;
00225 double iso2=-1;
00226 bool isMu1Iso = false;
00227 bool isMu2Iso = false;
00228 bool singleTrigFlag1 = false;
00229 bool singleTrigFlag2 = false;
00230 isZGolden1HLT_=false;
00231 isZGolden2HLT_=false;
00232 isZGoldenNoIso_=false;
00233 isZGlbSta_=false;
00234 isZGlbTrk_=false;
00235 isW_=false;
00236
00237 bool trigger_fired = false;
00238
00239 Handle<TriggerResults> triggerResults;
00240 if (!ev.getByLabel(trigTag_, triggerResults)) {
00241
00242 return;
00243 }
00244
00245 ev.getByLabel(trigTag_, triggerResults);
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 string lowestMuonUnprescaledTrig = "";
00262 bool lowestMuonUnprescaledTrigFound = false;
00263 const std::vector<std::string>& triggerNames = hltConfigProvider_.triggerNames();
00264 for (size_t ts = 0; ts< triggerNames.size() ; ts++){
00265 string trig = triggerNames[ts];
00266 size_t f = trig.find("HLT_Mu");
00267 if ( (f != std::string::npos) ) {
00268
00269
00271 bool prescaled = false;
00272 const unsigned int prescaleSize = hltConfigProvider_.prescaleSize() ;
00273 for (unsigned int ps= 0; ps< prescaleSize; ps++){
00274 const unsigned int prescaleValue = hltConfigProvider_.prescaleValue(ps, trig) ;
00275 if (prescaleValue != 1) prescaled =true;
00276
00277 }
00278 if (!prescaled){
00279
00280 for (unsigned int n=9; n<100 ; n++ ){
00281 string lowestTrig= "HLT_Mu";
00282 string lowestTrigv0 = "copy";
00283 std::stringstream out;
00284 out << n;
00285 std::string s = out.str();
00286 lowestTrig.append(s);
00287 lowestTrigv0 = lowestTrig;
00288 for (unsigned int v = 1; v<10 ; v++ ){
00289 lowestTrig.append("_v");
00290 std::stringstream oout;
00291 oout << v;
00292 std::string ss = oout.str();
00293 lowestTrig.append(ss);
00294 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
00295 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound = true ;
00296 if (trig==lowestTrig) break ;
00297 }
00298 if (lowestMuonUnprescaledTrigFound) break;
00299
00300 lowestTrig = lowestTrigv0;
00301 if (trig==lowestTrig) lowestMuonUnprescaledTrig = trig ;
00302
00303 if (trig==lowestTrig) lowestMuonUnprescaledTrigFound = true ;
00304 if (trig==lowestTrig) break ;
00305 }
00306 if (lowestMuonUnprescaledTrigFound) break;
00307 }
00308 }
00309 }
00310
00311 unsigned int triggerIndex;
00312
00313
00314 std::string hltPath_ = lowestMuonUnprescaledTrig;
00315
00316 triggerIndex = hltConfigProvider_.triggerIndex(hltPath_);
00317 if (triggerIndex < triggerResults->size()) trigger_fired = triggerResults->accept(triggerIndex);
00318 std::string L3FilterName_="";
00319 if (trigger_fired){
00320 const std::vector<std::string>& moduleLabs = hltConfigProvider_.moduleLabels(hltPath_);
00321
00322
00323
00324
00325
00326 size_t moduleLabsSizeMinus2 = moduleLabs.size() - 2 ;
00327
00328
00329 L3FilterName_ = moduleLabs[moduleLabsSizeMinus2];
00330
00331 }
00332
00333
00334 edm::Handle< trigger::TriggerEvent > handleTriggerEvent;
00335 LogTrace("") << ">>> Trigger bit: " << trigger_fired << " (" << hltPath_ << ")";
00336 if ( ! ev.getByLabel( trigEv_, handleTriggerEvent )) {
00337
00338 return;
00339 }
00340 ev.getByLabel( trigEv_, handleTriggerEvent );
00341 const trigger::TriggerObjectCollection & toc(handleTriggerEvent->getObjects());
00342 size_t nMuHLT =0;
00343 std::vector<reco::Particle> HLTMuMatched;
00344 for ( size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
00345 std::string fullname = handleTriggerEvent->filterTag(ia).encode();
00346
00347 std::string name;
00348 size_t p = fullname.find_first_of(':');
00349 if ( p != std::string::npos) {
00350 name = fullname.substr(0, p);
00351 }
00352 else {
00353 name = fullname;
00354 }
00355 if ( &toc !=0 ) {
00356 const trigger::Keys & k = handleTriggerEvent->filterKeys(ia);
00357 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
00358
00359 if (name == L3FilterName_ ) {
00360
00361 hlt_sel=true;
00362 nhlt++;
00363 HLTMuMatched.push_back(toc[*ki].particle());
00364 nMuHLT++;
00365 }
00366 }
00367 }
00368 }
00369
00370
00371 Handle<reco::BeamSpot> beamSpotHandle;
00372 if (!ev.getByLabel(InputTag("offlineBeamSpot"), beamSpotHandle)) {
00373
00374 return;
00375 }
00376
00377
00378
00379 Handle<View<Muon> > muons;
00380 if (!ev.getByLabel(muonTag_, muons)) {
00381
00382 return;
00383 }
00384
00385 ev.getByLabel(muonTag_, muons);
00386
00387 std::vector<reco::Muon> highPtGlbMuons;
00388 std::vector<reco::Muon> highPtStaMuons;
00389
00390 for (size_t i=0; i<muons->size(); i++ ){
00391 const reco::Muon & mu = muons->at(i);
00392 double pt = mu.pt();
00393 double eta = mu.eta();
00394 if (pt> ptMuCut_ && fabs(eta)< etaMuCut_ ) {
00395 if (mu.isGlobalMuon()) {
00396
00397 double dxy = mu.innerTrack()->dxy(beamSpotHandle->position());
00398 if (fabs(dxy)>dxyCut_) continue;
00399 highPtGlbMuons.push_back(mu);
00400 }
00401 if (mu.isGlobalMuon()) continue;
00402
00403 if(mu.isStandAloneMuon()) highPtStaMuons.push_back(mu);
00404 nEvWithHighPtMu++;
00405 }
00406 }
00407 size_t nHighPtGlbMu = highPtGlbMuons.size();
00408 size_t nHighPtStaMu = highPtStaMuons.size();
00409 if ( hlt_sel && (nHighPtGlbMu> 0) ) {
00410
00411
00412 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
00413
00414 if (nHighPtGlbMu>1 ){
00415 for(unsigned int i =0 ; i < nHighPtGlbMu ; i++) {
00416 reco::Muon muon1 = highPtGlbMuons[i];
00417 math::XYZTLorentzVector mu1(muon1.p4());
00418
00419 for (unsigned int j =i+1; j <nHighPtGlbMu ; ++j ){
00420 reco::Muon muon2 = highPtGlbMuons[j];
00421 math::XYZTLorentzVector mu2(muon2.p4());
00422
00423 if (muon1.charge() == muon2.charge()) continue;
00424 math::XYZTLorentzVector pair = mu1 + mu2;
00425 double mass = pair.M();
00426
00427 iso1 = muIso ( muon1 );
00428 iso2 = muIso ( muon2 );
00429 isMu1Iso = (iso1 < isoCut03_);
00430 isMu2Iso = (iso2 < isoCut03_);
00431 singleTrigFlag1 = IsMuMatchedToHLTMu ( muon1, HLTMuMatched ,maxDeltaR_, maxDPtRel_ );
00432 singleTrigFlag2 = IsMuMatchedToHLTMu ( muon2, HLTMuMatched ,maxDeltaR_, maxDPtRel_ );
00433 if (singleTrigFlag1 && singleTrigFlag2) isZGolden2HLT_ = true;
00434 if ( (singleTrigFlag1 && !singleTrigFlag2) || (!singleTrigFlag1 && singleTrigFlag2) ) isZGolden1HLT_ = true;
00435
00436 if (isZGolden2HLT_ || isZGolden1HLT_){
00437
00438 highPtGlbMuons.erase(highPtGlbMuons.begin() + i );
00439 highPtGlbMuons.erase(highPtGlbMuons.begin() + j );
00440
00441 nHighPtGlbMu = highPtGlbMuons.size();
00442
00443 if ( isMu1Iso && isMu2Iso ){
00444 niso++;
00445 if (isZGolden2HLT_) {
00446 n2hlt++;
00447 mass2HLT_->Fill(mass);
00448 highMass2HLT_->Fill(mass);
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458 }
00459 if (isZGolden1HLT_) {
00460 n1hlt++;
00461 mass1HLT_->Fill(mass);
00462 highMass1HLT_->Fill(mass);
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472 }
00473 } else {
00474
00475
00476 if (((isMu1Iso && !isMu2Iso) || (!isMu1Iso && isMu2Iso )) && (isZGolden2HLT_ && isZGolden1HLT_) ) {
00477 isZGoldenNoIso_=true;
00478 nNotIso++;
00479 massNotIso_->Fill(mass);
00480 highMassNotIso_->Fill(mass);
00481 }
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491 }
00492 }
00493 }
00494 }
00495 }
00496
00497
00498 if ( !(isZGolden2HLT_ || isZGolden1HLT_ )){
00499 Handle<View<MET> > metCollection;
00500 if (!ev.getByLabel(metTag_, metCollection)) {
00501
00502 return;
00503 }
00504 const MET& met = metCollection->at(0);
00505 nW=0;
00506 for(unsigned int i =0 ; i < nHighPtGlbMu ; i++) {
00507 reco::Muon muon1 = highPtGlbMuons[i];
00508
00509
00510
00511
00512
00513
00514
00515
00516 iso1 = muIso ( muon1 );
00517 isMu1Iso = (iso1 < isoCut03_);
00518 if (!isMu1Iso) continue;
00519
00520 singleTrigFlag1 = IsMuMatchedToHLTMu ( muon1, HLTMuMatched ,maxDeltaR_, maxDPtRel_ );
00521 if (!singleTrigFlag1) continue;
00522
00523
00524 double met_px = met.px();
00525 double met_py = met.py();
00526
00527 if (!metIncludesMuons_) {
00528 for(unsigned int i =0 ; i < nHighPtGlbMu ; i++) {
00529 reco::Muon muon1 = highPtGlbMuons[i];
00530 met_px -= muon1.px();
00531 met_py -= muon1.py();
00532 }
00533 }
00534 double met_et = met.pt() ;
00535 LogTrace("") << ">>> MET, MET_px, MET_py: " << met_et << ", " << met_px << ", " << met_py << " [GeV]";
00536 double w_et = met_et+ muon1.pt();
00537 double w_px = met_px+ muon1.px();
00538 double w_py = met_py+muon1.py();
00539 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
00540 massT = (massT>0) ? sqrt(massT) : 0;
00541
00542 Geom::Phi<double> deltaphi(muon1.phi()-atan2(met_py,met_px));
00543 double acop = M_PI - fabs(deltaphi.value());
00544
00545 if (acop > acopCut_) continue ;
00546 TMass_->Fill(massT);
00547 if (massT<mtMin_ || massT>mtMax_) continue;
00548
00549 isW_=true;
00550 nW++;
00551 nTMass++;
00552 }
00553 }
00554
00555 if ( !(isZGolden2HLT_ || isZGolden1HLT_ || isZGoldenNoIso_ )){
00556 for(unsigned int i =0 ; i < nHighPtGlbMu ; ++i) {
00557 reco::Muon glbMuon = highPtGlbMuons[i];
00558 math::XYZTLorentzVector mu1(glbMuon.p4());
00559
00560
00561 singleTrigFlag1 = IsMuMatchedToHLTMu ( glbMuon, HLTMuMatched ,maxDeltaR_, maxDPtRel_ );
00562 if (!singleTrigFlag1) continue;
00563
00564 iso1 = muIso ( glbMuon );
00565 isMu1Iso = (iso1 < isoCut03_);
00566 if (!isMu1Iso) continue;
00567
00568
00569 (nHighPtStaMu> 10)? nHighPtStaMu=10 : 1;
00570 for (unsigned int j =0; j <nHighPtStaMu ; ++j ){
00571 reco::Muon staMuon = highPtStaMuons[j];
00572 math::XYZTLorentzVector mu2(staMuon.p4());
00573
00574 if (glbMuon.charge() == staMuon.charge()) continue;
00575 math::XYZTLorentzVector pair = mu1 + mu2;
00576 double mass = pair.M();
00577 iso2 = muIso ( staMuon);
00578 isMu2Iso = (iso2 < isoCut03_);
00579 LogTrace("") << "\t... isolation value" << iso1 <<", isolated? " << isMu1Iso ;
00580 LogTrace("") << "\t... isolation value" << iso2 <<", isolated? " << isMu2Iso ;
00581
00582 if (isMu2Iso ) {
00583 isZGlbSta_=true;
00584 nGlbSta++;
00585 massGlbSta_->Fill(mass);
00586 highMassGlbSta_->Fill(mass);
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596 }
00597 }
00598
00599 Handle< TrackCollection > tracks;
00600 if (!ev.getByLabel(trackTag_, tracks)) {
00601
00602 return;
00603 }
00604 ev.getByLabel(trackTag_, tracks);
00605 Handle< CaloTowerCollection > calotower;
00606 if (!ev.getByLabel(caloTowerTag_, calotower)) {
00607
00608 return;
00609 }
00610 ev.getByLabel(caloTowerTag_, calotower);
00611
00612 size_t nTrk = tracks->size();
00613 (nTrk> 5000)? nTrk=5000 : 1;
00614 for (unsigned int j=0; j<nTrk; j++ ){
00615 const reco::Track & tk = tracks->at(j);
00616 if (glbMuon.charge() == tk.charge()) continue;
00617 double pt2 = tk.pt();
00618 double eta = tk.eta();
00619 double dxy = tk.dxy(beamSpotHandle->position());
00620 if (pt2< ptMuCut_ || fabs(eta) > etaMuCut_ || fabs(dxy)>dxyCut_) continue;
00621
00622 math::XYZTLorentzVector mu2(tk.px(),tk.py(), tk.pz(), sqrt( (tk.p() * tk.p()) + ( 0.10566 * 0.10566))) ;
00623 math::XYZTLorentzVector pair = mu1 + mu2;
00624 double mass = pair.M();
00625
00626 iso2 = tkIso( tk, tracks, calotower);
00627 isMu2Iso = (iso2 < isoCut03_);
00628
00629 if (isMu2Iso) {
00630 isZGlbTrk_=true;
00631 nGlbTrk++;
00632 massGlbTrk_->Fill(mass);
00633 highMassGlbTrk_->Fill(mass);
00634 if (!isW_) continue;
00635 massIsBothGlbTrkThanW_->Fill(mass);
00636 highMassIsBothGlbTrkThanW_->Fill(mass);
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646 }
00647 }
00648 }
00649 }
00650 }
00651 if ( (hlt_sel || isZGolden2HLT_ || isZGolden1HLT_ || isZGoldenNoIso_ || isZGlbSta_ || isZGlbTrk_ || isW_) ) {
00652 nsel++;
00653 LogTrace("") << ">>>> Event ACCEPTED";
00654 } else {
00655 LogTrace("") << ">>>> Event REJECTED";
00656 }
00657 return;
00658 }