Changeset 18 in huonglan


Ignore:
Timestamp:
Aug 29, 2011, 12:59:40 AM (13 years ago)
Author:
huonglan
Message:

adding muon to b-jet

Location:
ANA2011
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ANA2011/CutFlow.C

    r6 r18  
    11{
    2   TFile *f = TFile::Open("res.root");
     2  TFile *f = TFile::Open("./CUTFLOW/res180710Muons_satisfyCutFlow.root");
    33
    44  TString s[6] = {"","E","M","Sig","ESig","MSig"};
  • ANA2011/ana2011.C

    r16 r18  
    723723
    724724  //Before selecting jets, look if there is a muon coming from jet
     725  cout << "1" << endl;
    725726  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  cout << "Number of pair muon and jet that overlap " << MuonJetPairs.size() << endl;
    727728
    728729  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   }
     730  if (MuonJetPairs.size() > 0){
     731    for (unsigned int i = 0; i < MuonJetPairs.size(); i++){
     732      pair<TLorentzVector,TLorentzVector> MuonJet = MuonJetPairs.at(i);
     733      vMuon.push_back(MuonJet.first);
     734      vJet.push_back(MuonJet.second);
     735    }
     736  }
     737
     738  cout << "MuonJetPairs.size() " << MuonJetPairs.size() << endl;
    734739
    735740  //SELECTION OF JETS
     
    747752      for (unsigned int iJ = 0; iJ < vJet.size(); iJ++){
    748753        TLorentzVector vJ = vJet.at(iJ);
    749         if (v4j==vJ) v4j += vMuon.at(iJ);
     754        if (v4j==vJ){
     755          cout << "jet_pt before adding " << jet_pt->at(i) << endl;
     756          cout << "vJ pt " << vJ.Pt() << endl;
     757          cout << "vM pt " << vMuon.at(iJ).Pt() << endl;
     758          v4j += vMuon.at(iJ);
     759        }
    750760      }
     761      jet_pt->at(i) = v4j.Pt();
     762      jet_E->at(i)  = v4j.E();
     763
     764      //cout << "jet_pt after adding " << jet_pt->at(i) << endl;
    751765    }
    752766
    753     jet_pt->at(i) = v4j.Pt();
    754     jet_E->at(i)  = v4j.E();
     767    cout << "before GoodJets" << endl;
    755768
    756769    if(GoodJets(i)) {
     
    798811  m_weiSV0Max[0]->Fill(sv0Max,weight);
    799812
     813  cout << "2" << endl;
     814
    800815  bool askbtagged = false;
    801816
     
    831846  }
    832847  HT += topMET_et;
     848
     849  cout << "3" << endl;
    833850
    834851  //pt leading jet : C15 : add for u4
     
    11461163  // #### The Naive analysis : no fit, test all combinations,         ###########
    11471164  // #### take the one minimizing the difference between the two tops ########### 
     1165
     1166  cout << "begin first analysis" << endl;
    11481167
    11491168  //###### RECONSTRUCT the LEPTONIC W ######
     
    14351454  if (!doChi2Ana) return kTRUE;
    14361455
     1456  cout << "begin chi2" << endl;
     1457
    14371458  //Here I have to add this condition cause my chi2 method is happy
    14381459  //just in the case I have one Lepton (e or mu)
     
    14761497    vector<TLorentzVector> vecpars2;
    14771498    vector<int> index = indjets.at(id);
    1478     //cout << "index size : " << index.size() << endl;
     1499    cout << "index size : " << index.size() << endl;
    14791500
    14801501    vector<TLorentzVector> vJetsUseForChi2;
     
    14841505    }
    14851506   
     1507    cout << "vJetsUseForChi2 " << vJetsUseForChi2.size() << endl;
     1508
    14861509    //in case we ask for b-tagging
    14871510    //we have to force the bjets to be in the jets used to calculate chi2 first
     
    15061529      if (!bjetusedforchi2) continue;
    15071530
     1531      cout << "before case 3 b-jet in 4 good jets" << endl;
     1532
    15081533      if (vGoodJets.size()==4 && bjetsInd.size()==3){
     1534        cout << "threebjets4GoodJets" << endl;
     1535
    15091536        threebjets4GoodJets = true;
    15101537        TVector2 IndSV0;
     
    15131540          vj1.SetPtEtaPhiM(jet_pt->at(inew),jet_eta->at(inew),jet_phi->at(inew),jet_m->at(inew));
    15141541          double SV0j = jet_flavor_weight_SV0->at(inew);
     1542          if (vJet.size()>0){
     1543            cout << "back to add muon prob" << endl;
     1544            for (unsigned int iJ = 0; iJ < vJet.size(); iJ++){
     1545              TLorentzVector vJ = vJet.at(iJ);
     1546              if (vj1==vJ){
     1547                cout << "find one bjet" << endl;
     1548                vj1 += vMuon.at(iJ);
     1549              }
     1550            }
     1551          }
    15151552          for (unsigned int jnew = 0; jnew < vJetsUseForChi2.size(); jnew++){
    15161553            TLorentzVector vj2 = vJetsUseForChi2.at(jnew);
     
    15221559          }
    15231560        }
     1561       
     1562        cout << "now here?" << endl;
     1563
    15241564        sort(IndSV0jets34.begin(),IndSV0jets34.end(),sortdecreaseSV0);
     1565        cout << "IndSV0jets34 size " << IndSV0jets34.size() << endl;
     1566
    15251567        bjetsInd34.push_back((int)IndSV0jets34.at(0).X());
     1568        cout << "IndSV0jets34.at(0).X() " << IndSV0jets34.at(0).X() << endl;
     1569
    15261570        bjetsInd34.push_back((int)IndSV0jets34.at(1).X());
     1571        cout << "IndSV0jets34.at(1).X() " << IndSV0jets34.at(1).X() << endl;
    15271572      }
    15281573    }//end of (askbtagged)
    15291574   
    1530     /*for (unsigned int j=0; j < index.size(); j++){
    1531       if (PRINT) cout << "index : " << index.at(j) << endl;
    1532       TLorentzVector vp4 = vGoodJets.at(index.at(j));
    1533       if (isMuonJet && vp4 == vJetOverlapNotGoodMuon)
    1534         vp4 += vMuonJet;
    1535       vecpars2.push_back(vp4);
    1536     }
    1537     vecpars2.push_back(goodLepton.at(0).vector4());
    1538     */ //comment for 26 August
    1539    
     1575    cout << "come here ? " << endl;
     1576
    15401577    for (unsigned int j=0; j < index.size(); j++){
    15411578      if (PRINT) cout << "index : " << index.at(j) << endl;
     
    15441581    }
    15451582    vecpars2.push_back(goodLepton.at(0).vector4());   
     1583
     1584    cout << "vecpars2 size " << vecpars2.size() << endl;
    15461585
    15471586    //##############################################################
     
    33263365bool ana2011::GoodJets(int ij)
    33273366{
     3367  //cout << "jet_pt in GoodJet loop " << jet_pt->at(ij) << endl;
    33283368
    33293369  // Acceptance (remove crack also):
Note: See TracChangeset for help on using the changeset viewer.