Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion macros/L1AlgoFactory.C
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void L1AlgoFactory::ComplexSingleMuPt(Float_t& ptcut, Bool_t isER, Int_t qualmin
continue;
if (muonType == 2 && ! ( ( TfIdx >= 18 && TfIdx <= 35) || (TfIdx>= 72 && TfIdx <= 89)))
continue;
if (muonType == 3 && ! (TfIdx< 18 || TfIdx < 89))
if (muonType == 3 && ! (TfIdx< 18 || TfIdx > 89))
continue;
#endif // ----- not L1T_POST_TSGV3 -----

Expand Down
23 changes: 14 additions & 9 deletions macros/L1Menu2016.C
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ bool L1Menu2016::InitConfig()
L1Config["UseuGTDecision"] = 0;
L1Config["UseUnpackTree"] = 0;
L1Config["doScanLS"] = 0;
L1Config["SetL1AcceptPS"] = 0;

L1ConfigStr["SelectLS"] = "";
L1ConfigStr["SelectBX"] = "";
Expand Down Expand Up @@ -718,7 +719,7 @@ bool L1Menu2016::ReadMenuCSV(std::ifstream &menufile)
{
tokenizer::iterator t = tokens.begin();
std::advance(t, k.first);
std::string it = std::regex_replace(*t, std::regex("^ +|\t+$| +$|( ) +"), "$1");
std::string it = std::regex_replace(*t, std::regex("^ +|\t+| +|( ) +"), "$1");

if (k.second == "n")
{
Expand Down Expand Up @@ -1141,7 +1142,8 @@ bool L1Menu2016::Loop()

if(event_ -> lumi != currentLumi){
currentLumi = event_ -> lumi;
skipLS = CheckLS(currentLumi);
if (L1ConfigStr["SelectLS"] != "" || L1Config["doScanLS"])
skipLS = CheckLS(currentLumi);
if (!skipLS)
nLumi.insert(currentLumi);
}
Expand All @@ -1162,7 +1164,8 @@ bool L1Menu2016::Loop()
}

//Use Final decision by default, unless for PlotLS
if (l1unpackuGT != NULL && !l1unpackuGT->GetuGTDecision("L1_ZeroBias", L1Config["doPlotLS"]))
//In case using L1Accept, don't count the Zerobias Event
if (L1Config["SetL1AcceptPS"] ==0 && l1unpackuGT != NULL && !l1unpackuGT->GetuGTDecision("L1_ZeroBias", L1Config["doPlotLS"]))
continue;

nZeroBiasevents++;
Expand Down Expand Up @@ -1337,12 +1340,14 @@ bool L1Menu2016::L1SeedFunc()
if(ParseL1Seed(L1Seed.first))
continue;

#ifdef UTM_MENULIB
if (L1SeedFun_temp.find(L1Seed.first) != L1SeedFun_temp.end())
{
//std::cout << "Add from Menulib " << L1Seed.first << std::endl;
L1SeedFun[L1Seed.first] = L1SeedFun_temp[L1Seed.first];
continue;
}
#endif

std::cout << "No function call for " << L1Seed.first <<"; setting to no fire"<< std::endl;
}
Expand Down Expand Up @@ -1413,9 +1418,9 @@ double L1Menu2016::CalScale(int nEvents_, int nBunches_, bool print)

if (L1Config["nBunches"] < 0)
{
scale = (-1.*L1Config["nBunches"])/(nLumi.size()*23.31);
scale = (-1.*L1Config["nBunches"] * L1Config["SetL1AcceptPS"])/(nLumi.size()*23.31);
if (print)
std::cout << "Scale by " << "("<< -1. * L1Config["nBunches"] <<")/(nLumi*23.31) with nLumi = " << nLumi.size() << std::endl;
std::cout << "Scale by " << "("<< -1. * L1Config["nBunches"] <<"* L1AcceptPS )/(nLumi*23.31) with L1AcceptPS = "<< L1Config["SetL1AcceptPS"] <<" nLumi = " << nLumi.size() << std::endl;
} else {
scale = 11246.; // ZB per bunch in Hz
//scale /= nZeroBiasevents*1000.; // in kHz
Expand Down Expand Up @@ -1979,7 +1984,7 @@ bool L1Menu2016::ParseComplexSingleMu(const std::string& SeedName)
return false;

std::smatch base_match;
std::regex integer("L1_Single(Mu)([0-9]+)([^0-9_]*)(_(EMTF|OMTF|BMTF))*(_Bx([-+0-9]+))*(_(Open|LowQ|HighQ))*");
std::regex integer("L1_Single(Mu)([0-9]+)([^0-9_]*)(_(Open|LowQ|HighQ))*(_(EMTF|OMTF|BMTF))*(_Bx([-+0-9]+))*");
std::string L1object ="";
std::string postfix = "";
std::string muonType = "";
Expand All @@ -1996,15 +2001,15 @@ bool L1Menu2016::ParseComplexSingleMu(const std::string& SeedName)
postfix = base_match[3];
if (base_match[4] != "")
{
muonType = base_match[5];
muonQual = base_match[5];
}
if (base_match[6]!="")
{
muonBx = std::stoi(base_match[7], nullptr);
muonType = base_match[7];
}
if (base_match[8] != "")
{
muonQual = base_match[9];
muonBx = std::stoi(base_match[9], nullptr);
}
} else return false;

Expand Down
10 changes: 8 additions & 2 deletions macros/batch/RunExe.csh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/csh -v

set SCRAM = DELSCR
set CMSSW = DELDIR
set EXE = DELEXE
set OUTPUT = OUTDIR
Expand All @@ -8,8 +9,13 @@ set OUTPUT = OUTDIR
#----------------------------- Setup the env ----------------------------#
#============================================================================#
echo "============ Running on" $HOST " ============"
cd ${CMSSW}/src
eval `scramv1 runtime -csh`
cd ${_CONDOR_SCRATCH_DIR}
source /cvmfs/cms.cern.ch/cmsset_default.csh
setenv SCRAM_ARCH ${SCRAM}
eval `scramv1 project CMSSW ${CMSSW}`
cd ${CMSSW}
eval `scramv1 runtime -csh` # cmsenv is an alias not on the workers
echo "CMSSW: "$CMSSW_BASE
cd ${_CONDOR_SCRATCH_DIR}

#============================================================================#
Expand Down
9 changes: 4 additions & 5 deletions macros/batch/SubmitLPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
splitline = 50
DelExe = 'testMenu2016'
OutDir = '/store/user/benwu/L1MenuStage2/Menu2017'
Analysis = 'v6PUS_v36'
Analysis = 'v6PUS_v37'
MenuFile = [
"menu/L1Menu_2017.csv"
]
Expand Down Expand Up @@ -71,8 +71,8 @@ def CondorSub(Analysis, Menu, Ntuple, Option, cnt):
RunHTFile = tempdir + "/" + "RunExe.csh"
with open(RunHTFile, "wt") as outfile:
for line in open("%s/RunExe.csh" % os.path.dirname(os.path.realpath(__file__)), "r"):
#line = line.replace("DELDIR", os.environ['PWD'])
line = line.replace("DELDIR", os.environ['CMSSW_BASE'])
line = line.replace("DELSCR", os.environ['SCRAM_ARCH'])
line = line.replace("DELDIR", os.environ['CMSSW_VERSION'])
line = line.replace("DELEXE", DelExe.split('/')[-1])
line = line.replace("OUTDIR", OutDir)
outfile.write(line)
Expand All @@ -99,7 +99,6 @@ def CondorSub(Analysis, Menu, Ntuple, Option, cnt):
with open(condorfile, "wt") as outfile:
for line in open("%s/condor_template" % os.path.dirname(os.path.realpath(__file__)), "r"):
line = line.replace("EXECUTABLE", os.path.abspath(RunHTFile))
#line = line.replace("DELDIR", os.environ['CMSSW_BASE'])
line = line.replace("TARFILES", tranferfiles)
line = line.replace("TEMPDIR", tempdir)
line = line.replace("PROJECTNAME", ProjectName)
Expand Down Expand Up @@ -131,7 +130,7 @@ def my_process():
## Create the output directory
OutDir = OutDir + "/" + ProjectName + "/"
try:
os.makedirs(OutDir)
subprocess.call("eos root://cmseos.fnal.gov mkdir -p %s" % OutDir, shell=True)
except OSError:
pass

Expand Down
Loading