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

Changing linkage of the "timeshift_ns_hbheho" function to external #14957

Merged
merged 4 commits into from Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions RecoLocalCalo/HcalRecAlgos/interface/timeshift_ns_hbheho.h
@@ -0,0 +1,14 @@
#ifndef RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_
#define RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_

///Timeshift correction for HPDs based on the position of the peak ADC measurement.
/// Allows for an accurate determination of the relative phase of the pulse shape from
/// the HPD. Calculated based on a weighted sum of the -1,0,+1 samples relative to the peak
/// as follows: wpksamp = (0*sample[0] + 1*sample[1] + 2*sample[2]) / (sample[0] + sample[1] + sample[2])
/// where sample[1] is the maximum ADC sample value.
float timeshift_ns_hbheho(float wpksamp);

/// Special energy correction for some HB- cells
float hbminus_special_ecorr(int ieta, int iphi, double energy, int runnum);
Copy link
Contributor

Choose a reason for hiding this comment

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

since there are two methods declared here now, the timeshift_ns_hbheho.h file name is no longer intuitive.
Please rename to something more comprising.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no idea what is intuitive for you. It is intuitive enough for me.
If you want it renamed, suggest a name.

On 06/26/2016 11:06 AM, Slava Krutelyov wrote:

In RecoLocalCalo/HcalRecAlgos/interface/timeshift_ns_hbheho.h #14957 (comment):

@@ -0,0 +1,14 @@
+#ifndef RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_
+#define RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_
+
+///Timeshift correction for HPDs based on the position of the peak ADC measurement.
+/// Allows for an accurate determination of the relative phase of the pulse shape from
+/// the HPD. Calculated based on a weighted sum of the -1,0,+1 samples relative to the peak
+/// as follows: wpksamp = (0_sample[0] + 1_sample[1] + 2*sample[2]) / (sample[0] + sample[1] + sample[2])
+/// where sample[1] is the maximum ADC sample value.
+float timeshift_ns_hbheho(float wpksamp);
+
+/// Special energy correction for some HB- cells
+float hbminus_special_ecorr(int ieta, int iphi, double energy, int runnum);

since there are two methods declared here now, the timeshift_ns_hbheho.h file name is no longer intuitive.
Please rename to something more comprising.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/cms-sw/cmssw/pull/14957/files/0f0937650a7012d4c9a9a387e9ebb0997eb4842c#r68505180, or mute the thread
https://github.com/notifications/unsubscribe/AFS4-ciRrWqRBHpzU8FAYDSB32ivTLTfks5qPqN2gaJpZM4I8hdG.

Copy link
Contributor

Choose a reason for hiding this comment

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

a file named timeshift containing energy correction is not intuitive.
CorrectionFunctions.h may be well covering what's here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine. Renamed into HcalCorrectionFunctions.h

On 06/26/2016 12:38 PM, Slava Krutelyov wrote:

In RecoLocalCalo/HcalRecAlgos/interface/timeshift_ns_hbheho.h #14957 (comment):

@@ -0,0 +1,14 @@
+#ifndef RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_
+#define RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_
+
+///Timeshift correction for HPDs based on the position of the peak ADC measurement.
+/// Allows for an accurate determination of the relative phase of the pulse shape from
+/// the HPD. Calculated based on a weighted sum of the -1,0,+1 samples relative to the peak
+/// as follows: wpksamp = (0_sample[0] + 1_sample[1] + 2*sample[2]) / (sample[0] + sample[1] + sample[2])
+/// where sample[1] is the maximum ADC sample value.
+float timeshift_ns_hbheho(float wpksamp);
+
+/// Special energy correction for some HB- cells
+float hbminus_special_ecorr(int ieta, int iphi, double energy, int runnum);

a file named timeshift containing energy correction is not intuitive.
CorrectionFunctions.h may be well covering what's here.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/cms-sw/cmssw/pull/14957/files/0f0937650a7012d4c9a9a387e9ebb0997eb4842c#r68506304, or mute the thread
https://github.com/notifications/unsubscribe/AFS4-QiZlp5TynSgw4i4oQb5CLYCC_g-ks5qPrj-gaJpZM4I8hdG.

