Skip to content

Commit 9f990a6

Browse files
committed
Fixes
1 parent 4e7f6ff commit 9f990a6

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

‎Common/Tools/PID/pidTPCModule.h‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,13 @@ class pidTPCModule
569569
// every page of an O(100 MB) buffer twice.
570570
std::unique_ptr<float[]> networkPrediction(new float[predictionSize * NParticleTypes]); // For each mass hypotheses
571571

572-
std::vector<float> track_properties(track_prop_size);
573-
std::vector<float> output_network; // output buffer, allocation is reused for all mass hypotheses
574-
uint64_t counter_track_props = 0;
575-
int loop_counter = 0;
572+
const float nNclNormalization = response->GetNClNormalization();
573+
float durationNetwork = 0.f;
574+
575+
std::vector<float> trackProperties(trackPropSize);
576+
std::vector<float> outputNetwork; // output buffer, allocation is reused for all mass hypotheses
577+
uint64_t counterTrackProps = 0;
578+
uint64_t loopCounter = 0;
576579

577580
// To load the Hadronic rate once for each collision
578581
std::vector<float> hadronicRateForCollision(collisions.size(), 0.0f);
@@ -623,14 +626,14 @@ class pidTPCModule
623626
counterTrackProps += inputDimensions;
624627
}
625628

626-
auto start_network_eval = std::chrono::high_resolution_clock::now();
627-
network.evalModel(track_properties, output_network);
628-
auto stop_network_eval = std::chrono::high_resolution_clock::now();
629-
duration_network += std::chrono::duration<float, std::ratio<1, 1000000000>>(stop_network_eval - start_network_eval).count();
630-
if (output_network.size() != prediction_size) {
631-
LOG(fatal) << "Network output size (" << output_network.size() << ") does not match the expected prediction size (" << prediction_size << ")";
629+
const auto startNetworkEval = std::chrono::high_resolution_clock::now();
630+
network.evalModel(trackProperties, outputNetwork);
631+
const auto stopNetworkEval = std::chrono::high_resolution_clock::now();
632+
durationNetwork += std::chrono::duration<float, std::ratio<1, NanoToOne>>(stopNetworkEval - startNetworkEval).count();
633+
if (outputNetwork.size() != predictionSize) {
634+
LOG(fatal) << "Network output size (" << outputNetwork.size() << ") does not match the expected prediction size (" << predictionSize << ")";
632635
}
633-
std::copy(output_network.begin(), output_network.end(), network_prediction.get() + prediction_size * loop_counter);
636+
std::copy(outputNetwork.begin(), outputNetwork.end(), networkPrediction.get() + predictionSize * loopCounter);
634637

635638
counterTrackProps = 0;
636639
++loopCounter;

0 commit comments

Comments
 (0)