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

#include <UniRawFile.h>

Public Member Functions

virtual ~UniRawFile ()
 
int GetFileId ()
 get file id of the current raw file
 
int GetPeriodNumber ()
 get period number of the current raw file
 
int GetRunNumber ()
 get run number of the current raw file
 
int GetStartEvent ()
 get start event of the current raw file
 
int GetEndEvent ()
 get end event of the current raw file
 
TDatime GetStartDatetime ()
 get start datetime of the current raw file
 
TDatime GetEndDatetime ()
 get end datetime of the current raw file
 
TString GetFilePath ()
 get file path of the current raw file
 
int GetEventCount ()
 get event count of the current raw file
 
int64_t GetFileSize ()
 get file size of the current raw file
 
TString * GetFileHash ()
 get file hash of the current raw file
 
int SetPeriodNumber (int period_number)
 set period number of the current raw file
 
int SetRunNumber (int run_number)
 set run number of the current raw file
 
int SetStartEvent (int start_event)
 set start event of the current raw file
 
int SetEndEvent (int end_event)
 set end event of the current raw file
 
int SetStartDatetime (TDatime start_datetime)
 set start datetime of the current raw file
 
int SetEndDatetime (TDatime end_datetime)
 set end datetime of the current raw file
 
int SetFilePath (TString file_path)
 set file path of the current raw file
 
int SetEventCount (int event_count)
 set event count of the current raw file
 
int SetFileSize (int64_t file_size)
 set file size of the current raw file
 
int SetFileHash (TString *file_hash)
 set file hash of the current raw file
 
void Print ()
 print information about current raw file
 
 ClassDef (UniRawFile, 1)
 
virtual ~UniRawFile ()
 
int GetFileId ()
 get file id of the current raw file
 
int GetPeriodNumber ()
 get period number of the current raw file
 
int GetRunNumber ()
 get run number of the current raw file
 
int GetStartEvent ()
 get start event of the current raw file
 
int GetEndEvent ()
 get end event of the current raw file
 
TDatime GetStartDatetime ()
 get start datetime of the current raw file
 
TDatime GetEndDatetime ()
 get end datetime of the current raw file
 
TString GetFilePath ()
 get file path of the current raw file
 
int GetEventCount ()
 get event count of the current raw file
 
int64_t GetFileSize ()
 get file size of the current raw file
 
TString * GetFileHash ()
 get file hash of the current raw file
 
int SetPeriodNumber (int period_number)
 set period number of the current raw file
 
int SetRunNumber (int run_number)
 set run number of the current raw file
 
int SetStartEvent (int start_event)
 set start event of the current raw file
 
int SetEndEvent (int end_event)
 set end event of the current raw file
 
int SetStartDatetime (TDatime start_datetime)
 set start datetime of the current raw file
 
int SetEndDatetime (TDatime end_datetime)
 set end datetime of the current raw file
 
int SetFilePath (TString file_path)
 set file path of the current raw file
 
int SetEventCount (int event_count)
 set event count of the current raw file
 
int SetFileSize (int64_t file_size)
 set file size of the current raw file
 
int SetFileHash (TString *file_hash)
 set file hash of the current raw file
 
void Print ()
 print information about current raw file
 
 ClassDef (UniRawFile, 1)
 

Static Public Member Functions

static UniRawFileCreateRawFile (int period_number, int run_number, int start_event, int end_event, TDatime start_datetime, TDatime end_datetime, TString file_path, int event_count, int64_t file_size, TString *file_hash)
 add new raw file to the database
 
static UniRawFileGetRawFile (int file_id)
 get raw file from the database
 
static UniRawFileGetRawFile (TString file_path)
 get raw file from the database
 
static int CheckRawFileExists (int file_id)
 check raw file exists in the database: 1- true, 0 - false, <0 - database operation error
 
static int CheckRawFileExists (TString file_path)
 check raw file exists in the database: 1- true, 0 - false, <0 - database operation error
 
static int DeleteRawFile (int file_id)
 delete raw file from the database
 
static int DeleteRawFile (TString file_path)
 delete raw file from the database
 
static int PrintAll ()
 print all raw files
 
static int CheckRawFileExists (int period_number, int run_number, int start_event, int end_event, bool strict_compare=false)
 
static int CheckRawFileExists (int period_number, int run_number, int start_event)
 
