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

Prompt calibration loop module for SiPixelLorentzAngle #35507

Merged

Conversation

wweiphy
Copy link
Contributor

@wweiphy wweiphy commented Oct 1, 2021

PR description:

With this PR, we introduce the Lorentz Angle (LA) calibration PCL module for barrel Pixel detector. It includes the general workflow of PCL as well as dedicated improvements for LA measurements. The details are listed below:

  • SiPixelLorentzAnglePCLWorker creates and fills the 2D histograms of electron drift and its production depth as tracks pass through the barrel pixel. We applied improved selections on clusters. Tree production of tracks and clusters is also included in case of other needs and is made optional.
  • SiPixelLorentzAnglePCLHarvester fits the histograms and obtains LA. We have improved the fitting by moving to a higher order polynomial fit to include the nonlinear distributions in the histograms.
  • Pass the DetID of layer 2 new modules in SiPixelLorentzAnglePCLWorker and SiPixelLorentzAnglePCLHarvester and measure LA fo each one of them.
New module names:
    BPix_BmI_SEC7_LYR2_LDR12F_MOD1
    BPix_BmI_SEC8_LYR2_LDR14F_MOD1
    BPix_BmO_SEC3_LYR2_LDR5F_MOD1
    BPix_BmO_SEC3_LYR2_LDR5F_MOD2
    BPix_BmO_SEC3_LYR2_LDR5F_MOD3
    BPix_BpO_SEC1_LYR2_LDR1F_MOD1
    BPix_BpO_SEC1_LYR2_LDR1F_MOD2
    BPix_BpO_SEC1_LYR2_LDR1F_MOD3

PR validation:

Tested with 50000 events from /store/data/Run2018D/SingleMuon/ALCARECO/SiPixelCalSingleMuon-ForPixelALCARECO_UL2018-v1/230000/F33B7CA6-256A-B34F-9536-7594FBC6F75B.root
Results were presented in the AlCaDB meeting and also attached.
LA_AlCa.pdf

if this PR is a backport please specify the original PR and why you need to backport that PR: N/A

Before submitting your pull requests, make sure you followed this checklist:

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-35507/25703

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2021

A new Pull Request was created by @wweiphy for master.

It involves the following packages:

  • CalibTracker/SiPixelLorentzAngle (alca)
  • Calibration/TkAlCaRecoProducers (alca)
  • Configuration/AlCa (alca)
  • Configuration/EventContent (operations)
  • Configuration/PyReleaseValidation (pdmv, upgrade)
  • Configuration/StandardSequences (operations)

@perrotta, @malbouis, @yuanchao, @jordan-martins, @davidlange6, @bbilin, @wajidalikhan, @cmsbuild, @AdrianoDee, @srimanob, @kskovpen, @qliphy, @francescobrivio, @fabiocos, @tvami can you please review it and eventually sign? Thanks.
@felicepantaleo, @kpedro88, @Martin-Grunewald, @OzAmram, @threus, @mmusich, @slomeo, @makortel, @JanFSchulte, @dgulhan, @missirol, @ferencek, @GiacomoSguazzoni, @rovere, @VinInn, @tocheng, @ebrondol, @mtosi, @fabiocos, @dkotlins, @lecriste, @tvami this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@mmusich
Copy link
Contributor

mmusich commented Oct 1, 2021

test parameters:

  • workflow = 1001.2

@mmusich
Copy link
Contributor

mmusich commented Oct 1, 2021

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Oct 1, 2021

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-86c3fd/19325/summary.html
COMMIT: bd25f72
CMSSW: CMSSW_12_1_X_2021-09-30-2300/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/35507/19325/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

The workflows 1001.0 have different files in step1_dasquery.log than the ones found in the baseline. You may want to check and retrigger the tests if necessary. You can check it in the "files" directory in the results of the comparisons

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-86c3fd/1001.2_RunZeroBias2017F+RunZeroBias2017F+TIER0EXPRUN2+ALCAEXPRUN2+ALCAHARVDSIPIXELCAL

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 40
  • DQMHistoTests: Total histograms compared: 3210975
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3210953
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 38 files compared)
  • Checked 160 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

Copy link
Contributor

@mmusich mmusich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @wweiphy!
Find below a first pass of review comments.
Also please change the title in order to contain the word SiPixel in it.
Finally please add the new PCL workflow to the testPCLAlCaHarvesting unit test at

process.PoolDBOutputService.toPut.append(process.ALCAHARVESTSiPixelAli_dbOutput)

// if the fit quality is OK
if (prob > fitProbCut_) {
for (const auto& id : detIdsToFill) {
bPixLorentzAnglePerTesla_ = p1 / 3.8f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please take the magnetic field value from the ES.

edm::LogError("SiPixelLorentzAngleDB") << er.what() << std::endl;
} catch (const std::exception& er) {
edm::LogError("SiPixelLorentzAngleDB") << "caught std::exception " << er.what() << std::endl;
} catch (...) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This triggers a warning in the static analyzer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should catch (...) be replaced?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think it should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MonitorElement* h_drift_depth_adc_slice_ =
iBooker.book1D("h_drift_depth_adc_slice", "slice of adc histogram", hist_drift_, min_drift_, max_drift_);

edm::LogPrint("LorentzAngle") << "module"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not very readable, please break into multiple lines.


// tree branches barrel
int run_;
long int event_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these variables are giving static analyzer warnings "non-const global static variable":
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-86c3fd/19325/llvm-analysis/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmusich Any recommendation to fix this? I think we need the global variables for Tree production.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't these be private members of the class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving those variables into private class result in errors such as:
assignment of member 'SiPixelLorentzAnglePCLWorker::panelF_' in read-only object
because function dqmAnalyze is set const.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps another DQM class interface is better suited:
https://github.com/cms-sw/cmssw/tree/master/DQMServices/Core

}
}

