Project
Loading...
Searching...
No Matches
NeuralNetworkClusterizer.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
18
19using namespace o2::tpc;
20
22{
23 ccdbApi.init(url);
24}
25
26void NeuralNetworkClusterizer::loadIndividualFromCCDB(std::map<std::string, std::string> settings)
27{
28 metadata["inputDType"] = settings["inputDType"];
29 metadata["outputDType"] = settings["outputDType"];
30 metadata["nnCCDBEvalType"] = settings["nnCCDBEvalType"]; // classification_1C, classification_2C, regression_1C, regression_2C
31 metadata["nnCCDBWithMomentum"] = settings["nnCCDBWithMomentum"]; // 0, 1 -> Only for regression model
32 metadata["nnCCDBLayerType"] = settings["nnCCDBLayerType"]; // FC, CNN
33 if (settings["nnCCDBInteractionRate"] != "" && std::stoi(settings["nnCCDBInteractionRate"]) > 0) {
34 metadata["nnCCDBInteractionRate"] = settings["nnCCDBInteractionRate"];
35 }
36 if (settings["nnCCDBBeamType"] != "") {
37 metadata["nnCCDBBeamType"] = settings["nnCCDBBeamType"];
38 }
39
40 bool retrieveSuccess = ccdbApi.retrieveBlob(settings["nnCCDBPath"], settings["outputFolder"], metadata, 1, false, settings["outputFile"]);
41 // headers = ccdbApi.retrieveHeaders(settings["nnPathCCDB"], metadata, 1); // potentially needed to init some local variables
42
43 if (retrieveSuccess) {
44 LOG(info) << "Network " << settings["nnCCDBPath"] << " retrieved from CCDB, stored at " << settings["outputFile"];
45 } else {
46 LOG(error) << "Failed to retrieve network from CCDB";
47 }
48}
Fetching neural networks for clusterization from CCDB.
bool retrieveBlob(std::string const &path, std::string const &targetdir, std::map< std::string, std::string > const &metadata, long timestamp, bool preservePathStructure=true, std::string const &localFileName="snapshot.root", std::string const &createdNotAfter="", std::string const &createdNotBefore="") const
Definition CcdbApi.cxx:832
void init(std::string const &hosts)
Definition CcdbApi.cxx:165
void loadIndividualFromCCDB(std::map< std::string, std::string > settings)
Global TPC definitions and constants.
Definition SimTraits.h:167
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"