Skip to content

Commit 8662727

Browse files
Merge pull request #1 from michele-mormile/from-CMSSW_14_0_X_2023-11-30-2300
From cmssw 14 0 x 2023 11 30 2300
2 parents 821d9f0 + 3d15312 commit 8662727

File tree

2,000 files changed

+243973
-108848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,000 files changed

+243973
-108848
lines changed

Alignment/APEEstimation/test/plottingTools/granularity.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,12 @@ def __init__(self):
3535

3636
# this name is used by default by other plotting tools
3737
standardGranularity = phaseOneGranularity
38+
39+
# Granularity for Validation plots in ApeEstimator2 part of allData.root
40+
validationGranularity = Granularity()
41+
validationGranularity.sectors["X"].append( (1,8) ) # Only X is needed here, names are not required
42+
43+
# By default, these 8 sectors are included for the ValidationSectors granularity:
44+
# BpixLayer1Out, BpixLayer3In, FpixMinusLayer1, TibLayer1RphiOut, TibLayer4In, TobLayer1StereoOut, TobLayer5Out, TecPlusRing7
45+
# This can be changed in apeEstimator_cfg or in SectorBuilder_cff
46+
# For these sectors, additional hit validation plots are created

Alignment/APEEstimation/test/plottingTools/validationPlotter.py

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def __init__(self):
1515
self.markers = {}
1616
self.outPath = None
1717
self.granularity = standardGranularity
18+
self.validationGranularity = validationGranularity
19+
1820
self.order = []
1921

2022
def addInputFile(self, label, inFile, color=None, marker=20):
@@ -120,7 +122,7 @@ def plotHist(self, folder, name, title, hists, twoDimensional=False):
120122
if not twoDimensional:
121123
legend.Draw()
122124

123-
cmsText = ROOT.TLatex(0.16,0.96,title)
125+
cmsText = ROOT.TLatex(0.26,0.96,title)
124126
cmsText.SetTextFont(42)
125127
cmsText.SetNDC()
126128
cmsText.Draw("same")
@@ -194,14 +196,36 @@ def makeTrackPlot(self,histName, twoDimensional=False):
194196
if self.markers[label] == 0:
195197
hist.SetMarkerSize(0)
196198
hist.SetLineWidth(2)
197-
199+
fi.Close()
198200
if twoDimensional:
199201
self.plotHist("tracks", histName+"_"+label, label, [(hist, label),], twoDimensional=True)
200202
else:
201203
hists.append((hist, label))
202204
if len(hists) > 0:
203205
self.plotHist("tracks", histName, histName, hists, twoDimensional=twoDimensional)
204206

207+
def makeHitsPlot(self, sectorNumber, histName, twoDimensional=False):
208+
hists = []
209+
for label in self.order:
210+
fi = ROOT.TFile(self.inFiles[label], "READ")
211+
sectorName = fi.Get("ApeEstimator2/Sector_{sector}/z_name".format(sector=sectorNumber)).GetTitle()
212+
hist = fi.Get("ApeEstimator2/Sector_{sector}/{histName}".format(sector=sectorNumber,histName=histName))
213+
hist.SetLineColor(self.colors[label])
214+
hist.SetMarkerColor(self.colors[label])
215+
hist.SetMarkerStyle(self.markers[label])
216+
hist.SetDirectory(0)
217+
fi.Close()
218+
if self.markers[label] == 0:
219+
hist.SetMarkerSize(0)
220+
hist.SetLineWidth(2)
221+
222+
if twoDimensional:
223+
self.plotHist("hits"+"/{}".format(sectorName), histName+"_"+label, "{}: ".format(sectorName)+histName+" "+label, [(hist, label),], twoDimensional=True)
224+
else:
225+
hists.append((hist, label))
226+
if len(hists) > 0:
227+
self.plotHist("hits"+"/{}".format(sectorName), histName, "{}: ".format(sectorName)+histName, hists, twoDimensional=twoDimensional)
228+
205229

206230

207231
def draw(self):
@@ -245,7 +269,23 @@ def draw(self):
245269
self.makeTrackPlot("h2_hitsStripVsTheta", twoDimensional=True)
246270
self.makeTrackPlot("h2_ptVsTheta", twoDimensional=True)
247271

