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 } else if (phi > -2.356 && phi < -0.7853) {
136 m_segmentMap.insert(std::pair<int, int>(cid, 2));
137 m_crystalsInSegment[2] += 1;
138 } else {
139 m_segmentMap.insert(std::pair<int, int>(cid, 3));
140 m_crystalsInSegment[3] += 1;
141 }
142 } else if (cid < 7777) {
143 if (z > 0) {
144 if (phi > 0.7853 && phi < 2.356) {
145 m_segmentMap.insert(std::pair<int, int>(cid, 4));
146 m_crystalsInSegment[4] += 1;
147 } else if (phi >= 2.356 || phi <= -2.356) {
148 m_segmentMap.insert(std::pair<int, int>(cid, 5));
149 m_crystalsInSegment[5] += 1;
150 } else if (phi > -2.356 && phi < -0.7853) {
151 m_segmentMap.insert(std::pair<int, int>(cid, 6));
152 m_crystalsInSegment[6] += 1;
153 } else {
154 m_segmentMap.insert(std::pair<int, int>(cid, 7));
155 m_crystalsInSegment[7] += 1;
156 }
157 } else {
158 if (phi > 0.7853 && phi < 2.356) {
159 m_segmentMap.insert(std::pair<int, int>(cid, 8));
160 m_crystalsInSegment[8] += 1;
161 } else if (phi >= 2.356 || phi <= -2.356) {
162 m_segmentMap.insert(std::pair<int, int>(cid, 9));
163 m_crystalsInSegment[9] += 1;
164 } else if (phi > -2.356 && phi < -0.7853) {
165 m_segmentMap.insert(std::pair<int, int>(cid, 10));
166 m_crystalsInSegment[10] += 1;
167 } else {
168 m_segmentMap.insert(std::pair<int, int>(cid, 11));
169 m_crystalsInSegment[11] += 1;
170 }
171 }
172 } else {
173 if (phi > 0.7853 && phi < 2.356) {
174 m_segmentMap.insert(std::pair<int, int>(cid, 12));
175 m_crystalsInSegment[12] += 1;
176 } else if (phi >= 2.356 || phi <= -2.356) {
177 m_segmentMap.insert(std::pair<int, int>(cid, 13));
178 m_crystalsInSegment[13] += 1;
179 } else if (phi > -2.356 && phi < -0.7853) {
180 m_segmentMap.insert(std::pair<int, int>(cid, 14));
181 m_crystalsInSegment[14] += 1;
182 } else {
183 m_segmentMap.insert(std::pair<int, int>(cid, 15));
184 m_crystalsInSegment[15] += 1;
185 }
186 }
187 }
188 }
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
B2Vector3< double > B2Vector3D
typedef for common usage with double