HighLAND
Public Member Functions | Protected Attributes | List of all members
FluxWeightSystematics Class Referenceabstract

This is a normalization systematic. It takes into account the uncertainty on the neutrino flux. More...

#include <FluxWeightSystematics.hxx>

Inheritance diagram for FluxWeightSystematics:
EventWeightBase BinnedParams SystematicBase FluxWeightSystematicsAntiNeutrino FluxWeightSystematicsNeutrino

Public Member Functions

 FluxWeightSystematics (const std::string &name)
 
Weight_h ComputeWeight (const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
 
virtual bool IsCorrectRunPeriod (int runPeriod)=0
 
- Public Member Functions inherited from EventWeightBase
 EventWeightBase ()
 Create the systematic, with one parameter.
 
 EventWeightBase (UInt_t npar)
 Create the systematic, specifying the number of systematic parameters.
 
virtual ~EventWeightBase ()
 Everyone should have a destructor.
 
virtual void InitializeEvent (const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
 Initialize the SystBox for this event.
 
virtual Weight_h ComputeWeight (const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box, const SelectionBase &sel)
 This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled.
 
- Public Member Functions inherited from SystematicBase
 SystematicBase ()
 Create the systematic, with one parameter.
 
 SystematicBase (UInt_t npar)
 Create the systematic, specifying the number of systematic parameters.
 
virtual ~SystematicBase ()
 Everyone should have a destructor.
 
UInt_t GetNParameters () const
 Returns the number of systematic parameters associated to this systematic.
 
void SetNParameters (int N)
 Set the number of systematic parameters associated to this systematic.
 
virtual const char * GetName () const
 Return the name of this systematic. This overrides the TObject::GetName() interface.
 
const std::string & Name () const
 Return the name of this systematic.
 
void SetName (const std::string &name)
 Set the name of this systematic.
 
Int_t GetIndex () const
 Return the index of this systematic.
 
void SetIndex (Int_t index)
 Set the index of this systematic.
 
TypeEnum Type () const
 Return the type of this systematic.
 
std::string ConvertType ()
 Return the type of this systematic.
 
void SetType (TypeEnum type)
 Set the type of this systematic.
 
PDFEnum PDF () const
 Return the PDF of this systematic.
 
std::string ConvertPDF ()
 Return the PDF of this systematic.
 
void SetPDF (PDFEnum PDF)
 Set the PDF of this systematic.
 
void SetEnabled (bool ena)
 Set the enable bit.
 
bool IsEnabled () const
 Returns the enable bit.
 
virtual void FinalizeEvent (const AnaEventC &event)
 Delete the SystBox for this event.
 
SystBoxBGetSystBox (const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
 Get the SystBox corresponding to a selection, branch and event.
 
virtual void Initialize (Int_t nsel, Int_t isel, Int_t nbranch, Int_t nevents)
 Create the array of SystBox.
 
 ClassDef (SystematicBase, 2)
 
- Public Member Functions inherited from BinnedParams
 BinnedParams (const std::string &folder_name, const std::string &name, TypeEnum type, const std::string &extension="", bool useInterpolation=false)
 Constructor provided the folder name, name and the type.
 
 BinnedParams (const std::string &name, TypeEnum type, const std::string &extension="", bool useInterpolation=false)
 Constructor provided the name and the type, this is to make current psycheSystematics work, may remove it.
 
void AddBin (Float_t min, Float_t max, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin for a 1D source.
 
void AddBin (Float_t min, Float_t max, Float_t mean, Float_t sigma)
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin for a 2D source.
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t mean, Float_t sigma)
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin for a 3D source.
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t mean, Float_t sigma)
 
void AddGraphBin (Float_t min, Float_t max, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin graph for a 1D source.
 
void AddGraphBin (Float_t min, Float_t max, Float_t mean, Float_t sigma)
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin graph for a 2D source.
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t mean, Float_t sigma)
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin graph for a 3D source.
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t mean, Float_t sigma)
 
bool GetGraphBin (Float_t value, BinnedParamsGraphBin *&bin)
 Gets the bin for a 2D source.
 
bool GetGraphBin (Float_t value1, Float_t value2, BinnedParamsGraphBin *&bin)
 Gets the bin for a 3D source.
 
bool GetBin (Float_t value, BinnedParamsBin *&bin)
 Gets the bin for a 1D source.
 
bool GetBin (Float_t value1, Float_t value2, BinnedParamsBin *&bin)
 Gets the bin for a 2D source.
 
bool GetBin (Float_t value1, Float_t value2, Float_t value3, BinnedParamsBin *&bin)
 Gets the bin for a 3D source.
 
bool GetBinIndex (Float_t value, Int_t &index)
 Gets the bin index for a 1D source.
 
bool GetParametersForBin (Int_t index, Float_t &mean, Float_t &sigma)
 Gets the bin values for a source provided the bin index.
 
bool GetParametersForBin (Int_t index, BinnedParamsParams &params)
 
bool GetSigmaValueForBin (Int_t index, Float_t &sigma)
 Get only mean or sigma.
 
bool GetMeanValueForBin (Int_t index, Float_t &mean)
 
bool GetBinValues (Float_t value, Float_t &mean, Float_t &sigma)
 Gets the bin values for a 1D source.
 
bool GetBinValues (Float_t value, Float_t &mean, Float_t &sigma, Int_t &index)
 
bool GetBinSigmaValue (Float_t value, Float_t &sigma)
 Get only sigma.
 
bool GetBinSigmaValue (Float_t value, Float_t &sigma, Int_t &index)
 
bool GetBinMeanValue (Float_t value, Float_t &mean)
 
bool GetBinMeanValue (Float_t value, Float_t &mean, Int_t &index)
 
bool GetBinValues (Float_t value, BinnedParamsParams &params)
 
bool GetBinValues (Float_t value, BinnedParamsParams &params, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t &mean, Float_t &sigma)
 Gets the bin values for a 2D source.
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t &mean, Float_t &sigma, Int_t &index)
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t &sigma)
 Get only sigma.
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t &sigma, Int_t &index)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t &mean)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t &mean, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, BinnedParamsParams &params)
 