248-
272+
rangeList = self.validationGranularity.sectors["X"]
273+
for first, last in rangeList:
274+
for i in range(first, last+1):
275+
# Get list of plots per sector, as pixel sectors have different plots
276+
# We get the list from one of the result files, the rest should have the same structure
277+
directoryFile = ROOT.TFile(self.inFiles[self.order[0]], "READ")
278+
directory = directoryFile.GetDirectory("ApeEstimator2/Sector_{}".format(i))
279+
280+
for histObject in directory.GetListOfKeys():
281+
histName = histObject.GetName()
282+
if histName.startswith("h_"): # 1D hist
283+
self.makeHitsPlot(i, histName)
284+
elif histName.startswith("h2_"):
285+
self.makeHitsPlot(i, histName, twoDimensional=True)
286+
287+
directoryFile.Close()
288+
249289

250290
def main():
251291
pass

Alignment/CommonAlignmentProducer/python/ALCARECOTkAlMinBias_cff.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,24 @@
4949
## customizations for the pp_on_AA eras
5050
from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
5151
from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
52-
(pp_on_XeXe_2017 | pp_on_AA).toModify(ALCARECOTkAlMinBiasHLT,
53-
eventSetupPathsKey='TkAlMinBiasHI'
54-
)
55-
5652
(pp_on_XeXe_2017 | pp_on_AA).toModify(ALCARECOTkAlMinBias,
5753
trackQualities = cms.vstring("highPurity")
5854
)
5955

56+
pp_on_XeXe_2017.toModify(ALCARECOTkAlMinBiasHLT,
57+
eventSetupPathsKey='TkAlMinBiasHI')
58+
59+
import HLTrigger.HLTfilters.triggerResultsFilterFromDB_cfi
60+
ALCARECOTkAlMinBiasTriggerResultsHI = HLTrigger.HLTfilters.triggerResultsFilterFromDB_cfi.triggerResultsFilterFromDB.clone(
61+
eventSetupPathsKey = 'TkAlMinBiasHI',
62+
usePathStatus = False,
63+
hltResults = 'TriggerResults::HLT',
64+
l1tResults = '', # leaving empty (not interested in L1T results)
65+
throw = False # tolerate triggers stated above, but not available
66+
)
67+
68+
seqALCARECOTkAlMinBiasHI = cms.Sequence(ALCARECOTkAlMinBiasTriggerResultsHI*~ALCARECOTkAlMinBiasNOTHLT+ALCARECOTkAlMinBiasDCSFilter+ALCARECOTkAlMinBias)
69+
pp_on_AA.toReplaceWith(seqALCARECOTkAlMinBias,seqALCARECOTkAlMinBiasHI)
70+
6071
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
6172
phase2_tracker.toModify(ALCARECOTkAlMinBias, etaMin = -4, etaMax = 4)

Alignment/MuonAlignment/python/convertXMLtoSQLite_cfg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929

3030
process.MuonGeometryDBConverter = cms.EDAnalyzer("MuonGeometryDBConverter",
3131
input = cms.string("xml"),
32-
fileName = cms.string(str(sys.argv[2])),
32+
fileName = cms.string(str(sys.argv[1])),
3333
shiftErr = cms.double(1000.),
3434
angleErr = cms.double(6.28),
3535
output = cms.string("db"))
3636

