BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
UniRunPeriod Class Reference

UniRunPeriod.h Class for the table: run_period. More...

#include <UniRunPeriod.h>

Collaboration diagram for UniRunPeriod:

Public Member Functions

virtual ~UniRunPeriod ()
int GetPeriodNumber ()
 get period number of the current run period
TDatime GetStartDatetime ()
 get start datetime of the current run period
TDatime * GetEndDatetime ()
 get end datetime of the current run period
int SetPeriodNumber (int period_number)
 set period number of the current run period
int SetStartDatetime (TDatime start_datetime)
 set start datetime of the current run period
int SetEndDatetime (TDatime *end_datetime)
 set end datetime of the current run period
void Print ()
 print information about current run period
virtual ~UniRunPeriod ()
int GetPeriodNumber ()
 get period number of the current run period
TDatime GetStartDatetime ()
 get start datetime of the current run period
TDatime * GetEndDatetime ()
 get end datetime of the current run period
int SetPeriodNumber (int period_number)
 set period number of the current run period
int SetStartDatetime (TDatime start_datetime)
 set start datetime of the current run period
int SetEndDatetime (TDatime *end_datetime)
 set end datetime of the current run period
void Print ()
 print information about current run period

Static Public Member Functions

static UniRunPeriod * CreateRunPeriod (int period_number, TDatime start_datetime, TDatime *end_datetime)
 add new run period to the database
static UniRunPeriod * GetRunPeriod (int period_number)
 get run period from the database
static int CheckRunPeriodExists (int period_number)
 check run period exists in the database: 1- true, 0 - false, <0 - database operation error
static int DeleteRunPeriod (int period_number)
 delete run period from the database
static int PrintAll ()
 print all run periods
static int GetRunNumbers (UniqueRunNumber *&run_numbers, int period_number)
 get numbers of runs existing in the Database for a selected period
static int GetFirstRunNumber (int period_number)
 get first run number for a selected period
static int GetLastRunNumber (int period_number)
 get last run number for a selected period
static int GetPeriodNumber (TDatime datetime)
 get period number for specified datetime
static int GetPeriodNumber (const char *pcdatetime)
 get period number for specified string containing datetime in SQL format ("DD-MM-YYYY hh:mm:ss")
static UniRunPeriod * CreateRunPeriod (int period_number, TDatime start_datetime, TDatime *end_datetime)
 add new run period to the database
static UniRunPeriod * GetRunPeriod (int period_number)
 get run period from the database
static int CheckRunPeriodExists (int period_number)
 check run period exists in the database: 1- true, 0 - false, <0 - database operation error
static int DeleteRunPeriod (int period_number)
 delete run period from the database
static int PrintAll ()
 print all run periods
static int GetRunNumbers (UniqueRunNumber *&run_numbers, int period_number)
 get numbers of runs existing in the Database for a selected period
static int GetFirstRunNumber (int period_number)
 get first run number for a selected period
static int GetLastRunNumber (int period_number)
 get last run number for a selected period
static int GetPeriodNumber (TDatime datetime)
 get period number for specified datetime
static int GetPeriodNumber (const char *pcdatetime)
 get period number for specified string containing datetime in SQL format ("DD-MM-YYYY hh:mm:ss")

Private Member Functions

 UniRunPeriod (UniConnection *db_connect, int period_number, TDatime start_datetime, TDatime *end_datetime)
 UniRunPeriod (UniConnection *db_connect, int period_number, TDatime start_datetime, TDatime *end_datetime)

Private Attributes

UniConnection * connectionDB
 connection to the database
int i_period_number
 period number
TDatime ts_start_datetime
 start datetime
TDatime * ts_end_datetime
 end datetime

Detailed Description

Definition at line 18 of file UniRunPeriod.h.

Constructor & Destructor Documentation

◆ UniRunPeriod() [1/2]

UniRunPeriod::UniRunPeriod ( UniConnection * db_connect,
int period_number,
TDatime start_datetime,
TDatime * end_datetime )
private

Definition at line 16 of file UniRunPeriod.cxx.

References connectionDB, i_period_number, ts_end_datetime, and ts_start_datetime.

Referenced by CreateRunPeriod(), GetPeriodNumber(), and GetRunPeriod().

Here is the caller graph for this function:

◆ ~UniRunPeriod() [1/2]