static int GetSumEventCount (int period_number, int run_number)
 get event count for a given run as a sum for all raw files: if <0 - database operation error
 
static TObjArray * GetRawFiles (int period_number, int run_number)
 
static TObjArray * GetRawFiles (int period_number, int run_number, int start_event, int end_event, bool strict_compare=true)
 
static TObjArray * GetRawFiles (TString path_part)
 
static TString CalculateFileHash (TString file_path)
 
static UniRawFileCreateRawFile (int period_number, int run_number, int start_event, int end_event, TDatime start_datetime, TDatime end_datetime, TString file_path, int event_count, int64_t file_size, TString *file_hash)
 add new raw file to the database
 
static UniRawFileGetRawFile (int file_id)
 get raw file from the database
 
static UniRawFileGetRawFile (TString file_path)
 get raw file from the database
 
static int CheckRawFileExists (int file_id)
 check raw file exists in the database: 1- true, 0 - false, <0 - database operation error
 
static int CheckRawFileExists (TString file_path)
 check raw file exists in the database: 1- true, 0 - false, <0 - database operation error
 
static int DeleteRawFile (int file_id)
 delete raw file from the database
 
static int DeleteRawFile (TString file_path)
 delete raw file from the database
 
static int PrintAll ()
 print all raw files
 
static int CheckRawFileExists (int period_number, int run_number, int start_event, int end_event, bool strict_compare=false)
 
static int CheckRawFileExists (int period_number, int run_number, int start_event)
 
static int GetSumEventCount (int period_number, int run_number)
 get event count for a given run as a sum for all raw files: if <0 - database operation error
 
static TObjArray * GetRawFiles (int period_number, int run_number)
 
static TObjArray * GetRawFiles (int period_number, int run_number, int start_event, int end_event, bool strict_compare=true)
 
static TObjArray * GetRawFiles (TString path_part)
 
static TString CalculateFileHash (TString file_path)
 

Detailed Description

/home/soul/bmnroot/database/uni_db1/UniRawFile.h Class for the table: raw_file

Definition at line 18 of file UniRawFile.h.

Constructor & Destructor Documentation

◆ ~UniRawFile() [1/2]

UniRawFile::~UniRawFile ( )
virtual

Definition at line 53 of file UniRawFile.cxx.

◆ ~UniRawFile() [2/2]

virtual UniRawFile::~UniRawFile ( )
virtual

Member Function Documentation

◆ CalculateFileHash() [1/2]

TString UniRawFile::CalculateFileHash ( TString  raw_file_path)
static

calculate and return (in hex string format) cheсksum for a given file use Adler32 algorithm if zlib library is found or use MD5 algorithm if zlib library is not found

Definition at line 1251 of file UniRawFile.cxx.

Referenced by BmnRawSource::ConvertRawToRoot().

◆ CalculateFileHash() [2/2]

static TString UniRawFile::CalculateFileHash ( TString  file_path)
static

calculate and return (in hex string format) cheсksum for a given file use Adler32 algorithm if zlib library is found or use MD5 algorithm if zlib library is not found

◆ CheckRawFileExists() [1/8]

int UniRawFile::CheckRawFileExists ( int  file_id)
static

check raw file exists in the database: 1- true, 0 - false, <0 - database operation error

Definition at line 305 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

Referenced by BmnRawSource::ConvertRawToRoot().

◆ CheckRawFileExists() [2/8]

static int UniRawFile::CheckRawFileExists ( int  file_id)
static

check raw file exists in the database: 1- true, 0 - false, <0 - database operation error

◆ CheckRawFileExists() [3/8]

int UniRawFile::CheckRawFileExists ( int  period_number,
int  run_number,
int  start_event 
)
static

check that raw file exists in the database for the given period_number:run_number and start_event value returns maximum 'end_event' value, 0 - not exists, <0 - database operation error

Definition at line 907 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ CheckRawFileExists() [4/8]

static int UniRawFile::CheckRawFileExists ( int  period_number,
int  run_number,
int  start_event 
)
static

check that raw file exists in the database for the given period_number:run_number and start_event value returns maximum 'end_event' value, 0 - not exists, <0 - database operation error

◆ CheckRawFileExists() [5/8]

int UniRawFile::CheckRawFileExists ( int  period_number,
int  run_number,
int  start_event,
int  end_event,
bool  strict_compare = false 
)
static