3737
process.load("CondCore.DBCommon.CondDBSetup_cfi")
3838
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
3939
process.CondDBSetup,
40-
connect = cms.string("sqlite_file:"+str(sys.argv[2])[:-3]+"db"),
40+
connect = cms.string("sqlite_file:"+str(sys.argv[1])[:-3]+"db"),
4141
toPut = cms.VPSet(
4242
cms.PSet(record = cms.string("DTAlignmentRcd"), tag = cms.string("DTAlignmentRcd")),
4343
cms.PSet(record = cms.string("DTAlignmentErrorExtendedRcd"), tag = cms.string("DTAlignmentErrorExtendedRcd")),

Alignment/MuonAlignmentAlgorithms/src/DTMuonMillepede.cc

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "Alignment/MuonAlignmentAlgorithms/interface/DTMuonMillepede.h"
22

3+
#include <array>
34
#include <iostream>
45

56
DTMuonMillepede::DTMuonMillepede(std::string path,
@@ -567,34 +568,32 @@ TMatrixD DTMuonMillepede::getCqcMatrix(int wh, int st, int se) {
567568
}
568569
}
569570
}
570-
double **Eta = new double *[12];
571-
for (int counterLayer = 0; counterLayer < 12; counterLayer++) {
571+
572+
std::array<std::array<double, 12>, 12> Eta{};
573+
for (size_t counterLayer = 0; counterLayer < Eta.size(); counterLayer++) {
572574
if (counterLayer > 7 && st == 4)
573575
continue;
574-
Eta[counterLayer] = new double[5];
575-
for (int counterLayer2 = 0; counterLayer2 < 12; counterLayer2++) {
576-
if (counterLayer > 7 && st == 4)
576+
for (size_t counterLayer2 = 0; counterLayer2 < Eta[counterLayer].size(); counterLayer2++) {
577+
if (counterLayer2 > 7 && st == 4)
577578
continue;
578579
if ((counterLayer2 < 4 && counterLayer < 4) || (counterLayer2 > 3 && counterLayer > 3)) {
579580
if (counterLayer == counterLayer2) {
580581
Eta[counterLayer][counterLayer2] = 3.0 / (4.0);
581582
} else {
582583
Eta[counterLayer][counterLayer2] = -1.0 / (4.0);
583584
}
584-
} else {
585-
Eta[counterLayer][counterLayer2] = 0.0;
586585
}
587586
}
588587
}
589588

590589
for (int counterDeg = 0; counterDeg < 5; counterDeg++) {
591-
for (int counterLayer = 0; counterLayer < 12; counterLayer++) {
590+
for (size_t counterLayer = 0; counterLayer < 12; counterLayer++) {
592591
if (counterLayer > 7 && st == 4)
593592
continue;
594-
for (int counterLayer2 = 0; counterLayer2 < 12; counterLayer2++) {
593+
for (size_t counterLayer2 = 0; counterLayer2 < 12; counterLayer2++) {
595594
if (counterLayer2 > 7 && st == 4)
596595
continue;
597-
for (int counterLayer3 = 0; counterLayer3 < 12; counterLayer3++) {
596+
for (size_t counterLayer3 = 0; counterLayer3 < 12; counterLayer3++) {
598597
if (counterLayer3 > 7 && st == 4)
599598
continue;
600599
matrix(5 * counterLayer2 + counterDeg, 5 * counterLayer3 + counterDeg) +=
@@ -668,13 +667,12 @@ TMatrixD DTMuonMillepede::getbqcMatrix(int wh, int st, int se) {
668667
}
669668
}
670669
}
671-
double **Eta = new double *[12];
672-
for (int counterLayer = 0; counterLayer < 12; counterLayer++) {
670+
std::array<std::array<double, 12>, 12> Eta{};
671+
for (size_t counterLayer = 0; counterLayer < Eta.size(); counterLayer++) {
673672
if (counterLayer > 7 && st == 4)
674673
continue;
675-
Eta[counterLayer] = new double[5];
676-
for (int counterLayer2 = 0; counterLayer2 < 12; counterLayer2++) {
677-
if (counterLayer > 7 && st == 4)
674+
for (size_t counterLayer2 = 0; counterLayer2 < Eta[counterLayer].size(); counterLayer2++) {
675+
if (counterLayer2 > 7 && st == 4)
678676
continue;
679677
if ((counterLayer2 < 4 && counterLayer < 4) || (counterLayer2 > 3 && counterLayer > 3)) {
680678
if (counterLayer == counterLayer2) {
@@ -689,10 +687,10 @@ TMatrixD DTMuonMillepede::getbqcMatrix(int wh, int st, int se) {
689687
}
690688

691689
for (int counterDeg = 0; counterDeg < 5; counterDeg++) {
692-
for (int counterLayer = 0; counterLayer < 12; counterLayer++) {
690+
for (size_t counterLayer = 0; counterLayer < 12; counterLayer++) {
693691
if (counterLayer > 7 && st == 4)
694692
continue;
695-
for (int counterLayer2 = 0; counterLayer2 < 12; counterLayer2++) {
693+
for (size_t counterLayer2 = 0; counterLayer2 < 12; counterLayer2++) {
696694
if (counterLayer2 > 7 && st == 4)
697695
continue;
698696
float mean = 0;

Alignment/OfflineValidation/bin/PVmerge.cc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,26 @@ int merge(int argc, char* argv[]) {
5454
float m_dzPhiMax = validation.count("m_dzPhiMax") ? validation.get<float>("m_dzPhiMax") : 40;
5555
float m_dxyEtaMax = validation.count("m_dxyEtaMax") ? validation.get<float>("m_dxyEtaMax") : 40;
5656
float m_dzEtaMax = validation.count("m_dzEtaMax") ? validation.get<float>("m_dzEtaMax") : 40;
57+
float m_dxyPtMax = validation.count("m_dxyPtMax") ? validation.get<float>("m_dxyPtMax") : 40;
58+
float m_dzPtMax = validation.count("m_dzPtMax") ? validation.get<float>("m_dzPtMax") : 40;
5759
float m_dxyPhiNormMax = validation.count("m_dxyPhiNormMax") ? validation.get<float>("m_dxyPhiNormMax") : 0.5;
5860
float m_dzPhiNormMax = validation.count("m_dzPhiNormMax") ? validation.get<float>("m_dzPhiNormMax") : 0.5;
5961
float m_dxyEtaNormMax = validation.count("m_dxyEtaNormMax") ? validation.get<float>("m_dxyEtaNormMax") : 0.5;
6062
float m_dzEtaNormMax = validation.count("m_dzEtaNormMax") ? validation.get<float>("m_dzEtaNormMax") : 0.5;
63+
float m_dxyPtNormMax = validation.count("m_dxyPtNormMax") ? validation.get<float>("m_dxyPtNormMax") : 0.5;
64+
float m_dzPtNormMax = validation.count("m_dzPtNormMax") ? validation.get<float>("m_dzPtNormMax") : 0.5;
6165
float w_dxyPhiMax = validation.count("w_dxyPhiMax") ? validation.get<float>("w_dxyPhiMax") : 150;
6266
float w_dzPhiMax = validation.count("w_dzPhiMax") ? validation.get<float>("w_dzPhiMax") : 150;
6367
float w_dxyEtaMax = validation.count("w_dxyEtaMax") ? validation.get<float>("w_dxyEtaMax") : 150;
6468
float w_dzEtaMax = validation.count("w_dzEtaMax") ? validation.get<float>("w_dzEtaMax") : 1000;
69+
float w_dxyPtMax = validation.count("w_dxyPtMax") ? validation.get<float>("w_dxyPtMax") : 150;
70+
float w_dzPtMax = validation.count("w_dzPtMax") ? validation.get<float>("w_dzPtMax") : 150;
6571
float w_dxyPhiNormMax = validation.count("w_dxyPhiNormMax") ? validation.get<float>("w_dxyPhiNormMax") : 1.8;
6672
float w_dzPhiNormMax = validation.count("w_dzPhiNormMax") ? validation.get<float>("w_dzPhiNormMax") : 1.8;
6773
float w_dxyEtaNormMax = validation.count("w_dxyEtaNormMax") ? validation.get<float>("w_dxyEtaNormMax") : 1.8;
6874
float w_dzEtaNormMax = validation.count("w_dzEtaNormMax") ? validation.get<float>("w_dzEtaNormMax") : 1.8;
75+
float w_dxyPtNormMax = validation.count("w_dxyPtNormMax") ? validation.get<float>("w_dxyPtNormMax") : 1.8;
76+
float w_dzPtNormMax = validation.count("w_dzPtNormMax") ? validation.get<float>("w_dzPtNormMax") : 1.8;
6977
int iov = validation.count("IOV") ? validation.get<int>("IOV") : 1;
7078
std::string rlabel = validation.count("customrighttitle") ? validation.get<std::string>("customrighttitle") : "";
7179
rlabel = merge_style.count("Rlabel") ? merge_style.get<std::string>("Rlabel") : rlabel;
@@ -81,18 +89,26 @@ int merge(int argc, char* argv[]) {
8189
m_dzPhiMax, // mean of dz vs Phi
8290
m_dxyEtaMax, // mean of dxy vs Eta
8391
m_dzEtaMax, // mean of dz vs Eta
92+
m_dxyPtMax, // mean of dxy vs Pt
93+
m_dzPtMax, // mean of dz vs Pt
8494
m_dxyPhiNormMax, // mean of dxy vs Phi (norm)
8595
m_dzPhiNormMax, // mean of dz vs Phi (norm)
8696
m_dxyEtaNormMax, // mean of dxy vs Eta (norm)
8797
m_dzEtaNormMax, // mean of dz vs Eta (norm)
98+
m_dxyPtNormMax, // mean of dxy vs Pt (norm)
99+
m_dzPtNormMax, // mean of dz vs Pt (norm)
88100
w_dxyPhiMax, // width of dxy vs Phi
89101
w_dzPhiMax, // width of dz vs Phi
90102
w_dxyEtaMax, // width of dxy vs Eta
91103
w_dzEtaMax, // width of dz vs Eta
104+
w_dxyPtMax, // width of dxy vs Pt
105+
w_dzPtMax, // width of dz vs Pt
92106
w_dxyPhiNormMax, // width of dxy vs Phi (norm)
93107
w_dzPhiNormMax, // width of dz vs Phi (norm)
94108
w_dxyEtaNormMax, // width of dxy vs Eta (norm)
95-
w_dzEtaNormMax // width of dz vs Eta (norm)
109+
w_dzEtaNormMax, // width of dz vs Eta (norm)
110+
w_dxyPtNormMax, // width of dxy vs Pt (norm)
111+
w_dzPtNormMax // width of dz vs Pt (norm)
96112
);
97113

98114
//Load file list in user defined order

0 commit comments

Comments
 (0)