BmnRoot
Loading...
Searching...
No Matches
EventCatalogue Class Reference

#include <EventCatalogue.h>

Public Member Functions

 EventCatalogue ()
 
virtual ~EventCatalogue ()
 
vector< unique_ptr< EventInfo > > GetEventList (vector< unique_ptr< EventCondition > > event_conditions)
 
unique_ptr< EventInfoGetEventInfo (string storage_name, string file_path, int event_number)
 
int AddEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata)
 
int AddEventInfo (string json_file_path)
 
int UpdateEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata)
 
int DeleteEventInfo (string storage_name, string file_path, int event_number)
 
int CheckEventInfo (string storage_name, string file_path, int event_number)
 
int PrintEventInfo (string storage_name, string file_path, int event_number)
 
int AddStorageInfo (string storage_name)
 
int AddSoftwareInfo (string software_version)
 
vector< unique_ptr< EventInfo > > EventCatalogueRequest (string rest_api_request)
 
int EventCatalogueChecks (int &file_not_found, vector< unique_ptr< EventInfo > > &event_list)
 
int EventCatalogueStats (int &record_count)
 
void SetVerbose (int verbose_level=2)
 
 EventCatalogue ()
 
virtual ~EventCatalogue ()
 
vector< unique_ptr< EventInfo > > GetEventList (vector< unique_ptr< EventCondition > > event_conditions)
 
unique_ptr< EventInfoGetEventInfo (string storage_name, string file_path, int event_number)
 
int AddEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata)
 
int AddEventInfo (string json_file_path)
 
int UpdateEventInfo (string storage_name, string file_path, int event_number, EventInfo event_metadata)
 
int DeleteEventInfo (string storage_name, string file_path, int event_number)
 
int CheckEventInfo (string storage_name, string file_path, int event_number)
 
int PrintEventInfo (string storage_name, string file_path, int event_number)
 
int AddStorageInfo (string storage_name)
 
int AddSoftwareInfo (string software_version)
 
vector< unique_ptr< EventInfo > > EventCatalogueRequest (string rest_api_request)
 
int EventCatalogueChecks (int &file_not_found, vector< unique_ptr< EventInfo > > &event_list)
 
int EventCatalogueStats (int &record_count)
 
void SetVerbose (int verbose_level=2)
 

Detailed Description

Main Interface Class to work with the Event Catalogue of the experiment Throws runtime_exception if a critical error occurrs while the constructor Error Codes: -1 - sending command via CURL failed, -401 - unauthorized request, -403 - token invalid or expired, -404 - data not found, -409 - incorrect database request (e.g. violating constraints), -422 - incorrect input request, -500 - internal server error, -503 - service unavaialble, -504 - gateway timeout

Definition at line 98 of file EventCatalogue.h.

Constructor & Destructor Documentation

◆ EventCatalogue() [1/2]

EventCatalogue::EventCatalogue ( )

◆ ~EventCatalogue() [1/2]

EventCatalogue::~EventCatalogue ( )
virtual

Definition at line 88 of file EventCatalogue.cxx.

◆ EventCatalogue() [2/2]

EventCatalogue::EventCatalogue ( )

◆ ~EventCatalogue() [2/2]

virtual EventCatalogue::~EventCatalogue ( )
virtual

Member Function Documentation

◆ AddEventInfo() [1/4]

int EventCatalogue::AddEventInfo ( string  json_file_path)

Function to add metadata of events to the Event Catalogue using input JSON file path

Parameters
[in]json_file_pathpath of the JSON file containing a set of event metadata to be stored
Returns
number (>=0) of successfully added event metadata records or error_code (<0) in case of failures

Definition at line 170 of file EventCatalogue.cxx.

◆ AddEventInfo() [2/4]

int EventCatalogue::AddEventInfo ( string  json_file_path)

Function to add metadata of events to the Event Catalogue using input JSON file path

Parameters
[in]json_file_pathpath of the JSON file containing a set of event metadata to be stored
Returns
number (>=0) of successfully added event metadata records or error_code (<0) in case of failures

◆ AddEventInfo() [3/4]

int EventCatalogue::AddEventInfo ( string  storage_name,
string  file_path,
int  event_number,
EventInfo  event_metadata 
)

Function to add metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
[in]event_metadata'EventInfo' object containing event metadata for the event
Returns
0 - if successfully added, <0 - an error occured

Function to add metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
[in]event_metadata'EventInfo' object containing event metadata for the event
Returns
0 - if successfully added, -2 - if event was not found at the location, -3 - connection problem with the Event Catalogue

Definition at line 132 of file EventCatalogue.cxx.

◆ AddEventInfo() [4/4]

