Skip to content

Commit

Permalink
Merge pull request cms-sw#141 from mariadalfonso/TopBotV18
Browse files Browse the repository at this point in the history
Top bot v18
  • Loading branch information
mariadalfonso authored May 24, 2017
2 parents b393408 + 97494e1 commit c4ef279
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 25 deletions.
2 changes: 2 additions & 0 deletions dat/branches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ fatjetAK8CHSTau3
fatjetAK8CHSnSubjets
fatjetAK8CHSSoftdropMass
fatjetAK8CHSCorrectedPrunedMass
fatjetAK8CHSsubjet_btag
fatjetAK8CHSfirstSubjet
### Leptons
lepP4
lepIso
Expand Down
5 changes: 3 additions & 2 deletions interface/FatJet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class FatJet : virtual public Object, virtual public SmearableBase
float CorrectedPrunedMass;
int nSubjets;
float subjet_btag;
bool hasSubJetBTag{false};

//Gen-level info

Expand All @@ -72,14 +73,14 @@ class FatJet : virtual public Object, virtual public SmearableBase
inline float SDMass() const { return softdropMass ; }
inline float CorrPrunedMass() const { return CorrectedPrunedMass ; }

inline float SubjetBTag() const { return subjet_btag ; }
inline bool IsSubjetBTag() const { return hasSubJetBTag ; }

inline int IsJet() const { return 1;}

// tipically 250 GeV
inline int IsWJet() const { if( softdropMass > 65. and softdropMass < 105. and tau2 < tau1*0.6 and IsJet() ) return 1; return 0;}
// tipically 400 GeV
inline int IsTopJet() const { if( softdropMass > 105. and softdropMass < 220. and tau3 < tau2*tau21cut_ and IsJet() ) return 1; return 0;}
inline int IsTopJet() const { if( softdropMass > 105. and softdropMass < 220. and tau3 < tau2*0.81 and IsJet() ) return 1; return 0;}

};

Expand Down
31 changes: 18 additions & 13 deletions src/AnalysisChargedHiggsTBfullHad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,21 +851,26 @@ int ChargedHiggsTopBottomFullHad::analyze(Event*e,string systname)
jetPlot(e, label, category, systname,"Baseline");


/*
for(int i=0;i!=e->NFatJets();++i) {
FatJet* j = e->GetFatJet(i);
std::cout << " Pt()= " << j->Pt();
std::cout << " Tau1()= " << j->Tau1();
std::cout << " Tau2()= " << j->Tau2();
std::cout << " Tau3()= " << j->Tau3();
std::cout << " SDMass()= " << j->SDMass();
std::cout << " CorrPrunedMass()= " << j->CorrPrunedMass() << endl;
std::cout << " subjet_btag= " << j->SubjetBTag() << endl;
if(e->Wjets()>0 || e->Topjets()>0) {

cout << "=======================================" << endl;
cout << "N(W) jets = " << e->Wjets() << endl;
cout << "N(TOP) jets = " << e->Topjets() << endl;

for(int i=0;i!=e->NFatJets();++i) {
FatJet* j = e->GetFatJet(i);
std::cout << " Pt()= " << j->Pt();
std::cout << " Tau1()= " << j->Tau1();
std::cout << " Tau2()= " << j->Tau2();
std::cout << " Tau3()= " << j->Tau3();
std::cout << " SDMass()= " << j->SDMass();
std::cout << " CorrPrunedMass()= " << j->CorrPrunedMass() << endl;
std::cout << " subjet_btag= " << j->IsSubjetBTag() << endl;
std::cout << " is TOP jet = " << j->IsTopJet() << endl;
std::cout << " is W jet = " << j->IsWJet() << endl;
}
}

cout << "NW jets = " << e->Wjets() << endl;
*/

