@@ -448,7 +448,7 @@ class pidTPCModule
448448
449449 std::vector<float > networkPrediction;
450450
451- auto startNetworkTotal = std::chrono::high_resolution_clock::now ();
451+ const auto startNetworkTotal = std::chrono::high_resolution_clock::now ();
452452 if (pidTPCopts.autofetchNetworks ) {
453453 const auto & bc = bcs.begin ();
454454 // Initialise correct TPC response object before NN setup (for NCl normalisation)
@@ -486,7 +486,7 @@ class pidTPCModule
486486
487487 if (bc.timestamp () < network.getValidityFrom () || bc.timestamp () > network.getValidityUntil ()) { // fetches network only if the runnumbers change
488488 LOG (info) << " Fetching network for timestamp: " << bc.timestamp ();
489- bool retrieveSuccess = ccdb->getCCDBAccessor ().retrieveBlob (pidTPCopts.networkPathCCDB .value , " ." , metadata, bc.timestamp (), false , pidTPCopts.networkPathLocally .value , " " , " " , &headers);
489+ const bool retrieveSuccess = ccdb->getCCDBAccessor ().retrieveBlob (pidTPCopts.networkPathCCDB .value , " ." , metadata, bc.timestamp (), false , pidTPCopts.networkPathLocally .value , " " , " " , &headers);
490490 networkVersion = headers[" NN-Version" ];
491491 if (retrieveSuccess) {
492492 network.initModel (pidTPCopts.networkPathLocally .value , pidTPCopts.enableNetworkOptimizations .value , pidTPCopts.networkSetNumThreads .value , strtoul (headers[" Valid-From" ].c_str (), NULL , 0 ), strtoul (headers[" Valid-Until" ].c_str (), NULL , 0 ));
@@ -500,16 +500,16 @@ class pidTPCModule
500500 }
501501
502502 // Defining some network parameters
503- int inputDimensions = network.getNumInputNodes ();
504- int outputDimensions = network.getNumOutputNodes ();
505- const uint64_t track_prop_size = inputDimensions * size;
506- const uint64_t prediction_size = outputDimensions * size;
503+ const int inputDimensions = network.getNumInputNodes ();
504+ const int outputDimensions = network.getNumOutputNodes ();
505+ const uint64_t trackPropSize = inputDimensions * size;
506+ const uint64_t predictionSize = outputDimensions * size;
507507
508- networkPrediction = std::vector<float >(prediction_size * 9 ); // For each mass hypotheses
508+ networkPrediction = std::vector<float >(predictionSize * 9 ); // For each mass hypotheses
509509 const float nNclNormalization = response->GetNClNormalization ();
510510 float durationNetwork = 0 ;
511511
512- std::vector<float > trackProperties (track_prop_size );
512+ std::vector<float > trackProperties (trackPropSize );
513513 uint64_t counterTrackProps = 0 ;
514514 int loopCounter = 0 ;
515515
@@ -600,13 +600,13 @@ class pidTPCModule
600600 counterTrackProps += inputDimensions;
601601 }
602602
603- auto startNetworkEval = std::chrono::high_resolution_clock::now ();
604- float * outputNetwork = network.evalModel (trackProperties);
605- auto stopNetworkEval = std::chrono::high_resolution_clock::now ();
603+ const auto startNetworkEval = std::chrono::high_resolution_clock::now ();
604+ const float * const outputNetwork = network.evalModel (trackProperties);
605+ const auto stopNetworkEval = std::chrono::high_resolution_clock::now ();
606606 durationNetwork += std::chrono::duration<float , std::ratio<1 , 1000000000 >>(stopNetworkEval - startNetworkEval).count ();
607- for (uint64_t k = 0 ; k < prediction_size ; k += outputDimensions) {
607+ for (uint64_t k = 0 ; k < predictionSize ; k += outputDimensions) {
608608 for (int l = 0 ; l < outputDimensions; l++) {
609- networkPrediction[k + l + prediction_size * loopCounter] = outputNetwork[k + l];
609+ networkPrediction[k + l + predictionSize * loopCounter] = outputNetwork[k + l];
610610 }
611611 }
612612
@@ -615,7 +615,7 @@ class pidTPCModule
615615 }
616616 trackProperties.clear ();
617617
618- auto stopNetworkTotal = std::chrono::high_resolution_clock::now ();
618+ const auto stopNetworkTotal = std::chrono::high_resolution_clock::now ();
619619 LOG (debug) << " Neural Network for the TPC PID response correction: Time per track (eval ONNX): " << durationNetwork / (size * 9 ) << " ns ; Total time (eval ONNX): " << durationNetwork / 1000000000 << " s" ;
620620 LOG (debug) << " Neural Network for the TPC PID response correction: Time per track (eval + overhead): " << std::chrono::duration<float , std::ratio<1 , 1000000000 >>(stopNetworkTotal - startNetworkTotal).count () / (size * 9 ) << " ns ; Total time (eval + overhead): " << std::chrono::duration<float , std::ratio<1 , 1000000000 >>(stopNetworkTotal - startNetworkTotal).count () / 1000000000 << " s" ;
621621
0 commit comments