1101{
1103 {
1104 const int total_size = (cluster_order.size() ? cluster_order.size() :
clusters->number);
1105 for (
int i = 0;
i < total_size; ++
i)
1106 {
1107 const int cluster_index = (cluster_order.size() ? cluster_order[i] : i);
1108
1110
1112
1115 {
1116 const int cells_per_sampling =
clusters->moments.nCellSampling[sampl][cluster_index];
1117
1118 if (cells_per_sampling > 0)
1119 {
1120 sampling_pattern |= (0x1U << sampl);
1121 }
1122 }
1123
1124 if (
clusters->moments.nExtraCellSampling[cluster_index] > 0)
1125 {
1126 sampling_pattern |= (1U << static_cast<unsigned int>(CaloSampling::EME2));
1127 }
1128
1130
1132 {
1133 if (sampling_pattern & (1U << s))
1134 {
1136 }
1137 }
1138
1139 if (
clusters->moments.nExtraCellSampling[cluster_index] > 0)
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 }
1180 {
1181 if (sampling_pattern & (1U << s))
1182 {
1184 }
1185 }
1186
1189
1190#define CALORECGPU_MOMENTS_OUTPUT_HELPER(VAR_NAME, PROPER_MOMENT, NORMAL_ASSIGN, IS_CALCULATED, MOMENT_NAME, ...) \
1191 CRGPU_CONCAT(CRGPU_CONCAT(CALORECGPU_MOMENTS_OUTPUT_HELPER_, NORMAL_ASSIGN), IS_CALCULATED) (VAR_NAME, MOMENT_NAME)
1192
1193#define CALORECGPU_MOMENTS_OUTPUT_HELPER_11(VAR_NAME, MOMENT_NAME) \
1194 if (moments_to_add[xAOD::CaloCluster:: MOMENT_NAME]) \
1195 { \
1196 cluster->insertMoment(xAOD::CaloCluster:: MOMENT_NAME , clusters->moments. VAR_NAME [cluster_index]); \
1197 }
1198
1199#define CALORECGPU_MOMENTS_OUTPUT_HELPER_10(VAR_NAME, MOMENT_NAME) \
1200 if (output_extra_moments && moments_to_add[xAOD::CaloCluster:: MOMENT_NAME]) \
1201 { \
1202 cluster->insertMoment(xAOD::CaloCluster:: MOMENT_NAME , clusters->moments. VAR_NAME [cluster_index]); \
1203 }
1204
1205#define CALORECGPU_MOMENTS_OUTPUT_HELPER_00(...)
1206#define CALORECGPU_MOMENTS_OUTPUT_HELPER_01(...)
1207
1209 }
1210 }
1211}
#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.