check raw file exists in the database for the given period_number:run_number and start_event-end_event values returns 1 - true, 0 - false, <0 - database operation error

Definition at line 854 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ CheckRawFileExists() [6/8]

static int UniRawFile::CheckRawFileExists ( int  period_number,
int  run_number,
int  start_event,
int  end_event,
bool  strict_compare = false 
)
static

check raw file exists in the database for the given period_number:run_number and start_event-end_event values returns 1 - true, 0 - false, <0 - database operation error

◆ CheckRawFileExists() [7/8]

int UniRawFile::CheckRawFileExists ( TString  file_path)
static

check raw file exists in the database: 1- true, 0 - false, <0 - database operation error

Definition at line 345 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ CheckRawFileExists() [8/8]

static int UniRawFile::CheckRawFileExists ( TString  file_path)
static

check raw file exists in the database: 1- true, 0 - false, <0 - database operation error

◆ ClassDef() [1/2]

UniRawFile::ClassDef ( UniRawFile  ,
 
)

◆ ClassDef() [2/2]

UniRawFile::ClassDef ( UniRawFile  ,
 
)

◆ CreateRawFile() [1/2]

UniRawFile * UniRawFile::CreateRawFile ( int  period_number,
int  run_number,
int  start_event,
int  end_event,
TDatime  start_datetime,
TDatime  end_datetime,
TString  file_path,
int  event_count,
int64_t  file_size,
TString *  file_hash 
)
static

add new raw file to the database

Definition at line 62 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

Referenced by BmnRawSource::ConvertRawToRoot().

◆ CreateRawFile() [2/2]

static UniRawFile * UniRawFile::CreateRawFile ( int  period_number,
int  run_number,
int  start_event,
int  end_event,
TDatime  start_datetime,
TDatime  end_datetime,
TString  file_path,
int  event_count,
int64_t  file_size,
TString *  file_hash 
)
static

add new raw file to the database

◆ DeleteRawFile() [1/4]

int UniRawFile::DeleteRawFile ( int  file_id)
static

delete raw file from the database

Definition at line 385 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ DeleteRawFile() [2/4]

static int UniRawFile::DeleteRawFile ( int  file_id)
static

delete raw file from the database

◆ DeleteRawFile() [3/4]

int UniRawFile::DeleteRawFile ( TString  file_path)
static

delete raw file from the database

Definition at line 415 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ DeleteRawFile() [4/4]

static int UniRawFile::DeleteRawFile ( TString  file_path)
static

delete raw file from the database

◆ GetEndDatetime() [1/2]

TDatime UniRawFile::GetEndDatetime ( )
inline

get end datetime of the current raw file

Definition at line 108 of file UniRawFile.h.

◆ GetEndDatetime() [2/2]

TDatime UniRawFile::GetEndDatetime ( )
inline

get end datetime of the current raw file

Definition at line 108 of file UniRawFile.h.

◆ GetEndEvent() [1/2]

int UniRawFile::GetEndEvent ( )
inline

get end event of the current raw file

Definition at line 104 of file UniRawFile.h.

Referenced by BmnRawSource::ConvertRawToRoot().

◆ GetEndEvent() [2/2]

int UniRawFile::GetEndEvent ( )
inline

get end event of the current raw file

Definition at line 104 of file UniRawFile.h.

◆ GetEventCount() [1/2]

int UniRawFile::GetEventCount ( )
inline

get event count of the current raw file

Definition at line 112 of file UniRawFile.h.

◆ GetEventCount() [2/2]

int UniRawFile::GetEventCount ( )
inline

get event count of the current raw file

Definition at line 112 of file UniRawFile.h.

◆ GetFileHash() [1/2]

TString * UniRawFile::GetFileHash ( )
inline

get file hash of the current raw file

Definition at line 116 of file UniRawFile.h.

◆ GetFileHash() [2/2]

TString * UniRawFile::GetFileHash ( )
inline

get file hash of the current raw file

Definition at line 116 of file UniRawFile.h.

◆ GetFileId() [1/2]

int UniRawFile::GetFileId ( )
inline

get file id of the current raw file

Definition at line 96 of file UniRawFile.h.

◆ GetFileId() [2/2]

int UniRawFile::GetFileId ( )
inline

get file id of the current raw file

Definition at line 96 of file UniRawFile.h.