int EventCatalogue::AddEventInfo ( string  storage_name,
string  file_path,
int  event_number,
EventInfo  event_metadata 
)

Function to add metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
[in]event_metadata'EventInfo' object containing event metadata for the event
Returns
0 - if successfully added, <0 - an error occured

◆ AddSoftwareInfo() [1/2]

int EventCatalogue::AddSoftwareInfo ( string  software_version)

Function to add software version to the dictionary used by the Event Catalogue

Parameters
[in]software_versionVersion of the software, which was used to obtain processed events
Returns
0 - if successfull, <0 - an error occured

Definition at line 273 of file EventCatalogue.cxx.

◆ AddSoftwareInfo() [2/2]

int EventCatalogue::AddSoftwareInfo ( string  software_version)

Function to add software version to the dictionary used by the Event Catalogue

Parameters
[in]software_versionVersion of the software, which was used to obtain processed events
Returns
0 - if successfull, <0 - an error occured

◆ AddStorageInfo() [1/2]

int EventCatalogue::AddStorageInfo ( string  storage_name)

Function to add storage to the dictionary used by the Event Catalogue

Parameters
[in]storage_nameName of the storage be added to the dictionary
Returns
0 - if successfull, <0 - an error occured

Definition at line 252 of file EventCatalogue.cxx.

◆ AddStorageInfo() [2/2]

int EventCatalogue::AddStorageInfo ( string  storage_name)

Function to add storage to the dictionary used by the Event Catalogue

Parameters
[in]storage_nameName of the storage be added to the dictionary
Returns
0 - if successfull, <0 - an error occured

◆ CheckEventInfo() [1/2]

int EventCatalogue::CheckEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function to check metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if event metadata is avaialble, 1 - if event metadata is not set, <0 - an error occured

Function to check metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if event metadata is avaialble, -1 - if event metadata is not set, -2 - if event was not found at the location, -3 - connection problem with the Event Catalogue

Definition at line 225 of file EventCatalogue.cxx.

◆ CheckEventInfo() [2/2]

int EventCatalogue::CheckEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function to check metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if event metadata is avaialble, 1 - if event metadata is not set, <0 - an error occured

◆ DeleteEventInfo() [1/2]

int EventCatalogue::DeleteEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function to delete metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if successfully deleted, <0 - an error occured

Function to delete metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if successfully deleted, -2 - if event was not found at the location, -3 - connection problem with the Event Catalogue

Definition at line 210 of file EventCatalogue.cxx.

◆ DeleteEventInfo() [2/2]

int EventCatalogue::DeleteEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function to delete metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if successfully deleted, <0 - an error occured

◆ EventCatalogueChecks() [1/2]

int EventCatalogue::EventCatalogueChecks ( int &  file_not_found,
vector< unique_ptr< EventInfo > > &  event_list 
)

Function to perform a set of specific checks in the Event Catalogue

Parameters
[out]file_not_foundNumber of not found files for existing metadata in the Catalogue
[out]event_listList of not found files for existing metadata in the Catalogue
Returns
0 - if successfull, <0 - an error occured

Function to perform a set of specific checks in the Event Catalogue

Parameters
[out]file_not_foundNumber of not found files for existing metadata in the Catalogue
[out]event_listList of not found files for existing metadata in the Catalogue
Returns
0 - if successfull, -3 - connection problem with the Event Catalogue

Definition at line 310 of file EventCatalogue.cxx.

◆ EventCatalogueChecks() [2/2]

int EventCatalogue::EventCatalogueChecks ( int &  file_not_found,
vector< unique_ptr< EventInfo > > &  event_list 
)

Function to perform a set of specific checks in the Event Catalogue

Parameters
[out]file_not_foundNumber of not found files for existing metadata in the Catalogue
[out]event_listList of not found files for existing metadata in the Catalogue
Returns
0 - if successfull, <0 - an error occured

◆ EventCatalogueRequest() [1/2]

vector< unique_ptr< EventInfo > > EventCatalogue::EventCatalogueRequest ( string  rest_api_request)

Function for searching for event metadata in the Event Catalogue using REST API request as an HTTP(s) string

Parameters
[in]rest_api_requestString HTTP command representing a request using REST API format
Returns
Array of the 'EventInfo' objects containing selected event metadata (enpty if not found or some errors occured)

Definition at line 296 of file EventCatalogue.cxx.

◆ EventCatalogueRequest() [2/2]

vector< unique_ptr< EventInfo > > EventCatalogue::EventCatalogueRequest ( string  rest_api_request)

Function for searching for event metadata in the Event Catalogue using REST API request as an HTTP(s) string

Parameters
[in]rest_api_requestString HTTP command representing a request using REST API format
Returns
Array of the 'EventInfo' objects containing selected event metadata (enpty if not found or some errors occured)