bool GetBinValues (Float_t value1, Float_t value2, BinnedParamsParams &params, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, Float_t &mean, Float_t &sigma)
 Gets the bin values for a 3D source.
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, Float_t &mean, Float_t &sigma, Int_t &index)
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t value3, Float_t &sigma)
 Get only sigma.
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t value3, Float_t &sigma, Int_t &index)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t value3, Float_t &mean)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t value3, Float_t &mean, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, BinnedParamsParams &params)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, BinnedParamsParams &params, Int_t &index)
 
bool GetInterBinValues (Float_t value1, BinnedParamsParams &params)
 Get values using interpolation.
 
bool GetInterBinValues (Float_t value1, Float_t value2, BinnedParamsParams &params)
 Gets the bin values for a 2D source.
 
bool GetInterBinValues (Float_t value1, Float_t value2, Float_t value3, BinnedParamsParams &params)
 Gets the bin values for a 3D source.
 
void SetType (TypeEnum type)
 Set the type.
 
void SetName (const std::string &name)
 Set the name.
 
void SetInterpolationUsage (bool use)
 Set the name.
 
const std::string & GetDataName ()
 Get the name of the source.
 
TypeEnum GetDataType ()
 Returns the type of the data.
 
bool GetInterpolationStatus ()
 Returns the type of the data.
 
void Print ()
 Dump into the screen the systematic source values.
 
void Read (const std::string &inputDirName, const std::string &extension="")
 Read from a file the systematic source values.
 
Int_t GetNBins ()
 Get the number of bins.
 
bool UpdateEfficiencyCounter (Int_t index, bool correct)
 Update the efficiency variables _ncorrect and _nwrong.
 
void InitializeEfficiencyCounter ()
 Initialize counters.
 
Int_t GetNCorrectAssoc (Int_t index)
 
Int_t GetNWrongAssoc (Int_t index)
 

Protected Attributes

FluxWeighting_flux
 Bit of a hack right now; hopefully future will have the beam polarity as a variable. More...
 
- Protected Attributes inherited from SystematicBase
std::string _name
 The name of this systematic.
 
Int_t _index
 The index of this systematic (needed by SystematicsManager);.
 
TypeEnum _type
 The type of this systematic (variation, weight or flux)
 
bool _enabled
 Is this systematic enabled ?
 
PDFEnum _PDF
 The PDF use for the systematic parameter scan.
 
UInt_t _nParameters
 the number of systematic parameters
 
SystBoxB **** _systBoxes
 ----—— Relevant objects for this systematic ------------—— More...
 
Int_t _systBoxesNSel
 
Int_t _systBoxesNBranches [NMAXSELECTIONS]
 
Int_t _systBoxesNEvents [NMAXSELECTIONS][NMAXBRANCHES]
 

Additional Inherited Members

- Public Types inherited from SystematicBase
enum  TypeEnum { kVariation = 0, kWeight, kFlux, kUnknown }
 Enumerator describing the values that _type member can take.
 
enum  PDFEnum {
  kGaussian = 0, kUniform, kBinomial, kMultinomial,
  kUnknownPDF
}
 Enumerator describing the values that _PDF member can take.
 
- Public Types inherited from BinnedParams
enum  TypeEnum {
  k1D_SYMMETRIC = 0, k2D_SYMMETRIC, k3D_SYMMETRIC, k1D_SYMMETRIC_NOMEAN,
  k2D_SYMMETRIC_NOMEAN, k3D_SYMMETRIC_NOMEAN, k1D_EFF_SYMMETRIC, k2D_EFF_SYMMETRIC,
  k3D_EFF_SYMMETRIC, k1D_EFF_ASSYMMETRIC, k2D_EFF_ASSYMMETRIC, k3D_EFF_ASSYMMETRIC,
  k1D_DATA, k2D_DATA, k3D_DATA, kUnknown
}
 Enumerator describing the values that _type member can take.
 