◆ GetFilePath() [1/2]

TString UniRawFile::GetFilePath ( )
inline

get file path of the current raw file

Definition at line 110 of file UniRawFile.h.

Referenced by BmnMetadataDecoder::SetDigiDirectory().

◆ GetFilePath() [2/2]

TString UniRawFile::GetFilePath ( )
inline

get file path of the current raw file

Definition at line 110 of file UniRawFile.h.

◆ GetFileSize() [1/2]

int64_t UniRawFile::GetFileSize ( )
inline

get file size of the current raw file

Definition at line 114 of file UniRawFile.h.

◆ GetFileSize() [2/2]

int64_t UniRawFile::GetFileSize ( )
inline

get file size of the current raw file

Definition at line 114 of file UniRawFile.h.

◆ GetPeriodNumber() [1/2]

int UniRawFile::GetPeriodNumber ( )
inline

get period number of the current raw file

Definition at line 98 of file UniRawFile.h.

◆ GetPeriodNumber() [2/2]

int UniRawFile::GetPeriodNumber ( )
inline

get period number of the current raw file

Definition at line 98 of file UniRawFile.h.

◆ GetRawFile() [1/4]

UniRawFile * UniRawFile::GetRawFile ( int  file_id)
static

get raw file from the database

Definition at line 165 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ GetRawFile() [2/4]

static UniRawFile * UniRawFile::GetRawFile ( int  file_id)
static

get raw file from the database

◆ GetRawFile() [3/4]

UniRawFile * UniRawFile::GetRawFile ( TString  file_path)
static

get raw file from the database

Definition at line 235 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ GetRawFile() [4/4]

static UniRawFile * UniRawFile::GetRawFile ( TString  file_path)
static

get raw file from the database

◆ GetRawFiles() [1/6]

TObjArray * UniRawFile::GetRawFiles ( int  period_number,
int  run_number 
)
static

get array of raw files (UniRawFile*) corresponding to the period:run number ordered by start_event ascending return nullptr if an error occured)

Definition at line 1002 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

Referenced by BmnRawSource::ConvertRawToRoot(), and UniRun::GetRawFiles().

◆ GetRawFiles() [2/6]

static TObjArray * UniRawFile::GetRawFiles ( int  period_number,
int  run_number 
)
static

get array of raw files (UniRawFile*) corresponding to the period:run number ordered by start_event ascending return nullptr if an error occured)

◆ GetRawFiles() [3/6]

TObjArray * UniRawFile::GetRawFiles ( int  period_number,
int  run_number,
int  start_event,
int  end_event,
bool  strict_compare = true 
)
static

get array of raw files (UniRawFile*) corresponding to the period_number:run_number and start_event - end_event ordered by file_id descending returns nullptr if an error occured

Definition at line 1080 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ GetRawFiles() [4/6]

static TObjArray * UniRawFile::GetRawFiles ( int  period_number,
int  run_number,
int  start_event,
int  end_event,
bool  strict_compare = true 
)
static

get array of raw files (UniRawFile*) corresponding to the period_number:run_number and start_event - end_event ordered by file_id descending returns nullptr if an error occured

◆ GetRawFiles() [5/6]

TObjArray * UniRawFile::GetRawFiles ( TString  path_part)
static

get array of raw files (UniRawFile*) corresponding to a part of the file path, e.g. filename ordered by file_id descending return nullptr if an error occured)

Definition at line 1173 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ GetRawFiles() [6/6]

static TObjArray * UniRawFile::GetRawFiles ( TString  path_part)
static

get array of raw files (UniRawFile*) corresponding to a part of the file path, e.g. filename ordered by file_id descending return nullptr if an error occured)

◆ GetRunNumber() [1/2]

int UniRawFile::GetRunNumber ( )
inline

get run number of the current raw file

Definition at line 100 of file UniRawFile.h.

◆ GetRunNumber() [2/2]

int UniRawFile::GetRunNumber ( )
inline

get run number of the current raw file

Definition at line 100 of file UniRawFile.h.

◆ GetStartDatetime() [1/2]

TDatime UniRawFile::GetStartDatetime ( )
inline

get start datetime of the current raw file

Definition at line 106 of file UniRawFile.h.

◆ GetStartDatetime() [2/2]

TDatime UniRawFile::GetStartDatetime ( )
inline

get start datetime of the current raw file

