FairRoot/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 {
43 public:
44 
45  // Constructors
47  PndEmcTwoCoordIndex( long theXcoord, long theYcoord, long theIndex );
48 
49  // Destructors
50 
51  // destructor in base class
52  virtual ~PndEmcTwoCoordIndex();
53 
54 
55  // Operators
56  bool operator==( const PndEmcTwoCoordIndex& c ) const { return fIndex==c.fIndex; }
57  bool operator!=( const PndEmcTwoCoordIndex& c ) const { return fIndex!=c.fIndex; }
58 
59  bool operator<( const PndEmcTwoCoordIndex& ) const;
60 
61  virtual const PndEmcCoordIndexSet GetNeighbours() const;
62 
63  long XCoord() const {return fCoords[0];}
64  long YCoord() const {return fCoords[1];}
65  long Index() const {return fIndex;}
66 
68 
69  //check if 2 tci are neigbour or not
70  bool IsNeighbour(PndEmcTwoCoordIndex* _tci);
71 
72 
73 protected:
74  long fCoords[2];
75  long fIndex;
77 
78 private:
79 
80  ClassDef(PndEmcTwoCoordIndex,1)
81 };
82 
83 #endif // PNDEMCTWOCOORDINDEX_HH
84 
85 
86 
bool operator==(const PndEmcTwoCoordIndex &c) const
stores crystal index coordinates (x,y) or (theta,phi)
bool operator!=(const PndEmcTwoCoordIndex &c) const
std::set< PndEmcTwoCoordIndex * > PndEmcCoordIndexSet
virtual void AddToNeighbourList(PndEmcTwoCoordIndex *)
bool IsNeighbour(PndEmcTwoCoordIndex *_tci)
bool operator<(const PndEmcTwoCoordIndex &) const
PndEmcCoordIndexSet fNeighbours
virtual const PndEmcCoordIndexSet GetNeighbours() const