-
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
PPS global alignment - reformat #36257
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a20f497
Small reformat
MatiXOfficial 03b1ef1
Moved fitProfile to utils.h.
MatiXOfficial b11b4ab
Added reasonability ranges to the harvester.
MatiXOfficial e217f09
Replaced folder variables with the ones with more reasonable names.
MatiXOfficial 0b6542a
AlignmentGlobal package reformat
MatiXOfficial 34b2e20
Moved a small part of the code to a new SlicePlots method.
MatiXOfficial e4c27fa
Updated the READMEs in AlignmentGlobal.
MatiXOfficial 9252c9b
Changed the tag in the AlignmentGlobal test config.
MatiXOfficial 88d93fd
Added comments to the PPSAlignmentConfig classes to mark them obsolete.
MatiXOfficial 9e64eea
Deleted obsolete files and lines of code related with PPSAlignmentCon…
MatiXOfficial 21fb68d
Updated logging categories in the AlignmentGlobal plugins.
MatiXOfficial File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<export> | ||
<lib name="1"/> | ||
</export> | ||
<use name="rootcore"/> | ||
<use name="rootgraphics"/> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/**************************************************************************** | ||
* Authors: | ||
* Jan Kašpar (jan.kaspar@gmail.com) | ||
* Mateusz Kocot (mateuszkocot99@gmail.com) | ||
****************************************************************************/ | ||
|
||
#ifndef CalibPPS_AlignmentGlobal_utils_h | ||
#define CalibPPS_AlignmentGlobal_utils_h | ||
|
||
#include "TProfile.h" | ||
|
||
namespace alig_utils { | ||
|
||
// Fits a linear function to a TProfile. | ||
int fitProfile(TProfile* p, | ||
double x_mean, | ||
double x_rms, | ||
unsigned int minBinEntries, | ||
unsigned int minNBinsReasonable, | ||
double& sl, | ||
double& sl_unc); | ||
|
||
} // namespace alig_utils | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
248 changes: 119 additions & 129 deletions
248
CalibPPS/AlignmentGlobal/plugins/PPSAlignmentHarvester.cc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/**************************************************************************** | ||
* Authors: | ||
* Jan Kašpar (jan.kaspar@gmail.com) | ||
* Mateusz Kocot (mateuszkocot99@gmail.com) | ||
****************************************************************************/ | ||
|
||
#include "CalibPPS/AlignmentGlobal/interface/utils.h" | ||
|
||
#include "TF1.h" | ||
|
||
#include <memory> | ||
|
||
// Fits a linear function to a TProfile. | ||
int alig_utils::fitProfile(TProfile* p, | ||
double x_mean, | ||
double x_rms, | ||
unsigned int minBinEntries, | ||
unsigned int minNBinsReasonable, | ||
double& sl, | ||
double& sl_unc) { | ||
unsigned int n_reasonable = 0; | ||
for (int bi = 1; bi <= p->GetNbinsX(); bi++) { | ||
if (p->GetBinEntries(bi) < minBinEntries) { | ||
p->SetBinContent(bi, 0.); | ||
p->SetBinError(bi, 0.); | ||
} else { | ||
n_reasonable++; | ||
} | ||
} | ||
|
||
if (n_reasonable < minNBinsReasonable) | ||
return 1; | ||
|
||
double x_min = x_mean - x_rms, x_max = x_mean + x_rms; | ||
|
||
auto ff_pol1 = std::make_unique<TF1>("ff_pol1", "[0] + [1]*x"); | ||
|
||
ff_pol1->SetParameter(0., 0.); | ||
p->Fit(ff_pol1.get(), "Q", "", x_min, x_max); | ||
|
||
sl = ff_pol1->GetParameter(1); | ||
sl_unc = ff_pol1->GetParError(1); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should there be a real exception thrown if somebody wants to use this? I'm not sure a single comment in the code is sufficient to stop people to use it haha
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 just wanted to make sure no one is confused when they see two very similar classes in one directory, but throwing an exception is a good idea too. I'll add it.
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 the module is obsolete, what's the reason to keep it in the code-base?
Are there still clients of it?
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.
PPSAlignmentConfiguration
has fully replacedPPSAlignmentConfig
, so nobody will use its ESSource in the future. To be honest, I wanted to delete all thePPSAlignmentConfig
auxiliary classes in one of the previous PRs (#35174 (comment)), but eventually we decided to keep them. Do you suggest to delete them now?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.
the less code is in the stack, the less maintenance it will require. If the functionality is fully replaced by other modules, deleting the obsolete files sounds like a good option (and will also automatically enforce that nobody uses them by mistake).
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.
Ok then, I'll delete them. Am I right though that I can't delete the
PPSAlignmentConfig
class? It has a few payloads in the DB.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.
provided they are not included in any
autoCond
GlobalTag you technically could delete the C++ class as well, though if I am not mistaken AlCa/DB discourages that practice @cms-sw/alca-l2 can comment further.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.
Ok, thanks! I will leave the class for now.