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

The effect of module sum split over multiple towers on physics objects #472

Merged

Conversation

mhassans
Copy link

PR description:

In trigger primitive generator (TPG) of the HGCal, the total energy of a module (module sum) is split over multiple towers overlapping with it. We are investigating the effect of this splitting on the variables associated to physical objects, such as the position/energy resolution of e/gamma/jets.

PR validation:

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

@jbsauvan
Copy link

Hi @mhassans
There are some external commits that should not be there. It seems this is coming from a merge.
In general the best is to do rebases and not merges in order to keep a clean history.

@mhassans
Copy link
Author

Hi @mhassans
There are some external commits that should not be there. It seems this is coming from a merge.
In general the best is to do rebases and not merges in order to keep a clean history.

Hi @jbsauvan
Yes, sorry for that. Should I try undoing this merge to make it cleaner? Or you only meant for future I should do a rebase instead of merge?

@jbsauvan
Copy link

I would be good to fix it as I will ask you at the very end, before merging, to squash all the commits.
You can probably fix it with an interactive rebase and pick only your commits.

@mhassans
Copy link
Author

I would be good to fix it as I will ask you at the very end, before merging, to squash all the commits.
You can probably fix it with an interactive rebase and pick only your commits.

Thanks, it should be fixed now.

@mhassans mhassans marked this pull request as ready for review June 28, 2021 10:43
DataFormats/L1THGCal/interface/HGCalTowerMap.h Outdated Show resolved Hide resolved
DataFormats/L1THGCal/src/HGCalTowerMap.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
Comment on lines 199 to 304
for (int i=1; i<=std::stoi(result.at(4)); i++){
towerEta = 2 + std::stoi(result.at(3*i+2)); // shift by two to avoid negative eta
towerPhi = (std::stoi(result.at(3*i+3)) + sector*int(nBinsPhi_)/3 + int(nBinsPhi_)/2) % int(nBinsPhi_);//move to the correct sector
if(zside==1){
towerPhi = (3*int(nBinsPhi_)/2 - towerPhi - 1) % int(nBinsPhi_); //correct x -> -x in z>0
}
binIDandShares.insert( {l1t::HGCalTowerID(doNose_, zside, towerEta, towerPhi).rawId(), std::stod(result.at(3*i+4))/splitDivisor } );
}

Choose a reason for hiding this comment

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

All the hardcoded numbers should be implemented as named constants, otherwise it is difficult to understand what they mean exactly

@jbsauvan
Copy link

Hello @mhassans
Are there any news regarding this PR?
Thanks!

@mhassans
Copy link
Author

Hello @mhassans
Are there any news regarding this PR?
Thanks!

Hi Jean-Baptiste,

Sorry for delay on this. I will start working on this soon. I will also send you an email explaining the reasons for this delay.

Thanks!

Copy link

@jbsauvan jbsauvan left a comment

Choose a reason for hiding this comment

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

Thanks @mhassans
Here are some additional comments.

DataFormats/L1THGCal/interface/HGCalTowerID.h Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc Outdated Show resolved Hide resolved
@mhassans
Copy link
Author

Hi @jbsauvan

Thanks for your comments. I implemented all in the code. Please let me know if the code needs any further changes.

Copy link

@jbsauvan jbsauvan left a comment

Choose a reason for hiding this comment

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

Thanks a lot @mhassans
I just have one remaining minor naming comment below. Once implemented, could you:

  • rebase your work on top of the latest devel branch (currently CMSSW_12_0_0_pre3). Given that you have a large number of commits, it might be simpler to squash them first and rebase.
  • run scram b code-format and commit the proposed changes

std::string substr;
std::getline(ss, substr, ' ');
lineSplitted.push_back(substr);
int NumOfWordsInThisRow = 0;
Copy link

Choose a reason for hiding this comment

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

Variable names should not start with a capital letter (usually reserved for class names).
So should rather be numOfWordsInThisRow

Copy link
Author

Choose a reason for hiding this comment

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

Thanks a lot @mhassans I just have one remaining minor naming comment below. Once implemented, could you:

  • rebase your work on top of the latest devel branch (currently CMSSW_12_0_0_pre3). Given that you have a large number of commits, it might be simpler to squash them first and rebase.
  • run scram b code-format and commit the proposed changes

Thanks @jbsauvan

I implemented the comment and then squashed the commits. Could you please confirm if the rebasing can be done in the following way?

Create a branch from the latest CMSSW version:
git checkout -b my_CMSSW_12_0_0_pre3 pfcaldev/hgc-tpg-devel-CMSSW_12_0_0_pre3
Then update it with origin (pfcaldev):
git pull pfcaldev hgc-tpg-devel-CMSSW_12_0_0_pre3
Back to my branch:
git checkout moh-modSplit
Finally rebase:
git rebase my_CMSSW_12_0_0_pre3
Then force push it to my branch:
git push myRemote +moh-modSplit

Copy link

Choose a reason for hiding this comment

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

Hi @mhassans
That looks correct. In case you want to check that the rebase will pick the commit you want, you can do an interactive rebase (with -i)

Copy link
Author

Choose a reason for hiding this comment

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

Screen Shot 2021-11-02 at 12 16 34 PM

@jbsauvan
There are some merging conflicts after I did the rebase (please see the attached screenshot). Should I resolve it by choosing lines from the newest release (12_0_0_pre3), or the conflicts are not expected?

Copy link

Choose a reason for hiding this comment

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

There should be conflict only in the files that you modified, which doesn't seem to be the case here. So these conflicts are not expected. I'll have a look.

Copy link

Choose a reason for hiding this comment

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

It seems that the rebase wants to apply a bunch of commits unrelated to this PR. The simplest then is probably to cherry-pick your single commit. Or you can still do the rebase but do it interactively (with -i) and remove all the commits except your commit.

Copy link

Choose a reason for hiding this comment

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

By the way, I just modified the base branch of the PR to the latest devel branch (this is why there are now conflicts). When you push the rebased branch, it should be able to merge again.

Copy link
Author

Choose a reason for hiding this comment

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

@jbsauvan Thanks! The rebasing went well this time and I also did code-format check. So please let me know about the next step if everything looks fine.

@jbsauvan jbsauvan changed the base branch from hgc-tpg-devel-CMSSW_12_0_0_pre1 to hgc-tpg-devel-CMSSW_12_0_0_pre3 November 2, 2021 13:02
@jbsauvan
Copy link

jbsauvan commented Nov 2, 2021

Thanks @mhassans
There are some includes to be fixed. I got these compilation errors:

In file included from /grid_mnt/vol_home/llr/cms/sauvan/01-Projects/2105-XX_Review-modulesum-split/CMSSW_12_0_0_pre3/src/L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc:2:                                                                                                                                                                 
/grid_mnt/vol_home/llr/cms/sauvan/01-Projects/2105-XX_Review-modulesum-split/CMSSW_12_0_0_pre3/src/L1Trigger/L1THGCal/interface/HGCalTriggerTowerGeometryHelper.h:18:10: fatal error: L1Trigger/L1THGCal/interface/HGCalModuleDetId.h: No such file or directory                                                                                      
   18 | #include "L1Trigger/L1THGCal/interface/HGCalModuleDetId.h"                                                                                                                                                                                                                                                                                    
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
>> Compiling  /grid_mnt/vol_home/llr/cms/sauvan/01-Projects/2105-XX_Review-modulesum-split/CMSSW_12_0_0_pre3/src/L1Trigger/L1THGCal/src/backend/HGCalClusteringDummyImpl.cc                                                                                                                                                                           
>> Compiling  /grid_mnt/vol_home/llr/cms/sauvan/01-Projects/2105-XX_Review-modulesum-split/CMSSW_12_0_0_pre3/src/L1Trigger/L1THGCal/src/backend/HGCalClusteringImpl.cc                                                                                                                                                                                
In file included from /grid_mnt/vol_home/llr/cms/sauvan/01-Projects/2105-XX_Review-modulesum-split/CMSSW_12_0_0_pre3/src/L1Trigger/L1THGCal/src/HGCalTriggerTowerGeometryHelper.cc:2:                                                                                                                                                                 
/grid_mnt/vol_home/llr/cms/sauvan/01-Projects/2105-XX_Review-modulesum-split/CMSSW_12_0_0_pre3/src/L1Trigger/L1THGCal/interface/HGCalTriggerTowerGeometryHelper.h:18:10: fatal error: L1Trigger/L1THGCal/interface/HGCalModuleDetId.h: No such file or directory                                                                                      
   18 | #include "L1Trigger/L1THGCal/interface/HGCalModuleDetId.h"                                                                                                                                                                                                                                                                                    
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This ModuleDetId class has now been moved to DataFormats/ForwardDetId/interface/HGCalTriggerModuleDetId.h

@mhassans
Copy link
Author

mhassans commented Nov 2, 2021

@jbsauvan Ah I see. So it just needs renaming the path and the class names wherever used. This means changing the old name (HGCalModuleDetId) to the new name (HGCalTriggerModuleDetId).

One more question: How can I un-hide DataFormats/ForwardDetId in my local machine?

@jbsauvan
Copy link

jbsauvan commented Nov 2, 2021

@jbsauvan Ah I see. So it just needs renaming the path and the class names wherever used. This means changing the old name (HGCalModuleDetId) to the new name (HGCalTriggerModuleDetId).

In principle yes.

One more question: How can I un-hide DataFormats/ForwardDetId in my local machine?

You can git cms-addpkg DataFormats/ForwardDetId

@mhassans
Copy link
Author

mhassans commented Nov 2, 2021

Thanks @jbsauvan . I pushed the changes. It should work now.

@jbsauvan
Copy link

jbsauvan commented Nov 3, 2021

Thanks @mhassans

  • Performing some last tests, it seems that the test configs doesn't run, it misses the splitModuleSum parameter in the default config. Can you add splitModuleSum=cms.bool(False) in the L1TTriggerTowerConfig_etaphi PSet.
  • Also you'll need to rerun code-format

@mhassans
Copy link
Author

mhassans commented Nov 3, 2021

Thanks @mhassans

  • Performing some last tests, it seems that the test configs doesn't run, it misses the splitModuleSum parameter in the default config. Can you add splitModuleSum=cms.bool(False) in the L1TTriggerTowerConfig_etaphi PSet.
  • Also you'll need to rerun code-format

Thanks @jbsauvan . I made the changes and re-ran the code-format.

@jbsauvan jbsauvan merged commit c4b1a1b into PFCal-dev:hgc-tpg-devel-CMSSW_12_0_0_pre3 Nov 4, 2021
@jbsauvan
Copy link

jbsauvan commented Nov 4, 2021

  • Default config keeps the tower distributions the same:
    image
    [Red=reference, Blue=this PR]

  • Switching on the module splitting, more towers are produced containing less energy:
    image

-> Behaves as expected.

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

Successfully merging this pull request may close these issues.

2 participants