MarlinTPC  1.2.0
NeighbouringPadHandler.h
1 #ifndef NEIGHBOURING_PAD_HANDLER_H
2 #define NEIGHBOURING_PAD_HANDLER_H
3 
4 #include <vector>
5 #include <map>
6 
7 namespace marlintpc
8 {
9 
17  {
18 
19  public:
20 
23 
25  NeighbouringPadsObject(const NeighbouringPadsObject& originalObject);
26 
28  NeighbouringPadsObject(const int padIndex);
29 
31  std::vector<int> getPrecedingPads() const;
32 
34  std::vector<int> getSucceedingPads() const;
35 
37  void addNeighbouringPad(const int padIndex);
38 
40  void setPadSideRowCoordinates(double cLeft, double cRight);
41 
43  double getLeftSide() const;
44 
46  double getRightSide() const;
47 
49  int getPadIndex() const;
50 
51  protected:
52 
53  int _thisPadsPadIndex;
54 
57 
58  std::vector<int> _precedingPads;
59  std::vector<int> _succeedingPads;
60 
61  };
62 
64  {
65  public:
66 
69 
71  bool areNeighbouringPads(int moduleIndex, int padIndex1, int padIndex2) const;
72 
75  int getSmallestNeighbouringPadIndex(int moduleIndex, int padIndex) const;
76 
79  int getLargestNeighbouringPadIndex(int moduleIndex, int padIndex) const;
80 
82  std::vector<int> getPrecedingNeighbouringPads(int moduleIndex, int padIndex) const;
83 
85  std::vector<int> getSucceedingNeighbouringPads(int moduleIndex, int padIndex) const;
86 
88  NeighbouringPadsObject* getNeighbouringPadsObject(int moduleIndex, int padIndex);
89 
90  protected:
91 
92  std::map<int, std::map<int, NeighbouringPadsObject> > _endPlateMap;
93 
94  };
95 } // namespace marlintpc
96 
97 #endif // NEIGHBOURING_PAD_HANDLER_H
void addNeighbouringPad(const int padIndex)
Adds a Pad Index to either the vector of preceding or successing pads.
Definition: NeighbouringPadHandler.cc:59
int getSmallestNeighbouringPadIndex(int moduleIndex, int padIndex) const
Returns the smallest pad index of all the neighbouring pads of the given one.
Definition: NeighbouringPadHandler.cc:317
int getLargestNeighbouringPadIndex(int moduleIndex, int padIndex) const
Returns the largest pad index of all the neighbouring pads of the given one.
Definition: NeighbouringPadHandler.cc:335
Definition: NeighbouringPadHandler.h:63
A helper class which stores information about the neighbouring pads of a specific pad...
Definition: NeighbouringPadHandler.h:16
void setPadSideRowCoordinates(double cLeft, double cRight)
Set the x- or phi-coordinates of the corners of the pad.
Definition: NeighbouringPadHandler.cc:77
std::vector< int > getPrecedingNeighbouringPads(int moduleIndex, int padIndex) const
Returns a vector with all the neighbouring pads with a smaller pad index.
Definition: NeighbouringPadHandler.cc:342
int getPadIndex() const
Returns the pad index of the pad.
Definition: NeighbouringPadHandler.cc:96
double _leftRowCoordinate
x or phi-coordinate of the left corner of the pad
Definition: NeighbouringPadHandler.h:55
NeighbouringPadsObject * getNeighbouringPadsObject(int moduleIndex, int padIndex)
Returns a pointer to the NeighbouringPadsObject of the specified pad- and module index.
Definition: NeighbouringPadHandler.cc:356
double getRightSide() const
Returns the x- or phi-coordinate of the right side of the pad.
Definition: NeighbouringPadHandler.cc:90
double getLeftSide() const
Returns the x- or phi-coordinate of the left side of the pad.
Definition: NeighbouringPadHandler.cc:84
NeighbouringPadHandler()
Constructor. The maps with information about neighbours are initialized here.
Definition: NeighbouringPadHandler.cc:105
std::vector< int > getSucceedingNeighbouringPads(int moduleIndex, int padIndex) const
Returns a vector with all the neighbouring pads with a larger pad index.
Definition: NeighbouringPadHandler.cc:349
double _rightRowCoordinate
x or phi-coordinate of the right corner of the pad
Definition: NeighbouringPadHandler.h:56
std::vector< int > getPrecedingPads() const
Returns a vector with all the neighbouring pads with a smaller pad index.
Definition: NeighbouringPadHandler.cc:47
bool areNeighbouringPads(int moduleIndex, int padIndex1, int padIndex2) const
The test function. It returns true, if.
Definition: NeighbouringPadHandler.cc:268
std::vector< int > getSucceedingPads() const
Returns a vector with all the neighbouring pads with a larger pad index.
Definition: NeighbouringPadHandler.cc:53
std::map< int, std::map< int, NeighbouringPadsObject > > _endPlateMap
Map of all pads of the GEAR geometry. First index is for modules, second for pads.
Definition: NeighbouringPadHandler.h:92
NeighbouringPadsObject()
Default Constructor, needed for pointers.
Definition: NeighbouringPadHandler.cc:25