UniRunPeriod::~UniRunPeriod ( )
virtual

Definition at line 26 of file UniRunPeriod.cxx.

References connectionDB, and ts_end_datetime.

◆ UniRunPeriod() [2/2]

UniRunPeriod::UniRunPeriod ( UniConnection * db_connect,
int period_number,
TDatime start_datetime,
TDatime * end_datetime )
private

◆ ~UniRunPeriod() [2/2]

virtual UniRunPeriod::~UniRunPeriod ( )
virtual

Member Function Documentation

◆ CheckRunPeriodExists() [1/2]

int UniRunPeriod::CheckRunPeriodExists ( int period_number)
static

Definition at line 130 of file UniRunPeriod.cxx.

References TString::Format(), UniConnection::GetSQLServer(), TSQLStatement::NextResultRow(), UniConnection::Open(), TSQLStatement::Process(), TSQLServer::Statement(), and TSQLStatement::StoreResult().

Referenced by prerun_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckRunPeriodExists() [2/2]

int UniRunPeriod::CheckRunPeriodExists ( int period_number)
static

◆ CreateRunPeriod() [1/2]

UniRunPeriod * UniRunPeriod::CreateRunPeriod ( int period_number,
TDatime start_datetime,
TDatime * end_datetime )
static

Definition at line 35 of file UniRunPeriod.cxx.

References UniRunPeriod(), TString::Format(), UniConnection::GetSQLServer(), TSQLStatement::NextIteration(), UniConnection::Open(), TSQLStatement::Process(), TSQLStatement::SetDatime(), TSQLStatement::SetInt(), TSQLStatement::SetNull(), and TSQLServer::Statement().

Referenced by create_run_period().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateRunPeriod() [2/2]

UniRunPeriod * UniRunPeriod::CreateRunPeriod ( int period_number,
TDatime start_datetime,
TDatime * end_datetime )
static

References UniRunPeriod().

Here is the call graph for this function:

◆ DeleteRunPeriod() [1/2]

int UniRunPeriod::DeleteRunPeriod ( int period_number)
static

Definition at line 170 of file UniRunPeriod.cxx.

References TString::Format(), UniConnection::GetSQLServer(), TSQLStatement::NextIteration(), UniConnection::Open(), TSQLStatement::Process(), TSQLStatement::SetInt(), and TSQLServer::Statement().

Here is the call graph for this function:

◆ DeleteRunPeriod() [2/2]

int UniRunPeriod::DeleteRunPeriod ( int period_number)
static

◆ GetEndDatetime() [1/2]

TDatime * UniRunPeriod::GetEndDatetime ( )
inline

Definition at line 58 of file UniRunPeriod.h.

References ts_end_datetime.

Referenced by check_event_and_time(), and show_avg_field().

Here is the caller graph for this function:

◆ GetEndDatetime() [2/2]

TDatime * UniRunPeriod::GetEndDatetime ( )
inline

Definition at line 58 of file UniRunPeriod.h.

References ts_end_datetime.

◆ GetFirstRunNumber() [1/2]

int UniRunPeriod::GetFirstRunNumber ( int period_number)
static
Parameters
[in]period_numbera selected period number to find the minimal run number
Returns
minimal run number for a selected period. if number < 0, the return value corresponds to the error number

Definition at line 408 of file UniRunPeriod.cxx.

References TString::Format(), TSQLStatement::GetInt(), UniConnection::GetSQLServer(), TSQLStatement::NextResultRow(), UniConnection::Open(), TSQLStatement::Process(), TSQLServer::Statement(), and TSQLStatement::StoreResult().

Referenced by UniDetectorParameter::CreateDetectorParameter(), and UniDetectorParameter::CreateDetectorParameter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFirstRunNumber() [2/2]

int UniRunPeriod::GetFirstRunNumber ( int period_number)
static
Parameters
[in]period_numbera selected period number to find the minimal run number
Returns
minimal run number for a selected period. if number < 0, the return value corresponds to the error number

◆ GetLastRunNumber() [1/2]

int UniRunPeriod::GetLastRunNumber ( int period_number)
static
Parameters
[in]period_numbera selected period number to find the maximal run number
Returns
maximal run number for a selected period. if number < 0, the return value corresponds to the error number

Definition at line 446 of file UniRunPeriod.cxx.

