File indexing completed on 2024-04-06 12:20:08
0001 #ifndef L1Trigger_L1CaloTrigger_Phase2L1RCT
0002 #define L1Trigger_L1CaloTrigger_Phase2L1RCT
0003
0004 #include "L1Trigger/L1CaloTrigger/interface/Phase2L1CaloEGammaUtils.h"
0005
0006
0007
0008
0009
0010 inline p2eg::ecalRegion_t p2eg::initStructure(p2eg::crystal temporary[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI]) {
0011 ap_uint<5> Eta = 0x0;
0012 ap_uint<5> Phi = 0x0;
0013
0014 p2eg::ecalRegion_t out;
0015
0016 out.etaStrip0.cr0.energy = temporary[Eta + 0][Phi + 0].energy;
0017 out.etaStrip0.cr0.eta = 0;
0018 out.etaStrip0.cr0.phi = 0;
0019 out.etaStrip0.cr1.energy = temporary[Eta + 0][Phi + 1].energy;
0020 out.etaStrip0.cr1.eta = 0;
0021 out.etaStrip0.cr1.phi = 1;
0022 out.etaStrip0.cr2.energy = temporary[Eta + 0][Phi + 2].energy;
0023 out.etaStrip0.cr2.eta = 0;
0024 out.etaStrip0.cr2.phi = 2;
0025 out.etaStrip0.cr3.energy = temporary[Eta + 0][Phi + 3].energy;
0026 out.etaStrip0.cr3.eta = 0;
0027 out.etaStrip0.cr3.phi = 3;
0028 out.etaStrip0.cr4.energy = temporary[Eta + 0][Phi + 4].energy;
0029 out.etaStrip0.cr4.eta = 0;
0030 out.etaStrip0.cr4.phi = 4;
0031 out.etaStrip0.cr5.energy = temporary[Eta + 0][Phi + 5].energy;
0032 out.etaStrip0.cr5.eta = 0;
0033 out.etaStrip0.cr5.phi = 5;
0034 out.etaStrip0.cr6.energy = temporary[Eta + 0][Phi + 6].energy;
0035 out.etaStrip0.cr6.eta = 0;
0036 out.etaStrip0.cr6.phi = 6;
0037 out.etaStrip0.cr7.energy = temporary[Eta + 0][Phi + 7].energy;
0038 out.etaStrip0.cr7.eta = 0;
0039 out.etaStrip0.cr7.phi = 7;
0040 out.etaStrip0.cr8.energy = temporary[Eta + 0][Phi + 8].energy;
0041 out.etaStrip0.cr8.eta = 0;
0042 out.etaStrip0.cr8.phi = 8;
0043 out.etaStrip0.cr9.energy = temporary[Eta + 0][Phi + 9].energy;
0044 out.etaStrip0.cr9.eta = 0;
0045 out.etaStrip0.cr9.phi = 9;
0046 out.etaStrip0.cr10.energy = temporary[Eta + 0][Phi + 10].energy;
0047 out.etaStrip0.cr10.eta = 0;
0048 out.etaStrip0.cr10.phi = 10;
0049 out.etaStrip0.cr11.energy = temporary[Eta + 0][Phi + 11].energy;
0050 out.etaStrip0.cr11.eta = 0;
0051 out.etaStrip0.cr11.phi = 11;
0052 out.etaStrip0.cr12.energy = temporary[Eta + 0][Phi + 12].energy;
0053 out.etaStrip0.cr12.eta = 0;
0054 out.etaStrip0.cr12.phi = 12;
0055 out.etaStrip0.cr13.energy = temporary[Eta + 0][Phi + 13].energy;
0056 out.etaStrip0.cr13.eta = 0;
0057 out.etaStrip0.cr13.phi = 13;
0058 out.etaStrip0.cr14.energy = temporary[Eta + 0][Phi + 14].energy;
0059 out.etaStrip0.cr14.eta = 0;
0060 out.etaStrip0.cr14.phi = 14;
0061 out.etaStrip0.cr15.energy = temporary[Eta + 0][Phi + 15].energy;
0062 out.etaStrip0.cr15.eta = 0;
0063 out.etaStrip0.cr15.phi = 15;
0064 out.etaStrip0.cr16.energy = temporary[Eta + 0][Phi + 16].energy;
0065 out.etaStrip0.cr16.eta = 0;
0066 out.etaStrip0.cr16.phi = 16;
0067 out.etaStrip0.cr17.energy = temporary[Eta + 0][Phi + 17].energy;
0068 out.etaStrip0.cr17.eta = 0;
0069 out.etaStrip0.cr17.phi = 17;
0070 out.etaStrip0.cr18.energy = temporary[Eta + 0][Phi + 18].energy;
0071 out.etaStrip0.cr18.eta = 0;
0072 out.etaStrip0.cr18.phi = 18;
0073 out.etaStrip0.cr19.energy = temporary[Eta + 0][Phi + 19].energy;
0074 out.etaStrip0.cr19.eta = 0;
0075 out.etaStrip0.cr19.phi = 19;
0076
0077 out.etaStrip1.cr0.energy = temporary[Eta + 1][Phi + 0].energy;
0078 out.etaStrip1.cr0.eta = 1;
0079 out.etaStrip1.cr0.phi = 0;
0080 out.etaStrip1.cr1.energy = temporary[Eta + 1][Phi + 1].energy;
0081 out.etaStrip1.cr1.eta = 1;
0082 out.etaStrip1.cr1.phi = 1;
0083 out.etaStrip1.cr2.energy = temporary[Eta + 1][Phi + 2].energy;
0084 out.etaStrip1.cr2.eta = 1;
0085 out.etaStrip1.cr2.phi = 2;
0086 out.etaStrip1.cr3.energy = temporary[Eta + 1][Phi + 3].energy;
0087 out.etaStrip1.cr3.eta = 1;
0088 out.etaStrip1.cr3.phi = 3;
0089 out.etaStrip1.cr4.energy = temporary[Eta + 1][Phi + 4].energy;
0090 out.etaStrip1.cr4.eta = 1;
0091 out.etaStrip1.cr4.phi = 4;
0092 out.etaStrip1.cr5.energy = temporary[Eta + 1][Phi + 5].energy;
0093 out.etaStrip1.cr5.eta = 1;
0094 out.etaStrip1.cr5.phi = 5;
0095 out.etaStrip1.cr6.energy = temporary[Eta + 1][Phi + 6].energy;
0096 out.etaStrip1.cr6.eta = 1;
0097 out.etaStrip1.cr6.phi = 6;
0098 out.etaStrip1.cr7.energy = temporary[Eta + 1][Phi + 7].energy;
0099 out.etaStrip1.cr7.eta = 1;
0100 out.etaStrip1.cr7.phi = 7;
0101 out.etaStrip1.cr8.energy = temporary[Eta + 1][Phi + 8].energy;
0102 out.etaStrip1.cr8.eta = 1;
0103 out.etaStrip1.cr8.phi = 8;
0104 out.etaStrip1.cr9.energy = temporary[Eta + 1][Phi + 9].energy;
0105 out.etaStrip1.cr9.eta = 1;
0106 out.etaStrip1.cr9.phi = 9;
0107 out.etaStrip1.cr10.energy = temporary[Eta + 1][Phi + 10].energy;
0108 out.etaStrip1.cr10.eta = 1;
0109 out.etaStrip1.cr10.phi = 10;
0110 out.etaStrip1.cr11.energy = temporary[Eta + 1][Phi + 11].energy;
0111 out.etaStrip1.cr11.eta = 1;
0112 out.etaStrip1.cr11.phi = 11;
0113 out.etaStrip1.cr12.energy = temporary[Eta + 1][Phi + 12].energy;
0114 out.etaStrip1.cr12.eta = 1;
0115 out.etaStrip1.cr12.phi = 12;
0116 out.etaStrip1.cr13.energy = temporary[Eta + 1][Phi + 13].energy;
0117 out.etaStrip1.cr13.eta = 1;
0118 out.etaStrip1.cr13.phi = 13;
0119 out.etaStrip1.cr14.energy = temporary[Eta + 1][Phi + 14].energy;
0120 out.etaStrip1.cr14.eta = 1;
0121 out.etaStrip1.cr14.phi = 14;
0122 out.etaStrip1.cr15.energy = temporary[Eta + 1][Phi + 15].energy;
0123 out.etaStrip1.cr15.eta = 1;
0124 out.etaStrip1.cr15.phi = 15;
0125 out.etaStrip1.cr16.energy = temporary[Eta + 1][Phi + 16].energy;
0126 out.etaStrip1.cr16.eta = 1;
0127 out.etaStrip1.cr16.phi = 16;
0128 out.etaStrip1.cr17.energy = temporary[Eta + 1][Phi + 17].energy;
0129 out.etaStrip1.cr17.eta = 1;
0130 out.etaStrip1.cr17.phi = 17;
0131 out.etaStrip1.cr18.energy = temporary[Eta + 1][Phi + 18].energy;
0132 out.etaStrip1.cr18.eta = 1;
0133 out.etaStrip1.cr18.phi = 18;
0134 out.etaStrip1.cr19.energy = temporary[Eta + 1][Phi + 19].energy;
0135 out.etaStrip1.cr19.eta = 1;
0136 out.etaStrip1.cr19.phi = 19;
0137
0138 out.etaStrip2.cr0.energy = temporary[Eta + 2][Phi + 0].energy;
0139 out.etaStrip2.cr0.eta = 2;
0140 out.etaStrip2.cr0.phi = 0;
0141 out.etaStrip2.cr1.energy = temporary[Eta + 2][Phi + 1].energy;
0142 out.etaStrip2.cr1.eta = 2;
0143 out.etaStrip2.cr1.phi = 1;
0144 out.etaStrip2.cr2.energy = temporary[Eta + 2][Phi + 2].energy;
0145 out.etaStrip2.cr2.eta = 2;
0146 out.etaStrip2.cr2.phi = 2;
0147 out.etaStrip2.cr3.energy = temporary[Eta + 2][Phi + 3].energy;
0148 out.etaStrip2.cr3.eta = 2;
0149 out.etaStrip2.cr3.phi = 3;
0150 out.etaStrip2.cr4.energy = temporary[Eta + 2][Phi + 4].energy;
0151 out.etaStrip2.cr4.eta = 2;
0152 out.etaStrip2.cr4.phi = 4;
0153 out.etaStrip2.cr5.energy = temporary[Eta + 2][Phi + 5].energy;
0154 out.etaStrip2.cr5.eta = 2;
0155 out.etaStrip2.cr5.phi = 5;
0156 out.etaStrip2.cr6.energy = temporary[Eta + 2][Phi + 6].energy;
0157 out.etaStrip2.cr6.eta = 2;
0158 out.etaStrip2.cr6.phi = 6;
0159 out.etaStrip2.cr7.energy = temporary[Eta + 2][Phi + 7].energy;
0160 out.etaStrip2.cr7.eta = 2;
0161 out.etaStrip2.cr7.phi = 7;
0162 out.etaStrip2.cr8.energy = temporary[Eta + 2][Phi + 8].energy;
0163 out.etaStrip2.cr8.eta = 2;
0164 out.etaStrip2.cr8.phi = 8;
0165 out.etaStrip2.cr9.energy = temporary[Eta + 2][Phi + 9].energy;
0166 out.etaStrip2.cr9.eta = 2;
0167 out.etaStrip2.cr9.phi = 9;
0168 out.etaStrip2.cr10.energy = temporary[Eta + 2][Phi + 10].energy;
0169 out.etaStrip2.cr10.eta = 2;
0170 out.etaStrip2.cr10.phi = 10;
0171 out.etaStrip2.cr11.energy = temporary[Eta + 2][Phi + 11].energy;
0172 out.etaStrip2.cr11.eta = 2;
0173 out.etaStrip2.cr11.phi = 11;
0174 out.etaStrip2.cr12.energy = temporary[Eta + 2][Phi + 12].energy;
0175 out.etaStrip2.cr12.eta = 2;
0176 out.etaStrip2.cr12.phi = 12;
0177 out.etaStrip2.cr13.energy = temporary[Eta + 2][Phi + 13].energy;
0178 out.etaStrip2.cr13.eta = 2;
0179 out.etaStrip2.cr13.phi = 13;
0180 out.etaStrip2.cr14.energy = temporary[Eta + 2][Phi + 14].energy;
0181 out.etaStrip2.cr14.eta = 2;
0182 out.etaStrip2.cr14.phi = 14;
0183 out.etaStrip2.cr15.energy = temporary[Eta + 2][Phi + 15].energy;
0184 out.etaStrip2.cr15.eta = 2;
0185 out.etaStrip2.cr15.phi = 15;
0186 out.etaStrip2.cr16.energy = temporary[Eta + 2][Phi + 16].energy;
0187 out.etaStrip2.cr16.eta = 2;
0188 out.etaStrip2.cr16.phi = 16;
0189 out.etaStrip2.cr17.energy = temporary[Eta + 2][Phi + 17].energy;
0190 out.etaStrip2.cr17.eta = 2;
0191 out.etaStrip2.cr17.phi = 17;
0192 out.etaStrip2.cr18.energy = temporary[Eta + 2][Phi + 18].energy;
0193 out.etaStrip2.cr18.eta = 2;
0194 out.etaStrip2.cr18.phi = 18;
0195 out.etaStrip2.cr19.energy = temporary[Eta + 2][Phi + 19].energy;
0196 out.etaStrip2.cr19.eta = 2;
0197 out.etaStrip2.cr19.phi = 19;
0198
0199 out.etaStrip3.cr0.energy = temporary[Eta + 3][Phi + 0].energy;
0200 out.etaStrip3.cr0.eta = 3;
0201 out.etaStrip3.cr0.phi = 0;
0202 out.etaStrip3.cr1.energy = temporary[Eta + 3][Phi + 1].energy;
0203 out.etaStrip3.cr1.eta = 3;
0204 out.etaStrip3.cr1.phi = 1;
0205 out.etaStrip3.cr2.energy = temporary[Eta + 3][Phi + 2].energy;
0206 out.etaStrip3.cr2.eta = 3;
0207 out.etaStrip3.cr2.phi = 2;
0208 out.etaStrip3.cr3.energy = temporary[Eta + 3][Phi + 3].energy;
0209 out.etaStrip3.cr3.eta = 3;
0210 out.etaStrip3.cr3.phi = 3;
0211 out.etaStrip3.cr4.energy = temporary[Eta + 3][Phi + 4].energy;
0212 out.etaStrip3.cr4.eta = 3;
0213 out.etaStrip3.cr4.phi = 4;
0214 out.etaStrip3.cr5.energy = temporary[Eta + 3][Phi + 5].energy;
0215 out.etaStrip3.cr5.eta = 3;
0216 out.etaStrip3.cr5.phi = 5;
0217 out.etaStrip3.cr6.energy = temporary[Eta + 3][Phi + 6].energy;
0218 out.etaStrip3.cr6.eta = 3;
0219 out.etaStrip3.cr6.phi = 6;
0220 out.etaStrip3.cr7.energy = temporary[Eta + 3][Phi + 7].energy;
0221 out.etaStrip3.cr7.eta = 3;
0222 out.etaStrip3.cr7.phi = 7;
0223 out.etaStrip3.cr8.energy = temporary[Eta + 3][Phi + 8].energy;
0224 out.etaStrip3.cr8.eta = 3;
0225 out.etaStrip3.cr8.phi = 8;
0226 out.etaStrip3.cr9.energy = temporary[Eta + 3][Phi + 9].energy;
0227 out.etaStrip3.cr9.eta = 3;
0228 out.etaStrip3.cr9.phi = 9;
0229 out.etaStrip3.cr10.energy = temporary[Eta + 3][Phi + 10].energy;
0230 out.etaStrip3.cr10.eta = 3;
0231 out.etaStrip3.cr10.phi = 10;
0232 out.etaStrip3.cr11.energy = temporary[Eta + 3][Phi + 11].energy;
0233 out.etaStrip3.cr11.eta = 3;
0234 out.etaStrip3.cr11.phi = 11;
0235 out.etaStrip3.cr12.energy = temporary[Eta + 3][Phi + 12].energy;
0236 out.etaStrip3.cr12.eta = 3;
0237 out.etaStrip3.cr12.phi = 12;
0238 out.etaStrip3.cr13.energy = temporary[Eta + 3][Phi + 13].energy;
0239 out.etaStrip3.cr13.eta = 3;
0240 out.etaStrip3.cr13.phi = 13;
0241 out.etaStrip3.cr14.energy = temporary[Eta + 3][Phi + 14].energy;
0242 out.etaStrip3.cr14.eta = 3;
0243 out.etaStrip3.cr14.phi = 14;
0244 out.etaStrip3.cr15.energy = temporary[Eta + 3][Phi + 15].energy;
0245 out.etaStrip3.cr15.eta = 3;
0246 out.etaStrip3.cr15.phi = 15;
0247 out.etaStrip3.cr16.energy = temporary[Eta + 3][Phi + 16].energy;
0248 out.etaStrip3.cr16.eta = 3;
0249 out.etaStrip3.cr16.phi = 16;
0250 out.etaStrip3.cr17.energy = temporary[Eta + 3][Phi + 17].energy;
0251 out.etaStrip3.cr17.eta = 3;
0252 out.etaStrip3.cr17.phi = 17;
0253 out.etaStrip3.cr18.energy = temporary[Eta + 3][Phi + 18].energy;
0254 out.etaStrip3.cr18.eta = 3;
0255 out.etaStrip3.cr18.phi = 18;
0256 out.etaStrip3.cr19.energy = temporary[Eta + 3][Phi + 19].energy;
0257 out.etaStrip3.cr19.eta = 3;
0258 out.etaStrip3.cr19.phi = 19;
0259
0260 out.etaStrip4.cr0.energy = temporary[Eta + 4][Phi + 0].energy;
0261 out.etaStrip4.cr0.eta = 4;
0262 out.etaStrip4.cr0.phi = 0;
0263 out.etaStrip4.cr1.energy = temporary[Eta + 4][Phi + 1].energy;
0264 out.etaStrip4.cr1.eta = 4;
0265 out.etaStrip4.cr1.phi = 1;
0266 out.etaStrip4.cr2.energy = temporary[Eta + 4][Phi + 2].energy;
0267 out.etaStrip4.cr2.eta = 4;
0268 out.etaStrip4.cr2.phi = 2;
0269 out.etaStrip4.cr3.energy = temporary[Eta + 4][Phi + 3].energy;
0270 out.etaStrip4.cr3.eta = 4;
0271 out.etaStrip4.cr3.phi = 3;
0272 out.etaStrip4.cr4.energy = temporary[Eta + 4][Phi + 4].energy;
0273 out.etaStrip4.cr4.eta = 4;
0274 out.etaStrip4.cr4.phi = 4;
0275 out.etaStrip4.cr5.energy = temporary[Eta + 4][Phi + 5].energy;
0276 out.etaStrip4.cr5.eta = 4;
0277 out.etaStrip4.cr5.phi = 5;
0278 out.etaStrip4.cr6.energy = temporary[Eta + 4][Phi + 6].energy;
0279 out.etaStrip4.cr6.eta = 4;
0280 out.etaStrip4.cr6.phi = 6;
0281 out.etaStrip4.cr7.energy = temporary[Eta + 4][Phi + 7].energy;
0282 out.etaStrip4.cr7.eta = 4;
0283 out.etaStrip4.cr7.phi = 7;
0284 out.etaStrip4.cr8.energy = temporary[Eta + 4][Phi + 8].energy;
0285 out.etaStrip4.cr8.eta = 4;
0286 out.etaStrip4.cr8.phi = 8;
0287 out.etaStrip4.cr9.energy = temporary[Eta + 4][Phi + 9].energy;
0288 out.etaStrip4.cr9.eta = 4;
0289 out.etaStrip4.cr9.phi = 9;
0290 out.etaStrip4.cr10.energy = temporary[Eta + 4][Phi + 10].energy;
0291 out.etaStrip4.cr10.eta = 4;
0292 out.etaStrip4.cr10.phi = 10;
0293 out.etaStrip4.cr11.energy = temporary[Eta + 4][Phi + 11].energy;
0294 out.etaStrip4.cr11.eta = 4;
0295 out.etaStrip4.cr11.phi = 11;
0296 out.etaStrip4.cr12.energy = temporary[Eta + 4][Phi + 12].energy;
0297 out.etaStrip4.cr12.eta = 4;
0298 out.etaStrip4.cr12.phi = 12;
0299 out.etaStrip4.cr13.energy = temporary[Eta + 4][Phi + 13].energy;
0300 out.etaStrip4.cr13.eta = 4;
0301 out.etaStrip4.cr13.phi = 13;
0302 out.etaStrip4.cr14.energy = temporary[Eta + 4][Phi + 14].energy;
0303 out.etaStrip4.cr14.eta = 4;
0304 out.etaStrip4.cr14.phi = 14;
0305 out.etaStrip4.cr15.energy = temporary[Eta + 4][Phi + 15].energy;
0306 out.etaStrip4.cr15.eta = 4;
0307 out.etaStrip4.cr15.phi = 15;
0308 out.etaStrip4.cr16.energy = temporary[Eta + 4][Phi + 16].energy;
0309 out.etaStrip4.cr16.eta = 4;
0310 out.etaStrip4.cr16.phi = 16;
0311 out.etaStrip4.cr17.energy = temporary[Eta + 4][Phi + 17].energy;
0312 out.etaStrip4.cr17.eta = 4;
0313 out.etaStrip4.cr17.phi = 17;
0314 out.etaStrip4.cr18.energy = temporary[Eta + 4][Phi + 18].energy;
0315 out.etaStrip4.cr18.eta = 4;
0316 out.etaStrip4.cr18.phi = 18;
0317 out.etaStrip4.cr19.energy = temporary[Eta + 4][Phi + 19].energy;
0318 out.etaStrip4.cr19.eta = 4;
0319 out.etaStrip4.cr19.phi = 19;
0320
0321 out.etaStrip5.cr0.energy = temporary[Eta + 5][Phi + 0].energy;
0322 out.etaStrip5.cr0.eta = 5;
0323 out.etaStrip5.cr0.phi = 0;
0324 out.etaStrip5.cr1.energy = temporary[Eta + 5][Phi + 1].energy;
0325 out.etaStrip5.cr1.eta = 5;
0326 out.etaStrip5.cr1.phi = 1;
0327 out.etaStrip5.cr2.energy = temporary[Eta + 5][Phi + 2].energy;
0328 out.etaStrip5.cr2.eta = 5;
0329 out.etaStrip5.cr2.phi = 2;
0330 out.etaStrip5.cr3.energy = temporary[Eta + 5][Phi + 3].energy;
0331 out.etaStrip5.cr3.eta = 5;
0332 out.etaStrip5.cr3.phi = 3;
0333 out.etaStrip5.cr4.energy = temporary[Eta + 5][Phi + 4].energy;
0334 out.etaStrip5.cr4.eta = 5;
0335 out.etaStrip5.cr4.phi = 4;
0336 out.etaStrip5.cr5.energy = temporary[Eta + 5][Phi + 5].energy;
0337 out.etaStrip5.cr5.eta = 5;
0338 out.etaStrip5.cr5.phi = 5;
0339 out.etaStrip5.cr6.energy = temporary[Eta + 5][Phi + 6].energy;
0340 out.etaStrip5.cr6.eta = 5;
0341 out.etaStrip5.cr6.phi = 6;
0342 out.etaStrip5.cr7.energy = temporary[Eta + 5][Phi + 7].energy;
0343 out.etaStrip5.cr7.eta = 5;
0344 out.etaStrip5.cr7.phi = 7;
0345 out.etaStrip5.cr8.energy = temporary[Eta + 5][Phi + 8].energy;
0346 out.etaStrip5.cr8.eta = 5;
0347 out.etaStrip5.cr8.phi = 8;
0348 out.etaStrip5.cr9.energy = temporary[Eta + 5][Phi + 9].energy;
0349 out.etaStrip5.cr9.eta = 5;
0350 out.etaStrip5.cr9.phi = 9;
0351 out.etaStrip5.cr10.energy = temporary[Eta + 5][Phi + 10].energy;
0352 out.etaStrip5.cr10.eta = 5;
0353 out.etaStrip5.cr10.phi = 10;
0354 out.etaStrip5.cr11.energy = temporary[Eta + 5][Phi + 11].energy;
0355 out.etaStrip5.cr11.eta = 5;
0356 out.etaStrip5.cr11.phi = 11;
0357 out.etaStrip5.cr12.energy = temporary[Eta + 5][Phi + 12].energy;
0358 out.etaStrip5.cr12.eta = 5;
0359 out.etaStrip5.cr12.phi = 12;
0360 out.etaStrip5.cr13.energy = temporary[Eta + 5][Phi + 13].energy;
0361 out.etaStrip5.cr13.eta = 5;
0362 out.etaStrip5.cr13.phi = 13;
0363 out.etaStrip5.cr14.energy = temporary[Eta + 5][Phi + 14].energy;
0364 out.etaStrip5.cr14.eta = 5;
0365 out.etaStrip5.cr14.phi = 14;
0366 out.etaStrip5.cr15.energy = temporary[Eta + 5][Phi + 15].energy;
0367 out.etaStrip5.cr15.eta = 5;
0368 out.etaStrip5.cr15.phi = 15;
0369 out.etaStrip5.cr16.energy = temporary[Eta + 5][Phi + 16].energy;
0370 out.etaStrip5.cr16.eta = 5;
0371 out.etaStrip5.cr16.phi = 16;
0372 out.etaStrip5.cr17.energy = temporary[Eta + 5][Phi + 17].energy;
0373 out.etaStrip5.cr17.eta = 5;
0374 out.etaStrip5.cr17.phi = 17;
0375 out.etaStrip5.cr18.energy = temporary[Eta + 5][Phi + 18].energy;
0376 out.etaStrip5.cr18.eta = 5;
0377 out.etaStrip5.cr18.phi = 18;
0378 out.etaStrip5.cr19.energy = temporary[Eta + 5][Phi + 19].energy;
0379 out.etaStrip5.cr19.eta = 5;
0380 out.etaStrip5.cr19.phi = 19;
0381
0382 out.etaStrip6.cr0.energy = temporary[Eta + 6][Phi + 0].energy;
0383 out.etaStrip6.cr0.eta = 6;
0384 out.etaStrip6.cr0.phi = 0;
0385 out.etaStrip6.cr1.energy = temporary[Eta + 6][Phi + 1].energy;
0386 out.etaStrip6.cr1.eta = 6;
0387 out.etaStrip6.cr1.phi = 1;
0388 out.etaStrip6.cr2.energy = temporary[Eta + 6][Phi + 2].energy;
0389 out.etaStrip6.cr2.eta = 6;
0390 out.etaStrip6.cr2.phi = 2;
0391 out.etaStrip6.cr2.energy = temporary[Eta + 6][Phi + 2].energy;
0392 out.etaStrip6.cr2.eta = 6;
0393 out.etaStrip6.cr2.phi = 2;
0394 out.etaStrip6.cr3.energy = temporary[Eta + 6][Phi + 3].energy;
0395 out.etaStrip6.cr3.eta = 6;
0396 out.etaStrip6.cr3.phi = 3;
0397 out.etaStrip6.cr4.energy = temporary[Eta + 6][Phi + 4].energy;
0398 out.etaStrip6.cr4.eta = 6;
0399 out.etaStrip6.cr4.phi = 4;
0400 out.etaStrip6.cr5.energy = temporary[Eta + 6][Phi + 5].energy;
0401 out.etaStrip6.cr5.eta = 6;
0402 out.etaStrip6.cr5.phi = 5;
0403 out.etaStrip6.cr6.energy = temporary[Eta + 6][Phi + 6].energy;
0404 out.etaStrip6.cr6.eta = 6;
0405 out.etaStrip6.cr6.phi = 6;
0406 out.etaStrip6.cr7.energy = temporary[Eta + 6][Phi + 7].energy;
0407 out.etaStrip6.cr7.eta = 6;
0408 out.etaStrip6.cr7.phi = 7;
0409 out.etaStrip6.cr8.energy = temporary[Eta + 6][Phi + 8].energy;
0410 out.etaStrip6.cr8.eta = 6;
0411 out.etaStrip6.cr8.phi = 8;
0412 out.etaStrip6.cr9.energy = temporary[Eta + 6][Phi + 9].energy;
0413 out.etaStrip6.cr9.eta = 6;
0414 out.etaStrip6.cr9.phi = 9;
0415 out.etaStrip6.cr10.energy = temporary[Eta + 6][Phi + 10].energy;
0416 out.etaStrip6.cr10.eta = 6;
0417 out.etaStrip6.cr10.phi = 10;
0418 out.etaStrip6.cr11.energy = temporary[Eta + 6][Phi + 11].energy;
0419 out.etaStrip6.cr11.eta = 6;
0420 out.etaStrip6.cr11.phi = 11;
0421 out.etaStrip6.cr12.energy = temporary[Eta + 6][Phi + 12].energy;
0422 out.etaStrip6.cr12.eta = 6;
0423 out.etaStrip6.cr12.phi = 12;
0424 out.etaStrip6.cr13.energy = temporary[Eta + 6][Phi + 13].energy;
0425 out.etaStrip6.cr13.eta = 6;
0426 out.etaStrip6.cr13.phi = 13;
0427 out.etaStrip6.cr14.energy = temporary[Eta + 6][Phi + 14].energy;
0428 out.etaStrip6.cr14.eta = 6;
0429 out.etaStrip6.cr14.phi = 14;
0430 out.etaStrip6.cr15.energy = temporary[Eta + 6][Phi + 15].energy;
0431 out.etaStrip6.cr15.eta = 6;
0432 out.etaStrip6.cr15.phi = 15;
0433 out.etaStrip6.cr16.energy = temporary[Eta + 6][Phi + 16].energy;
0434 out.etaStrip6.cr16.eta = 6;
0435 out.etaStrip6.cr16.phi = 16;
0436 out.etaStrip6.cr17.energy = temporary[Eta + 6][Phi + 17].energy;
0437 out.etaStrip6.cr17.eta = 6;
0438 out.etaStrip6.cr17.phi = 17;
0439 out.etaStrip6.cr18.energy = temporary[Eta + 6][Phi + 18].energy;
0440 out.etaStrip6.cr18.eta = 6;
0441 out.etaStrip6.cr18.phi = 18;
0442 out.etaStrip6.cr19.energy = temporary[Eta + 6][Phi + 19].energy;
0443 out.etaStrip6.cr19.eta = 6;
0444 out.etaStrip6.cr19.phi = 19;
0445
0446 out.etaStrip7.cr0.energy = temporary[Eta + 7][Phi + 0].energy;
0447 out.etaStrip7.cr0.eta = 7;
0448 out.etaStrip7.cr0.phi = 0;
0449 out.etaStrip7.cr1.energy = temporary[Eta + 7][Phi + 1].energy;
0450 out.etaStrip7.cr1.eta = 7;
0451 out.etaStrip7.cr1.phi = 1;
0452 out.etaStrip7.cr2.energy = temporary[Eta + 7][Phi + 2].energy;
0453 out.etaStrip7.cr2.eta = 7;
0454 out.etaStrip7.cr2.phi = 2;
0455 out.etaStrip7.cr3.energy = temporary[Eta + 7][Phi + 3].energy;
0456 out.etaStrip7.cr3.eta = 7;
0457 out.etaStrip7.cr3.phi = 3;
0458 out.etaStrip7.cr4.energy = temporary[Eta + 7][Phi + 4].energy;
0459 out.etaStrip7.cr4.eta = 7;
0460 out.etaStrip7.cr4.phi = 4;
0461 out.etaStrip7.cr5.energy = temporary[Eta + 7][Phi + 5].energy;
0462 out.etaStrip7.cr5.eta = 7;
0463 out.etaStrip7.cr5.phi = 5;
0464 out.etaStrip7.cr6.energy = temporary[Eta + 7][Phi + 6].energy;
0465 out.etaStrip7.cr6.eta = 7;
0466 out.etaStrip7.cr6.phi = 6;
0467 out.etaStrip7.cr7.energy = temporary[Eta + 7][Phi + 7].energy;
0468 out.etaStrip7.cr7.eta = 7;
0469 out.etaStrip7.cr7.phi = 7;
0470 out.etaStrip7.cr8.energy = temporary[Eta + 7][Phi + 8].energy;
0471 out.etaStrip7.cr8.eta = 7;
0472 out.etaStrip7.cr8.phi = 8;
0473 out.etaStrip7.cr9.energy = temporary[Eta + 7][Phi + 9].energy;
0474 out.etaStrip7.cr9.eta = 7;
0475 out.etaStrip7.cr9.phi = 9;
0476 out.etaStrip7.cr10.energy = temporary[Eta + 7][Phi + 10].energy;
0477 out.etaStrip7.cr10.eta = 7;
0478 out.etaStrip7.cr10.phi = 10;
0479 out.etaStrip7.cr11.energy = temporary[Eta + 7][Phi + 11].energy;
0480 out.etaStrip7.cr11.eta = 7;
0481 out.etaStrip7.cr11.phi = 11;
0482 out.etaStrip7.cr12.energy = temporary[Eta + 7][Phi + 12].energy;
0483 out.etaStrip7.cr12.eta = 7;
0484 out.etaStrip7.cr12.phi = 12;
0485 out.etaStrip7.cr13.energy = temporary[Eta + 7][Phi + 13].energy;
0486 out.etaStrip7.cr13.eta = 7;
0487 out.etaStrip7.cr13.phi = 13;
0488 out.etaStrip7.cr14.energy = temporary[Eta + 7][Phi + 14].energy;
0489 out.etaStrip7.cr14.eta = 7;
0490 out.etaStrip7.cr14.phi = 14;
0491 out.etaStrip7.cr15.energy = temporary[Eta + 7][Phi + 15].energy;
0492 out.etaStrip7.cr15.eta = 7;
0493 out.etaStrip7.cr15.phi = 15;
0494 out.etaStrip7.cr16.energy = temporary[Eta + 7][Phi + 16].energy;
0495 out.etaStrip7.cr16.eta = 7;
0496 out.etaStrip7.cr16.phi = 16;
0497 out.etaStrip7.cr17.energy = temporary[Eta + 7][Phi + 17].energy;
0498 out.etaStrip7.cr17.eta = 7;
0499 out.etaStrip7.cr17.phi = 17;
0500 out.etaStrip7.cr18.energy = temporary[Eta + 7][Phi + 18].energy;
0501 out.etaStrip7.cr18.eta = 7;
0502 out.etaStrip7.cr18.phi = 18;
0503 out.etaStrip7.cr19.energy = temporary[Eta + 7][Phi + 19].energy;
0504 out.etaStrip7.cr19.eta = 7;
0505 out.etaStrip7.cr19.phi = 19;
0506
0507 out.etaStrip8.cr0.energy = temporary[Eta + 8][Phi + 0].energy;
0508 out.etaStrip8.cr0.eta = 8;
0509 out.etaStrip8.cr0.phi = 0;
0510 out.etaStrip8.cr1.energy = temporary[Eta + 8][Phi + 1].energy;
0511 out.etaStrip8.cr1.eta = 8;
0512 out.etaStrip8.cr1.phi = 1;
0513 out.etaStrip8.cr2.energy = temporary[Eta + 8][Phi + 2].energy;
0514 out.etaStrip8.cr2.eta = 8;
0515 out.etaStrip8.cr2.phi = 2;
0516 out.etaStrip8.cr3.energy = temporary[Eta + 8][Phi + 3].energy;
0517 out.etaStrip8.cr3.eta = 8;
0518 out.etaStrip8.cr3.phi = 3;
0519 out.etaStrip8.cr4.energy = temporary[Eta + 8][Phi + 4].energy;
0520 out.etaStrip8.cr4.eta = 8;
0521 out.etaStrip8.cr4.phi = 4;
0522 out.etaStrip8.cr5.energy = temporary[Eta + 8][Phi + 5].energy;
0523 out.etaStrip8.cr5.eta = 8;
0524 out.etaStrip8.cr5.phi = 5;
0525 out.etaStrip8.cr6.energy = temporary[Eta + 8][Phi + 6].energy;
0526 out.etaStrip8.cr6.eta = 8;
0527 out.etaStrip8.cr6.phi = 6;
0528 out.etaStrip8.cr7.energy = temporary[Eta + 8][Phi + 7].energy;
0529 out.etaStrip8.cr7.eta = 8;
0530 out.etaStrip8.cr7.phi = 7;
0531 out.etaStrip8.cr8.energy = temporary[Eta + 8][Phi + 8].energy;
0532 out.etaStrip8.cr8.eta = 8;
0533 out.etaStrip8.cr8.phi = 8;
0534 out.etaStrip8.cr9.energy = temporary[Eta + 8][Phi + 9].energy;
0535 out.etaStrip8.cr9.eta = 8;
0536 out.etaStrip8.cr9.phi = 9;
0537 out.etaStrip8.cr10.energy = temporary[Eta + 8][Phi + 10].energy;
0538 out.etaStrip8.cr10.eta = 8;
0539 out.etaStrip8.cr10.phi = 10;
0540 out.etaStrip8.cr11.energy = temporary[Eta + 8][Phi + 11].energy;
0541 out.etaStrip8.cr11.eta = 8;
0542 out.etaStrip8.cr11.phi = 11;
0543 out.etaStrip8.cr12.energy = temporary[Eta + 8][Phi + 12].energy;
0544 out.etaStrip8.cr12.eta = 8;
0545 out.etaStrip8.cr12.phi = 12;
0546 out.etaStrip8.cr13.energy = temporary[Eta + 8][Phi + 13].energy;
0547 out.etaStrip8.cr13.eta = 8;
0548 out.etaStrip8.cr13.phi = 13;
0549 out.etaStrip8.cr14.energy = temporary[Eta + 8][Phi + 14].energy;
0550 out.etaStrip8.cr14.eta = 8;
0551 out.etaStrip8.cr14.phi = 14;
0552 out.etaStrip8.cr15.energy = temporary[Eta + 8][Phi + 15].energy;
0553 out.etaStrip8.cr15.eta = 8;
0554 out.etaStrip8.cr15.phi = 15;
0555 out.etaStrip8.cr16.energy = temporary[Eta + 8][Phi + 16].energy;
0556 out.etaStrip8.cr16.eta = 8;
0557 out.etaStrip8.cr16.phi = 16;
0558 out.etaStrip8.cr17.energy = temporary[Eta + 8][Phi + 17].energy;
0559 out.etaStrip8.cr17.eta = 8;
0560 out.etaStrip8.cr17.phi = 17;
0561 out.etaStrip8.cr18.energy = temporary[Eta + 8][Phi + 18].energy;
0562 out.etaStrip8.cr18.eta = 8;
0563 out.etaStrip8.cr18.phi = 18;
0564 out.etaStrip8.cr19.energy = temporary[Eta + 8][Phi + 19].energy;
0565 out.etaStrip8.cr19.eta = 8;
0566 out.etaStrip8.cr19.phi = 19;
0567
0568 out.etaStrip9.cr0.energy = temporary[Eta + 9][Phi + 0].energy;
0569 out.etaStrip9.cr0.eta = 9;
0570 out.etaStrip9.cr0.phi = 0;
0571 out.etaStrip9.cr1.energy = temporary[Eta + 9][Phi + 1].energy;
0572 out.etaStrip9.cr1.eta = 9;
0573 out.etaStrip9.cr1.phi = 1;
0574 out.etaStrip9.cr2.energy = temporary[Eta + 9][Phi + 2].energy;
0575 out.etaStrip9.cr2.eta = 9;
0576 out.etaStrip9.cr2.phi = 2;
0577 out.etaStrip9.cr3.energy = temporary[Eta + 9][Phi + 3].energy;
0578 out.etaStrip9.cr3.eta = 9;
0579 out.etaStrip9.cr3.phi = 3;
0580 out.etaStrip9.cr4.energy = temporary[Eta + 9][Phi + 4].energy;
0581 out.etaStrip9.cr4.eta = 9;
0582 out.etaStrip9.cr4.phi = 4;
0583 out.etaStrip9.cr5.energy = temporary[Eta + 9][Phi + 5].energy;
0584 out.etaStrip9.cr5.eta = 9;
0585 out.etaStrip9.cr5.phi = 5;
0586 out.etaStrip9.cr6.energy = temporary[Eta + 9][Phi + 6].energy;
0587 out.etaStrip9.cr6.eta = 9;
0588 out.etaStrip9.cr6.phi = 6;
0589 out.etaStrip9.cr7.energy = temporary[Eta + 9][Phi + 7].energy;
0590 out.etaStrip9.cr7.eta = 9;
0591 out.etaStrip9.cr7.phi = 7;
0592 out.etaStrip9.cr8.energy = temporary[Eta + 9][Phi + 8].energy;
0593 out.etaStrip9.cr8.eta = 9;
0594 out.etaStrip9.cr8.phi = 8;
0595 out.etaStrip9.cr9.energy = temporary[Eta + 9][Phi + 9].energy;
0596 out.etaStrip9.cr9.eta = 9;
0597 out.etaStrip9.cr9.phi = 9;
0598 out.etaStrip9.cr10.energy = temporary[Eta + 9][Phi + 10].energy;
0599 out.etaStrip9.cr10.eta = 9;
0600 out.etaStrip9.cr10.phi = 10;
0601 out.etaStrip9.cr11.energy = temporary[Eta + 9][Phi + 11].energy;
0602 out.etaStrip9.cr11.eta = 9;
0603 out.etaStrip9.cr11.phi = 11;
0604 out.etaStrip9.cr12.energy = temporary[Eta + 9][Phi + 12].energy;
0605 out.etaStrip9.cr12.eta = 9;
0606 out.etaStrip9.cr12.phi = 12;
0607 out.etaStrip9.cr13.energy = temporary[Eta + 9][Phi + 13].energy;
0608 out.etaStrip9.cr13.eta = 9;
0609 out.etaStrip9.cr13.phi = 13;
0610 out.etaStrip9.cr14.energy = temporary[Eta + 9][Phi + 14].energy;
0611 out.etaStrip9.cr14.eta = 9;
0612 out.etaStrip9.cr14.phi = 14;
0613 out.etaStrip9.cr15.energy = temporary[Eta + 9][Phi + 15].energy;
0614 out.etaStrip9.cr15.eta = 9;
0615 out.etaStrip9.cr15.phi = 15;
0616 out.etaStrip9.cr16.energy = temporary[Eta + 9][Phi + 16].energy;
0617 out.etaStrip9.cr16.eta = 9;
0618 out.etaStrip9.cr16.phi = 16;
0619 out.etaStrip9.cr17.energy = temporary[Eta + 9][Phi + 17].energy;
0620 out.etaStrip9.cr17.eta = 9;
0621 out.etaStrip9.cr17.phi = 17;
0622 out.etaStrip9.cr18.energy = temporary[Eta + 9][Phi + 18].energy;
0623 out.etaStrip9.cr18.eta = 9;
0624 out.etaStrip9.cr18.phi = 18;
0625 out.etaStrip9.cr19.energy = temporary[Eta + 9][Phi + 19].energy;
0626 out.etaStrip9.cr19.eta = 9;
0627 out.etaStrip9.cr19.phi = 19;
0628
0629 out.etaStrip10.cr0.energy = temporary[Eta + 10][Phi + 0].energy;
0630 out.etaStrip10.cr0.eta = 10;
0631 out.etaStrip10.cr0.phi = 0;
0632 out.etaStrip10.cr1.energy = temporary[Eta + 10][Phi + 1].energy;
0633 out.etaStrip10.cr1.eta = 10;
0634 out.etaStrip10.cr1.phi = 1;
0635 out.etaStrip10.cr2.energy = temporary[Eta + 10][Phi + 2].energy;
0636 out.etaStrip10.cr2.eta = 10;
0637 out.etaStrip10.cr2.phi = 2;
0638 out.etaStrip10.cr3.energy = temporary[Eta + 10][Phi + 3].energy;
0639 out.etaStrip10.cr3.eta = 10;
0640 out.etaStrip10.cr3.phi = 3;
0641 out.etaStrip10.cr4.energy = temporary[Eta + 10][Phi + 4].energy;
0642 out.etaStrip10.cr4.eta = 10;
0643 out.etaStrip10.cr4.phi = 4;
0644 out.etaStrip10.cr5.energy = temporary[Eta + 10][Phi + 5].energy;
0645 out.etaStrip10.cr5.eta = 10;
0646 out.etaStrip10.cr5.phi = 5;
0647 out.etaStrip10.cr6.energy = temporary[Eta + 10][Phi + 6].energy;
0648 out.etaStrip10.cr6.eta = 10;
0649 out.etaStrip10.cr6.phi = 6;
0650 out.etaStrip10.cr7.energy = temporary[Eta + 10][Phi + 7].energy;
0651 out.etaStrip10.cr7.eta = 10;
0652 out.etaStrip10.cr7.phi = 7;
0653 out.etaStrip10.cr8.energy = temporary[Eta + 10][Phi + 8].energy;
0654 out.etaStrip10.cr8.eta = 10;
0655 out.etaStrip10.cr8.phi = 8;
0656 out.etaStrip10.cr9.energy = temporary[Eta + 10][Phi + 9].energy;
0657 out.etaStrip10.cr9.eta = 10;
0658 out.etaStrip10.cr9.phi = 9;
0659 out.etaStrip10.cr10.energy = temporary[Eta + 10][Phi + 10].energy;
0660 out.etaStrip10.cr10.eta = 10;
0661 out.etaStrip10.cr10.phi = 10;
0662 out.etaStrip10.cr11.energy = temporary[Eta + 10][Phi + 11].energy;
0663 out.etaStrip10.cr11.eta = 10;
0664 out.etaStrip10.cr11.phi = 11;
0665 out.etaStrip10.cr12.energy = temporary[Eta + 10][Phi + 12].energy;
0666 out.etaStrip10.cr12.eta = 10;
0667 out.etaStrip10.cr12.phi = 12;
0668 out.etaStrip10.cr13.energy = temporary[Eta + 10][Phi + 13].energy;
0669 out.etaStrip10.cr13.eta = 10;
0670 out.etaStrip10.cr13.phi = 13;
0671 out.etaStrip10.cr14.energy = temporary[Eta + 10][Phi + 14].energy;
0672 out.etaStrip10.cr14.eta = 10;
0673 out.etaStrip10.cr14.phi = 14;
0674 out.etaStrip10.cr15.energy = temporary[Eta + 10][Phi + 15].energy;
0675 out.etaStrip10.cr15.eta = 10;
0676 out.etaStrip10.cr15.phi = 15;
0677 out.etaStrip10.cr16.energy = temporary[Eta + 10][Phi + 16].energy;
0678 out.etaStrip10.cr16.eta = 10;
0679 out.etaStrip10.cr16.phi = 16;
0680 out.etaStrip10.cr17.energy = temporary[Eta + 10][Phi + 17].energy;
0681 out.etaStrip10.cr17.eta = 10;
0682 out.etaStrip10.cr17.phi = 17;
0683 out.etaStrip10.cr18.energy = temporary[Eta + 10][Phi + 18].energy;
0684 out.etaStrip10.cr18.eta = 10;
0685 out.etaStrip10.cr18.phi = 18;
0686 out.etaStrip10.cr19.energy = temporary[Eta + 10][Phi + 19].energy;
0687 out.etaStrip10.cr19.eta = 10;
0688 out.etaStrip10.cr19.phi = 19;
0689
0690 out.etaStrip11.cr0.energy = temporary[Eta + 11][Phi + 0].energy;
0691 out.etaStrip11.cr0.eta = 11;
0692 out.etaStrip11.cr0.phi = 0;
0693 out.etaStrip11.cr1.energy = temporary[Eta + 11][Phi + 1].energy;
0694 out.etaStrip11.cr1.eta = 11;
0695 out.etaStrip11.cr1.phi = 1;
0696 out.etaStrip11.cr2.energy = temporary[Eta + 11][Phi + 2].energy;
0697 out.etaStrip11.cr2.eta = 11;
0698 out.etaStrip11.cr2.phi = 2;
0699 out.etaStrip11.cr3.energy = temporary[Eta + 11][Phi + 3].energy;
0700 out.etaStrip11.cr3.eta = 11;
0701 out.etaStrip11.cr3.phi = 3;
0702 out.etaStrip11.cr4.energy = temporary[Eta + 11][Phi + 4].energy;
0703 out.etaStrip11.cr4.eta = 11;
0704 out.etaStrip11.cr4.phi = 4;
0705 out.etaStrip11.cr5.energy = temporary[Eta + 11][Phi + 5].energy;
0706 out.etaStrip11.cr5.eta = 11;
0707 out.etaStrip11.cr5.phi = 5;
0708 out.etaStrip11.cr6.energy = temporary[Eta + 11][Phi + 6].energy;
0709 out.etaStrip11.cr6.eta = 11;
0710 out.etaStrip11.cr6.phi = 6;
0711 out.etaStrip11.cr7.energy = temporary[Eta + 11][Phi + 7].energy;
0712 out.etaStrip11.cr7.eta = 11;
0713 out.etaStrip11.cr7.phi = 7;
0714 out.etaStrip11.cr8.energy = temporary[Eta + 11][Phi + 8].energy;
0715 out.etaStrip11.cr8.eta = 11;
0716 out.etaStrip11.cr8.phi = 8;
0717 out.etaStrip11.cr9.energy = temporary[Eta + 11][Phi + 9].energy;
0718 out.etaStrip11.cr9.eta = 11;
0719 out.etaStrip11.cr9.phi = 9;
0720 out.etaStrip11.cr10.energy = temporary[Eta + 11][Phi + 10].energy;
0721 out.etaStrip11.cr10.eta = 11;
0722 out.etaStrip11.cr10.phi = 10;
0723 out.etaStrip11.cr11.energy = temporary[Eta + 11][Phi + 11].energy;
0724 out.etaStrip11.cr11.eta = 11;
0725 out.etaStrip11.cr11.phi = 11;
0726 out.etaStrip11.cr12.energy = temporary[Eta + 11][Phi + 12].energy;
0727 out.etaStrip11.cr12.eta = 11;
0728 out.etaStrip11.cr12.phi = 12;
0729 out.etaStrip11.cr13.energy = temporary[Eta + 11][Phi + 13].energy;
0730 out.etaStrip11.cr13.eta = 11;
0731 out.etaStrip11.cr13.phi = 13;
0732 out.etaStrip11.cr14.energy = temporary[Eta + 11][Phi + 14].energy;
0733 out.etaStrip11.cr14.eta = 11;
0734 out.etaStrip11.cr14.phi = 14;
0735 out.etaStrip11.cr15.energy = temporary[Eta + 11][Phi + 15].energy;
0736 out.etaStrip11.cr15.eta = 11;
0737 out.etaStrip11.cr15.phi = 15;
0738 out.etaStrip11.cr16.energy = temporary[Eta + 11][Phi + 16].energy;
0739 out.etaStrip11.cr16.eta = 11;
0740 out.etaStrip11.cr16.phi = 16;
0741 out.etaStrip11.cr17.energy = temporary[Eta + 11][Phi + 17].energy;
0742 out.etaStrip11.cr17.eta = 11;
0743 out.etaStrip11.cr17.phi = 17;
0744 out.etaStrip11.cr18.energy = temporary[Eta + 11][Phi + 18].energy;
0745 out.etaStrip11.cr18.eta = 11;
0746 out.etaStrip11.cr18.phi = 18;
0747 out.etaStrip11.cr19.energy = temporary[Eta + 11][Phi + 19].energy;
0748 out.etaStrip11.cr19.eta = 11;
0749 out.etaStrip11.cr19.phi = 19;
0750
0751 out.etaStrip12.cr0.energy = temporary[Eta + 12][Phi + 0].energy;
0752 out.etaStrip12.cr0.eta = 12;
0753 out.etaStrip12.cr0.phi = 0;
0754 out.etaStrip12.cr1.energy = temporary[Eta + 12][Phi + 1].energy;
0755 out.etaStrip12.cr1.eta = 12;
0756 out.etaStrip12.cr1.phi = 1;
0757 out.etaStrip12.cr2.energy = temporary[Eta + 12][Phi + 2].energy;
0758 out.etaStrip12.cr2.eta = 12;
0759 out.etaStrip12.cr2.phi = 2;
0760 out.etaStrip12.cr3.energy = temporary[Eta + 12][Phi + 3].energy;
0761 out.etaStrip12.cr3.eta = 12;
0762 out.etaStrip12.cr3.phi = 3;
0763 out.etaStrip12.cr4.energy = temporary[Eta + 12][Phi + 4].energy;
0764 out.etaStrip12.cr4.eta = 12;
0765 out.etaStrip12.cr4.phi = 4;
0766 out.etaStrip12.cr5.energy = temporary[Eta + 12][Phi + 5].energy;
0767 out.etaStrip12.cr5.eta = 12;
0768 out.etaStrip12.cr5.phi = 5;
0769 out.etaStrip12.cr6.energy = temporary[Eta + 12][Phi + 6].energy;
0770 out.etaStrip12.cr6.eta = 12;
0771 out.etaStrip12.cr6.phi = 6;
0772 out.etaStrip12.cr7.energy = temporary[Eta + 12][Phi + 7].energy;
0773 out.etaStrip12.cr7.eta = 12;
0774 out.etaStrip12.cr7.phi = 7;
0775 out.etaStrip12.cr8.energy = temporary[Eta + 12][Phi + 8].energy;
0776 out.etaStrip12.cr8.eta = 12;
0777 out.etaStrip12.cr8.phi = 8;
0778 out.etaStrip12.cr9.energy = temporary[Eta + 12][Phi + 9].energy;
0779 out.etaStrip12.cr9.eta = 12;
0780 out.etaStrip12.cr9.phi = 9;
0781 out.etaStrip12.cr10.energy = temporary[Eta + 12][Phi + 10].energy;
0782 out.etaStrip12.cr10.eta = 12;
0783 out.etaStrip12.cr10.phi = 10;
0784 out.etaStrip12.cr11.energy = temporary[Eta + 12][Phi + 11].energy;
0785 out.etaStrip12.cr11.eta = 12;
0786 out.etaStrip12.cr11.phi = 11;
0787 out.etaStrip12.cr12.energy = temporary[Eta + 12][Phi + 12].energy;
0788 out.etaStrip12.cr12.eta = 12;
0789 out.etaStrip12.cr12.phi = 12;
0790 out.etaStrip12.cr13.energy = temporary[Eta + 12][Phi + 13].energy;
0791 out.etaStrip12.cr13.eta = 12;
0792 out.etaStrip12.cr13.phi = 13;
0793 out.etaStrip12.cr14.energy = temporary[Eta + 12][Phi + 14].energy;
0794 out.etaStrip12.cr14.eta = 12;
0795 out.etaStrip12.cr14.phi = 14;
0796 out.etaStrip12.cr15.energy = temporary[Eta + 12][Phi + 15].energy;
0797 out.etaStrip12.cr15.eta = 12;
0798 out.etaStrip12.cr15.phi = 15;
0799 out.etaStrip12.cr16.energy = temporary[Eta + 12][Phi + 16].energy;
0800 out.etaStrip12.cr16.eta = 12;
0801 out.etaStrip12.cr16.phi = 16;
0802 out.etaStrip12.cr17.energy = temporary[Eta + 12][Phi + 17].energy;
0803 out.etaStrip12.cr17.eta = 12;
0804 out.etaStrip12.cr17.phi = 17;
0805 out.etaStrip12.cr18.energy = temporary[Eta + 12][Phi + 18].energy;
0806 out.etaStrip12.cr18.eta = 12;
0807 out.etaStrip12.cr18.phi = 18;
0808 out.etaStrip12.cr19.energy = temporary[Eta + 12][Phi + 19].energy;
0809 out.etaStrip12.cr19.eta = 12;
0810 out.etaStrip12.cr19.phi = 19;
0811
0812 out.etaStrip13.cr0.energy = temporary[Eta + 13][Phi + 0].energy;
0813 out.etaStrip13.cr0.eta = 13;
0814 out.etaStrip13.cr0.phi = 0;
0815 out.etaStrip13.cr1.energy = temporary[Eta + 13][Phi + 1].energy;
0816 out.etaStrip13.cr1.eta = 13;
0817 out.etaStrip13.cr1.phi = 1;
0818 out.etaStrip13.cr2.energy = temporary[Eta + 13][Phi + 2].energy;
0819 out.etaStrip13.cr2.eta = 13;
0820 out.etaStrip13.cr2.phi = 2;
0821 out.etaStrip13.cr3.energy = temporary[Eta + 13][Phi + 3].energy;
0822 out.etaStrip13.cr3.eta = 13;
0823 out.etaStrip13.cr3.phi = 3;
0824 out.etaStrip13.cr4.energy = temporary[Eta + 13][Phi + 4].energy;
0825 out.etaStrip13.cr4.eta = 13;
0826 out.etaStrip13.cr4.phi = 4;
0827 out.etaStrip13.cr5.energy = temporary[Eta + 13][Phi + 5].energy;
0828 out.etaStrip13.cr5.eta = 13;
0829 out.etaStrip13.cr5.phi = 5;
0830 out.etaStrip13.cr6.energy = temporary[Eta + 13][Phi + 6].energy;
0831 out.etaStrip13.cr6.eta = 13;
0832 out.etaStrip13.cr6.phi = 6;
0833 out.etaStrip13.cr7.energy = temporary[Eta + 13][Phi + 7].energy;
0834 out.etaStrip13.cr7.eta = 13;
0835 out.etaStrip13.cr7.phi = 7;
0836 out.etaStrip13.cr8.energy = temporary[Eta + 13][Phi + 8].energy;
0837 out.etaStrip13.cr8.eta = 13;
0838 out.etaStrip13.cr8.phi = 8;
0839 out.etaStrip13.cr9.energy = temporary[Eta + 13][Phi + 9].energy;
0840 out.etaStrip13.cr9.eta = 13;
0841 out.etaStrip13.cr9.phi = 9;
0842 out.etaStrip13.cr10.energy = temporary[Eta + 13][Phi + 10].energy;
0843 out.etaStrip13.cr10.eta = 13;
0844 out.etaStrip13.cr10.phi = 10;
0845 out.etaStrip13.cr11.energy = temporary[Eta + 13][Phi + 11].energy;
0846 out.etaStrip13.cr11.eta = 13;
0847 out.etaStrip13.cr11.phi = 11;
0848 out.etaStrip13.cr12.energy = temporary[Eta + 13][Phi + 12].energy;
0849 out.etaStrip13.cr12.eta = 13;
0850 out.etaStrip13.cr12.phi = 12;
0851 out.etaStrip13.cr13.energy = temporary[Eta + 13][Phi + 13].energy;
0852 out.etaStrip13.cr13.eta = 13;
0853 out.etaStrip13.cr13.phi = 13;
0854 out.etaStrip13.cr14.energy = temporary[Eta + 13][Phi + 14].energy;
0855 out.etaStrip13.cr14.eta = 13;
0856 out.etaStrip13.cr14.phi = 14;
0857 out.etaStrip13.cr15.energy = temporary[Eta + 13][Phi + 15].energy;
0858 out.etaStrip13.cr15.eta = 13;
0859 out.etaStrip13.cr15.phi = 15;
0860 out.etaStrip13.cr16.energy = temporary[Eta + 13][Phi + 16].energy;
0861 out.etaStrip13.cr16.eta = 13;
0862 out.etaStrip13.cr16.phi = 16;
0863 out.etaStrip13.cr17.energy = temporary[Eta + 13][Phi + 17].energy;
0864 out.etaStrip13.cr17.eta = 13;
0865 out.etaStrip13.cr17.phi = 17;
0866 out.etaStrip13.cr18.energy = temporary[Eta + 13][Phi + 18].energy;
0867 out.etaStrip13.cr18.eta = 13;
0868 out.etaStrip13.cr18.phi = 18;
0869 out.etaStrip13.cr19.energy = temporary[Eta + 13][Phi + 19].energy;
0870 out.etaStrip13.cr19.eta = 13;
0871 out.etaStrip13.cr19.phi = 19;
0872
0873 out.etaStrip14.cr0.energy = temporary[Eta + 14][Phi + 0].energy;
0874 out.etaStrip14.cr0.eta = 14;
0875 out.etaStrip14.cr0.phi = 0;
0876 out.etaStrip14.cr1.energy = temporary[Eta + 14][Phi + 1].energy;
0877 out.etaStrip14.cr1.eta = 14;
0878 out.etaStrip14.cr1.phi = 1;
0879 out.etaStrip14.cr2.energy = temporary[Eta + 14][Phi + 2].energy;
0880 out.etaStrip14.cr2.eta = 14;
0881 out.etaStrip14.cr2.phi = 2;
0882 out.etaStrip14.cr3.energy = temporary[Eta + 14][Phi + 3].energy;
0883 out.etaStrip14.cr3.eta = 14;
0884 out.etaStrip14.cr3.phi = 3;
0885 out.etaStrip14.cr4.energy = temporary[Eta + 14][Phi + 4].energy;
0886 out.etaStrip14.cr4.eta = 14;
0887 out.etaStrip14.cr4.phi = 4;
0888 out.etaStrip14.cr5.energy = temporary[Eta + 14][Phi + 5].energy;
0889 out.etaStrip14.cr5.eta = 14;
0890 out.etaStrip14.cr5.phi = 5;
0891 out.etaStrip14.cr6.energy = temporary[Eta + 14][Phi + 6].energy;
0892 out.etaStrip14.cr6.eta = 14;
0893 out.etaStrip14.cr6.phi = 6;
0894 out.etaStrip14.cr7.energy = temporary[Eta + 14][Phi + 7].energy;
0895 out.etaStrip14.cr7.eta = 14;
0896 out.etaStrip14.cr7.phi = 7;
0897 out.etaStrip14.cr8.energy = temporary[Eta + 14][Phi + 8].energy;
0898 out.etaStrip14.cr8.eta = 14;
0899 out.etaStrip14.cr8.phi = 8;
0900 out.etaStrip14.cr9.energy = temporary[Eta + 14][Phi + 9].energy;
0901 out.etaStrip14.cr9.eta = 14;
0902 out.etaStrip14.cr9.phi = 9;
0903 out.etaStrip14.cr10.energy = temporary[Eta + 14][Phi + 10].energy;
0904 out.etaStrip14.cr10.eta = 14;
0905 out.etaStrip14.cr10.phi = 10;
0906 out.etaStrip14.cr11.energy = temporary[Eta + 14][Phi + 11].energy;
0907 out.etaStrip14.cr11.eta = 14;
0908 out.etaStrip14.cr11.phi = 11;
0909 out.etaStrip14.cr12.energy = temporary[Eta + 14][Phi + 12].energy;
0910 out.etaStrip14.cr12.eta = 14;
0911 out.etaStrip14.cr12.phi = 12;
0912 out.etaStrip14.cr13.energy = temporary[Eta + 14][Phi + 13].energy;
0913 out.etaStrip14.cr13.eta = 14;
0914 out.etaStrip14.cr13.phi = 13;
0915 out.etaStrip14.cr14.energy = temporary[Eta + 14][Phi + 14].energy;
0916 out.etaStrip14.cr14.eta = 14;
0917 out.etaStrip14.cr14.phi = 14;
0918 out.etaStrip14.cr15.energy = temporary[Eta + 14][Phi + 15].energy;
0919 out.etaStrip14.cr15.eta = 14;
0920 out.etaStrip14.cr15.phi = 15;
0921 out.etaStrip14.cr16.energy = temporary[Eta + 14][Phi + 16].energy;
0922 out.etaStrip14.cr16.eta = 14;
0923 out.etaStrip14.cr16.phi = 16;
0924 out.etaStrip14.cr17.energy = temporary[Eta + 14][Phi + 17].energy;
0925 out.etaStrip14.cr17.eta = 14;
0926 out.etaStrip14.cr17.phi = 17;
0927 out.etaStrip14.cr18.energy = temporary[Eta + 14][Phi + 18].energy;
0928 out.etaStrip14.cr18.eta = 14;
0929 out.etaStrip14.cr18.phi = 18;
0930 out.etaStrip14.cr19.energy = temporary[Eta + 14][Phi + 19].energy;
0931 out.etaStrip14.cr19.eta = 14;
0932 out.etaStrip14.cr19.phi = 19;
0933
0934 return out;
0935 }
0936
0937
0938
0939
0940 inline p2eg::ecaltp_t p2eg::bestOf2(const p2eg::ecaltp_t ecaltp0, const p2eg::ecaltp_t ecaltp1) {
0941 p2eg::ecaltp_t x;
0942 x = (ecaltp0.energy > ecaltp1.energy) ? ecaltp0 : ecaltp1;
0943
0944 return x;
0945 }
0946
0947
0948
0949
0950 inline p2eg::ecaltp_t p2eg::getPeakBin20N(const p2eg::etaStrip_t etaStrip) {
0951 p2eg::ecaltp_t best01 = p2eg::bestOf2(etaStrip.cr0, etaStrip.cr1);
0952 p2eg::ecaltp_t best23 = p2eg::bestOf2(etaStrip.cr2, etaStrip.cr3);
0953 p2eg::ecaltp_t best45 = p2eg::bestOf2(etaStrip.cr4, etaStrip.cr5);
0954 p2eg::ecaltp_t best67 = p2eg::bestOf2(etaStrip.cr6, etaStrip.cr7);
0955 p2eg::ecaltp_t best89 = p2eg::bestOf2(etaStrip.cr8, etaStrip.cr9);
0956 p2eg::ecaltp_t best1011 = p2eg::bestOf2(etaStrip.cr10, etaStrip.cr11);
0957 p2eg::ecaltp_t best1213 = p2eg::bestOf2(etaStrip.cr12, etaStrip.cr13);
0958 p2eg::ecaltp_t best1415 = p2eg::bestOf2(etaStrip.cr14, etaStrip.cr15);
0959 p2eg::ecaltp_t best1617 = p2eg::bestOf2(etaStrip.cr16, etaStrip.cr17);
0960 p2eg::ecaltp_t best1819 = p2eg::bestOf2(etaStrip.cr18, etaStrip.cr19);
0961
0962 p2eg::ecaltp_t best0123 = p2eg::bestOf2(best01, best23);
0963 p2eg::ecaltp_t best4567 = p2eg::bestOf2(best45, best67);
0964 p2eg::ecaltp_t best891011 = p2eg::bestOf2(best89, best1011);
0965 p2eg::ecaltp_t best12131415 = p2eg::bestOf2(best1213, best1415);
0966 p2eg::ecaltp_t best16171819 = p2eg::bestOf2(best1617, best1819);
0967
0968 p2eg::ecaltp_t best01234567 = p2eg::bestOf2(best0123, best4567);
0969 p2eg::ecaltp_t best89101112131415 = p2eg::bestOf2(best891011, best12131415);
0970
0971 p2eg::ecaltp_t best0to15 = p2eg::bestOf2(best01234567, best89101112131415);
0972 p2eg::ecaltp_t bestOf20 = p2eg::bestOf2(best0to15, best16171819);
0973
0974 return bestOf20;
0975 }
0976
0977
0978
0979
0980
0981
0982 inline p2eg::crystalMax p2eg::getPeakBin15N(const p2eg::etaStripPeak_t etaStrip) {
0983 p2eg::crystalMax x;
0984
0985 p2eg::ecaltp_t best01 = p2eg::bestOf2(etaStrip.pk0, etaStrip.pk1);
0986 p2eg::ecaltp_t best23 = p2eg::bestOf2(etaStrip.pk2, etaStrip.pk3);
0987 p2eg::ecaltp_t best45 = p2eg::bestOf2(etaStrip.pk4, etaStrip.pk5);
0988 p2eg::ecaltp_t best67 = p2eg::bestOf2(etaStrip.pk6, etaStrip.pk7);
0989 p2eg::ecaltp_t best89 = p2eg::bestOf2(etaStrip.pk8, etaStrip.pk9);
0990 p2eg::ecaltp_t best1011 = p2eg::bestOf2(etaStrip.pk10, etaStrip.pk11);
0991 p2eg::ecaltp_t best1213 = p2eg::bestOf2(etaStrip.pk12, etaStrip.pk13);
0992
0993 p2eg::ecaltp_t best0123 = p2eg::bestOf2(best01, best23);
0994 p2eg::ecaltp_t best4567 = p2eg::bestOf2(best45, best67);
0995 p2eg::ecaltp_t best891011 = p2eg::bestOf2(best89, best1011);
0996 p2eg::ecaltp_t best121314 = p2eg::bestOf2(best1213, etaStrip.pk14);
0997
0998 p2eg::ecaltp_t best01234567 = p2eg::bestOf2(best0123, best4567);
0999 p2eg::ecaltp_t best891011121314 = p2eg::bestOf2(best891011, best121314);
1000
1001 p2eg::ecaltp_t bestOf15 = p2eg::bestOf2(best01234567, best891011121314);
1002
1003 x.energy = bestOf15.energy;
1004 x.etaMax = bestOf15.eta;
1005 x.phiMax = bestOf15.phi;
1006
1007 return x;
1008 }
1009
1010
1011
1012
1013
1014
1015 inline void p2eg::getECALTowersEt(p2eg::crystal tempX[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI],
1016 ap_uint<12> towerEt[12]) {
1017 ap_uint<10> temp[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI];
1018 ap_uint<12> towerEtN[3][4][5];
1019 for (int i = 0; i < p2eg::CRYSTAL_IN_ETA; i++) {
1020 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1021 temp[i][k] = tempX[i][k].energy;
1022 }
1023 }
1024
1025 for (int i = 0; i < p2eg::CRYSTAL_IN_ETA; i = i + 5) {
1026 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k = k + 5) {
1027 towerEtN[i / 5][k / 5][0] = temp[i][k] + temp[i][k + 1] + temp[i][k + 2] + temp[i][k + 3] + temp[i][k + 4];
1028 towerEtN[i / 5][k / 5][1] =
1029 temp[i + 1][k] + temp[i + 1][k + 1] + temp[i + 1][k + 2] + temp[i + 1][k + 3] + temp[i + 1][k + 4];
1030 towerEtN[i / 5][k / 5][2] =
1031 temp[i + 2][k] + temp[i + 2][k + 1] + temp[i + 2][k + 2] + temp[i + 2][k + 3] + temp[i + 2][k + 4];
1032 towerEtN[i / 5][k / 5][3] =
1033 temp[i + 3][k] + temp[i + 3][k + 1] + temp[i + 3][k + 2] + temp[i + 3][k + 3] + temp[i + 3][k + 4];
1034 towerEtN[i / 5][k / 5][4] =
1035 temp[i + 4][k] + temp[i + 4][k + 1] + temp[i + 4][k + 2] + temp[i + 4][k + 3] + temp[i + 4][k + 4];
1036 }
1037 }
1038
1039 for (int i = 0; i < 3; i++) {
1040 for (int j = 0; j < 4; j++) {
1041 int index = j + 4 * i;
1042 towerEt[index] = 0;
1043 for (int k = 0; k < 5; k++) {
1044 towerEt[index] += towerEtN[i][j][k];
1045 }
1046 }
1047 }
1048
1049 ap_uint<12> totalEt;
1050 for (int i = 0; i < 12; i++) {
1051 totalEt += towerEt[i];
1052 }
1053 }
1054
1055
1056
1057 inline p2eg::clusterInfo p2eg::getClusterPosition(const p2eg::ecalRegion_t ecalRegion) {
1058 p2eg::etaStripPeak_t etaStripPeak;
1059 p2eg::clusterInfo cluster;
1060
1061 etaStripPeak.pk0 = p2eg::getPeakBin20N(ecalRegion.etaStrip0);
1062 etaStripPeak.pk1 = p2eg::getPeakBin20N(ecalRegion.etaStrip1);
1063 etaStripPeak.pk2 = p2eg::getPeakBin20N(ecalRegion.etaStrip2);
1064 etaStripPeak.pk3 = p2eg::getPeakBin20N(ecalRegion.etaStrip3);
1065 etaStripPeak.pk4 = p2eg::getPeakBin20N(ecalRegion.etaStrip4);
1066 etaStripPeak.pk5 = p2eg::getPeakBin20N(ecalRegion.etaStrip5);
1067 etaStripPeak.pk6 = p2eg::getPeakBin20N(ecalRegion.etaStrip6);
1068 etaStripPeak.pk7 = p2eg::getPeakBin20N(ecalRegion.etaStrip7);
1069 etaStripPeak.pk8 = p2eg::getPeakBin20N(ecalRegion.etaStrip8);
1070 etaStripPeak.pk9 = p2eg::getPeakBin20N(ecalRegion.etaStrip9);
1071 etaStripPeak.pk10 = p2eg::getPeakBin20N(ecalRegion.etaStrip10);
1072 etaStripPeak.pk11 = p2eg::getPeakBin20N(ecalRegion.etaStrip11);
1073 etaStripPeak.pk12 = p2eg::getPeakBin20N(ecalRegion.etaStrip12);
1074 etaStripPeak.pk13 = p2eg::getPeakBin20N(ecalRegion.etaStrip13);
1075 etaStripPeak.pk14 = p2eg::getPeakBin20N(ecalRegion.etaStrip14);
1076
1077 p2eg::crystalMax peakIn15;
1078 peakIn15 = p2eg::getPeakBin15N(etaStripPeak);
1079
1080 cluster.seedEnergy = peakIn15.energy;
1081 cluster.energy = 0;
1082 cluster.etaMax = peakIn15.etaMax;
1083 cluster.phiMax = peakIn15.phiMax;
1084 cluster.brems = 0;
1085 cluster.et5x5 = 0;
1086 cluster.et2x5 = 0;
1087
1088 return cluster;
1089 }
1090
1091
1092
1093
1094
1095
1096 inline p2eg::Cluster p2eg::packCluster(ap_uint<15>& clusterEt, ap_uint<5>& etaMax_t, ap_uint<5>& phiMax_t) {
1097 ap_uint<12> peggedEt;
1098 p2eg::Cluster pack;
1099
1100 ap_uint<5> towerEta = (etaMax_t) / 5;
1101 ap_uint<2> towerPhi = (phiMax_t) / 5;
1102 ap_uint<3> clusterEta = etaMax_t - 5 * towerEta;
1103 ap_uint<3> clusterPhi = phiMax_t - 5 * towerPhi;
1104
1105 peggedEt = (clusterEt > 0xFFF) ? (ap_uint<12>)0xFFF : (ap_uint<12>)clusterEt;
1106
1107 pack = p2eg::Cluster(peggedEt, towerEta, towerPhi, clusterEta, clusterPhi, 0);
1108
1109 return pack;
1110 }
1111
1112
1113
1114
1115
1116
1117 inline void p2eg::removeClusterFromCrystal(p2eg::crystal temp[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI],
1118 ap_uint<5> seed_eta,
1119 ap_uint<5> seed_phi,
1120 ap_uint<2> brems) {
1121
1122 for (int i = 0; i < p2eg::CRYSTAL_IN_ETA; i++) {
1123 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1124 if ((i >= (seed_eta - 1)) && (i <= (seed_eta + 1)) && (k >= (seed_phi - 2)) && (k <= (seed_phi + 2))) {
1125 temp[i][k].energy = 0;
1126 }
1127 }
1128 }
1129
1130
1131
1132
1133 if (brems == 1) {
1134 for (int i = 0; i < p2eg::CRYSTAL_IN_ETA; i++) {
1135 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1136 if ((i >= (seed_eta - 1)) && (i <= (seed_eta + 1)) && (k >= (seed_phi - 2 - 5)) && (k <= (seed_phi + 2 - 5))) {
1137 temp[i][k].energy = 0;
1138 }
1139 }
1140 }
1141 }
1142
1143
1144
1145 else if (brems == 2) {
1146 for (int i = 0; i < p2eg::CRYSTAL_IN_ETA; i++) {
1147 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1148 if ((i >= (seed_eta - 1)) && (i <= (seed_eta + 1)) && (k >= (seed_phi - 2 + 5)) && (k <= (seed_phi + 2 + 5))) {
1149 temp[i][k].energy = 0;
1150 }
1151 }
1152 }
1153 }
1154 }
1155
1156
1157
1158
1159
1160
1161 inline p2eg::clusterInfo p2eg::getBremsValuesPos(p2eg::crystal tempX[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI],
1162 ap_uint<5> seed_eta,
1163 ap_uint<5> seed_phi) {
1164 ap_uint<12> temp[p2eg::CRYSTAL_IN_ETA + 2][p2eg::CRYSTAL_IN_PHI + 4];
1165 ap_uint<12> phi0eta[3], phi1eta[3], phi2eta[3], phi3eta[3], phi4eta[3];
1166 ap_uint<12> eta_slice[3];
1167 p2eg::clusterInfo cluster_tmp;
1168
1169
1170 for (int i = 0; i < (p2eg::CRYSTAL_IN_ETA + 2); i++) {
1171 for (int j = 0; j < (p2eg::CRYSTAL_IN_PHI + 4); j++) {
1172 temp[i][j] = 0;
1173 }
1174 }
1175
1176
1177
1178 for (int i = 0; i < (p2eg::CRYSTAL_IN_ETA); i++) {
1179 for (int j = 0; j < (p2eg::CRYSTAL_IN_PHI - 3); j++) {
1180 temp[i + 1][j] = tempX[i][j + 3].energy;
1181 }
1182 }
1183
1184 ap_uint<6> seed_eta1, seed_phi1;
1185 seed_eta1 = seed_eta;
1186 seed_phi1 = seed_phi;
1187
1188
1189
1190
1191 for (int j = 0; j < p2eg::CRYSTAL_IN_ETA; j++) {
1192 if (j == seed_eta1) {
1193 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1194 if (k == seed_phi1) {
1195
1196 phi0eta[0] = temp[j][k];
1197 phi1eta[0] = temp[j][k + 1];
1198 phi2eta[0] = temp[j][k + 2];
1199 phi3eta[0] = temp[j][k + 3];
1200 phi4eta[0] = temp[j][k + 4];
1201
1202
1203 phi0eta[1] = temp[j + 1][k];
1204 phi1eta[1] = temp[j + 1][k + 1];
1205 phi2eta[1] = temp[j + 1][k + 2];
1206 phi3eta[1] = temp[j + 1][k + 3];
1207 phi4eta[1] = temp[j + 1][k + 4];
1208
1209
1210 phi0eta[2] = temp[j + 2][k];
1211 phi1eta[2] = temp[j + 2][k + 1];
1212 phi2eta[2] = temp[j + 2][k + 2];
1213 phi3eta[2] = temp[j + 2][k + 3];
1214 phi4eta[2] = temp[j + 2][k + 4];
1215
1216 continue;
1217 }
1218 }
1219 }
1220 }
1221
1222
1223 for (int i = 0; i < 3; i++) {
1224 eta_slice[i] = phi0eta[i] + phi1eta[i] + phi2eta[i] + phi3eta[i] + phi4eta[i];
1225 }
1226 cluster_tmp.energy = (eta_slice[0] + eta_slice[1] + eta_slice[2]);
1227
1228 return cluster_tmp;
1229 }
1230
1231
1232
1233
1234
1235
1236 inline p2eg::clusterInfo p2eg::getBremsValuesNeg(p2eg::crystal tempX[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI],
1237 ap_uint<5> seed_eta,
1238 ap_uint<5> seed_phi) {
1239 ap_uint<12> temp[p2eg::CRYSTAL_IN_ETA + 2][p2eg::CRYSTAL_IN_PHI + 4];
1240 ap_uint<12> phi0eta[3], phi1eta[3], phi2eta[3], phi3eta[3], phi4eta[3];
1241
1242 ap_uint<12> eta_slice[3];
1243
1244 p2eg::clusterInfo cluster_tmp;
1245
1246
1247 for (int i = 0; i < (p2eg::CRYSTAL_IN_ETA + 2); i++) {
1248 for (int j = 0; j < (p2eg::CRYSTAL_IN_PHI + 4); j++) {
1249 temp[i][j] = 0;
1250 }
1251 }
1252
1253
1254
1255 for (int i = 0; i < (p2eg::CRYSTAL_IN_ETA); i++) {
1256 for (int j = 0; j < (p2eg::CRYSTAL_IN_PHI - 1); j++) {
1257 temp[i + 1][j + 7] = tempX[i][j].energy;
1258 }
1259 }
1260
1261 ap_uint<6> seed_eta1, seed_phi1;
1262 seed_eta1 = seed_eta;
1263 seed_phi1 = seed_phi;
1264
1265
1266
1267 for (int j = 0; j < p2eg::CRYSTAL_IN_ETA; j++) {
1268 if (j == seed_eta1) {
1269 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1270 if (k == seed_phi1) {
1271
1272 phi0eta[0] = temp[j][k];
1273 phi1eta[0] = temp[j][k + 1];
1274 phi2eta[0] = temp[j][k + 2];
1275 phi3eta[0] = temp[j][k + 3];
1276 phi4eta[0] = temp[j][k + 4];
1277
1278
1279 phi0eta[1] = temp[j + 1][k];
1280 phi1eta[1] = temp[j + 1][k + 1];
1281 phi2eta[1] = temp[j + 1][k + 2];
1282 phi3eta[1] = temp[j + 1][k + 3];
1283 phi4eta[1] = temp[j + 1][k + 4];
1284
1285
1286 phi0eta[2] = temp[j + 2][k];
1287 phi1eta[2] = temp[j + 2][k + 1];
1288 phi2eta[2] = temp[j + 2][k + 2];
1289 phi3eta[2] = temp[j + 2][k + 3];
1290 phi4eta[2] = temp[j + 2][k + 4];
1291 continue;
1292 }
1293 }
1294 }
1295 }
1296
1297
1298 for (int i = 0; i < 3; i++) {
1299 eta_slice[i] = phi0eta[i] + phi1eta[i] + phi2eta[i] + phi3eta[i] + phi4eta[i];
1300 }
1301 cluster_tmp.energy = (eta_slice[0] + eta_slice[1] + eta_slice[2]);
1302
1303 return cluster_tmp;
1304 }
1305
1306
1307
1308
1309
1310
1311 inline p2eg::clusterInfo p2eg::getClusterValues(p2eg::crystal tempX[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI],
1312 ap_uint<5> seed_eta,
1313 ap_uint<5> seed_phi) {
1314 ap_uint<12> temp[p2eg::CRYSTAL_IN_ETA + 4][p2eg::CRYSTAL_IN_PHI + 4];
1315 ap_uint<12> phi0eta[5], phi1eta[5], phi2eta[5], phi3eta[5], phi4eta[5];
1316 ap_uint<12> eta_slice[5];
1317 ap_uint<12> et2x5_1Tot, et2x5_2Tot, etSum2x5;
1318 ap_uint<12> et5x5Tot;
1319
1320 p2eg::clusterInfo cluster_tmp;
1321
1322 for (int i = 0; i < (p2eg::CRYSTAL_IN_ETA + 4); i++) {
1323 for (int k = 0; k < (p2eg::CRYSTAL_IN_PHI + 4); k++) {
1324 temp[i][k] = 0;
1325 }
1326 }
1327
1328
1329 for (int i = 0; i < (p2eg::CRYSTAL_IN_ETA); i++) {
1330 for (int k = 0; k < (p2eg::CRYSTAL_IN_PHI); k++) {
1331 temp[i + 2][k + 2] = tempX[i][k].energy;
1332 }
1333 }
1334
1335 ap_uint<6> seed_eta1, seed_phi1;
1336 seed_eta1 = seed_eta;
1337 seed_phi1 = seed_phi;
1338
1339
1340
1341
1342 for (int j = 0; j < p2eg::CRYSTAL_IN_ETA; j++) {
1343 if (j == seed_eta1) {
1344 for (int k = 0; k < p2eg::CRYSTAL_IN_PHI; k++) {
1345 if (k == seed_phi1) {
1346
1347 phi0eta[0] = temp[j][k];
1348 phi1eta[0] = temp[j][k + 1];
1349 phi2eta[0] = temp[j][k + 2];
1350 phi3eta[0] = temp[j][k + 3];
1351 phi4eta[0] = temp[j][k + 4];
1352
1353
1354 phi0eta[1] = temp[j + 1][k];
1355 phi1eta[1] = temp[j + 1][k + 1];
1356 phi2eta[1] = temp[j + 1][k + 2];
1357 phi3eta[1] = temp[j + 1][k + 3];
1358 phi4eta[1] = temp[j + 1][k + 4];
1359
1360
1361 phi0eta[2] = temp[j + 2][k];
1362 phi1eta[2] = temp[j + 2][k + 1];
1363 phi2eta[2] = temp[j + 2][k + 2];
1364 phi3eta[2] = temp[j + 2][k + 3];
1365 phi4eta[2] = temp[j + 2][k + 4];
1366
1367
1368 phi0eta[3] = temp[j + 3][k];
1369 phi1eta[3] = temp[j + 3][k + 1];
1370 phi2eta[3] = temp[j + 3][k + 2];
1371 phi3eta[3] = temp[j + 3][k + 3];
1372 phi4eta[3] = temp[j + 3][k + 4];
1373
1374
1375 phi0eta[4] = temp[j + 4][k];
1376 phi1eta[4] = temp[j + 4][k + 1];
1377 phi2eta[4] = temp[j + 4][k + 2];
1378 phi3eta[4] = temp[j + 4][k + 3];
1379 phi4eta[4] = temp[j + 4][k + 4];
1380
1381 continue;
1382 }
1383 }
1384 }
1385 }
1386
1387
1388 for (int i = 0; i < 5; i++) {
1389 eta_slice[i] = phi0eta[i] + phi1eta[i] + phi2eta[i] + phi3eta[i] + phi4eta[i];
1390 }
1391
1392 cluster_tmp.energy = (eta_slice[1] + eta_slice[2] + eta_slice[3]);
1393
1394
1395 et5x5Tot = (eta_slice[0] + eta_slice[1] + eta_slice[2] + eta_slice[3] + eta_slice[4]);
1396 et2x5_1Tot = (eta_slice[1] + eta_slice[2]);
1397 et2x5_2Tot = (eta_slice[2] + eta_slice[3]);
1398
1399 if (et2x5_1Tot >= et2x5_2Tot)
1400 etSum2x5 = et2x5_1Tot;
1401 else
1402 etSum2x5 = et2x5_2Tot;
1403
1404 cluster_tmp.et5x5 = et5x5Tot;
1405 cluster_tmp.et2x5 = etSum2x5;
1406
1407 return cluster_tmp;
1408 }
1409
1410
1411
1412
1413
1414
1415 inline p2eg::Cluster p2eg::getClusterFromRegion3x4(p2eg::crystal temp[p2eg::CRYSTAL_IN_ETA][p2eg::CRYSTAL_IN_PHI]) {
1416 p2eg::Cluster returnCluster;
1417 p2eg::clusterInfo cluster_tmp;
1418 p2eg::clusterInfo cluster_tmpCenter;
1419 p2eg::clusterInfo cluster_tmpBneg;
1420 p2eg::clusterInfo cluster_tmpBpos;
1421
1422 p2eg::ecalRegion_t ecalRegion;
1423 ecalRegion = p2eg::initStructure(temp);
1424
1425 cluster_tmp = p2eg::getClusterPosition(ecalRegion);
1426
1427 float seedEnergyFloat = cluster_tmp.seedEnergy * ECAL_LSB;
1428
1429
1430 if (seedEnergyFloat < 1.0) {
1431 cluster_tmp.energy = 0;
1432 cluster_tmp.phiMax = 0;
1433 cluster_tmp.etaMax = 0;
1434 return p2eg::packCluster(cluster_tmp.energy, cluster_tmp.phiMax, cluster_tmp.etaMax);
1435 }
1436
1437 ap_uint<5> seed_phi = cluster_tmp.phiMax;
1438 ap_uint<5> seed_eta = cluster_tmp.etaMax;
1439
1440 cluster_tmpCenter = p2eg::getClusterValues(temp, seed_eta, seed_phi);
1441 cluster_tmpBneg = p2eg::getBremsValuesNeg(temp, seed_eta, seed_phi);
1442 cluster_tmpBpos = p2eg::getBremsValuesPos(temp, seed_eta, seed_phi);
1443
1444 cluster_tmp.energy = cluster_tmpCenter.energy;
1445 cluster_tmp.brems = 0;
1446
1447
1448 if ((cluster_tmpBneg.energy > cluster_tmpCenter.energy / 8) && (cluster_tmpBneg.energy > cluster_tmpBpos.energy)) {
1449 cluster_tmp.energy = (cluster_tmpCenter.energy + cluster_tmpBneg.energy);
1450 cluster_tmp.brems = 1;
1451 } else if (cluster_tmpBpos.energy > cluster_tmpCenter.energy / 8) {
1452 cluster_tmp.energy = (cluster_tmpCenter.energy + cluster_tmpBpos.energy);
1453 cluster_tmp.brems = 2;
1454 }
1455
1456 returnCluster = p2eg::packCluster(cluster_tmp.energy, cluster_tmp.etaMax, cluster_tmp.phiMax);
1457 p2eg::removeClusterFromCrystal(temp, seed_eta, seed_phi, cluster_tmp.brems);
1458
1459
1460 returnCluster.brems = cluster_tmp.brems;
1461 returnCluster.et5x5 = cluster_tmpCenter.et5x5;
1462 returnCluster.et2x5 = cluster_tmpCenter.et2x5;
1463
1464 return returnCluster;
1465 }
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475 inline void p2eg::stitchClusterOverRegionBoundary(std::vector<Cluster>& cluster_list,
1476 int towerEtaUpper,
1477 int towerEtaLower,
1478 int cc) {
1479 (void)cc;
1480
1481 int crystalEtaUpper = 0;
1482 int crystalEtaLower = 4;
1483
1484 for (size_t i = 0; i < cluster_list.size(); i++) {
1485 for (size_t j = 0; j < cluster_list.size(); j++) {
1486
1487 if (i == j)
1488 continue;
1489
1490 p2eg::Cluster c1 = cluster_list[i];
1491 p2eg::Cluster c2 = cluster_list[j];
1492
1493 p2eg::Cluster newc1;
1494 p2eg::Cluster newc2;
1495
1496
1497 if ((c1.clusterEnergy() > 0) && (c1.towerEtaInCard() == towerEtaUpper) && (c1.clusterEta() == crystalEtaUpper)) {
1498 if ((c2.clusterEnergy() > 0) && (c2.towerEtaInCard() == towerEtaLower) &&
1499 (c2.clusterEta() == crystalEtaLower)) {
1500 ap_uint<5> phi1 = c1.towerPhi() * 5 + c1.clusterPhi();
1501 ap_uint<5> phi2 = c2.towerPhi() * 5 + c2.clusterPhi();
1502 ap_uint<5> dPhi;
1503 dPhi = (phi1 > phi2) ? (phi1 - phi2) : (phi2 - phi1);
1504
1505 if (dPhi < 2) {
1506 ap_uint<12> totalEnergy = c1.clusterEnergy() + c2.clusterEnergy();
1507 ap_uint<15> totalEt2x5 = c1.uint_et2x5() + c2.uint_et2x5();
1508 ap_uint<15> totalEt5x5 = c1.uint_et5x5() + c2.uint_et5x5();
1509
1510 bool rct_is_iso = false;
1511 bool rct_is_looseTkiso = false;
1512
1513
1514 if (c1.clusterEnergy() > c2.clusterEnergy()) {
1515 newc1 = p2eg::Cluster(totalEnergy,
1516 c1.towerEta(),
1517 c1.towerPhi(),
1518 c1.clusterEta(),
1519 c1.clusterPhi(),
1520 c1.satur(),
1521 totalEt5x5,
1522 totalEt2x5,
1523 c1.getBrems(),
1524 c1.getCalib(),
1525 c1.getIsSS(),
1526 c1.getIsLooseTkss(),
1527 rct_is_iso,
1528 rct_is_looseTkiso,
1529 c1.region());
1530 newc2 = p2eg::Cluster(0,
1531 c2.towerEta(),
1532 c2.towerPhi(),
1533 c2.clusterEta(),
1534 c2.clusterPhi(),
1535 c2.satur(),
1536 0,
1537 0,
1538 0,
1539 1.0,
1540 false,
1541 false,
1542 rct_is_iso,
1543 rct_is_looseTkiso,
1544 c2.region());
1545 cluster_list[i] = newc1;
1546 cluster_list[j] = newc2;
1547 } else {
1548
1549 newc1 = p2eg::Cluster(0,
1550 c1.towerEta(),
1551 c1.towerPhi(),
1552 c1.clusterEta(),
1553 c1.clusterPhi(),
1554 c1.satur(),
1555 0,
1556 0,
1557 0,
1558 1.0,
1559 false,
1560 false,
1561 rct_is_iso,
1562 rct_is_looseTkiso,
1563 c1.region());
1564 newc2 = p2eg::Cluster(totalEnergy,
1565 c2.towerEta(),
1566 c2.towerPhi(),
1567 c2.clusterEta(),
1568 c2.clusterPhi(),
1569 c2.satur(),
1570 totalEt5x5,
1571 totalEt2x5,
1572 c2.getBrems(),
1573 c2.getCalib(),
1574 c2.getIsSS(),
1575 c2.getIsLooseTkss(),
1576 rct_is_iso,
1577 rct_is_looseTkiso,
1578 c2.region());
1579 cluster_list[i] = newc1;
1580 cluster_list[j] = newc2;
1581 }
1582 }
1583 }
1584 }
1585 }
1586 }
1587 }
1588
1589
1590
1591 #endif