// ////////
// ////
// //// Fill tree
Expand Down
24 changes: 14 additions & 10 deletions src/AnalysisChargedHiggsTopBottom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2249,6 +2249,18 @@ void ChargedHiggsTopBottom::printSynch(Event*e) {
if((e->IsTriggered("HLT_IsoMu24_v") or e->IsTriggered("HLT_IsoTkMu24_v") or e->IsTriggered("HLT_Mu50_v"))) std::cout << "passTrigger(IsoMu24 and IsoTkMu24 and Mu50)" << std::endl;
// if(e->GetName().find("SingleElectron")!=string::npos and e->IsTriggered("HLT_Ele32_eta2p1_WPTight_Gsf_v")) std::cout << "passEleTrigger" << std::endl;
// if(e->GetName().find("SingleMuon")!=string::npos and (e->IsTriggered("HLT_IsoMu24_v") or e->IsTriggered("HLT_IsoTkMu24_v"))) std::cout << "passMuonTrigger" << std::endl;

if(e->IsTriggered("HLT_Ele27_eta2p1_WPTight_Gsf_v")) std::cout << " passTrigger(HLT_Ele27_eta2p1_WPTight_Gsf_v)" << std::endl;
if(e->IsTriggered("HLT_Ele105_CaloIdVT_GsfTrkIdT_v")) std::cout << " passTrigger(HLT_Ele105_CaloIdVT_GsfTrkIdT_v)" << std::endl;
if(e->IsTriggered("HLT_Photon165_HE10")) std::cout << " passTrigger(HLT_Photon165_HE10)" << std::endl;
if(e->IsTriggered("HLT_Ele35_WPLoose_Gsf_v")) std::cout << " passTrigger(HLT_Ele35_WPLoose_Gsf_v)" << std::endl;
if(e->IsTriggered("HLT_IsoMu24_v")) std::cout << " passTrigger(HLT_IsoMu24_v)" << std::endl;
if(e->IsTriggered("HLT_IsoTkMu24_v")) std::cout << " passTrigger(HLT_IsoTkMu24_v)" << std::endl;
if(e->IsTriggered("HLT_Mu50_v")) std::cout << " passTrigger(HLT_Mu50_v)" << std::endl;




std::cout << " Nleps(pt>10, eta<2.4)=" << e->Nleps() << std::endl;
if(leadLep != NULL) {
std::cout << " leadLep->Pt()=" << leadLep->Pt();
Expand Down Expand Up @@ -2450,17 +2462,9 @@ int ChargedHiggsTopBottom::analyze(Event*e,string systname)

} else {
// DATA
/*
if(e->GetName().find("SingleMuon")!=string::npos) passTriggerMu=(e->IsTriggered("HLT_IsoMu24_v") or e->IsTriggered("HLT_IsoTkMu24_v"));
// if(e->GetName().find("SingleElectron")!=string::npos) passTriggerEle=(e->IsTriggered("HLT_Ele32_eta2p1_WPTight_Gsf_v")); // added later, Julie
// if(e->GetName().find("SingleElectron")!=string::npos) passTriggerEle=(e->IsTriggered("HLT_Ele27_WPTight_Gsf_v") or e->IsTriggered("HLT_Ele30_WPTight_Gsf_v")); //Ele27_WPTight exist in runC
// if(e->GetName().find("SingleElectron")!=string::npos) passTriggerEle=(e->IsTriggered("HLT_Ele27_eta2p1_WPTight_Gsf_v")); // asked Dominick , used in stop
if(e->GetName().find("SingleElectron")!=string::npos) passTriggerEle=(e->IsTriggered("HLT_Ele27_eta2p1_WPTight_Gsf_v")); // asked Dominick , used in stop
// if(e->GetName().find("SingleElectron")!=string::npos) passTriggerEle=(e->IsTriggered("HLT_Ele27_WPTight_Gsf_v")); // for the moment in the v2.0 tag
*/

if(e->GetName().find("SingleMuon")!=string::npos) passTriggerMu=(e->IsTriggered("HLT_IsoMu24_v") or e->IsTriggered("HLT_IsoTkMu24_v") or e->IsTriggered("HLT_Mu50_v"));
if(e->GetName().find("SingleElectron")!=string::npos) passTriggerEle=(e->IsTriggered("HLT_Ele27_eta2p1_WPTight_Gsf_v") or e->IsTriggered("HLT_Ele105_CaloIdVT_GsfTrkIdT_v") or e->IsTriggered("HLT_Photon165_HE10") or e->IsTriggered("HLT_Ele35_WPLoose_Gsf_v"));
passTriggerMu=(e->IsTriggered("HLT_IsoMu24_v") or e->IsTriggered("HLT_IsoTkMu24_v") or e->IsTriggered("HLT_Mu50_v"));
passTriggerEle=(e->IsTriggered("HLT_Ele27_eta2p1_WPTight_Gsf_v") or e->IsTriggered("HLT_Ele105_CaloIdVT_GsfTrkIdT_v") or e->IsTriggered("HLT_Photon165_HE10") or e->IsTriggered("HLT_Ele35_WPLoose_Gsf_v"));

}

Expand Down
14 changes: 14 additions & 0 deletions src/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ void LoadNero::FillFatJets(){
cout <<"\t * tau1: " << tree_->GetBranchStatus("fatjetAK8CHSTau1") << " : "<< bj->tau1->size()<<endl;
cout <<"\t * tau2: " << tree_->GetBranchStatus("fatjetAK8CHSTau2") << " : "<< bj->tau2->size()<<endl;
cout <<"\t * tau3: " << tree_->GetBranchStatus("fatjetAK8CHSTau3") << " : "<< bj->tau3->size()<<endl;
cout <<"\t * nFirst: " << tree_->GetBranchStatus("fatjetAK8CHSfirstSubjet") << " : "<< bj->firstSubjet->size()<<endl;
cout <<"\t * nSubjets: " << tree_->GetBranchStatus("fatjetAK8CHSnSubjets") << " : "<< bj->nSubjets->size()<<endl;
cout <<"\t * subjet_btag: " << tree_->GetBranchStatus("fatjetAK8CHSsubjet_btag") << " : "<< bj->subjet_btag->size()<<endl;
cout <<"\t * softdropMass: " << tree_->GetBranchStatus("fatjetAK8CHSSoftdropMass") << " : "<< bj->softdropMass->size()<<endl;
cout <<"\t * CorrectedPrunedMass: " << tree_->GetBranchStatus("fatjetAK8CHSCorrectedPrunedMass") << " : "<< bj->corrprunedMass->size()<<endl;
#endif
Expand Down Expand Up @@ -265,6 +267,18 @@ void LoadNero::FillFatJets(){
j->softdropMass = bj -> softdropMass -> at(iJet);
j->CorrectedPrunedMass = bj -> corrprunedMass -> at(iJet);

int first = bj -> firstSubjet -> at(iJet);
int Nsub = bj -> nSubjets -> at(iJet);

j->hasSubJetBTag = false;

for (int iSubJet=first+0; iSubJet<first+(Nsub-1) ; ++iSubJet) {

if( bj->subjet_btag->at(iSubJet) > 0.8484) j->hasSubJetBTag = true;

}


// add it
event_ -> fat_ . push_back(j);

Expand Down

0 comments on commit c4ef279

Please sign in to comment.