-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36257 from CTPPS/pps-alignment-global
PPS global alignment - reformat
- Loading branch information
Showing
20 changed files
with
309 additions
and
1,306 deletions.
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 ([email protected]) | ||
* Mateusz Kocot ([email protected]) | ||
****************************************************************************/ | ||
|
||
#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
341 changes: 168 additions & 173 deletions
341
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 ([email protected]) | ||
* Mateusz Kocot ([email protected]) | ||
****************************************************************************/ | ||
|
||
#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
Oops, something went wrong.