enum  TypeShortEnum { k1D = 0, k2D, k3D, kUnknownShort }
 
- Protected Member Functions inherited from EventWeightBase
virtual Int_t GetRelevantRecObjectGroups (const SelectionBase &, Int_t ibranch, Int_t *IDs) const
 Get the IDs of the RecObject groups that are relevant for this systematic in a given selection.
 
virtual Int_t GetRelevantTrueObjectGroups (const SelectionBase &, Int_t ibranch, Int_t *IDs) const
 Get the IDs of the TrueObject groups that are relevant for this systematic in a given selection.
 
virtual bool IsRelevantRecObject (const AnaEventC &, const AnaRecObjectC &) const
 Check whether a AnaRecObject is relevant for this systematic or not.
 
virtual bool IsRelevantTrueObject (const AnaEventC &, const AnaTrueObjectC &) const
 Check whether a AnaTrueObject is relevant for this systematic or not.
 
virtual void FillSystBox (const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
 Fills the SystBox.
 
virtual bool CheckTrueRecoAssociation (const AnaTrueObjectC &trueRecObject, const AnaRecObjectC &track) const
 Criteria for true-reco association for this systematic.
 
void FillTrueRecoAssociation (SystBoxB &box)
 Fll the true-reco association array.
 

Detailed Description

This is a normalization systematic. It takes into account the uncertainty on the neutrino flux.

Definition at line 10 of file FluxWeightSystematics.hxx.

Member Function Documentation

§ ComputeWeight()

Weight_h FluxWeightSystematics::ComputeWeight ( const ToyExperiment toy,
const AnaEventC event,
const ToyBoxB box 
)
virtual

This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled This MUST be overridden in the derived class.

Implements EventWeightBase.

Definition at line 20 of file FluxWeightSystematics.cxx.

20  {
21 //********************************************************************
22 
23  const AnaEventB& event = *static_cast<const AnaEventB*>(&eventBB);
24 
25  // Cast the ToyBox to the appropriate type
26  const ToyBoxND280& box = *static_cast<const ToyBoxND280*>(&boxB);
27 
28  Weight_h eventWeight=1;
29 
30  if (event.GetIsSandMC()) return eventWeight; // No weight for sand MC
31  if (!this->IsCorrectRunPeriod(anaUtils::GetRunPeriod(event.EventInfo.Run))) return eventWeight; //should be in the correct run
32  if (!box.TrueVertex) return eventWeight; // True vertex associated to the recon vertex should exist
33 
34  // Get the true neutrino energy
35  Float_t enu = box.TrueVertex->NuEnergy;
36  int type = box.TrueVertex->NuPDG;
37 
38  // Get the flux error values for this energy
39  Float_t mean_dummy;
40  Float_t sigma;
41  Int_t index;
42  if(!GetBinValues(enu, type, mean_dummy, sigma, index)) return eventWeight;
43 
44  // Actual mean from FluxWeighting class
45  Float_t mean= _flux->GetWeight(box.TrueVertex,anaUtils::GetRunPeriod(event.EventInfo.Run));
46 
47  // Compute the weight
48  eventWeight.Systematic = 1 + (mean-1) + sigma * toy.GetToyVariations(_index)->Variations[index];
49  eventWeight.Correction = 1 + (mean-1);
50  if(debug)
51  {
52  std::cout << "Run: " << event.EventInfo.Run << " Enu: " << enu << " type: " << type << " mean " << mean << " sigma " << sigma
53  << " index " << index << " variation " << toy.GetToyVariations(_index)->Variations[index] << " weight " << eventWeight << std::endl;
54  }
55 
56  return eventWeight;
57 
58 }
Int_t _index
The index of this systematic (needed by SystematicsManager);.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
Int_t NuPDG
The PDG code of the incoming neutrino.
AnaTrueVertexB * TrueVertex
For storing the true vertex, for analyses with no reconstructed primary vertex.
Definition: ToyBoxND280.hxx:22
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
Float_t NuEnergy
The true energy of the incoming neutrino.
int GetRunPeriod(int run, int subrun=-1)
Returns the run period (sequentially: 0,1,2,3,4,5 ...)
FluxWeighting * _flux
Bit of a hack right now; hopefully future will have the beam polarity as a variable.
Float_t GetWeight(AnaTrueVertexB *vertex, int RunPeriod)
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)

Member Data Documentation

§ _flux

FluxWeighting* FluxWeightSystematics::_flux
protected

Bit of a hack right now; hopefully future will have the beam polarity as a variable.

Access to the flux weighting.

Definition at line 23 of file FluxWeightSystematics.hxx.


The documentation for this class was generated from the following files: