ATLAS Offline Software
Loading...
Searching...
No Matches
APEvtWeight.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
17
18#ifndef APEvtWeight_h
19#define APEvtWeight_h
20
21#include "TNamed.h"
22#include <vector>
23
24class APWeightEntry;
25
26class APEvtWeight : public TNamed {
27
28public:
30
32 virtual ~APEvtWeight();
33 void AddWeightToEvt(APWeightEntry* weight);
34
35 double GetWeight();
36 double GetStdDev();
37 double GetVariance();
38 double GetSysUncert();
39 double GetSysVariance();
40
41 std::vector< APWeightEntry* > GetWeightObjects(ObjType type);
42 unsigned long NEntries();
44
45 const friend APEvtWeight operator&&(const APEvtWeight& a_in, const APEvtWeight& b_in);
46 const friend APEvtWeight operator||(const APEvtWeight& a_in, const APEvtWeight& b_in);
47 const friend APEvtWeight operator!(const APEvtWeight& a_in);
48
49 ClassDef(APEvtWeight,1)
50
52 void Compute();
54 unsigned long int m_n_entries;
56 double m_variance;
60};
61
62#endif
#define protected
Class to calculate the sum of weights ("weighted counter")
Definition APEvtWeight.h:26
ClassDef(APEvtWeight, 1) protected std::vector< std::vector< APWeightEntry * > > m_current_evt_weights
< Calculates the event weight for the current entries.
Definition APEvtWeight.h:49
double GetVariance()
Returns the variance.
double GetStdDev()
Returns the standard deviation.
unsigned long int m_n_entries
Holds the original amount of unweighted counts ("sum of 1's").
Definition APEvtWeight.h:54
ObjType GetType()
Returns the type of the event weight (muon, electron, jet, ANDed, ORed).
APEvtWeight(ObjType type)
Default constructor.
double GetSysUncert()
Returns the systematic uncertainty (from systematics assigned to weights).
virtual ~APEvtWeight()
Default destructor.
const friend APEvtWeight operator!(const APEvtWeight &a_in)
Operator implementing negation of weight.
const friend APEvtWeight operator||(const APEvtWeight &a_in, const APEvtWeight &b_in)
Operator implementing logical OR.
bool m_isComputed
Flag if calculation has already been performed for current set of input weights.
Definition APEvtWeight.h:58
void AddWeightToEvt(APWeightEntry *weight)
Adds a weight to the sum of weights.
double m_variance
Holds the variance.
Definition APEvtWeight.h:56
double m_k_evt_weight
Holds the event weight.
Definition APEvtWeight.h:55
unsigned long NEntries()
Returns the unweighted number of entries.
double GetWeight()
Returns the event weight.
const friend APEvtWeight operator&&(const APEvtWeight &a_in, const APEvtWeight &b_in)
Operator implementing logical AND.
ObjType m_type
Holds the object type of the event weight (muon, electron, jet or combined).
Definition APEvtWeight.h:59
std::vector< APWeightEntry * > GetWeightObjects(ObjType type)
Returns the vector of weight objects for a specific object type.
double m_variance_sys
Holds the systematic variance (from systematics assigned to weights).
Definition APEvtWeight.h:57
double GetSysVariance()
Returns the systematic variance (from systematics assigned to weights).
Class to store a single weight entry (one bin).
STL namespace.