Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Puppiproducer to include fillDescriptions #28016

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d39f1c8
first commit for TAU miniaod validation/dqm
aspiezia Aug 21, 2019
342bbb2
second commit for TAU miniaod validation/dqm
aspiezia Aug 22, 2019
65902ee
Disabled PCA inputs for deepTau v2.
mbluj Aug 27, 2019
62a24bd
third commit for TAU miniaod validation/dqm
aspiezia Aug 28, 2019
6b6cf55
Control disabling dxy_PCA by a parameter
mbluj Aug 28, 2019
cef43ef
Add deepTau2017v2p1, i.e. v2 with disabled dxyPCA, to tauID tool
mbluj Aug 29, 2019
f3fdf98
Run deepTau2017v2p1, i.e. v2 with disabled dxy_PCA, with new era run2…
mbluj Aug 29, 2019
c1fb08a
Update example configuration
mbluj Aug 30, 2019
279954b
fix simulation of the pixel bad components on the FED channel basis f…
mmusich Aug 29, 2019
5516834
Monitor deepTau2017 v2p1 instead of deprecated v2
mbluj Sep 2, 2019
3e876d3
Updates to beamspot, tracker alignment, muon alignment, ECAL calibrat…
christopheralanwest Sep 5, 2019
765cad3
Updated PPS conditions for consistency with 2018 UL
christopheralanwest Sep 5, 2019
3d205fe
Updated 2018 MC tracker alignment scenario and APEs
christopheralanwest Sep 5, 2019
9688294
Backport of trend plotting tool
mteroerd Sep 5, 2019
ca7c5c8
fixing returned value for heep trk isol
Sam-Harper Sep 6, 2019
dc037f1
New era modifiers for tauID Run2 UL processing
mbluj Sep 10, 2019
dbf0143
New era modifiers for tauID Run2 UL processing in master cff
mbluj Sep 10, 2019
6081ba3
New era modifiers for tauID Run2 UL processing chained for 2016 and 2…
mbluj Sep 11, 2019
aad2192
Merge remote-tracking branch 'official-cmssw/CMSSW_10_6_X' into CMSSW…
mbluj Sep 11, 2019
633dfb4
New era modifiers for tauID Run2 UL processing unchained from Run3 an…
mbluj Sep 12, 2019
08f1fea
backport of tau validation
aspiezia Sep 13, 2019
34863e8
updating Puppiproducer
Sep 17, 2019
c08d7bd
bringing back headers
Sep 18, 2019
3a784d9
bringing back headers
Sep 18, 2019
97345b7
Merge pull request #27934 from christopheralanwest/alca-final-2018-gt…
cmsbuild Sep 19, 2019
3e9ea98
Merge pull request #27916 from mmusich/fixPremixingForStuckTBM_106X
cmsbuild Sep 19, 2019
ca3c6e4
Merge pull request #27936 from mteroerd/ape_trend_backport
cmsbuild Sep 19, 2019
3353beb
Merge pull request #27882 from cms-tau-pog/CMSSW_10_6_X_tau-pog_deepT…
cmsbuild Sep 19, 2019
400dfeb
Revert "Disabled PCA inputs for deepTau v2 (10_6_X)"
fabiocos Sep 20, 2019
3887146
Merge pull request #28032 from cms-sw/revert-27882-CMSSW_10_6_X_tau-p…
cmsbuild Sep 20, 2019
33bf3a3
Update PackedCandidate.cc
rappoccio Sep 20, 2019
86c60e2
Merge pull request #27945 from Sam-Harper/HEEPVIDTrkIsoValueFix_1061
cmsbuild Sep 21, 2019
8904eea
Revert "Revert "Disabled PCA inputs for deepTau v2 (10_6_X)""
fabiocos Sep 21, 2019
7dcc316
Fix order of era modifiers
mbluj Sep 20, 2019
7ed7826
Merge pull request #28046 from fabiocos/fix27882
cmsbuild Sep 23, 2019
5f41720
Merge pull request #27985 from aspiezia/DQMTauMiniaodValidation_CMSSW…
cmsbuild Sep 25, 2019
2574ac3
Merge pull request #28043 from rappoccio/patch-4
cmsbuild Sep 25, 2019
70e58fd
Merged updatePuppiproducer from repository alefisico with cms-merge-t…
Oct 3, 2019
e2d3bbd
adding fillDescription
Oct 3, 2019
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
963 changes: 963 additions & 0 deletions Alignment/APEEstimation/data/lumiperrun2017.txt

