109 B2ERROR(
"ParticleList " << iList <<
" not found");
112 unsigned int particleListSize = particleList -> getListSize();
113 if (particleListSize == 0) {
119 std::vector<CurlTagger::Bundle> bundles;
120 std::vector<CurlTagger::Bundle> truthBundles;
122 for (
unsigned int i = 0; i < particleListSize; i++) {
124 Particle* iPart = particleList -> getParticle(i);
125 iPart -> addExtraInfo(
"isCurl", 0);
126 iPart -> addExtraInfo(
"bundleSize", 0);
128 iPart -> addExtraInfo(
"isTruthCurl", 0);
129 iPart -> addExtraInfo(
"truthBundleSize", 0);
133 bool addedParticleToBundle =
false;
134 std::vector<float> bundlesResponse;
137 unsigned int bundleSize = bundle.size();
138 float averageResponse = 0;
140 for (
unsigned int b = 0; b < bundleSize; b++) {
141 Particle* bPart = bundle.getParticle(b);
142 averageResponse +=
m_Selector -> getResponse(iPart, bPart);
145 averageResponse /= bundleSize;
146 bundlesResponse.push_back(averageResponse);
149 if (bundlesResponse.size() > 0) {
150 auto maxElement = std::max_element(bundlesResponse.begin(), bundlesResponse.end());
152 int maxPosition = std::distance(std::begin(bundlesResponse), maxElement);
153 bundles[maxPosition].addParticle(iPart);
154 addedParticleToBundle =
true;
158 if (!addedParticleToBundle) {
161 bundles.push_back(tempBundle);
165 bool addedParticleToTruthBundle =
false;
166 for (
auto& truthBundle : truthBundles) {
167 Particle* bPart = truthBundle.getParticle(0);
168 if (Variable::genParticleIndex(iPart) == Variable::genParticleIndex(bPart)) {
169 truthBundle.addParticle(iPart);
170 addedParticleToTruthBundle =
true;
174 if (!addedParticleToTruthBundle) {
177 truthBundles.push_back(truthTempBundle);
182 bundle.tagCurlInfo();
184 bundle.tagSizeInfo();
189 truthBundle.tagCurlInfo();
190 truthBundle.tagSizeInfo();
194 for (
unsigned int i = 0; i < particleListSize; i++) {
195 Particle* iPart = particleList -> getParticle(i);
198 for (
unsigned int j = 0; j < particleListSize; j++) {
199 Particle* jPart = particleList -> getParticle(j);
200 if (i == j) {
continue;}
203 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.