Copy link
Contributor

Choose a reason for hiding this comment

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

thank you.


#endif // RecoLocalCalo_HcalRecAlgos_timeshift_ns_hbheho_h_
27 changes: 9 additions & 18 deletions RecoLocalCalo/HcalRecAlgos/src/HcalSimpleRecAlgo.cc
Expand Up @@ -3,6 +3,7 @@
#include "CalibCalorimetry/HcalAlgos/interface/HcalTimeSlew.h"
#include "RecoLocalCalo/HcalRecAlgos/src/HcalTDCReco.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/rawEnergy.h"
#include "RecoLocalCalo/HcalRecAlgos/interface/timeshift_ns_hbheho.h"
#include "DataFormats/METReco/interface/HcalCaloFlagLabels.h"

#include <algorithm>
Expand Down Expand Up @@ -107,19 +108,9 @@ void HcalSimpleRecAlgo::setBXInfo(const BunchXParameter* info,
lenBunchCrossingInfo_ = lenInfo;
}

///Timeshift correction for HPDs based on the position of the peak ADC measurement.
/// Allows for an accurate determination of the relative phase of the pulse shape from
/// the HPD. Calculated based on a weighted sum of the -1,0,+1 samples relative to the peak
/// as follows: wpksamp = (0*sample[0] + 1*sample[1] + 2*sample[2]) / (sample[0] + sample[1] + sample[2])
/// where sample[1] is the maximum ADC sample value.
static float timeshift_ns_hbheho(float wpksamp);

///Same as above, but for the HF PMTs.
///Timeshift correction for the HF PMTs.
static float timeshift_ns_hf(float wpksamp);

/// Ugly hack to apply energy corrections to some HB- cells
static float eCorr(int ieta, int iphi, double ampl, int runnum);

/// Leak correction
static float leakCorr(double energy);

Expand Down Expand Up @@ -396,9 +387,9 @@ namespace HcalSimpleRecAlgoImpl {
if (cell.subdet() == HcalBarrel) {
const int ieta = cell.ieta();
const int iphi = cell.iphi();
uncorr_ampl *= eCorr(ieta, iphi, uncorr_ampl, runnum);
ampl *= eCorr(ieta, iphi, ampl, runnum);
m3_ampl *= eCorr(ieta, iphi, m3_ampl, runnum);
uncorr_ampl *= hbminus_special_ecorr(ieta, iphi, uncorr_ampl, runnum);
ampl *= hbminus_special_ecorr(ieta, iphi, ampl, runnum);
m3_ampl *= hbminus_special_ecorr(ieta, iphi, m3_ampl, runnum);
}
}

Expand Down Expand Up @@ -504,9 +495,9 @@ namespace HcalSimpleRecAlgoImpl {
if (cell.subdet() == HcalBarrel) {
const int ieta = cell.ieta();
const int iphi = cell.iphi();
uncorr_ampl *= eCorr(ieta, iphi, uncorr_ampl, runnum);
ampl *= eCorr(ieta, iphi, ampl, runnum);
m3_ampl *= eCorr(ieta, iphi, m3_ampl, runnum);
uncorr_ampl *= hbminus_special_ecorr(ieta, iphi, uncorr_ampl, runnum);
ampl *= hbminus_special_ecorr(ieta, iphi, ampl, runnum);
m3_ampl *= hbminus_special_ecorr(ieta, iphi, m3_ampl, runnum);
}
}

Expand Down Expand Up @@ -665,7 +656,7 @@ HFRecHit HcalSimpleRecAlgo::reconstructHFUpgrade(const HcalUpgradeDataFrame& dig


/// Ugly hack to apply energy corrections to some HB- cells
float eCorr(int ieta, int iphi, double energy, int runnum) {
float hbminus_special_ecorr(int ieta, int iphi, double energy, int runnum) {
// return energy correction factor for HBM channels
// iphi=6 ieta=(-1,-15) and iphi=32 ieta=(-1,-7)
// I.Vodopianov 28 Feb. 2011
Expand Down