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

New high granularity pixel alignment for the PCL #38449

Merged
merged 5 commits into from
Jun 24, 2022

Conversation

dmeuser
Copy link
Contributor

@dmeuser dmeuser commented Jun 21, 2022

PR description:

This is the last PR towards using a higher granularity (HG) for the pixel alignment in the PCL, following #38195, #38286, #38273, #38367. It is planned to run the HG alignment in parallel to the LG alignment, with only the LG alignment updating the conditions. More details can also be found in [1].

In detail the following things are changed/added in this PR:

  • Adapt MillePedeFileReader and MillePedeDQMModule to read and store the high granularity alignment
  • Read and use the new thresholds in MillePedeDQMModule and MillePedeAlignmentAlgorithm
  • Store/read the pede results for the HG alignment in/from a separate folder, to avoid overwriting the LG result in the harvesting step.
  • Two new methods in the new HG threshold object, to get and store the float maps
  • Add workflows for the production and the harvesting required for the HG alignment in CommonAlignmentProducer
  • Add the new workflows to the PCL configuration
  • Add the LG and HG alignment to the 1001.2 workflows, which can be used with the runTheMatrix.py command
  • Add a relval customizer in CommonAlignmentProducer to override the 20 LS veto and required entries per structure in the HG aligment

PR validation:

The PR can be tested using the adapted relval workflow with runTheMatrix.py -l 1001.2.

cc:
@mmusich, @connorpa, @antoniovagnerini, @consuegs

[1] https://indico.cern.ch/event/1167313/contributions/4906905/attachments/2461217/4219804/AlCaDB_Meeting_13_06_22.pdf

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38449/30656

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • Alignment/CommonAlignmentProducer (alca)
  • Alignment/MillePedeAlignmentAlgorithm (alca)
  • CondFormats/PCLConfig (db, alca)
  • Configuration/AlCa (alca)
  • Configuration/EventContent (operations)
  • Configuration/PyReleaseValidation (pdmv, upgrade)
  • Configuration/StandardSequences (operations)

