Skip to content

Commit

Permalink
Update current code for post ICHEP tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenbin Wu committed Jul 8, 2016
1 parent eb9f1ad commit 391987f
Show file tree
Hide file tree
Showing 36 changed files with 5,511 additions and 33 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ Allowed options:
* `--nBunches float`: Positive number will be treated as number of colliding bunches for pre-deadtime rate estimation;
negative number will be treated as L1 and HLT ZB prescales for post-deadtime rate estimation.
* `--SelectLS string`: SelectLS allows JSON-like format, like "[1, 30], [34, 40]"



### Tuning for Post-ICHEP
Use plot/PUDep.py for PU scaling

```
./testMenu2016 -d NewLumi --UseUnpackTree --nBunches 4143.995262 --SelectLS '[1, 96]' -m menu/Lumi1p5E34.txt -l ntuple/r275066_parkV62.list -o r275066_1p5E34_0 >&! r275066_1p5E34_0.log &
```
20 changes: 7 additions & 13 deletions macros/L1AlgoFactory.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@ Bool_t L1AlgoFactory::DoubleMu_ETM(Float_t mu1pt, Float_t mu2pt, Float_t ETMcut,
return false;
}

Bool_t L1AlgoFactory::Onia2015(Float_t mu1pt, Float_t mu2pt, Bool_t isER, Bool_t isOS, Int_t delta) {
Bool_t L1AlgoFactory::Onia2015(Float_t mu1pt, Float_t mu2pt, Bool_t isER, Bool_t isOS, Int_t delta, Float_t MuEta) {
Float_t tmp_cut1 = -10.;
Float_t tmp_cut2 = -10.;
Onia2015Pt(tmp_cut1,tmp_cut2,isER,isOS,delta);
if(tmp_cut1 >= mu1pt && tmp_cut2 >= mu2pt) return true;
return false;
}

Bool_t L1AlgoFactory::Onia2016(Float_t mu1pt, Float_t mu2pt, Bool_t isER, Bool_t isOS, Int_t delta) {
Float_t tmp_cut1 = -10.;
Float_t tmp_cut2 = -10.;
Onia2015Pt(tmp_cut1,tmp_cut2,isER,isOS,delta, 1.25);
Onia2015Pt(tmp_cut1,tmp_cut2,isER,isOS,delta, MuEta);
if(tmp_cut1 >= mu1pt && tmp_cut2 >= mu2pt) return true;
return false;
}
Expand Down Expand Up @@ -221,10 +213,10 @@ Bool_t L1AlgoFactory::EGer_TripleJetCentral(Float_t egcut, Float_t jetcut) {
return false;
}

Bool_t L1AlgoFactory::IsoEGer_TauJetEta2p17(Float_t egcut, Float_t taucut){
Bool_t L1AlgoFactory::IsoEGer_TauJetEta2p17(Float_t egcut, Float_t taucut, bool IsIsoTau){
Float_t tmp_egcut = -10.;
Float_t tmp_taucut = -10.;
IsoEGer_TauJetEta2p17Pt(tmp_egcut, tmp_taucut);
IsoEGer_TauJetEta2p17Pt(tmp_egcut, tmp_taucut, IsIsoTau);
if(tmp_egcut >= egcut && tmp_taucut >= taucut) return true;
return false;
}
Expand Down Expand Up @@ -1319,7 +1311,7 @@ void L1AlgoFactory::EGer_TripleJetCentralPt(Float_t& EGcut, Float_t& jetcut) {
return;
}

void L1AlgoFactory::IsoEGer_TauJetEta2p17Pt(Float_t& egcut, Float_t& taucut) {
void L1AlgoFactory::IsoEGer_TauJetEta2p17Pt(Float_t& egcut, Float_t& taucut, bool& IsIsoTau) {

Float_t eleptmax = -10.;
Float_t eleetamax = -999.;
Expand All @@ -1344,6 +1336,8 @@ void L1AlgoFactory::IsoEGer_TauJetEta2p17Pt(Float_t& egcut, Float_t& taucut) {
if(bx != 0) continue;
Float_t pt = upgrade_->tauEt.at(ue);
Float_t eta = upgrade_->tauEta.at(ue);
if(IsIsoTau && !upgrade_->tauIso.at(ue)) continue;

if(fabs(eta) > tauER) continue; // eta = 5 - 16

if(fabs(eta-eleetamax) < 0.2) continue;
Expand Down
7 changes: 3 additions & 4 deletions macros/L1AlgoFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class L1AlgoFactory: public L1Ntuple{
void EG_FwdJetPt(Float_t& EGcut, Float_t& FWcut);
void EG_DoubleJetCentralPt(Float_t& EGcut, Float_t& jetcut);
void EGer_TripleJetCentralPt(Float_t& EGcut, Float_t& jetcut);
void IsoEGer_TauJetEta2p17Pt(Float_t& egcut, Float_t& taucut);
void IsoEGer_TauJetEta2p17Pt(Float_t& egcut, Float_t& taucut, bool& IsIsoTau);

void QuadJetCentral_TauJetPt(Float_t& jetcut, Float_t& taucut);

Expand Down Expand Up @@ -99,7 +99,7 @@ class L1AlgoFactory: public L1Ntuple{
Bool_t EG_FwdJet(Float_t EGcut, Float_t FWcut);
Bool_t EG_DoubleJetCentral(Float_t EGcut, Float_t jetcut);
Bool_t EGer_TripleJetCentral(Float_t EGcut, Float_t jetcut);
Bool_t IsoEGer_TauJetEta2p17(Float_t egcut, Float_t taucut);
Bool_t IsoEGer_TauJetEta2p17(Float_t egcut, Float_t taucut, bool IsIsoTau=false);

Bool_t QuadJetCentral_TauJet(Float_t jetcut, Float_t taucut);

Expand All @@ -121,8 +121,7 @@ class L1AlgoFactory: public L1Ntuple{
void DoubleMuXOpenPt(Float_t& cut);
Bool_t DoubleMuOpen(Float_t mu1pt);
void DoubleMuOpenPt(Float_t& cut);
Bool_t Onia2015(Float_t mu1pt, Float_t mu2pt, Bool_t isER, Bool_t isOS, Int_t delta);
Bool_t Onia2016(Float_t mu1pt, Float_t mu2pt, Bool_t isER, Bool_t isOS, Int_t delta);
Bool_t Onia2015(Float_t mu1pt, Float_t mu2pt, Bool_t isER, Bool_t isOS, Int_t delta, Float_t MuEta=1.6);
void Onia2015Pt(Float_t& ptcut1, Float_t& ptcut2, Bool_t isER, Bool_t isOS, Int_t delta, float Onia2015Pt_= -1);

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cross ~~~~~
Expand Down
34 changes: 19 additions & 15 deletions macros/L1Menu2016.C
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ bool L1Menu2016::InitConfig()
L1SeedFun["L1_QuadJetC36_Tau52"] = std::bind(&L1AlgoFactory::QuadJetCentral_TauJet, this, 36.,52.);

// MultiMuon
L1SeedFun["L1_DoubleMu0er1p6_dEta_Max1p8_OS"] = std::bind(&L1AlgoFactory::Onia2015, this, 0.,0.,true,true,18);
L1SeedFun["L1_DoubleMu0er1p6_dEta_Max1p8"] = std::bind(&L1AlgoFactory::Onia2015, this, 0.,0.,true,false,18);
L1SeedFun["L1_DoubleMu0er1p25_dEta_Max1p8_OS"] = std::bind(&L1AlgoFactory::Onia2016, this, 0.,0.,true,true,18);
L1SeedFun["L1_DoubleMu_10_0_dEta_Max1p8"] = std::bind(&L1AlgoFactory::Onia2015, this, 10.,0.,false,false,18);
L1SeedFun["L1_DoubleMu0er1p6_dEta_Max1p8_OS"] = std::bind(&L1AlgoFactory::Onia2015, this, 0.,0.,true,true,18, 1.6);
L1SeedFun["L1_DoubleMu0er1p6_dEta_Max1p8"] = std::bind(&L1AlgoFactory::Onia2015, this, 0.,0.,true,false,18, 1.6);
L1SeedFun["L1_DoubleMu0er1p25_dEta_Max1p8_OS"] = std::bind(&L1AlgoFactory::Onia2015, this, 0.,0.,true,true,18, 1.25);
L1SeedFun["L1_DoubleMu0er1p4_dEta_Max1p8_OS"] = std::bind(&L1AlgoFactory::Onia2015, this, 0.,0.,true,true,18, 1.4);
L1SeedFun["L1_DoubleMu_10_0_dEta_Max1p8"] = std::bind(&L1AlgoFactory::Onia2015, this, 10.,0.,false,false,18, 1.6);
L1SeedFun["L1_DoubleMu0"] = std::bind(&L1AlgoFactory::DoubleMu, this, 0.,0.,true, false);
L1SeedFun["L1_DoubleMuOpen"] = std::bind(&L1AlgoFactory::DoubleMuOpen, this, 0.);
L1SeedFun["L1_DoubleMu_10_Open"] = std::bind(&L1AlgoFactory::DoubleMuXOpen, this, 10.);
Expand All @@ -169,18 +170,19 @@ bool L1Menu2016::InitConfig()
L1SeedFun["L1_TripleMu0"] = std::bind(&L1AlgoFactory::TripleMu, this, 0.,0.,0.,1);
L1SeedFun["L1_TripleMuOpen"] = std::bind(&L1AlgoFactory::TripleMu, this, 0.,0.,0.,0);
L1SeedFun["L1_TripleMu_5_5_3"] = std::bind(&L1AlgoFactory::TripleMu, this, 5.,5.,3.,1);
L1SeedFun["L1_TripleMu_5_0_0"] = std::bind(&L1AlgoFactory::TripleMu, this, 5.,0.,0.,1);
L1SeedFun["L1_TripleMu_3_0_0"] = std::bind(&L1AlgoFactory::TripleMu, this, 3.,0.,0.,1);
L1SeedFun["L1_QuadMu0"] = std::bind(&L1AlgoFactory::QuadMu, this, 0.,0.,0.,0.,1);

//Cross
L1SeedFun["L1_IsoEG20er_Tau20er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,20.);
L1SeedFun["L1_IsoEG22er_Tau20er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 22.,20.);
L1SeedFun["L1_IsoEG20er_Tau24er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,24.);
L1SeedFun["L1_IsoEG23er_TauJet20er_NotWdEta0"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 23.,20.); // l1t-tsg-v3: L1_IsoEG20er_TauJet20er_NotWdEta0
L1SeedFun["L1_IsoEG22er_TauJet20er_NotWdEta0"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 22.,20.); // l1t-tsg-v3: L1_IsoEG20er_TauJet20er_NotWdEta0
L1SeedFun["L1_IsoEG20er_Tau20er_NotWdEta0"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,20.);
L1SeedFun["L1_IsoEG22er_Tau20er_NotWdEta0"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 22.,20.);
L1SeedFun["L1_IsoEG20er_Tau24er_NotWdEta0"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,24.);
L1SeedFun["L1_IsoEG23er_Tau20er_NotWdEta0"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 23.,20.); // l1t-tsg-v3: L1_IsoEG20er_TauJet20er_NotWdEta0
L1SeedFun["L1_IsoEG20er_Tau20er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,20.,false);
L1SeedFun["L1_IsoEG22er_Tau20er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 22.,20.,false);
L1SeedFun["L1_IsoEG20er_Tau24er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,24.,false);
L1SeedFun["L1_IsoEG22er_IsoTau26er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 22.,26.,true);
L1SeedFun["L1_IsoEG20er_IsoTau25er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 20.,25.,true);
L1SeedFun["L1_IsoEG18er_IsoTau23er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 18.,23.,true);
L1SeedFun["L1_IsoEG18er_IsoTau25er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 18.,25.,true);
L1SeedFun["L1_IsoEG18er_IsoTau24er_dEta_Min0p2"] = std::bind(&L1AlgoFactory::IsoEGer_TauJetEta2p17, this, 18.,24.,true);
L1SeedFun["L1_DoubleMu6_EG6"] = std::bind(&L1AlgoFactory::DoubleMu_EG, this, 6.,6.,true);
L1SeedFun["L1_DoubleMu6_EG16"] = std::bind(&L1AlgoFactory::DoubleMu_EG, this, 6.,16.,true); // l1t-tsg-v3: L1_DoubleMu6_EG6
L1SeedFun["L1_DoubleMu7_EG7"] = std::bind(&L1AlgoFactory::DoubleMu_EG, this, 7,7.,true);
Expand Down Expand Up @@ -212,6 +214,8 @@ bool L1Menu2016::InitConfig()
L1SeedFun["L1_DoubleJet12_ForwardBackward"] = std::bind(&L1AlgoFactory::DoubleJet_ForwardBackward, this, 12., 12.);
L1SeedFun["L1_DoubleJet16_ForwardBackward"] = std::bind(&L1AlgoFactory::DoubleJet_ForwardBackward, this, 16., 16.);
L1SeedFun["L1_ETM60_Jet60_dPhi_Min0p4"] = std::bind(&L1AlgoFactory::ETM_Jet, this, 60., 60., false);
L1SeedFun["L1_ETM70_Jet60_dPhi_Min0p4"] = std::bind(&L1AlgoFactory::ETM_Jet, this, 70., 60., false);
L1SeedFun["L1_ETM75_Jet60_dPhi_Min0p4"] = std::bind(&L1AlgoFactory::ETM_Jet, this, 75., 60., false);
L1SeedFun["L1_HTM60_HTT260"] = std::bind(&L1AlgoFactory::HTM_HTT, this, 60., 260.);
L1SeedFun["L1_HTM80_HTT220"] = std::bind(&L1AlgoFactory::HTM_HTT, this, 80., 220.);
L1SeedFun["L1_Mu3_JetC35"] = std::bind(&L1AlgoFactory::Mu_Jet, this, 3., 35., false, true);
Expand Down Expand Up @@ -708,7 +712,8 @@ bool L1Menu2016::Loop()
if (i % 200000 == 0)
std::cout << "Processed " << i << " events." << std::endl;

if (l1unpackuGT != NULL && !l1unpackuGT->GetuGTDecision("L1_ZeroBias", false)) //Use Final decision
//Use Final decision by default, unless for PlotLS
if (l1unpackuGT != NULL && !l1unpackuGT->GetuGTDecision("L1_ZeroBias", L1Config["doPlotLS"]))
continue;

nZeroBiasevents++;
Expand Down Expand Up @@ -876,7 +881,6 @@ bool L1Menu2016::PrintRates(std::ostream &out)
<<" +/- " << sqrt(nFireevents) * scale / 1000 << " (kHz)" << std::endl;
out << std::endl << "Total rate (with overlaps) = " << totalrate / 1000 << " (kHz)" << std::endl;
out << std::endl << "Total pure rate = " << totalpurerate / 1000 <<" (kHz)" << std::endl;

return true;
} // ----- end of function L1Menu2016::PrintRates -----

Expand Down
2 changes: 1 addition & 1 deletion macros/L1Plot.C
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ bool L1Plot::BookLSHistogram( const std::map<std::string, std::map<int, int> > &
ss.str("");
ss << l1seed.first <<"_LS";
std::string histname = ss.str();
ss <<";"<<"Lumi Section;"<<"Rate (nb = " << nBunches <<") Hz";
ss <<";"<<"Lumi Section;"<<"Counts";
hRate1F[histname] = new TH1F(histname.c_str(),ss.str().c_str(),lastLS-firstLS+1, firstLS, lastLS);
}

Expand Down
Loading

0 comments on commit 391987f

Please sign in to comment.