Performs ECL segmentation; Done once per run; Populates a map which connects each ECL crystal with a segment number (0-15); Segments 0-3 are in the forward endcap, 4-7 are in the barrel with z<0, 8-11 are in the barrel with z>0, 12-15 are in the backward endcap; Segment 0 contains crystals with 45deg < phi < 135deg, Segment 1 contains crystals with 135deg < phi < 225deg, Segment 2 contains crystals with 225deg < phi < 315deg, Segment 3 contains crystals with phi < 45deg or phi > 315deg, With the same angular pattern continuing for barrel and BWD encap segments.
120 {
122 for (int cid = 1; cid < 8737; cid++) {
123 m_geometry->Mapping(cid);
124 const B2Vector3D position = m_geometry->GetCrystalPos(cid - 1);
125 const double phi = position.Phi();
126 const double z = position.Z();
127
128 if (cid < 1297) {
129 if (phi > 0.7853 && phi < 2.356) {
130 m_segmentMap.insert(std::pair<int, int>(cid, 0));
131 m_crystalsInSegment[0] += 1;
132 } else if (phi >= 2.356 || phi <= -2.356) {
133 m_segmentMap.insert(std::pair<int, int>(cid, 1));
134 m_crystalsInSegment[1] += 1;
135
136 } else if (phi < -0.7853) {
137 m_segmentMap.insert(std::pair<int, int>(cid, 2));
138 m_crystalsInSegment[2] += 1;
139 } else {
140 m_segmentMap.insert(std::pair<int, int>(cid, 3));
141 m_crystalsInSegment[3] += 1;
142 }
143 } else if (cid < 7777) {
144 if (z > 0) {
145 if (phi > 0.7853 && phi < 2.356) {
146 m_segmentMap.insert(std::pair<int, int>(cid, 4));
147 m_crystalsInSegment[4] += 1;
148 } else if (phi >= 2.356 || phi <= -2.356) {
149 m_segmentMap.insert(std::pair<int, int>(cid, 5));
150 m_crystalsInSegment[5] += 1;
151
152 } else if (phi < -0.7853) {
153 m_segmentMap.insert(std::pair<int, int>(cid, 6));
154 m_crystalsInSegment[6] += 1;
155 } else {
156 m_segmentMap.insert(std::pair<int, int>(cid, 7));
157 m_crystalsInSegment[7] += 1;
158 }
159 } else {
160 if (phi > 0.7853 && phi < 2.356) {
161 m_segmentMap.insert(std::pair<int, int>(cid, 8));
162 m_crystalsInSegment[8] += 1;
163 } else if (phi >= 2.356 || phi <= -2.356) {
164 m_segmentMap.insert(std::pair<int, int>(cid, 9));
165 m_crystalsInSegment[9] += 1;
166
167 } else if (phi < -0.7853) {
168 m_segmentMap.insert(std::pair<int, int>(cid, 10));
169 m_crystalsInSegment[10] += 1;
170 } else {
171 m_segmentMap.insert(std::pair<int, int>(cid, 11));
172 m_crystalsInSegment[11] += 1;
173 }
174 }
175 } else {
176 if (phi > 0.7853 && phi < 2.356) {
177 m_segmentMap.insert(std::pair<int, int>(cid, 12));
178 m_crystalsInSegment[12] += 1;
179 } else if (phi >= 2.356 || phi <= -2.356) {
180 m_segmentMap.insert(std::pair<int, int>(cid, 13));
181 m_crystalsInSegment[13] += 1;
182
183 } else if (phi < -0.7853) {
184 m_segmentMap.insert(std::pair<int, int>(cid, 14));
185 m_crystalsInSegment[14] += 1;
186 } else {
187 m_segmentMap.insert(std::pair<int, int>(cid, 15));
188 m_crystalsInSegment[15] += 1;
189 }
190 }
191 }
192 }
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
B2Vector3< double > B2Vector3D
typedef for common usage with double