Skip to content

Commit

Permalink
Merge tag 'CMSSW_13_1_X_2023-03-27-1100' of https://github.com/cms-sw…
Browse files Browse the repository at this point in the history
…/cmssw into particlenet_cmssw130
  • Loading branch information
Stephane Cooperstein committed Mar 27, 2023
2 parents 3c15acd + 94b8d97 commit 55daf9d
Show file tree
Hide file tree
Showing 1,645 changed files with 149,042 additions and 169,603 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ def getSequence(process, collection,
## put the sequence together ##
###############################

if "Fast" in TTRHBuilder:
print("PixelCPEFast has been chosen, here we must include CUDAService first")
process.load('HeterogeneousCore.CUDAServices.CUDAService_cfi')

modules = []
src = collection
prevsrc = None
Expand Down
2 changes: 1 addition & 1 deletion Alignment/CommonAlignment/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<bin file="test_AlignableObjectId.cc">
<use name="Alignment/CommonAlignment"/>
</bin>
<test name="test_CreateFileLists" command="tkal_create_file_lists.py --test-mode --force -i /OVERRIDDEN/IN/TESTMODE -o ${LOCALTOP}/tmp/mps_create_file_lists -n 200000 --iov 42 --iov 174"/>
<test name="test_CreateFileLists" command="tkal_create_file_lists.py --test-mode --force -i /OVERRIDDEN/IN/TESTMODE -o ./mps_create_file_lists -n 200000 --iov 42 --iov 174"/>
13 changes: 4 additions & 9 deletions Alignment/MillePedeAlignmentAlgorithm/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
<use name="CondFormats/Alignment"/>
<flags EDM_PLUGIN="1"/>
</library>
<test name="test_PrepareInputDb" command="mps_prepare_input_db.py -g auto:run2_data -r 1 -o ${LOCALTOP}/tmp/test_input.db"/>
<test name="test_PrepareInputDb" command="mps_prepare_input_db.py -g auto:run2_data -r 1 -o ./test_input.db"/>
<test name="test_MpsWorkFlow" command="test_mps-workflow.sh"/>
<test name="test-pede" command="pede -t">
<use name="millepede"/>
<flags USE_UNITTEST_DIR="1"/>
</test>
<bin name="testPedeCampaign" file="TestDriver.cpp">
<flags TEST_RUNNER_ARGS="/bin/bash Alignment/MillePedeAlignmentAlgorithm/test test_pede.sh"/>
<use name="FWCore/Utilities"/>
</bin>
<bin name="testPayloadSanity" file="TestDriver.cpp">
<flags TEST_RUNNER_ARGS="/bin/bash Alignment/MillePedeAlignmentAlgorithm/test test_payload_sanity.sh"/>
<test name="testPedeCampaign" command="test_pede.sh"/>
<test name="testPayloadSanity" command="test_payload_sanity.sh">
<flags PRE_TEST="testPedeCampaign"/>
<use name="FWCore/Utilities"/>
</bin>
</test>
2 changes: 0 additions & 2 deletions Alignment/MillePedeAlignmentAlgorithm/test/TestDriver.cpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
function die { echo $1: status $2; exit $2; }

INPUTFILE=${LOCAL_TEST_DIR}/alignments_MP.db
(cmsRun ${LOCAL_TEST_DIR}/AlignmentRcdChecker_cfg.py inputSqliteFile=${INPUTFILE}) || die 'failed running AlignmentRcdChecker'
INPUTFILE=${SCRAM_TEST_PATH}/alignments_MP.db
(cmsRun ${SCRAM_TEST_PATH}/AlignmentRcdChecker_cfg.py inputSqliteFile=${INPUTFILE}) || die 'failed running AlignmentRcdChecker'
rm $INPUTFILE
5 changes: 1 addition & 4 deletions Alignment/MillePedeAlignmentAlgorithm/test/test_pede.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash
function die { echo $1: status $2; exit $2; }

if [ "${SCRAM_TEST_NAME}" != "" ] ; then
mkdir ${SCRAM_TEST_NAME}
cd ${SCRAM_TEST_NAME}
fi
LOCAL_TEST_DIR=${SCRAM_TEST_PATH}

clean_up(){
echo "cleaning the local test area"
Expand Down
14 changes: 7 additions & 7 deletions Alignment/OfflineValidation/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Validation
# Aligment/OfflineValidation

We use the Boost library (Program Options, Filesystem & Property Trees) to deal with the treatment of the config file.
Basic idea:
Expand Down Expand Up @@ -89,10 +89,10 @@ The python file returns a list of jobs to the `validateAligments.py` which final
- unification of local configuration style based on DMR/PV example
- plotting style options to be implemented
- change marker size for trends
- accept ROOT pre-defined encoding in config (kRed, kDotted, etc.)
- accept ROOT pre-defined encoding in config (`kRed`, `kDotted`, etc.)
- validations to implement:
- PV (only average is missing)
- Zµµ (single + merge)
- Zµµ (trend)
- MTS (single + merge)
- overlap (single + merge + trend)
- ...
Expand All @@ -106,13 +106,13 @@ The python file returns a list of jobs to the `validateAligments.py` which final
(list from October 2022)

## DMR validation
For details read `README_DMR.md`
For details read [`README_DMR.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_DMR.md)

## PV validation
For details read `README_PV.md`
For details read [`README_PV.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_PV.md)

## JetHT validation
For details read `README_JetHT.md`
For details read [`README_JetHT.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_JetHT.md)

## General info about IOV/run arguments
For details read `README_IOV.md`
For details read [`README_IOV.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_IOV.md)
14 changes: 7 additions & 7 deletions Alignment/OfflineValidation/README_DMR.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DMR validation

#General info
# Track-Hit Residuals Validation (DMR, DRnR, etc.)
## General info
```
validations:
DMR:
Expand All @@ -20,7 +20,7 @@ Trends/Averaged job will start if all corresponding merge jobs are done.
Trends and averaged jobs will run in parallel.
Averaged job consists of 3 types of sub-jobs (submission is automatized internally).

#Single DMR jobs:
## Single DMR jobs
Single jobs can be specified per run (IoV as well). In case of MC, IoV is specified to arbitrary 1.

Variable | Default value | Explanation/Options
Expand All @@ -38,7 +38,7 @@ usePixelQualityFlag | True | Use pixel quality flag?
cosmicsZeroTesla | False | Is this validation for cosmics with zero magnetic field?
vertexcollection | "offlinePrimaryVertices" | Specify vertex collection to be used.

#Merge DMR job
## Merge DMR job
Its name do not need to match single job name but option `singles` must list all single jobs to be merged.
Needs to be specified in order to run averaged/trends jobs.
DMR merged plot style can be adjusted from global plotting style (see `Alignment/OfflineValidation/test/example_DMR_full.yaml`)
Expand All @@ -56,7 +56,7 @@ minimum | 15 | Minimum number of hits requested.
bigtext | false | Legend text size should be enlarged.
moduleid | None | Plot residuals for selected list of module IDs. (debugging)

#Trends DMR job
## Trends DMR job
Its name do not need to match merge neither single job name but option `merges` must list all merge jobs to be put in trend plot.
Trend plot style is defined globally for all trend plots (see `Alignment/OfflineValidation/test/example_DMR_full.yaml`)

Expand All @@ -69,7 +69,7 @@ lastRun | 325175 | Specify the last run to be considered.
labels | None | List of string tags to be added in output rootfile.
year | Run2 | Enforce year tag to be included in lumiInputFile option specified in trend style (This is extra measure)

#Averaged DMR job
## Averaged DMR job
Its name do not need to match merge neither single job name but option `merges` must list all merge jobs to be put in averaged distribution.
Each merge job to be passed to averager must consist of data OR MC single jobs exclusively (no mix of Data and MC).
Some style options are accessible from global style config (see `Alignment/OfflineValidation/test/example_DMR_full.yaml`).
Expand Down
2 changes: 1 addition & 1 deletion Alignment/OfflineValidation/README_IOV.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Following document summarises usage of IOV/run-driven validations.
The following document summarises usage of IOV/run-driven validations.

## DMR and PV

Expand Down
9 changes: 4 additions & 5 deletions Alignment/OfflineValidation/README_JetHT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## JetHT validation
# JetHT validation

### Validation analysis - JetHT_cfg.py
## Validation analysis - JetHT_cfg.py

The vast majority of the time in the JetHT validation goes to running the actual validation analysis. This is done with cmsRun using the JetHT_cfg.py configuration file. To configure the analysis in the all-in-one framework, the following parameters can be set in the json/yaml configuration file:

Expand Down Expand Up @@ -29,7 +29,7 @@ profilePtBorders | [3,5,10,20,50,100] | List for pT borders used in wide pT bin
TrackerAlignmentRcdFile | "nothing" | Local database file from which the TrackerAlignmentRcd is read. Notice that usual method to set this is reading from the database for each alignment.
TrackerAlignmentErrorFile | "nothing" | Local database file from which the TrackerAlignmentExtendedErrorRcd is read. Notice that usual method to set this is reading from the database for each alignment.

### File merging - addHistograms.sh
## File merging - addHistograms.sh

The addHistograms.sh script is used to merge the root files for jetHT validation. Merging is fast and can easily be done locally in seconds, but the tool is fully integrated to the all-in-one configuration for automated processing.

Expand Down Expand Up @@ -61,8 +61,7 @@ Variable | Default value | Explanation
singles | None | An array of single job names that must be finished before plotting can be run.
alignments | None | An array of alignment names for which the files are merged within those alignments. Different alignments are kept separate.


### Plotting - jetHtPlotter
## Plotting - jetHtPlotter

The tool is originally designed to be used standalone, since the plotting the histograms locally does not take more that tens of second at maximum. But the plotter works also together with the all-in-one configuration. The only difference for user is the structure of the configuration file, that changes a bit between standalone and all-in-one usage.

Expand Down
11 changes: 5 additions & 6 deletions Alignment/OfflineValidation/README_PV.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## PV validation
# Primary Vertex (PV) Validation

#General info
## General info
```
validations:
PV:
Expand All @@ -18,7 +18,7 @@ Merge job and trend jobs will only start if all corresponding single jobs are do
Trend and merge jobs can run in parallel.
Averaged jobs are not yet implemented.

#Single PV jobs:
## Single PV jobs
Single jobs can be specified per run (IoV as well). In case of MC, IoV is specified to arbitrary 1.

Variable | Default value | Explanation/Options
Expand Down Expand Up @@ -47,7 +47,7 @@ doFPix | True | Do not run validation for FPix if needed
forceBeamSpot | False | Force beam spot
numberOfBins | 48 | Define histogram granularity

#Merge PV job
## Merge PV job
Its name do not need to match single job name but option `singles` must list all single jobs to be merged.
PV merged plot style can be adjusted from global plotting style (see `Alignment/OfflineValidation/test/example_PV_full.yaml`)

Expand Down Expand Up @@ -75,7 +75,7 @@ w_dxyEtaNormMax | 1.8 | If not take this...
w_dzEtaNormMax | 1.8 | If not take this...
customrighttitle | "" | Top right title. Reserved word "IOV" will be replaced for given IOV/run in the list.

#Trends PV job
## Trends PV job
Its name do not need to match single job name but option `singles` must list all single jobs to be put in trend plot.
Trend plot style is defined globally for all trend plots (see `Alignment/OfflineValidation/test/example_PV_full.yaml`)

Expand All @@ -88,4 +88,3 @@ firstRun | 272930 | Specify starting run to be plotted.
lastRun | 325175 | Specify the last run to be considered.
nWorkers | 20 | Number of threads.
doUnitTest | false | Disable certain settings for unit test.

17 changes: 1 addition & 16 deletions Alignment/OfflineValidation/bin/JDrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,22 +216,7 @@ class JDrawer {
/*
* Destructor for JDrawer
*/
~JDrawer() {
if (fCanvas)
delete fCanvas;
if (fSinglePad)
delete fSinglePad;
if (fUpperSplitPad)
delete fUpperSplitPad;
if (fLowerSplitPad)
delete fLowerSplitPad;
if (fLeftRowPad)
delete fLeftRowPad;
if (fMiddleRowPad)
delete fMiddleRowPad;
if (fRightRowPad)
delete fRightRowPad;
}
~JDrawer() = default;

/*
* Draw a histogram to a canvas
Expand Down
2 changes: 1 addition & 1 deletion Alignment/OfflineValidation/bin/Zmumumerge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ void Draw_TH1D_forMultiRootFiles(const vector<TString>& file_names,
for (auto const& filename : file_names | boost::adaptors::indexed(0)) {
file_input[filename.index()] = TFile::Open(filename.value());
th1d_input[filename.index()] = (TH1D*)file_input[filename.index()]->Get(th1d_name);
th1d_input[filename.index()]->SetTitle("");
}

TCanvas* c = new TCanvas();
TLegend* lg = new TLegend(0.2, 0.7, 0.5, 0.95);
c->cd();
gStyle->SetOptStat(0);
th1d_input[0]->SetTitle("");

for (auto const& labelname : label_names | boost::adaptors::indexed(0)) {
th1d_input[labelname.index()]->SetMarkerColor(colors[labelname.index()]);
Expand Down
16 changes: 15 additions & 1 deletion Alignment/OfflineValidation/bin/jetHtPlotter.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// framework includes
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

// C++ includes
#include <iostream> // Input/output stream. Needed for cout.
#include <vector>
Expand Down Expand Up @@ -256,7 +260,12 @@ std::tuple<std::vector<int>, std::vector<double>, std::vector<TString>, std::vec
double thisLumi;

// Load the iovList
std::ifstream iovList(inputFile);
std::ifstream iovList(edm::FileInPath(inputFile).fullPath().c_str());
if (!iovList.good()) {
edm::LogError("jetHTPlotter") << __PRETTY_FUNCTION__ << "\n Input file: " << inputFile
<< " is corrupt or not existing";
return std::make_tuple(iovVector, lumiPerIov, iovNames, iovLegend);
}

// Go through the file line by line. Each line has an IOV boundary and luminosity for this IOV.
while (std::getline(iovList, lineInFile)) {
Expand Down Expand Up @@ -643,6 +652,11 @@ void jetHtPlotter(std::string configurationFileName) {
std::vector<TString> iovLegend;

std::tie(iovVector, lumiPerIov, iovNames, iovLegend) = runAndLumiLists(iovAndLumiFile, iovListMode);
// protection against empty input
if (iovVector.empty()) {
edm::LogError("jetHTPlotter") << __PRETTY_FUNCTION__ << "\n The list of input IOVs is empty. Exiting!";
return;
}

// For the IOV legend, remove the two last entries and replace them with user defined names
iovLegend.pop_back();
Expand Down
26 changes: 19 additions & 7 deletions Alignment/OfflineValidation/plugins/GeneralPurposeTrackAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -995,8 +995,8 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "n. tracks: " << itrks << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;

int nFiringTriggers = triggerMap_.size();
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "firing triggers: " << nFiringTriggers << std::endl;
int nFiringTriggers = !triggerMap_.empty() ? triggerMap_.size() : 1;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "firing triggers: " << triggerMap_.size() << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;

tksByTrigger_ =
Expand Down Expand Up @@ -1028,6 +1028,15 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR
}

int nRuns = conditionsMap_.size();
if (nRuns < 1) {
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************"
<< "\n"
<< " no run was processed! "
<< "\n"
<< "*******************************";

return;
}

std::vector<int> theRuns_;
for (const auto &it : conditionsMap_) {
Expand All @@ -1037,11 +1046,12 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR
sort(theRuns_.begin(), theRuns_.end());
int runRange = theRuns_.back() - theRuns_.front() + 1;

edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "first run: " << theRuns_.front() << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "last run: " << theRuns_.back() << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "considered runs: " << nRuns << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************"
<< "\n"
<< "first run: " << theRuns_.front() << "\n"
<< "last run: " << theRuns_.back() << "\n"
<< "considered runs: " << nRuns << "\n"
<< "*******************************";

modeByRun_ = book<TH1D>("modeByRun",
"Strip APV mode by run number;;APV mode (-1=deco,+1=peak)",
Expand All @@ -1055,6 +1065,8 @@ class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchR
theRuns_.front() - 0.5,
theRuns_.back() + 0.5);

edm::LogPrint("") << __PRETTY_FUNCTION__ << " line: " << __LINE__ << std::endl;

for (const auto &the_r : theRuns_) {
if (conditionsMap_.find(the_r)->second.first != 0) {
edm::LogPrint("GeneralPurposeTrackAnalyzer")
Expand Down
12 changes: 6 additions & 6 deletions Alignment/OfflineValidation/plugins/PixelBaryCentreAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,19 @@ void PixelBaryCentreAnalyzer::analyze(const edm::Event& iEvent, const edm::Event
if (phase_ == 1) {
if (layer != 4) { // layer 1-3

if (ladder % 2 != 0) { // odd ladder = inner = flipped
nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
BPIXLayer_Flipped += barycentreLayer[ladder];
} else {
if (ladder % 2 != 0) { // odd ladder = outer ladder = unflipped
nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
BPIXLayer_NonFlipped += barycentreLayer[ladder];
} else { // even ladder = inner ladder = flipped
nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
BPIXLayer_Flipped += barycentreLayer[ladder];
}
} else { // layer-4

if (ladder % 2 == 0) { // even ladder = inner = flipped
if (ladder % 2 != 0) { // odd ladder = inner = flipped
nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
BPIXLayer_Flipped += barycentreLayer[ladder];
} else { // odd ladder = outer = non-flipped
} else { //even ladder = outer ladder = unflipped
nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
BPIXLayer_NonFlipped += barycentreLayer[ladder];
}
Expand Down
Loading

0 comments on commit 55daf9d

Please sign in to comment.