111 B2ERROR(
"ParticleList " << iList <<
" not found");
114 unsigned int particleListSize = particleList -> getListSize();
115 if (particleListSize == 0) {
121 std::vector<CurlTagger::Bundle> bundles;
122 std::vector<CurlTagger::Bundle> truthBundles;
124 for (
unsigned int i = 0; i < particleListSize; i++) {
126 Particle* iPart = particleList -> getParticle(i);
127 iPart -> addExtraInfo(
"isCurl", 0);
128 iPart -> addExtraInfo(
"bundleSize", 0);
130 iPart -> addExtraInfo(
"isTruthCurl", 0);
131 iPart -> addExtraInfo(
"truthBundleSize", 0);
135 bool addedParticleToBundle =
false;
136 std::vector<float> bundlesResponse;
139 unsigned int bundleSize = bundle.size();
140 float averageResponse = 0;
142 for (
unsigned int b = 0; b < bundleSize; b++) {
143 Particle* bPart = bundle.getParticle(b);
144 averageResponse +=
m_Selector -> getResponse(iPart, bPart);
147 averageResponse /= bundleSize;
148 bundlesResponse.push_back(averageResponse);
151 if (bundlesResponse.size() > 0) {
152 auto maxElement = std::max_element(bundlesResponse.begin(), bundlesResponse.end());
154 int maxPosition = std::distance(bundlesResponse.begin(), maxElement);
155 bundles[maxPosition].addParticle(iPart);
156 addedParticleToBundle =
true;
160 if (!addedParticleToBundle) {
163 bundles.push_back(tempBundle);
167 bool addedParticleToTruthBundle =
false;
168 for (
auto& truthBundle : truthBundles) {
169 Particle* bPart = truthBundle.getParticle(0);
170 if (Variable::genParticleIndex(iPart) == Variable::genParticleIndex(bPart)) {
171 truthBundle.addParticle(iPart);
172 addedParticleToTruthBundle =
true;
176 if (!addedParticleToTruthBundle) {
179 truthBundles.push_back(truthTempBundle);
184 bundle.tagCurlInfo();
186 bundle.tagSizeInfo();
191 truthBundle.tagCurlInfo();
192 truthBundle.tagSizeInfo();
196 for (
unsigned int i = 0; i < particleListSize; i++) {
197 Particle* iPart = particleList -> getParticle(i);
200 for (
unsigned int j = 0; j < particleListSize; j++) {
201 Particle* jPart = particleList -> getParticle(j);
202 if (i == j) {
continue;}
205 m_Selector->collectTrainingInfo(iPart, jPart);
Class to store reconstructed particles.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.