◆ EventCatalogueStats() [1/2]

int EventCatalogue::EventCatalogueStats ( int &  record_count)

Function to collect summary statistics on the Event Catalogue

Parameters
[out]record_countNumber of records in the Event Catalogue
Returns
0 - if successfull, <0 - an error occured

Function to collect summary statistics on the Event Catalogue

Parameters
[out]record_countNumber of records in the Event Catalogue
Returns
0 - if successfull, -3 - connection problem with the Event Catalogue

Definition at line 322 of file EventCatalogue.cxx.

◆ EventCatalogueStats() [2/2]

int EventCatalogue::EventCatalogueStats ( int &  record_count)

Function to collect summary statistics on the Event Catalogue

Parameters
[out]record_countNumber of records in the Event Catalogue
Returns
0 - if successfull, <0 - an error occured

◆ GetEventInfo() [1/2]

unique_ptr< EventInfo > EventCatalogue::GetEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function tp get metadata of the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
'EventInfo' object containing event metadata for the event (nullptr if not found or some errors occured)

Definition at line 115 of file EventCatalogue.cxx.

◆ GetEventInfo() [2/2]

unique_ptr< EventInfo > EventCatalogue::GetEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function tp get metadata of the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
'EventInfo' object containing event metadata for the event (nullptr if not found or some errors occured)

◆ GetEventList() [1/2]

vector< unique_ptr< EventInfo > > EventCatalogue::GetEventList ( vector< unique_ptr< EventCondition > >  event_conditions)

Function for searching for event metadata in the Event Catalogue using specified conditions

Parameters
[in]event_conditionsA set of conditions to specify criteria for event metadata search
Returns
Array of the 'EventInfo' objects containing selected event metadata (enpty if not found or some errors occured)

Definition at line 100 of file EventCatalogue.cxx.

◆ GetEventList() [2/2]

vector< unique_ptr< EventInfo > > EventCatalogue::GetEventList ( vector< unique_ptr< EventCondition > >  event_conditions)

Function for searching for event metadata in the Event Catalogue using specified conditions

Parameters
[in]event_conditionsA set of conditions to specify criteria for event metadata search
Returns
Array of the 'EventInfo' objects containing selected event metadata (enpty if not found or some errors occured)

◆ PrintEventInfo() [1/2]

int EventCatalogue::PrintEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function to print metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if successfull, <0 - an error occured

Function to print metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if successfull, -2 - if event was not found at the location, -3 - connection problem with the Event Catalogue

Definition at line 240 of file EventCatalogue.cxx.

◆ PrintEventInfo() [2/2]

int EventCatalogue::PrintEventInfo ( string  storage_name,
string  file_path,
int  event_number 
)

Function to print metadata for the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
Returns
0 - if successfull, <0 - an error occured

◆ SetVerbose() [1/2]

void EventCatalogue::SetVerbose ( int  verbose_level = 2)
inline

Setting Verbose level: 0 - only errors, 1 - normal output, 2 - detailed output, 2- all with debug info

Parameters
[in]verbose_levelVerbose level for output information

Definition at line 216 of file EventCatalogue.h.

◆ SetVerbose() [2/2]

void EventCatalogue::SetVerbose ( int  verbose_level = 2)
inline

Setting Verbose level: 0 - only errors, 1 - normal output, 2 - detailed output, 2- all with debug info

Parameters
[in]verbose_levelVerbose level for output information

Definition at line 216 of file EventCatalogue.h.

◆ UpdateEventInfo() [1/2]

int EventCatalogue::UpdateEventInfo ( string  storage_name,
string  file_path,
int  event_number,
EventInfo  event_metadata 
)

Function to update metadata of the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
[in]event_metadata'EventInfo' object containing event metadata for the event
Returns
0 - if successfully updated, <0 - an error occured

Function to update metadata of the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
[in]event_metadata'EventInfo' object containing event metadata for the event
Returns
0 - if successfully updated, -2 - if event was not found at the location, -3 - connection problem with the Event Catalogue

Definition at line 195 of file EventCatalogue.cxx.

◆ UpdateEventInfo() [2/2]

int EventCatalogue::UpdateEventInfo ( string  storage_name,
string  file_path,
int  event_number,
EventInfo  event_metadata 
)

Function to update metadata of the event stored at the given location

Parameters
[in]storage_nameStorage, where the file with the event is located
[in]file_pathPath of the file containing the event
[in]event_numberNumber of the event in the file
[in]event_metadata'EventInfo' object containing event metadata for the event
Returns
0 - if successfully updated, <0 - an error occured

The documentation for this class was generated from the following files: