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
EGamma Scale & Smearing For Re-miniAOD #22531
EGamma Scale & Smearing For Re-miniAOD #22531
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-22531/3844 |
A new Pull Request was created by @Sam-Harper for master. It involves the following packages: EgammaAnalysis/ElectronTools @perrotta, @monttj, @cmsbuild, @slava77, @gpetruc, @arizzi can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins. |
@Sam-Harper My rough estimate is that this will take until about Wednesday (Mar 14) to review and sign off for the master. |
The smearing is currently enabled. It can be disabled with a bool switch. The smearing will effect the data as it enters the energy error. @shervin86 can give a full explanation this more eloquently than me |
On the time estimate, the miniAOD production can start without this, this is an ongoing discussion with PC and PPD. What remains is that it is mandatory for this to be applied for all CMS analyses using this data. Therefore I want this in the release regardless whether it makes it to the re-miniAOD. And back ported to 9_4 (with it all disabled if needs be). This is a simple consequence of having high standards for code in the release now, things take longer, we had a working ready to go PR submitted. It got rejected due to code standards last week and it takes time to re-write and understand things. This will ultimately benefit us in the future. If it means that either the reminiAOD takes a bit longer or analysers have to suffer a bit with recipes, well that was the choice made. |
On 3/8/18 8:05 AM, Sam-Harper wrote:
The smearing is currently enabled. It can be disabled with a bool switch.
The smearing will effect the data as it enters the energy error.
@shervin86 <https://github.com/shervin86> can give a full explanation
this more eloquently than me
I was expecting the following is done:
a . having smeared energies accessible in miniAOD MC is of value,
keeping the un-smeared ones from the default accessors
|
Okay, will turn off the MC for now. The final decision on this is not taken though. |
The code-checks are being triggered in jenkins. |
done. It just occurred to me that to save a little bit of space, I didnt store the corrected ECAL energy as its trivally a function of other stored numbers. But given its not applied by default now I think its better to store another 4 floats which this information. If you agree, I'll update the PR later to do this as I have other issues to attend to |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-22531/3846 |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
unhold |
+1
|
Comparison is ready Comparison Summary:
|
@smuzaffar
It seems a bit crazy these days to have a copy out take 35 mins. |
@slava77 , last time I check it was still on high bandwidth connection :-) |
Archiving should be a good thing to do. |
+1 basis for 94X reminiAODv2, not affecting 2018 |
@slava77 , comparison files are avialable here /afs/cern.ch/work/m/muzaffar/public/PR22531.tar.gz |
merge |
Dear All,
This is mostly a complete re-write of the E/gamma Scale & Smearing code to bring it up to minimal acceptable standards. This code is not perfect, many things could be done better but perfect is the enemy of good. It is functionally equivalent to #22308
This is step one in an evolution of E/gamma energy correctors. You will notice significant ground work has been done in energy regression management. It is a future goal to remove the badness that is "EGExtraInfoModifierFromDB" and instead have the regression all calculated in simple classes which can be wrapped in producers or modifiers as we see fit.
Guide to changes:
ReducedEGProducer has been modified to allow the energy to be changed inside it. In hindsight, it would be have been better to have a general modification framework rather than such a specific hardcoded option. It is the easiest option here to modify the electrons rather an introduce another intermediate step. A reminder, VID re-run on the miniAOD output must give identical results hence ReducedEGProducer needs to already have any modifiers applied to it. Note, I am still "abusing" the PFClusterIsolation maps, this will be fixed by just renaming the parameters to something more neutral
All the classes in EgammaAnalysis/ElectronTools needed for scale & smearing have been put into RecoEgamma/EgammaTools. The classes have been substantially re-written, although the original design is clearly recognizable. They are as follows
EnergyScaleCorrection
The class which reads the scale & smearing corrections from a file and then returns the ones appropriate for an electron/photon. The information is now encapsulated in sub classes ScaleCorrection and SmearCorrection which contain the information for a given e/gamma object. In general, I dislike the reading mechanism, its all kinds of awful. However it is what we have. In the future, this should be either in the database or at the very least some sort of nice json/xml format.
PhotonEnergyCalibrator
Uses the energy scale correction class to calculate the new corrected energies and systmatic variations. Uses a deterministic random number based on run/event/lumi/supercluster seed id/#crystals in SC for the smearing. Note the smearing does effect the data, it enters in the error of the energy.
ElectronEnergyCalibrator
The electron equivalent class of PhotonEnergyCalibrator. Diffs because electrons energy is ECAL-Trk combined and the corrections apply solely to the ECAL energy. This complicates things, and is why I had to start to overhaul the regression code as it needs to re-apply the ecal-track regression starting from the new corrected energy. Obviously having two parallel codes doing exactly the same thing is unacceptable, this is why the class EpCombinationTool which does this is designed to as a drop in replacement for the code in "EGExtraInfoModifierFromDB". This hasnt been swapped over yet but will be in a future PR. Note I'm about 90% of the way to being able to fully template this with PhotonEnergyCalibrator but it wont happen for this PR.
CalibratedElectronProducerT, CalibratedPhotonProducerT
The produces which write the output of PhotonEnergyCalibrator , ElectronEnergyCalibrator to a file. Optionally writes out a new collection of calibrated eles/phos
Proto Regression Changes:
As mentioned the ElectronEnergyCalibrator needs to reapply the ecal-track regression. The following classes facilitate this
EpCombinationTool
applies the ECAL-Track regression. Intended to replace the code : https://github.com/cms-sw/cmssw/blob/CMSSW_9_4_0/RecoEgamma/EgammaTools/plugins/EGExtraInfoModifierFromDB.cc#L481-L542 and instead wrap it up in a nice little function
EgammaRegressionContainer
e/gamma regressions are binned in et, eta and saturation. This simply contains the the 4 regressions and allows the correct value to be returned based on et/eta/saturation. Also contains the range values rather than hardcoding them in the .cc.
Allows code such as this : https://github.com/cms-sw/cmssw/blob/CMSSW_9_4_0/RecoEgamma/EgammaTools/plugins/EGExtraInfoModifierFromDB.cc#L438-L462 to be replaced
Future evolution:
I am now re-running my longer validations these are