KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVINDRATelescope.cpp
1//Created by KVClassFactory on Thu Jun 9 10:34:54 2011
2//Author: frankland,,,,
3
4#include "KVINDRATelescope.h"
5#include "KVRing.h"
6
8
9
10
12
14{
15 // Default constructor
16}
17
18
19
22
24{
25 // Destructor
26}
27
28
29
36
38{
39 // Name of telescope given in the form Det1_Det2_..._Ring-numberTelescope-number
40 // where Det1 etc. are the ACTIVE detector layers of the telescope
41 // The detectors are signified by their TYPE names i.e. KVDetector::GetType
42 //
43 //Just a wrapper for GetArrayName to allow polymorphism
44 return const_cast<KVINDRATelescope*>(this)->GetArrayName();
45}
46
47
48
53
55{
56 // Name of telescope given in the form Det1_Det2_..._Ring-numberTelescope-number
57 // where Det1 etc. are the ACTIVE detector layers of the telescope
58 // The detectors are signified by their TYPE names i.e. KVDetector::GetType
59
60 TIter next_det(GetDetectors());
61 KVDetector* kdet;
62 TString dummy;
63 while ((kdet = (KVDetector*) next_det())) { //loop over detectors in telescope
64 if (dummy == "")
65 dummy = kdet->GetType();
66 else
67 dummy += kdet->GetType();
68 dummy += "_";
69 }
70 fName.Form("%s%02d%02d", dummy.Data(), GetRingNumber(), GetNumber());
71 return fName.Data();
72}
73
74
75
77
79{
80 return (GetRing() ? GetRing()->GetNumber() : 0);
81}
82
83
84
86
88{
89 return (KVRing*)GetParentStructure("RING");
90}
91
92
93
95
97{
98 return (KVGroup*)GetParentStructure("GROUP");
99}
100
101
102
103
109
111{
112 // telescopes are sorted
113 // (i) according to layer number if they are in different layers
114 // (ii) according to lower edge polar angle if they belong to the same layer
115 // (iii) according to telescope number if they belong to the same ring
116
118
119 Int_t this_layer_number = GetParentStructure("RING")->GetParentStructure("LAYER")->GetNumber();
120 Int_t obj_layer_number = tobj->GetParentStructure("RING")->GetParentStructure("LAYER")->GetNumber();
121 Int_t this_ring_number = GetParentStructure("RING")->GetNumber();
122 Int_t obj_ring_number = tobj->GetParentStructure("RING")->GetNumber();
123
124 if (this_layer_number != obj_layer_number) {
125// not in the same layer - sort according to layer number, smallest first
126//(closest to target)
127 if (this_layer_number < obj_layer_number)
128 return -1;
129 else if (this_layer_number > obj_layer_number)
130 return 1;
131 else
132 return 0;
133 }
134 if (this_ring_number != obj_ring_number) {
135// not in the same ring - sort according to lower edge polar angle
136 if (GetThetaMin() < tobj->GetThetaMin())
137 return -1;
138 else if (GetThetaMin() > tobj->GetThetaMin())
139 return 1;
140 else
141 return 0;
142 }
143 if (this_ring_number == obj_ring_number) {
144// same ring - sort according to telescope number
145 if (GetNumber() < tobj->GetNumber())
146 return -1;
147 else if (GetNumber() > tobj->GetNumber())
148 return 1;
149 else
150 return 0;
151 }
152 return 0;
153}
154
155
int Int_t
char Char_t
virtual const Char_t * GetType() const
Definition KVBase.h:177
UInt_t GetNumber() const
Definition KVBase.h:220
Base class for detector geometry description.
Definition KVDetector.h:160
KVGeoStrucElement * GetParentStructure(const Char_t *type, const Char_t *name="") const
const KVSeqCollection * GetDetectors() const
Group of detectors which can be treated independently of all others in array.
Definition KVGroup.h:20
Base class for telescopes in INDRA array.
KVGroup * GetGroup() const
KVRing * GetRing() const
const Char_t * GetName() const
virtual ~KVINDRATelescope()
Destructor.
Int_t Compare(const TObject *obj) const
virtual const Char_t * GetArrayName()
Int_t GetRingNumber() const
Double_t GetThetaMin() const
Definition KVPosition.h:150
Ring in INDRA array (obsolete)
Definition KVRing.h:20
TString fName
const char * Data() const
void Form(const char *fmt,...)
ClassImp(TPyArg)