ATLAS Offline Software
PairBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
14 #ifndef PairBuilder_H
15 #define PairBuilder_H
16 
17 #include <vector>
18 #include <utility>
19 #include <ostream>
20 #include <set>
21 
30 class PairBuilder {
31 public:
32  PairBuilder();
33  ~PairBuilder();
34 
35  typedef std::pair<int, int> XYPair;
36  typedef std::vector< XYPair > PairVector;
37  typedef std::set<int> IntSet;
38 
40  void inputx(const int xstrip);
42  void inputy(const int ystrip);
44  void inputxy(const int ystrip);
46  int numberOfPairs() const;
48  const PairVector& pairs() const;
50  float weight() const;
52  XYPair pairAtIndex(const int indx) const;
54  int xOfPairAt(const int indx) const;
56  int yOfPairAt(const int indx) const;
57 
58 private:
69  void formNewPairsWithX(const int xval);
70  void formNewPairsWithY(const int yval);
72 
73 };
74 
76 std::ostream& operator<< (std::ostream& os, const PairBuilder& e);
77 
78 #endif
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
PairBuilder::PairVector
std::vector< XYPair > PairVector
Definition: PairBuilder.h:36
PairBuilder::formNewPairsWithY
void formNewPairsWithY(const int yval)
Definition: PairBuilder.cxx:66
PairBuilder::pairs
const PairVector & pairs() const
Return the pairs as a vector of pairs of integers.
Definition: PairBuilder.cxx:42
PairBuilder::PairBuilder
PairBuilder()
Definition: PairBuilder.cxx:15
PairBuilder
Class to build pairs of XY values.
Definition: PairBuilder.h:30
PairBuilder::weight
float weight() const
Return the 'weight', = 1/(number of pairs)
Definition: PairBuilder.cxx:45
PairBuilder::m_yvalues
IntSet m_yvalues
Definition: PairBuilder.h:61
PairBuilder::XYPair
std::pair< int, int > XYPair
Definition: PairBuilder.h:35
PairBuilder::yOfPairAt
int yOfPairAt(const int indx) const
Return the Y value of a specific pair.
Definition: PairBuilder.cxx:56
operator<<
std::ostream & operator<<(std::ostream &os, const PairBuilder &e)
Overloaded "operator <<" for output of PairBuilder objects.
Definition: PairBuilder.cxx:73
plotting.yearwise_efficiency_vs_mu.xval
float xval
Definition: yearwise_efficiency_vs_mu.py:35
PairBuilder::inputx
void inputx(const int xstrip)
Input a new x value.
Definition: PairBuilder.cxx:23
PairBuilder::formNewPairsWithX
void formNewPairsWithX(const int xval)
Definition: PairBuilder.cxx:60
PairBuilder::xOfPairAt
int xOfPairAt(const int indx) const
Return the X value of a specific pair.
Definition: PairBuilder.cxx:52
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
PairBuilder::IntSet
std::set< int > IntSet
Definition: PairBuilder.h:37
PairBuilder::numberOfPairs
int numberOfPairs() const
Return the number of XY pairs made.
Definition: PairBuilder.cxx:39
plotting.yearwise_efficiency_vs_mu.yval
float yval
Definition: yearwise_efficiency_vs_mu.py:36
PairBuilder::inputxy
void inputxy(const int ystrip)
Input a new y value.
Definition: PairBuilder.cxx:31
PairBuilder::inputy
void inputy(const int ystrip)
Input a new y value.
Definition: PairBuilder.cxx:27
PairBuilder::m_xvalues
IntSet m_xvalues
use sets to avoid duplicate values
Definition: PairBuilder.h:63
PairBuilder::m_pairs
PairVector m_pairs
Vector to hold the pairs produced.
Definition: PairBuilder.h:66
PairBuilder::~PairBuilder
~PairBuilder()
Definition: PairBuilder.cxx:18
PairBuilder::pairAtIndex
XYPair pairAtIndex(const int indx) const
Return a specific XY pair at some vector index.
Definition: PairBuilder.cxx:48