References TString::Format(), TSQLStatement::GetInt(), UniConnection::GetSQLServer(), TSQLStatement::NextResultRow(), UniConnection::Open(), TSQLStatement::Process(), TSQLServer::Statement(), and TSQLStatement::StoreResult().

Referenced by UniDetectorParameter::CreateDetectorParameter(), and UniDetectorParameter::CreateDetectorParameter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLastRunNumber() [2/2]

int UniRunPeriod::GetLastRunNumber ( int period_number)
static
Parameters
[in]period_numbera selected period number to find the maximal run number
Returns
maximal run number for a selected period. if number < 0, the return value corresponds to the error number

◆ GetPeriodNumber() [1/6]

int UniRunPeriod::GetPeriodNumber ( )
inline

Definition at line 54 of file UniRunPeriod.h.

References i_period_number.

Referenced by GetPeriodNumber(), and tango_gem_u().

Here is the caller graph for this function:

◆ GetPeriodNumber() [2/6]

int UniRunPeriod::GetPeriodNumber ( )
inline

Definition at line 54 of file UniRunPeriod.h.

References i_period_number.

◆ GetPeriodNumber() [3/6]

int UniRunPeriod::GetPeriodNumber ( const char * pcdatetime)
static
Parameters
[in]pcdatetimestring in the SQL format containing date with time to search for period number
Returns
period number for specified date with time. if not found, returns 0, in case of errors error code < 0

Definition at line 490 of file UniRunPeriod.cxx.

References TString::Format(), TSQLStatement::GetInt(), UniConnection::GetSQLServer(), TSQLStatement::NextResultRow(), UniConnection::Open(), TSQLStatement::Process(), TSQLServer::Statement(), and TSQLStatement::StoreResult().

Here is the call graph for this function:

◆ GetPeriodNumber() [4/6]

int UniRunPeriod::GetPeriodNumber ( const char * pcdatetime)
static
Parameters
[in]pcdatetimestring in the SQL format containing date with time to search for period number
Returns
period number for specified date with time. if not found, returns 0, in case of errors error code < 0

References UniRunPeriod().

Here is the call graph for this function:

◆ GetPeriodNumber() [5/6]

int UniRunPeriod::GetPeriodNumber ( TDatime datetime)
static
Parameters
[in]datetimedate with time to search for period number
Returns
period number for specified date with time. if not found, returns 0, in case of errors error code < 0

Definition at line 484 of file UniRunPeriod.cxx.

References TDatime::AsSQLString(), and GetPeriodNumber().

Here is the call graph for this function:

◆ GetPeriodNumber() [6/6]

int UniRunPeriod::GetPeriodNumber ( TDatime datetime)
static
Parameters
[in]datetimedate with time to search for period number
Returns
period number for specified date with time. if not found, returns 0, in case of errors error code < 0

◆ GetRunNumbers() [1/2]

int UniRunPeriod::GetRunNumbers ( UniqueRunNumber *& run_numbers,
int period_number )
static
Parameters
[in]period_numberperiod number for selected run numbers' range
[out]run_numberspairs (period number+run numbers) of the really existing runs for a selected range (from start to end)
Returns
size of 'run_numbers' array. if size < 0, return value corresponds to error number

Definition at line 362 of file UniRunPeriod.cxx.

References TString::Format(), TSQLStatement::GetInt(), UniConnection::GetSQLServer(), i, TSQLStatement::NextResultRow(), UniConnection::Open(), UniqueRunNumber::period_number, TSQLStatement::Process(), UniqueRunNumber::run_number, TSQLServer::Statement(), and TSQLStatement::StoreResult().

Referenced by check_db_paths_exist(), remove_odd_runs(), run_beam_info(), tango_gem_trip(), and write_checksum_db().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRunNumbers() [2/2]

int UniRunPeriod::GetRunNumbers ( UniqueRunNumber *& run_numbers,
int period_number )
static
Parameters
[in]period_numberperiod number for selected run numbers' range
[out]run_numberspairs (period number+run numbers) of the really existing runs for a selected range (from start to end)
Returns
size of 'run_numbers' array. if size < 0, return value corresponds to error number

◆ GetRunPeriod() [1/2]

UniRunPeriod * UniRunPeriod::GetRunPeriod ( int period_number)
static

Definition at line 79 of file UniRunPeriod.cxx.