Definition at line 106 of file UniRawFile.h.

◆ GetStartEvent() [1/2]

int UniRawFile::GetStartEvent ( )
inline

get start event of the current raw file

Definition at line 102 of file UniRawFile.h.

Referenced by BmnRawSource::ConvertRawToRoot().

◆ GetStartEvent() [2/2]

int UniRawFile::GetStartEvent ( )
inline

get start event of the current raw file

Definition at line 102 of file UniRawFile.h.

◆ GetSumEventCount() [1/2]

int UniRawFile::GetSumEventCount ( int  period_number,
int  run_number 
)
static

get event count for a given run as a sum for all raw files: if <0 - database operation error

Definition at line 958 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ GetSumEventCount() [2/2]

static int UniRawFile::GetSumEventCount ( int  period_number,
int  run_number 
)
static

get event count for a given run as a sum for all raw files: if <0 - database operation error

◆ Print() [1/2]

void UniRawFile::Print ( )

print information about current raw file

Definition at line 837 of file UniRawFile.cxx.

◆ Print() [2/2]

void UniRawFile::Print ( )

print information about current raw file

◆ PrintAll() [1/2]

int UniRawFile::PrintAll ( )
static

print all raw files

Definition at line 445 of file UniRawFile.cxx.

References UniConnection::GetSQLServer(), and UniConnection::Open().

◆ PrintAll() [2/2]

static int UniRawFile::PrintAll ( )
static

print all raw files

◆ SetEndDatetime() [1/2]

int UniRawFile::SetEndDatetime ( TDatime  end_datetime)

set end datetime of the current raw file

Definition at line 668 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetEndDatetime() [2/2]

int UniRawFile::SetEndDatetime ( TDatime  end_datetime)

set end datetime of the current raw file

◆ SetEndEvent() [1/2]

int UniRawFile::SetEndEvent ( int  end_event)

set end event of the current raw file

Definition at line 604 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetEndEvent() [2/2]

int UniRawFile::SetEndEvent ( int  end_event)

set end event of the current raw file

◆ SetEventCount() [1/2]

int UniRawFile::SetEventCount ( int  event_count)

set event count of the current raw file

Definition at line 732 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetEventCount() [2/2]

int UniRawFile::SetEventCount ( int  event_count)

set event count of the current raw file

◆ SetFileHash() [1/2]

int UniRawFile::SetFileHash ( TString *  file_hash)

set file hash of the current raw file

Definition at line 796 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetFileHash() [2/2]

int UniRawFile::SetFileHash ( TString *  file_hash)

set file hash of the current raw file

◆ SetFilePath() [1/2]

int UniRawFile::SetFilePath ( TString  file_path)

set file path of the current raw file

Definition at line 700 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetFilePath() [2/2]

int UniRawFile::SetFilePath ( TString  file_path)

set file path of the current raw file

◆ SetFileSize() [1/2]

int UniRawFile::SetFileSize ( int64_t  file_size)

set file size of the current raw file

Definition at line 764 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetFileSize() [2/2]

int UniRawFile::SetFileSize ( int64_t  file_size)

set file size of the current raw file

◆ SetPeriodNumber() [1/2]

int UniRawFile::SetPeriodNumber ( int  period_number)

set period number of the current raw file

Definition at line 508 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetPeriodNumber() [2/2]

int UniRawFile::SetPeriodNumber ( int  period_number)

set period number of the current raw file

◆ SetRunNumber() [1/2]

int UniRawFile::SetRunNumber ( int  run_number)

set run number of the current raw file

Definition at line 540 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetRunNumber() [2/2]

int UniRawFile::SetRunNumber ( int  run_number)

set run number of the current raw file

◆ SetStartDatetime() [1/2]

int UniRawFile::SetStartDatetime ( TDatime  start_datetime)

set start datetime of the current raw file

Definition at line 636 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetStartDatetime() [2/2]

int UniRawFile::SetStartDatetime ( TDatime  start_datetime)

set start datetime of the current raw file

◆ SetStartEvent() [1/2]

int UniRawFile::SetStartEvent ( int  start_event)

set start event of the current raw file

Definition at line 572 of file UniRawFile.cxx.

References UniConnection::GetSQLServer().

◆ SetStartEvent() [2/2]

int UniRawFile::SetStartEvent ( int  start_event)

set start event of the current raw file


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