Skip to content

Commit

Permalink
Change ISyst to InteractionProxy rather than std record
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasales committed Feb 26, 2024
1 parent b9622ba commit 21a9d8b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
14 changes: 7 additions & 7 deletions CAFAna/Core/ISyst.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ namespace ana
//----------------------------------------------------------------------
ISyst::ISyst(const std::string& shortName,
const std::string& latexName,
bool applyPenalty,
double min,
double max,
double cv)
: INamed(shortName, latexName), fApplyPenalty(applyPenalty), fMin(min), fMax(max), fCentral(cv)
bool applyPenalty,
double min,
double max)
: _ISyst(shortName, latexName), fApplyPenalty(applyPenalty), fMin(min), fMax(max)
{
Registry<ISyst>::Register(this);
}
Expand All @@ -31,8 +30,9 @@ namespace ana
{
if(fApplyPenalty){
// Regular quadratic penalty term
// Error is always 1, so can ignore that
return (x-fCentral)*(x-fCentral);
return x*x;
// Error is always 1, so can ignore that (are we doing that??)
//return (x-fCentral)*(x-fCentral);
}
else{
// Otherwise, no penalty within range, but still apply one outside
Expand Down
48 changes: 24 additions & 24 deletions CAFAna/Core/ISyst.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#include "CAFAna/Core/FwdDeclare.h"

#include "CAFAna/Core/INamed.h"
#include "cafanacore/ISyst.h"

#include <list>

Expand All @@ -15,21 +14,21 @@ namespace ana
///
/// The Shift() function alters the \ref caf::StandardRecord or the weight
/// associated with the event.
class ISyst : public INamed
class ISyst: public _ISyst<caf::SRInteractionProxy>
{
public:
ISyst(const std::string& shortName,
const std::string& latexName,
bool applyPenalty = true,
double min = -3,
double max = +3,
double cv = 0);
ISyst(const ISyst &) = delete; // no copying.
ISyst(ISyst && rhs) = delete; // no moving either.
bool applyPenalty = true,
double min = -3,
double max = +3);
// double cv = 0);
//ISyst(const ISyst &) = delete; // no copying.
//ISyst(ISyst && rhs) = delete; // no moving either.
virtual ~ISyst();

void operator=(const ISyst &) = delete; // still no copying.
void operator=(ISyst &&) = delete; // etc.
// void operator=(const ISyst &) = delete; // still no copying.
//void operator=(ISyst &&) = delete; // etc.

virtual double Penalty(double x) const;

Expand All @@ -40,20 +39,21 @@ namespace ana
virtual double Min() const{return fMin;}
virtual double Max() const{return fMax;}

/// Set the central value used
virtual void SetCentral(double val) const{fCentral = val;}
///// Set the central value used
// virtual void SetCentral(double val) const{fCentral = val;}

/// Return the central value used
virtual double Central() const{return fCentral;}
///// Return the central value used
//virtual double Central() const{return fCentral;}

/// \brief Perform the systematic shift
///
/// \param sigma Number of sigma to shift record by
/// \param sr The record to inspect and alter
/// \param weight Scale this weight for reweighting systematics
virtual void Shift(double sigma,
caf::SRProxy* sr,
double& weight) const = 0;
// Is this even usegul?
///// \brief Perform the systematic shift
/////
///// \param sigma Number of sigma to shift record by
///// \param sr The record to inspect and alter
///// \param weight Scale this weight for reweighting systematics
//virtual void Shift(double sigma,
// caf::SRProxy* sr,
// double& weight) const = 0;

/// PredictionInterp normally interpolates between spectra made at
/// +/-1,2,3sigma. For some systematics that's overkill. Override this
Expand All @@ -67,7 +67,7 @@ namespace ana
bool fApplyPenalty;
double fMin;
double fMax;
mutable double fCentral; // I make no apologies for this
//mutable double fCentral; // I make no apologies for this
};

} // namespace

1 comment on commit 21a9d8b

@mcasales
Copy link
Member Author

Choose a reason for hiding this comment

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

I must've said change class to _ISyst instead of INamed

Please sign in to comment.