References UniRunPeriod(), TString::Format(), TSQLStatement::GetDatime(), TSQLStatement::GetInt(), UniConnection::GetSQLServer(), TSQLStatement::IsNull(), TSQLStatement::NextResultRow(), UniConnection::Open(), TSQLStatement::Process(), TSQLServer::Statement(), and TSQLStatement::StoreResult().

Referenced by check_event_and_time(), create_run_period(), and show_avg_field().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRunPeriod() [2/2]

UniRunPeriod * UniRunPeriod::GetRunPeriod ( int period_number)
static

References UniRunPeriod().

Here is the call graph for this function:

◆ GetStartDatetime() [1/2]

TDatime UniRunPeriod::GetStartDatetime ( )
inline

Definition at line 56 of file UniRunPeriod.h.

References ts_start_datetime.

Referenced by check_event_and_time(), and show_avg_field().

Here is the caller graph for this function:

◆ GetStartDatetime() [2/2]

TDatime UniRunPeriod::GetStartDatetime ( )
inline

Definition at line 56 of file UniRunPeriod.h.

References ts_start_datetime.

◆ Print() [1/2]

void UniRunPeriod::Print ( )

Definition at line 351 of file UniRunPeriod.cxx.

References i_period_number, ts_end_datetime, and ts_start_datetime.

◆ Print() [2/2]

void UniRunPeriod::Print ( )

◆ PrintAll() [1/2]

int UniRunPeriod::PrintAll ( )
static

Definition at line 200 of file UniRunPeriod.cxx.

References TDatime::AsSQLString(), TString::Format(), TSQLStatement::GetDatime(), TSQLStatement::GetInt(), UniConnection::GetSQLServer(), TSQLStatement::IsNull(), TSQLStatement::NextResultRow(), UniConnection::Open(), TSQLStatement::Process(), TSQLServer::Statement(), and TSQLStatement::StoreResult().

Here is the call graph for this function:

◆ PrintAll() [2/2]

int UniRunPeriod::PrintAll ( )
static

◆ SetEndDatetime() [1/2]

int UniRunPeriod::SetEndDatetime ( TDatime * end_datetime)

Definition at line 310 of file UniRunPeriod.cxx.

References connectionDB, TString::Format(), i_period_number, TSQLStatement::NextIteration(), TSQLStatement::Process(), TSQLStatement::SetDatime(), TSQLStatement::SetInt(), TSQLStatement::SetNull(), TSQLServer::Statement(), and ts_end_datetime.

Referenced by create_run_period().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetEndDatetime() [2/2]

int UniRunPeriod::SetEndDatetime ( TDatime * end_datetime)

◆ SetPeriodNumber() [1/2]

int UniRunPeriod::SetPeriodNumber ( int period_number)

Definition at line 246 of file UniRunPeriod.cxx.

References connectionDB, TString::Format(), i_period_number, TSQLStatement::NextIteration(), TSQLStatement::Process(), TSQLStatement::SetInt(), and TSQLServer::Statement().

Here is the call graph for this function:

◆ SetPeriodNumber() [2/2]

int UniRunPeriod::SetPeriodNumber ( int period_number)

◆ SetStartDatetime() [1/2]

int UniRunPeriod::SetStartDatetime ( TDatime start_datetime)

Definition at line 278 of file UniRunPeriod.cxx.

References connectionDB, TString::Format(), i_period_number, TSQLStatement::NextIteration(), TSQLStatement::Process(), TSQLStatement::SetDatime(), TSQLStatement::SetInt(), TSQLServer::Statement(), and ts_start_datetime.

Referenced by create_run_period().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStartDatetime() [2/2]

int UniRunPeriod::SetStartDatetime ( TDatime start_datetime)

Member Data Documentation

◆ connectionDB

UniConnection * UniRunPeriod::connectionDB
private

◆ i_period_number

int UniRunPeriod::i_period_number
private

◆ ts_end_datetime

TDatime * UniRunPeriod::ts_end_datetime
private

Definition at line 30 of file UniRunPeriod.h.

Referenced by UniRunPeriod(), ~UniRunPeriod(), GetEndDatetime(), Print(), and SetEndDatetime().

◆ ts_start_datetime

TDatime UniRunPeriod::ts_start_datetime
private

Definition at line 28 of file UniRunPeriod.h.

Referenced by UniRunPeriod(), GetStartDatetime(), Print(), and SetStartDatetime().


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