Changeset 16 in huonglan
- Timestamp:
- Aug 27, 2011, 12:20:55 AM (13 years ago)
- Location:
- ANA2011
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ANA2011/MyAdd.h
r8 r16 10 10 //bool GoodElectron(int,bool); 11 11 bool GoodMuon(int); 12 bool GoodMuonJet(int,bool,bool,vector<int>);//this function will be used to choose muon and add to jets 13 std::vector<std::pair<TLorentzVector,TLorentzVector> > AddMuonJet(bool,bool,std::vector<int>); 12 14 bool GoodJets(int); 13 15 bool MatchTrigger(int,vector<TLorentzVector>,vector<TLorentzVector>); -
ANA2011/ana2011.C
r8 r16 71 71 #include "emuOverlap.C" 72 72 #include "SF.C" 73 #include "AddMuonJetFunction.C" 73 74 74 75 bool sortdecreaseSV0(TVector2 v1, TVector2 v2) … … 504 505 505 506 //###### SELECTION OF MUON ###### 507 vector<int> indGoodMuon; 506 508 for (unsigned int i = 0; i < mu_pt->size(); i++) { 507 509 if(GoodMuon(i)) { 510 indGoodMuon.push_back(i); 508 511 TLorentzVector v4m; 509 512 … … 718 721 m_loose->Fill(10,weight); 719 722 if (ncate==12||ncate==13||ncate==21||ncate==31) m_looseSig->Fill(10,weight); 723 724 //Before selecting jets, look if there is a muon coming from jet 725 std::vector<std::pair<TLorentzVector,TLorentzVector> > MuonJetPairs = AddMuonJet(RealData,m_smearMC,indGoodMuon); 726 //cout << "Number of pair muon and jet that overlap " << MuonJetPairs.size() << endl; 727 728 vector<TLorentzVector> vMuon, vJet; 729 for (unsigned int i = 0; i < MuonJetPairs.size(); i++){ 730 pair<TLorentzVector,TLorentzVector> MuonJet = MuonJetPairs.at(i); 731 vMuon.push_back(MuonJet.first); 732 vJet.push_back(MuonJet.second); 733 } 720 734 721 735 //SELECTION OF JETS … … 729 743 TLorentzVector v4j; 730 744 v4j.SetPtEtaPhiM(jet_pt->at(i),jet_eta->at(i),jet_phi->at(i),jet_m->at(i)); 745 746 if (vJet.size()>0){ 747 for (unsigned int iJ = 0; iJ < vJet.size(); iJ++){ 748 TLorentzVector vJ = vJet.at(iJ); 749 if (v4j==vJ) v4j += vMuon.at(iJ); 750 } 751 } 752 753 jet_pt->at(i) = v4j.Pt(); 754 jet_E->at(i) = v4j.E(); 755 731 756 if(GoodJets(i)) { 732 757 double sv0 = jet_flavor_weight_SV0->at(i); … … 1069 1094 m_mjj3->Fill(mjj3,weight); 1070 1095 1096 /* 1071 1097 bool isMuonJet = false; 1072 1098 TLorentzVector vMuonJet; … … 1115 1141 } 1116 1142 } 1143 */ // comment for 26 August 1117 1144 1118 1145 // ##################### START THE FIRST ANALYSIS ####################### … … 1479 1506 if (!bjetusedforchi2) continue; 1480 1507 1481 //cout << "enter here???" << endl;1482 1483 //cout << "vGoodJets size = " << vGoodJets.size() << endl;1484 //cout << "bjetsInd size = " << bjetsInd.size() << endl;1485 //cout << "index of bjets in vGoodJets : ";1486 /*for (unsigned int i = 0; i < bjetsInd.size(); i++) {1487 cout << bjetsInd.at(i) << " " ;1488 }*/1489 //cout << endl;1490 1491 1508 if (vGoodJets.size()==4 && bjetsInd.size()==3){ 1492 1509 threebjets4GoodJets = true; … … 1511 1528 }//end of (askbtagged) 1512 1529 1513 for (unsigned int j=0; j < index.size(); j++){1530 /*for (unsigned int j=0; j < index.size(); j++){ 1514 1531 if (PRINT) cout << "index : " << index.at(j) << endl; 1515 1532 TLorentzVector vp4 = vGoodJets.at(index.at(j)); … … 1519 1536 } 1520 1537 vecpars2.push_back(goodLepton.at(0).vector4()); 1538 */ //comment for 26 August 1539 1540 for (unsigned int j=0; j < index.size(); j++){ 1541 if (PRINT) cout << "index : " << index.at(j) << endl; 1542 TLorentzVector vp4 = vGoodJets.at(index.at(j)); 1543 vecpars2.push_back(vp4); 1544 } 1545 vecpars2.push_back(goodLepton.at(0).vector4()); 1521 1546 1522 1547 //##############################################################
Note: See TracChangeset
for help on using the changeset viewer.