FairRoot/PandaRoot
PndEmcTwoCoordIndex.cxx
Go to the documentation of this file.
1 //======================================================================
2 //
3 // Class PndEmcTwoCoordIndex
4 //
5 // Software developed for the BaBar Detector at the SLAC B-Factory.
6 // Adapted for the PANDA experiment at GSI
7 //
8 // Class to hold coordinate and index information
9 // for system in which two co-ordinates specifies a channel uniquely.
10 // (Based on class from BABAR framework)
11 //
12 // Author List:
13 //
14 // Phil Strother Imperial College
15 // Stephen J. Gowdy University of Edinburgh
16 // Dima Melnichuk - adaption for PANDA
17 //
18 //======================================================================
19 
20 #include "PndEmcTwoCoordIndex.h"
21 #include <iostream>
22 #include "math.h"
23 
24 using namespace std;
25 
26 //----------------
27 // Constructors --
28 //----------------
30 {
31  fCoords[0]=-1;
32  fCoords[1]=-1;
33 }
34 
35 PndEmcTwoCoordIndex::PndEmcTwoCoordIndex( long x, long y, long ind ): fIndex(ind), fNeighbours(PndEmcCoordIndexSet())
36 {
37  fCoords[0]=x;
38  fCoords[1]=y;
39 }
40 
41 //--------------
42 // Destructor --
43 //--------------
45 {
46 }
47 
48 //-------------
49 // Operators --
50 //-------------
51 bool
53 {
54  bool answer = (fIndex < compare.fIndex);
55  return answer;
56 }
57 
58 //-------------
59 // Methods --
60 //-------------
63 {
64  return fNeighbours;
65 }
66 
67 void
69 {
70  fNeighbours.insert( addition );
71 }
72 
73 bool
75 {
76 
77  if( abs(fCoords[0] - tci->XCoord()) > 1 ) return false;
78  if (fCoords[1]<200) {
79  if((abs(fCoords[1] - tci->YCoord()) > 1)&&(abs(fCoords[1] - tci->YCoord()) !=159 )) return false;
80  } else if (abs(fCoords[1] - tci->YCoord()) > 1) {
81  return false;
82  }
83 
84  return true;
85 }
86 
stores crystal index coordinates (x,y) or (theta,phi)
std::set< PndEmcTwoCoordIndex * > PndEmcCoordIndexSet
virtual void AddToNeighbourList(PndEmcTwoCoordIndex *)
bool IsNeighbour(PndEmcTwoCoordIndex *_tci)
bool operator<(const PndEmcTwoCoordIndex &) const
PndEmcCoordIndexSet fNeighbours
Double_t x
ClassImp(PndAnaContFact)
Double_t y
virtual const PndEmcCoordIndexSet GetNeighbours() const