SiPixelLorentzAnglePCLWorker::~SiPixelLorentzAnglePCLWorker() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nothing is done here, then set it as default

std::vector<int> FPixnewDetIds_;
std::vector<int> FPixnewDisk_;
std::vector<int> FPixnewBlade_;
std::map<uint32_t, std::vector<uint32_t> > detIdsList;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be unordered?

}
*/

for (int i_layer = 1; i_layer <= hists.nlay; i_layer++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

range based loop?

}
}

for (int i = 0; i < (int)hists.BPixnewDetIds_.size(); i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

range based loop?

<< "\t"
<< "newDetId" << std::endl;

SiPixelLorentzAngle* LorentzAngle = new SiPixelLorentzAngle();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this deleted?

bool large_pix = false;
for (int j = 0; j < pixinfo_.npix; j++) {
int colpos = static_cast<int>(pixinfo_.col[j]);
if (pixinfo_.row[j] == 0 || pixinfo_.row[j] == 79 || pixinfo_.row[j] == 80 || pixinfo_.row[j] == 159 ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this interface can be re-used?

constexpr inline bool isBigPixX(uint16_t px) { return (px == 79) | (px == 80); }

constexpr inline bool isBigPixY(uint16_t py) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mmusich there are extra terms pixinfo_.row[j] == 0 and pixinfo_.row[j] == 159 , which are not included in the function phase1PixelTopology::isBigPixX. Should I keep or remove them?

In other words:

if (pixinfo_.row[j] == 0 || phase1PixelTopology::isBigPixX(pixinfo_.row[j]) || pixinfo_.row[j] == 159 || phase1PixelTopology::isBigPixY(pixinfo_.col[j]))

or

if (phase1PixelTopology::isBigPixX(pixinfo_.row[j]) || phase1PixelTopology::isBigPixY(pixinfo_.col[j])){

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsusa please clarify why the previous usage.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsusa please clarify, so that we can proceed with this PR

Copy link
Contributor

@tsusa tsusa Oct 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@perotta, @mmusich, @wweiphy The cut removes the hits which are at the ROC edges. In order to keep the compatibility with the code used to derive LA values that enter DB, I would keep that cut as it is.

#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"

#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "../interface/SiPixelLorentzAngleCalibrationStruct.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's preferred to have absolute path instead of the relative path

Comment on lines 182 to 186
/*
for(const auto& [index,histo] : hists.h_drift_depth_adc_){
std::cout << index << " => " << histo->getName();
}
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can either go or become LogDebug

#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "../interface/SiPixelLorentzAngleCalibrationStruct.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use absolute path

double max_depth_;
double min_drift_;
double max_drift_;
int bufsize;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int bufsize;
int bufsize_;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I guess one can argue that this should stay bufsize, let's see what others think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all class members should follow the same conventions for naming, therefore the trailing underscore should be added here.
On the other hand, bufsize is only used inside the constructor, where it is also initialized. Then I don't see why it should remain a class member, instead of becoming a local variable instead (without the trailing underscore in that case).

@tvami
Copy link
Contributor

tvami commented Oct 2, 2021

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-86c3fd/19612/summary.html
COMMIT: a9c114b
CMSSW: CMSSW_12_1_X_2021-10-13-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/35507/19612/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

The workflows 1001.0, 140.53 have different files in step1_dasquery.log than the ones found in the baseline. You may want to check and retrigger the tests if necessary. You can check it in the "files" directory in the results of the comparisons

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-86c3fd/1001.2_RunZeroBias2017F+RunZeroBias2017F+TIER0EXPRUN2+ALCAEXPRUN2+ALCAHARVDSIPIXELCAL

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 1000 differences found in the comparisons
  • DQMHistoTests: Total files compared: 40
  • DQMHistoTests: Total histograms compared: 2796686
  • DQMHistoTests: Total failures: 2568
  • DQMHistoTests: Total nulls: 62
  • DQMHistoTests: Total successes: 2794034
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 65.355 KiB( 38 files compared)
  • DQMHistoSizes: changed ( 140.53 ): 63.680 KiB Hcal/DigiRunHarvesting
  • DQMHistoSizes: changed ( 140.53 ): 1.676 KiB RPC/DCSInfo
  • Checked 160 log files, 37 edm output root files, 40 DQM output files
  • TriggerResults: no differences found

@tvami
Copy link
Contributor

tvami commented Oct 14, 2021

+alca

@srimanob
Copy link
Contributor

+Upgrade

The PR introduces a new PCL module as described in the PR description. Changes in Configuration/PyReleaseValidation is configuration as expected.

@bbilin
Copy link
Contributor

bbilin commented Oct 14, 2021

+1

@tvami
Copy link
Contributor

tvami commented Oct 14, 2021

@perrotta @qliphy this is again essentially fully signed, and we have another PR in the pipeline that right now changes some of the files here, so please sign it asap, thanks!

@perrotta
Copy link
Contributor

+operations

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants