-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38449/30656
|
A new Pull Request was created by @dmeuser for master. It involves the following packages:
@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. cms-bot commands are listed here |
Alignment/CommonAlignmentProducer/python/ALCARECOPromptCalibProdSiPixelAliHG_cff.py
Outdated
Show resolved
Hide resolved
Alignment/CommonAlignmentProducer/python/customizeLSNumberFilterForRelVals.py
Outdated
Show resolved
Hide resolved
Alignment/CommonAlignmentProducer/python/ALCARECOPromptCalibProdSiPixelAliHG_Output_cff.py
Outdated
Show resolved
Hide resolved
Alignment/CommonAlignmentProducer/python/ALCARECOPromptCalibProdSiPixelAliHG_cff.py
Outdated
Show resolved
Hide resolved
Alignment/CommonAlignmentProducer/python/ALCARECOPromptCalibProdSiPixelAliHG_cff.py
Outdated
Show resolved
Hide resolved
Alignment/CommonAlignmentProducer/python/ALCARECOPromptCalibProdSiPixelAliHG_cff.py
Outdated
Show resolved
Hide resolved
Alignment/CommonAlignmentProducer/python/AlcaSiPixelAliHarvesterHG_cff.py
Outdated
Show resolved
Hide resolved
} else { | ||
booker.setCurrentFolder("AlCaReco/SiPixelAliHG/"); | ||
|
||
layerVec = {{"Layer1", 12}, |
There was a problem hiding this comment.
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?
cmssw/Geometry/TrackerGeometryBuilder/interface/PixelTopologyMap.h
Lines 32 to 35 in a010308
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; } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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
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') | ||
) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related to this, please update also the unit test at https://github.com/cms-sw/cmssw/blob/master/Calibration/TkAlCaRecoProducers/test/testPCLAlCaHarvesting.py
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
- ProduceDropBoxMetadata.py
- DropBoxMetadataReader.py
- add the needed json files in https://github.com/cms-sw/cmssw/tree/master/CondFormats/Common/data
- in these json files you specify the name (and destination DB) of the tag to which PCL will append the new payloads
- please note each workflow has 2 json files: one for prod and one for prep DB
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.
There was a problem hiding this comment.
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
type trk |
urgent
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38449/30661
|
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. |
@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 |
+1 |
+Upgrade From the upgrade side, existing workflow 1001.2 is updated. The test runs fine. |
@cms-sw/orp-l2 we are essentially fully signed (and we'd like the backport to go into 12_4_1) |
There was a problem hiding this 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.
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' | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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' ], |
There was a problem hiding this comment.
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/'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runDir = cms.untracked.string('HGalignment/'), | |
runDir = 'HGalignment/', |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed at 1ac393c
|
||
if (it != floatMap_.end()) { | ||
return true; | ||
} else { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (it != floatMap_.end()) { | |
return true; | |
} else { | |
return false; | |
} | |
return (it != floatMap_.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed at 1ac393c
+1 |
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. |
@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 |
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:
MillePedeFileReader
andMillePedeDQMModule
to read and store the high granularity alignmentMillePedeDQMModule
andMillePedeAlignmentAlgorithm
CommonAlignmentProducer
1001.2
workflows, which can be used with therunTheMatrix.py
commandCommonAlignmentProducer
to override the 20 LS veto and required entries per structure in the HG aligmentPR 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