1094{
1096 {
1097 const int total_size = (cluster_order.size() ? cluster_order.size() :
clusters->number);
1098 for (
int i = 0;
i < total_size; ++
i)
1099 {
1100 const int cluster_index = (cluster_order.size() ? cluster_order[i] : i);
1101
1103
1105
1108 {
1109 const int cells_per_sampling =
clusters->moments.nCellSampling[sampl][cluster_index];
1110
1111 if (cells_per_sampling > 0)
1112 {
1113 sampling_pattern |= (0x1U << sampl);
1114 }
1115 }
1116
1117 if (
clusters->moments.nExtraCellSampling[cluster_index] > 0)
1118 {
1119 sampling_pattern |= (1U << static_cast<unsigned int>(CaloSampling::EME2));
1120 }
1121
1123
1125 {
1126 if (sampling_pattern & (1U << s))
1127 {
1129 }
1130 }
1131
1132 if (
clusters->moments.nExtraCellSampling[cluster_index] > 0)
1133 {
1135 }
1136
1138 {
1139 if (sampling_pattern & (1U << s))
1140 {
1142 }
1143 }
1145 {
1146 if (sampling_pattern & (1U << s))
1147 {
1149 }
1150 }
1152 {
1153 if (sampling_pattern & (1U << s))
1154 {
1156 }
1157 }
1159 {
1160 if (sampling_pattern & (1U << s))
1161 {
1163 }
1164 }
1166 {
1167 if (sampling_pattern & (1U << s))
1168 {
1170 }
1171 }
1173 {
1174 if (sampling_pattern & (1U << s))
1175 {
1177 }
1178 }
1179
1182
1183#define CALORECGPU_MOMENTS_OUTPUT_HELPER(VAR_NAME, PROPER_MOMENT, NORMAL_ASSIGN, IS_CALCULATED, MOMENT_NAME, ...) \
1184 CRGPU_CONCAT(CRGPU_CONCAT(CALORECGPU_MOMENTS_OUTPUT_HELPER_, NORMAL_ASSIGN), IS_CALCULATED) (VAR_NAME, MOMENT_NAME)
1185
1186#define CALORECGPU_MOMENTS_OUTPUT_HELPER_11(VAR_NAME, MOMENT_NAME) \
1187 if (moments_to_add[xAOD::CaloCluster:: MOMENT_NAME]) \
1188 { \
1189 cluster->insertMoment(xAOD::CaloCluster:: MOMENT_NAME , clusters->moments. VAR_NAME [cluster_index]); \
1190 }
1191
1192#define CALORECGPU_MOMENTS_OUTPUT_HELPER_10(VAR_NAME, MOMENT_NAME) \
1193 if (output_extra_moments && moments_to_add[xAOD::CaloCluster:: MOMENT_NAME]) \
1194 { \
1195 cluster->insertMoment(xAOD::CaloCluster:: MOMENT_NAME , clusters->moments. VAR_NAME [cluster_index]); \
1196 }
1197
1198#define CALORECGPU_MOMENTS_OUTPUT_HELPER_00(...)
1199#define CALORECGPU_MOMENTS_OUTPUT_HELPER_01(...)
1200
1202 }
1203 }
1204}
#define CALORECGPU_MOMENTS_OUTPUT_HELPER(VAR_NAME, PROPER_MOMENT, NORMAL_ASSIGN, IS_CALCULATED, MOMENT_NAME,...)
void setSecondTime(flt_t stime)
Set second moment of cell timing distribution.
void setTime(flt_t)
Set cluster time.
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
bool setEmax(const CaloSample sampling, const float eMax)
Set the Energy of the cell with the highest energy in a particular sampling.
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
void setSamplingPattern(const unsigned sp, const bool clearSamplingVars=false)
Set sampling pattern (one bit per sampling.
void setNumberCellsInSampling(CaloSampling::CaloSample samp, int ncells, bool isInnerWheel=false)
Set the number of cells in a sampling layer.
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.
void clearSamplingData()
Clear the sampling data.