ATLAS Offline Software
BaseTagInfo.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  BaseTagInfo.h - Description
7  -------------------
8  begin : 04-06-2004
9  authors : Andreas Wildauer (CERN PH-ATC), Fredrik Akesson (CERN PH-ATC)
10  email : andreas.wildauer@cern.ch, fredrik.akesson@cern.ch
11  changes :
12 
13  ***************************************************************************/
14 
15 #ifndef JETTAGINFO_BASETAGINFO_H
16 #define JETTAGINFO_BASETAGINFO_H
18 #include <vector>
19 #include <sys/types.h>
20 
21 namespace Analysis
22 {
23 
24  class BaseTagInfoCnv_p1;
25 
31 class BaseTagInfo : public JetTagInfoBase
32 {
33 public:
35  BaseTagInfo();
36 
38  BaseTagInfo(const TagInfoType& x);
39 
42 
44  BaseTagInfo &operator= (const BaseTagInfo& rhs);
45 
47  virtual ~BaseTagInfo();
48 
50  virtual void setTagLikelihood(const std::vector<double>&);
51  virtual void setTagLikelihood(std::vector<double>&&);
52  virtual const std::vector<double>& tagLikelihood(void) const;
53 // virtual double lhSig(void) const; //!< shortcut to retrieve the first element of the tagLikelihood
54  virtual void setWeight(double weight);
55  virtual double weight() const;
56  virtual void makeValid();
57  virtual bool isValid() const;
58  virtual TagInfoType infoType(void) const;
59  virtual BaseTagInfo* clone() const;
60 
61 protected:
62  friend class Analysis::BaseTagInfoCnv_p1;
63  void setValid (bool valid);
64  void setTagJetInfoType (const TagInfoType& type);
65 
66  bool m_isValid;
67  std::vector<double> m_tagLikelihood;
68  double m_weight;
70 }
71 ; // End class
72 
73 inline bool BaseTagInfo::isValid() const
74 {
75  return m_isValid;
76 }
78 {
79  m_isValid = true;
80 }
82 {
83  return m_tagJetInfoType;
84 }
85 inline void BaseTagInfo::setTagLikelihood(const std::vector<double>& tagLikelihood)
86 {
88 }
89 inline void BaseTagInfo::setTagLikelihood(std::vector<double>&& tagLikelihood)
90 {
91  m_tagLikelihood=std::move(tagLikelihood);
92 }
93 inline const std::vector<double>& BaseTagInfo::tagLikelihood(void) const
94 {
95  // in principal the caller has to check if the vector has a length
96  // -> no checking for the size as in the case of lhSig(void)
98 }
99 /*inline double BaseTagInfo::lhSig(void) const
100 {
101  if (m_tagLikelihood.size()>0) return m_tagLikelihood[0];
102  // cannot return anything when likelihood vector has zero length!!
103  else return -1.;
104 }*/
105 inline void BaseTagInfo::setWeight(double weight)
106 {
107  m_weight = weight;
108 }
109 inline double BaseTagInfo::weight(void) const
110 {
111  return (this->isValid() ? m_weight : -19.75);
112 }
114 {
115  return new BaseTagInfo(*this);
116 }
117 inline void BaseTagInfo::setValid (bool valid)
118 {
119  m_isValid = valid;
120 }
122 {
124 }
125 } // End namespace
126 #endif
Analysis::BaseTagInfo::m_tagLikelihood
std::vector< double > m_tagLikelihood
vector to hold the taglikelihood (signal plus N background)
Definition: BaseTagInfo.h:75
Analysis::BaseTagInfo::setTagLikelihood
virtual void setTagLikelihood(const std::vector< double > &)
Return and set methods for the likelihood.
Definition: BaseTagInfo.h:93
JetTagInfoBase.h
Analysis::BaseTagInfo::operator=
BaseTagInfo & operator=(const BaseTagInfo &rhs)
assigenment operator
Definition: BaseTagInfo.cxx:59
Analysis::BaseTagInfo::weight
virtual double weight() const
get the weight of one tagger
Definition: BaseTagInfo.h:117
Analysis::BaseTagInfo::setTagJetInfoType
void setTagJetInfoType(const TagInfoType &type)
Definition: BaseTagInfo.h:129
Analysis::BaseTagInfo::clone
virtual BaseTagInfo * clone() const
a clone method for the proper workings of the copy constructor
Definition: BaseTagInfo.h:121
Analysis::BaseTagInfo::m_isValid
bool m_isValid
true if the tagger could tag the jet, default is false
Definition: BaseTagInfo.h:74
x
#define x
Analysis::BaseTagInfo::infoType
virtual TagInfoType infoType(void) const
returns the infoType of the info objects.
Definition: BaseTagInfo.h:89
Analysis::BaseTagInfo::setWeight
virtual void setWeight(double weight)
set the weight for one tagger
Definition: BaseTagInfo.h:113
JetTagInfoBase
Definition: JetTagInfoBase.h:56
Analysis::BaseTagInfo::makeValid
virtual void makeValid()
sets the isValid flag to true, cannot be reversed!
Definition: BaseTagInfo.h:85
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
Analysis::BaseTagInfo::tagLikelihood
virtual const std::vector< double > & tagLikelihood(void) const
returns the tag likelihood of one tagger
Definition: BaseTagInfo.h:101
calibdata.valid
list valid
Definition: calibdata.py:45
Analysis::BaseTagInfo::setValid
void setValid(bool valid)
Definition: BaseTagInfo.h:125
Analysis::BaseTagInfo::~BaseTagInfo
virtual ~BaseTagInfo()
default destructor
Definition: BaseTagInfo.cxx:72
Analysis::BaseTagInfo
Class BasetagInfo: Implements methods defined in ITagInfo.
Definition: BaseTagInfo.h:40
Analysis::TagInfoType
std::string TagInfoType
Definition: JetTagInfoBase.h:19
Analysis::BaseTagInfo::isValid
virtual bool isValid() const
returns true if the tag was successfull
Definition: BaseTagInfo.h:81
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::BaseTagInfoCnv_p1
Definition: BaseTagInfoCnv_p1.h:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Analysis::BaseTagInfo::BaseTagInfo
BaseTagInfo()
default constructor
Definition: BaseTagInfo.cxx:29
Analysis::BaseTagInfo::m_tagJetInfoType
TagInfoType m_tagJetInfoType
string to hold the info type (specified by the tag tool)
Definition: BaseTagInfo.h:77
Analysis::BaseTagInfo::m_weight
double m_weight
weight for this tag
Definition: BaseTagInfo.h:76