Large diffs are not rendered by default.

551 changes: 551 additions & 0 deletions Alignment/APEEstimation/data/lumiperrun2018.txt

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions Alignment/APEEstimation/plugins/ApeEstimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h"
#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h"
#include "DataFormats/GeometryVector/interface/LocalPoint.h"
#include "DataFormats/GeometryCommonDetAlgo/interface/LocalError.h"
#include "DataFormats/GeometrySurface/interface/LocalError.h"
#include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementPoint.h"
#include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementError.h"
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
Expand Down Expand Up @@ -108,7 +108,6 @@
//ADDED BY LOIC QUERTENMONT
#include "FWCore/Framework/interface/DependentRecordImplementation.h"
#include "CalibTracker/Records/interface/SiStripDependentRecords.h"
#include "CalibTracker/SiStripESProducers/plugins/real/SiStripLorentzAngleDepESProducer.h"
/////////
#include "DataFormats/GeometryVector/interface/LocalVector.h"
#include "DataFormats/GeometrySurface/interface/Bounds.h"
Expand Down
339 changes: 155 additions & 184 deletions Alignment/APEEstimation/test/autoSubmitter/autoSubmitter.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

eval `scramv1 runtime -csh`

source /afs/cern.ch/cms/caf/setup.csh
#~ source /afs/cern.ch/cms/caf/setup.csh
cd $curDir

xrdcp {inputFile} reco.root
Expand All @@ -25,11 +25,27 @@
request_memory = 2000M
request_disk = 400M
batch_name = {jobName}
+JobFlavour = "longlunch"
+JobFlavour = "workday"
Queue Arguments from (
{arguments})
"""

# Use this one only if connected to lxplus-t0.cern.ch
#~ condorSubTemplate="""
#~ Executable = {jobFile}
#~ Universe = vanilla
#~ Output = {outputFile}
#~ Error = {errorFile}
#~ Log = {logFile}
#~ request_memory = 2000M
#~ request_disk = 400M
#~ batch_name = {jobName}
#~ +JobFlavour = "workday"
#~ +AccountingGroup = "group_u_CMS.CAF.ALCA"
#~ Queue Arguments from (
#~ {arguments})
#~ """

condorArgumentTemplate="""{fileNumber} {inputFile}
"""

Expand Down
8 changes: 7 additions & 1 deletion Alignment/APEEstimation/test/autoSubmitter/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ isMC=False
# in apeEstimation_cfg.py. If it is not defined or None, it will not overwrite
# anything defined in apeEstimation_cfg.py
globalTag=None
# name as defined in apeEstimation_cfg.py
# name as defined in apeEstimation_cfg.py, optional if alignment is loaded by condition
alignmentName=alignmentObjectName
# name of baseline folder. Only used if isDesign is False, elsewise the
# name of the APE measurement is used, Design by default
Expand All @@ -26,6 +26,10 @@ isDesign=False
# it will override the one defined by alignmentName
condition TrackerAlignmentRcd=sqlite_file:/afs/asdf.db Alignments
condition TrackerSurfaceDeformationRcd=sqlite_file:/afs/asdf.db Deformations
# another way to load these is:
condition Alignments+Deformations:sqlite_file:/afs/asdf.db
# in this case, the Rcd name has to be guessed by the autoSubmitter,
# so functionality is limited

# define measurements like this
[measurements]
Expand All @@ -50,6 +54,8 @@ exampleName: exampleDataset alignmentObject
wait label:exampleName
# load APE from these files (in labels ~ is replaced with whitespaces)
load label~with~empty~spaces:/path/to/allData_iterationApe.root
# optional attributes
load label~with~empty~spaces2:/path/to/allData_iterationApe.root color=ROOT.kRed+2 marker=0
# output path. If not defined, store in hists/Name
outPath=/asdf/
# title to the plot, optional
Expand Down
135 changes: 135 additions & 0 deletions Alignment/APEEstimation/test/autoSubmitter/helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
from __future__ import print_function
import re
import os
import errno
shortcuts = {}

# regex matching on key, replacement of groups on value
# implement any other shortcuts that you want to use
#sources
shortcuts["mp([0-9]*)"] = "sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/MP/MPproduction/mp{0}/jobData/jobm/alignments_MP.db"
shortcuts["mp([0-9]*)_jobm([0-9]*)"] = "sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/MP/MPproduction/mp{0}/jobData/jobm{1}/alignments_MP.db"
shortcuts["sm([0-9]*)_iter([0-9]*)"] = "sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN2/HipPy/alignments/sm{0}/alignments_iter{1}.db"
shortcuts["um([0-9]*)"] = "sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/MP/MPproduction/um{0}/jobData/jobm/um{0}.db"
shortcuts["um([0-9]*)_jobm([0-9]*)"] = "sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/MP/MPproduction/um{0}/jobData/jobm{1}/um{0}.db"
shortcuts["hp([0-9]*)_iter([0-9]*)"] = "sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN2/HipPy/alignments/hp{0}/alignments_iter{1}.db"
shortcuts["prod"] = "frontier://FrontierProd/CMS_CONDITIONS"

# Exact numbers don't really matter, but it is important that each one has a unique
# number, so that states are distinguishable
STATE_NONE = -1
STATE_ITERATION_START=0
STATE_BJOBS_WAITING=1
STATE_BJOBS_DONE=2
STATE_BJOBS_FAILED=12
STATE_MERGE_WAITING=3
STATE_MERGE_DONE=4
STATE_MERGE_FAILED=14
STATE_SUMMARY_WAITING=5
STATE_SUMMARY_DONE=6
STATE_SUMMARY_FAILED=16
STATE_LOCAL_WAITING=7
STATE_LOCAL_DONE=8
STATE_LOCAL_FAILED=18
STATE_FINISHED=9

status_map = {}
status_map[STATE_NONE] = "none"
status_map[STATE_ITERATION_START] = "starting iteration"
status_map[STATE_BJOBS_WAITING] = "waiting for jobs"
status_map[STATE_BJOBS_DONE] = "jobs finished"
status_map[STATE_BJOBS_FAILED] = "jobs failed"
status_map[STATE_MERGE_WAITING] = "waiting for merging"
status_map[STATE_MERGE_DONE] = "merging done"
status_map[STATE_MERGE_FAILED] = "merging failed"
status_map[STATE_SUMMARY_WAITING] = "waiting for APE determination"
status_map[STATE_SUMMARY_DONE] = "APE determination done"
status_map[STATE_SUMMARY_FAILED] = "APE determination failed"
status_map[STATE_LOCAL_WAITING] = "waiting for APE saving"
status_map[STATE_LOCAL_DONE] = "APE saving done"
status_map[STATE_LOCAL_FAILED] = "APE saving failed"
status_map[STATE_FINISHED] = "finished"

records = {}
records["Alignments"] = "TrackerAlignmentRcd"
records["TrackerAlignment"] = "TrackerAlignmentRcd"
records["Deformations"] = "TrackerSurfaceDeformationRcd"
records["TrackerSurfaceDeformations"] = "TrackerSurfaceDeformationRcd"
records["SiPixelTemplateDBObject"] = "SiPixelTemplateDBObjectRcd"
records["BeamSpotObjects"] = "BeamSpotObjectsRcd"


def ensurePathExists(path):
try:
os.makedirs(path)
except OSError as exception:
if exception.errno != errno.EEXIST:
raise


def replaceAllRanges(string):
if "[" in string and "]" in string:
strings = []
posS = string.find("[")
posE = string.find("]")
nums = string[posS+1:posE].split(",")
expression = string[posS:posE+1]

nums = string[string.find("[")+1:string.find("]")]
for interval in nums.split(","):
interval = interval.strip()
if "-" in interval:
lowNum = int(interval.split("-")[0])
upNum = int(interval.split("-")[1])
for i in range(lowNum, upNum+1):
newstring = string[0:posS]+str(i)+string[posE+1:]
newstring = replaceAllRanges(newstring)
strings += newstring
else:
newstring = string[0:posS]+interval+string[posE+1:]
newstring = replaceAllRanges(newstring)
strings += newstring
return strings
else:
return [string,]


def replaceShortcuts(toScan):
global shortcuts
for key, value in shortcuts.items():
match = re.search(key, toScan)
if match and match.group(0) == toScan:
return value.format(*match.groups())
# no match
return toScan

def loadConditions(dictionary):
hasAlignmentCondition = False
conditions = []
for key, value in dictionary.items():
if key.startswith("condition"):
if len(value.split(" ")) > 1: # structure is "condition rcd:source tag"
record = key.split(" ")[1]
connect, tag = value.split(" ")
if record == "TrackerAlignmentRcd":
hasAlignmentCondition = True
conditions.append({"record":record, "connect":replaceShortcuts(connect), "tag":tag})
else:
# structure is "condition tag:source", so we have to guess rcd from the tag. might also be "condition tag1+tag2+...+tagN:source"
global records
connect = value.strip()
tags = key.split(" ")[1]
for tag in tags.split("+"):
foundTag = False
for possibleTag, possibleRcd in records.items():
if tag.startswith(possibleTag):
conditions.append({"record":possibleRcd, "connect":replaceShortcuts(connect), "tag":tag})
if possibleRcd == "TrackerAlignmentRcd":
hasAlignmentCondition = True
foundTag = True
break
if not foundTag:
print("Did not find a record corresponding to {} tag".format(tag))
exit()

