ATLAS Offline Software
Loading...
Searching...
No Matches
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
29
31public:
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
58private:
65
69 void formNewPairsWithX(const int xval);
70 void formNewPairsWithY(const int yval);
72
73};
74
76std::ostream& operator<< (std::ostream& os, const PairBuilder& e);
77
78#endif
std::ostream & operator<<(std::ostream &os, const PairBuilder &e)
Overloaded "operator <<" for output of PairBuilder objects.
Class to build pairs of XY values.
Definition PairBuilder.h:30
int xOfPairAt(const int indx) const
Return the X value of a specific pair.
IntSet m_yvalues
Definition PairBuilder.h:61
void formNewPairsWithY(const int yval)
int numberOfPairs() const
Return the number of XY pairs made.
const PairVector & pairs() const
Return the pairs as a vector of pairs of integers.
float weight() const
Return the 'weight', = 1/(number of pairs)
void inputy(const int ystrip)
Input a new y value.
void inputx(const int xstrip)
Input a new x value.
int yOfPairAt(const int indx) const
Return the Y value of a specific pair.
std::vector< XYPair > PairVector
Definition PairBuilder.h:36
void inputxy(const int ystrip)
Input a new y value.
void formNewPairsWithX(const int xval)
PairVector m_pairs
Vector to hold the pairs produced.
Definition PairBuilder.h:66
std::set< int > IntSet
Definition PairBuilder.h:37
std::pair< int, int > XYPair
Definition PairBuilder.h:35
XYPair pairAtIndex(const int indx) const
Return a specific XY pair at some vector index.
IntSet m_xvalues
use sets to avoid duplicate values
Definition PairBuilder.h:63