@perrotta, @malbouis, @yuanchao, @jordan-martins, @bbilin, @tvami, @cmsbuild, @AdrianoDee, @srimanob, @kskovpen, @ggovi, @qliphy, @francescobrivio, @fabiocos, @davidlange6 can you please review it and eventually sign? Thanks.
@felicepantaleo, @kpedro88, @Martin-Grunewald, @tlampen, @trtomei, @ChrisMisan, @mmusich, @slomeo, @pakhotin, @makortel, @JanFSchulte, @dgulhan, @missirol, @seemasharmafnal, @beaucero, @GiacomoSguazzoni, @rovere, @VinInn, @tocheng, @ebrondol, @mtosi, @fabiocos, @adewit, @lecriste 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

} else {
booker.setCurrentFolder("AlCaReco/SiPixelAliHG/");

layerVec = {{"Layer1", 12},
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe all of this can be taken from ES instead of hardcoding?

inline const unsigned getPXBLadders(unsigned int lay) const { return m_pxbMap.at(lay).first; }
inline const unsigned getPXBModules(unsigned int lay) const { return m_pxbMap.at(lay).second; }
inline const unsigned getPXFBlades(int disk) const { return m_pxfMap.at(std::abs(disk)).first; }
inline const unsigned getPXFModules(int disk) const { return m_pxfMap.at(std::abs(disk)).second; }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, however from getPXFModules I get only 1 module for each disk. Is this expected? I could instead use getPXFBlades and multiply the result by 2.

Copy link
Contributor

@mmusich mmusich Jun 21, 2022

Choose a reason for hiding this comment

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

unfortunately as far as I can see from here it is:

  • Subdetector 2 (DetId::subDetId() == PixelSubdetector::PixelEndcap): Phase1 Pixel Forward
Name start bit hex mask bit size TrackerTopology method Notes
subdetector part 23 0x3 2 pxfSide(id) or side(id) 1=FPIX- 2=FPIX+
Blade 12 0x3F 6 pxfBlade(id) increasing phi and r: first inner ring blades and the outer ring blades
Panel 10 0x3 2 pxfPanel(id) 1=forward 2=backward
Module 2 0xFF 8 pxfModule(id) always = 1

though admittedly that's not the way I thought it was supposed to work when I wrote the code.
I guess you can go ahead with the blade implementation while I pick up the slack...

case 15:
return (tns.tpe().halfCylinderNumber(id) == 1)
? (tns.tpe().bladeNumber(id) * 2 - (tns.tpe().panelNumber(id) % 2)) + 148
: (tns.tpe().bladeNumber(id) * 2 - (tns.tpe().panelNumber(id) % 2)) + 148 + 56;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we reduce here the amount of harcoded constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm struggling a bit with this one. Probably it would be nice also to use the PixelTopologyMap, but if I'm not mistaken I can not take it from ES in the MillePedeFileReader, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

In principle you can make an object of the PixelTopologyMap class a data member of MillePedeFileReader that gets initialized elsewhere and then access here its methods, though if it slows you down too much, we can think on how to do it in a follow-up (of course if the other reviewers don't insist).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already thought about this, but the MillePedeFileReader is not only used in MillePedeDQMModule but also in MillePedeAlignmentAlgorithm, so there would be a few more changes when using the PixelTopologyMap. I am still not sure if it gets much better with this one.
So maybe we put this aside for now and come back to this later (hopefully with a better idea)

Copy link
Contributor

Choose a reason for hiding this comment

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

but also in MillePedeAlignmentAlgorithm

of course it would need to have all the callers changed, but presumably all of them have access to the ES.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to try it using the PixelTopologyMap, lets see how this turns out :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I came up with a solution, with almost no constants. Hope this is better now: 6e9c819

Comment on lines 173 to 178
ALCAHARVESTSiPixelAliHG_metadata = cms.PSet(record = cms.untracked.string('TrackerAlignmentRcd'))

ALCAHARVESTSiPixelAliHG_dbOutput = cms.PSet(record = cms.string('TrackerAlignmentRcd'),
tag = cms.string('SiPixelAli_pclHG'),
timetype = cms.untracked.string('runnumber')
)
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 using TrackerAlignmentRcd here might conflict with the key used in the metadata for the current SiPixel Alignment. I think it should be renamed.

Also, related to this, we should update the DropboxMetadata code (and the tags) in https://github.com/cms-sw/cmssw/blob/master/CondFormats/Common/test/ProduceDropBoxMetadata.py. @dmeuser do you want to include the changes in this PR or do you want us to do it in a different PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do you want to include the changes in this PR or do you want us to do it in a different PR?

As you prefer, if you want me to take care of it I would have the following question:
Do we need a new record? Or is renaming the one used in AlCaHarvesting_cff.py enough?
And for the changes in DropboxMetadata and in the unit test, can I just duplicate the LG ones and put the corresponding HG parts there?

Copy link
Contributor

Choose a reason for hiding this comment

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

taking the liberty of answering, since no-one from AlCa feels like commenting:

Do we need a new record?

No.

Or is renaming the one used in AlCaHarvesting_cff.py enough?

yes.

And for the changes in DropboxMetadata and in the unit test, can I just duplicate the LG ones and put the corresponding HG parts there?

yes, provided you are consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay in the answer, other committments 😉

As Marco said, no you don't need a new record, that's not really a record, but rather the key used in the DropboxMetada dictionary, that's why you need to be consistent also when changing the DropboxMetada code.
So you can make a change as simple as:
TrackerAlignmentRcd -> TrackerAlignmentRcd_HG

About the DropboxMetadata you need to update:

Once that is done we (AlCa) will take care of creating the new DropboxMetada payload and append it to the data-taking tags before putting this PCL wf in production.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I hope I managed to find all the necessary changes, which are applied in b946b6b

@tvami
Copy link
Contributor

tvami commented Jun 21, 2022

type trk

@cmsbuild cmsbuild added the trk label Jun 21, 2022
@tvami
Copy link
Contributor

tvami commented Jun 21, 2022

urgent

  • the backport should go into the next 12_4_X

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38449/30661

@cmsbuild
Copy link
Contributor

Pull request #38449 was updated. @perrotta, @malbouis, @yuanchao, @jordan-martins, @bbilin, @tvami, @cmsbuild, @AdrianoDee, @srimanob, @kskovpen, @ggovi, @qliphy, @francescobrivio, @fabiocos, @davidlange6 can you please check and sign again.

@tvami
Copy link
Contributor

tvami commented Jun 23, 2022

@cms-sw/pdmv-l2 @cms-sw/upgrade-l2 could you please sign this? The backport should go into the 12_4_X that we'll cut next week, so it would be nice to have it aired in the IBs before that

@bbilin
Copy link
Contributor

bbilin commented Jun 23, 2022

+1

@srimanob
Copy link
Contributor

+Upgrade

From the upgrade side, existing workflow 1001.2 is updated. The test runs fine.

@tvami
Copy link
Contributor

tvami commented Jun 24, 2022

@cms-sw/orp-l2 we are essentially fully signed (and we'd like the backport to go into 12_4_1)

Copy link
Contributor

@perrotta perrotta left a comment

Choose a reason for hiding this comment

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

Here are a few suggestion to improve the config and clean the code.
I don't want that by applying them the long list of signatures need to be recolectd: please update in a folllow up PR.

Comment on lines +44 to +53
options = cms.vstring(
#'regularisation 1.0 0.05', # non-stated pre-sigma 50 mrad or 500 mum
'entries 500',
'chisqcut 30.0 4.5',
'threads 1 1',
'closeandreopen',
'skipemptycons'
#'outlierdownweighting 3','dwfractioncut 0.1'
#'outlierdownweighting 5','dwfractioncut 0.2'
),
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
options = cms.vstring(
#'regularisation 1.0 0.05', # non-stated pre-sigma 50 mrad or 500 mum
'entries 500',
'chisqcut 30.0 4.5',
'threads 1 1',
'closeandreopen',
'skipemptycons'
#'outlierdownweighting 3','dwfractioncut 0.1'
#'outlierdownweighting 5','dwfractioncut 0.2'
),
options = [
#'regularisation 1.0 0.05', # non-stated pre-sigma 50 mrad or 500 mum
'entries 500',
'chisqcut 30.0 4.5',
'threads 1 1',
'closeandreopen',
'skipemptycons'
#'outlierdownweighting 3','dwfractioncut 0.1'
#'outlierdownweighting 5','dwfractioncut 0.2' ],

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed at 1ac393c

#'outlierdownweighting 5','dwfractioncut 0.2'
),
fileDir = 'HGalignment/',
runDir = cms.untracked.string('HGalignment/'),
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
runDir = cms.untracked.string('HGalignment/'),
runDir = 'HGalignment/',

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed at 1ac393c

@@ -854,7 +855,13 @@ void AlignmentProducerBase::writeForRunRange(cond::Time_t time) {
auto alignments = alignableTracker_->alignments();
auto alignmentErrors = alignableTracker_->alignmentErrors();
this->writeDB(
alignments, "TrackerAlignmentRcd", alignmentErrors, "TrackerAlignmentErrorExtendedRcd", trackerGlobal, time);
// ~alignments, "TrackerAlignmentRcd", alignmentErrors, "TrackerAlignmentErrorExtendedRcd", trackerGlobal, time);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this commented out and outdated line get removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed at 1ac393c

Comment on lines +104 to +109

if (it != floatMap_.end()) {
return true;
} else {
return false;
}
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
if (it != floatMap_.end()) {
return true;
} else {
return false;
}
return (it != floatMap_.end());

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed at 1ac393c

@perrotta
Copy link
Contributor

+1

@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 be automatically merged.

@cmsbuild cmsbuild merged commit 0f0c0f3 into cms-sw:master Jun 24, 2022
mmusich added a commit to cms-trackeralign/cmssw that referenced this pull request Jun 24, 2022
@perrotta
Copy link
Contributor

@dmeuser could you please have a look at the issue #38506 and provide a fix for it. It can be merged together with the cleanings I suggested in #38449 (review), and all them added together in the backport PR

Needless to say, this is rather urgent if we want to have this PR in the 12_4_1 release, that is expected to be built on Tuesday.

Attn. @mmusich @francescobrivio

mmusich added a commit to cms-trackeralign/cmssw that referenced this pull request Jun 25, 2022
mmusich added a commit to cms-trackeralign/cmssw that referenced this pull request Jun 25, 2022
mmusich added a commit to cms-trackeralign/cmssw that referenced this pull request Jun 25, 2022
mmusich added a commit to cms-trackeralign/cmssw that referenced this pull request Jun 25, 2022
mmusich added a commit to cms-trackeralign/cmssw that referenced this pull request Jun 25, 2022
jhakala pushed a commit to jhakala/cmssw that referenced this pull request Aug 2, 2022
jhakala pushed a commit to jhakala/cmssw that referenced this pull request Aug 3, 2022
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.

8 participants