PandaRoot
PndEmcTwoCoordIndex.h
Go to the documentation of this file.
1 //======================================================================
2 // Class PndEmcTwoCoordIndex
3 //
4 // Software developed for the BaBar Detector at the SLAC B-Factory.
5 // Adapted for the PANDA experiment at GSI
6 //
7 // Class to hold coordinate and index information
8 // for system in which two co-ordinates specifies a channel uniquely.
9 // (Simplified version of class taken from BABAR framework)
10 // It is convenient to use 2-coordinate index to describe barel part of EMC
11 // to search for neigbour crystals in clustering algorithms
12 //
13 //
14 // Author List:
15 //
16 // Phil Strother Imperial College
17 // Stephen J. Gowdy University of Edinburgh
18 // Dima Melnichuk - adaption for PANDA
19 //
20 //======================================================================
21 //#pragma once
22 #ifndef PNDEMCTWOCOORDINDEX_H
23 #define PNDEMCTWOCOORDINDEX_H
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 #include "iostream"
29 #include "stdlib.h"
30 //#include <vector>
31 #include "TObject.h"
32 #include "PndEmcDataTypes.h"
33 
34 using std::cout;
35 using std::endl;
36 
41 class PndEmcTwoCoordIndex : public TObject {
42  public:
43  // Constructors
45  PndEmcTwoCoordIndex(long theXcoord, long theYcoord, long theIndex);
46 
47  // Destructors
48 
49  // destructor in base class
50  virtual ~PndEmcTwoCoordIndex();
51 
52  // Operators
53  bool operator==(const PndEmcTwoCoordIndex &c) const { return fIndex == c.fIndex; }
54  bool operator!=(const PndEmcTwoCoordIndex &c) const { return fIndex != c.fIndex; }
55 
56  bool operator<(const PndEmcTwoCoordIndex &) const;
57 
58  virtual const PndEmcCoordIndexSet GetNeighbours() const;
59 
60  long XCoord() const { return fCoords[0]; }
61  long YCoord() const { return fCoords[1]; }
62  long Index() const { return fIndex; }
63 
65 
66  // check if 2 tci are neigbour or not
67  bool IsNeighbour(PndEmcTwoCoordIndex *_tci);
68 
69  protected:
70  long fCoords[2];
71  long fIndex;
73 
74  private:
75  ClassDef(PndEmcTwoCoordIndex, 1)
76 };
77 
78 #endif // PNDEMCTWOCOORDINDEX_HH
stores crystal index coordinates (x,y) or (theta,phi)
bool operator!=(const PndEmcTwoCoordIndex &c) const
bool operator<(const PndEmcTwoCoordIndex &) const
virtual void AddToNeighbourList(PndEmcTwoCoordIndex *)
virtual const PndEmcCoordIndexSet GetNeighbours() const
std::set< PndEmcTwoCoordIndex * > PndEmcCoordIndexSet
bool IsNeighbour(PndEmcTwoCoordIndex *_tci)
bool operator==(const PndEmcTwoCoordIndex &c) const
PndEmcCoordIndexSet fNeighbours
virtual ~PndEmcTwoCoordIndex()