return conditions, hasAlignmentCondition
4 changes: 3 additions & 1 deletion Alignment/APEEstimation/test/batch/startSkim.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def main(argv):
help="Name of sample as defined in skimProducer_cfg.py. Multiple inputs possible")
parser.add_argument("-c", "--consecutive", action="store_true", dest="consecutive", default=False,
help="Do consecutive instead of parallel skims")
parser.add_argument("-n", "--ncores", action="store", dest="ncores", default=-1, type="int",
parser.add_argument("-n", "--ncores", action="store", dest="ncores", default=-1, type=int,
help="Set maximum number of parallel skims to run")

args = parser.parse_args()
Expand All @@ -145,6 +145,8 @@ def main(argv):
doSkim(sample)
else:
try:
# In a later PR, this should be migrated to condor to avoid
# overloading lxplus and transfer load to lxbatch
pool = mp.Pool(args.ncores)
pool.map_async(doSkim, args.samples)
pool.close()
Expand Down
89 changes: 6 additions & 83 deletions Alignment/APEEstimation/test/cfgTemplate/apeEstimator_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,93 +169,16 @@
if options.alignRcd=='fromConditions':
pass # Alignment is read from the conditions file in this case
elif options.alignRcd=='design':
CondDBAlignment = CondDB.clone(connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'))
process.myTrackerAlignment = cms.ESSource("PoolDBESSource",
CondDBAlignment,
timetype = cms.string("runnumber"),
toGet = cms.VPSet(
cms.PSet(
record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('TrackerAlignment_Upgrade2017_design_v3')
)
)
)
process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","myTrackerAlignment")


elif options.alignRcd == 'misalTest':
CondDBAlignment = CondDB.clone(connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'))
process.myTrackerAlignment = cms.ESSource("PoolDBESSource",
CondDBAlignment,
timetype = cms.string("runnumber"),
toGet = cms.VPSet(
cms.PSet(
record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('TrackerAlignment_Phase1Realignment_CRUZET_2M'),
)
)
)
process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","myTrackerAlignment")

elif options.alignRcd == 'mp2705':
CondDBAlignment = CondDB.clone(connect = cms.string('sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/MP/MPproduction/mp2705/jobData/jobm/alignments_MP.db'))
process.myTrackerAlignment = cms.ESSource("PoolDBESSource",
CondDBAlignment,
timetype = cms.string("runnumber"),
toGet = cms.VPSet(
cms.PSet(
record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('Alignments'),
)
)
)
process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","myTrackerAlignment")

elif options.alignRcd == 'mp2853':
CondDBAlignment = CondDB.clone()
process.myTrackerAlignment = cms.ESSource("PoolDBESSource",
CondDBAlignment,
timetype = cms.string("runnumber"),
toGet = cms.VPSet(
cms.PSet(
connect = cms.string('sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN/MP/MPproduction/mp2853/jobData/jobm3/alignments_MP.db'),
record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('Alignments'),
),
#~ cms.PSet(
#~ connect=cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
#~ record=cms.string('SiPixelTemplateDBObjectRcd'),
#~ tag=cms.string('SiPixelTemplateDBObject_38T_TempForAlignmentReReco2018_v3'),
#~ )
)
)
process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","myTrackerAlignment")

elif options.alignRcd == 'hp1370':
CondDBAlignment = CondDB.clone(connect = cms.string('sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERALIGN2/HIP/xiaomeng/CMSSW_7_4_6_patch5/src/Alignment/HIPAlignmentAlgorithm/hp1370/alignments.db'))
process.myTrackerAlignment = cms.ESSource("PoolDBESSource",
CondDBAlignment,
timetype = cms.string("runnumber"),
toGet = cms.VPSet(
cms.PSet(
record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('Alignments'),
)
)
)
process.es_prefer_trackerAlignment = cms.ESPrefer("PoolDBESSource","myTrackerAlignment")



pass
elif options.alignRcd == 'globalTag':
pass
pass
elif options.alignRcd == 'useStartGlobalTagForAllConditions':
pass
pass
elif options.alignRcd == '':
pass
pass
else:
print('ERROR --- incorrect alignment: ', options.alignRcd)
exit(8888)
print('ERROR --- incorrect alignment: ', options.alignRcd)
exit(8888)

## APE
if options.iterNumber!=0:
Expand Down
8 changes: 4 additions & 4 deletions Alignment/APEEstimation/test/plottingTools/drawIterations.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Implementation to draw all iterations of an APE measurement
# to check convergence

from iterationsPlotter import *
from granularity import *
import os

try:
base = os.environ['CMSSW_BASE']+"/src/Alignment/APEEstimation"
except KeyError:
base = ""

plot = IterationsPlotter()
plot.setOutputPath(base+"/workingArea/")
plot.setInputFile(base+"/workingArea/iter14/allData_iterationApe.root")
plot.setTitle("")
plot.setOutputPath(base+"/hists/iterations/")
plot.setInputFile(base+"/src/Alignment/APEEstimation/hists/workingArea/iter14/allData_iterationApe.root")
plot.setTitle("Title")
plot.setGranularity(standardGranularity)
plot.draw()
15 changes: 6 additions & 9 deletions Alignment/APEEstimation/test/plottingTools/drawResults.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Implementation to draw all iterations of an APE measurement
# to check convergence

import ROOT
from resultPlotter import *
from systematics import *
from systematicErrors import *
from granularity import *

import os
try:
base = os.environ['CMSSW_BASE']+"/src/Alignment/APEEstimation"
except KeyError:
base = ""

plot = ResultPlotter()
plot.setOutputPath(base+"/workingArea/")
# internal name (used for example when adding systematic errors), path to file, label, color (optional)
plot.addInputFile("placeholder1", base+"/workingArea/iter14/allData_iterationApe.root", "measurement A")
plot.addInputFile("placeholder2", base+"/workingArea2/iter14/allData_iterationApe.root", "measurement B", ROOT.kRed)
plot.setTitle("")
plot.setOutputPath(base+"/hists/workingArea/")
# label(also used as name when adding systematic errors), inputFile, color (optional, automatic by default),
# marker (optional, 20 by default, 0 is line), hitNumbers (optional, file number of hits in each sector, allData.root)
plot.addInputFile("label", "base/hists/workingArea/iter14/allData_iterationApe.root", color = ROOT.kGray+2)
plot.setGranularity(standardGranularity)
plot.draw()
Loading