|
BmnRoot 26.10.0-233-gb9bbe585
Software framework of the BM@N experiment
|
#include <TangoData.h>
Public Types | |
| enum | enumConditions { conditionLess , conditionLessOrEqual , conditionEqual , conditionNotEqual , conditionGreater , conditionGreaterOrEqual , conditionLike , conditionNull , conditionNotNull } |
Public Member Functions | |
| TangoData (const char *start_date, const char *end_date, const char *system_name, const char *parameter_name, const char *member_name="", int verbose=0) | |
| Time Range Constructor: fill Tango data array according to the given parameters Tango database connection is defined in the 'tango_db_settings.h' file Parameters: start_date - time from which to start reading the parameter, format: "YYYY-MM-DD HH:MM:SS" (e.g. | |
| TangoData (int period_number, int start_run, int end_run, const char *system_name, const char *parameter_name, const char *member_name="", int verbose=0) | |
| Run Range Constructor: fill Tango data array for the time interval from the start time of the first run to the end time of the last run of the given range (the gaps between runs are included) The run times are taken from the Unified Condition Database Parameters: period_number - period (session) number of the runs (e.g. | |
| virtual | ~TangoData () |
| TObjArray * | GetTangoData () |
| TString | GetStartDate () |
| TString | GetEndDate () |
| TString | GetSystemName () |
| TString | GetParameterName () |
| TString | GetMemberName () |
| int | GetPeriodNumber () |
| int | GetStartRun () |
| int | GetEndRun () |
| TString | GetUserName () |
| void | SetUserName (TString user_name) |
| TString | GetFullName () |
| void | PrintTangoDataConsole () |
| void | PrintTangoDataSurface (const char *y_axis="tango parameter") |
| int | PrintTangoDataMultiGraph (const char *y_axis="parameter", bool is3D=false) |
| std::vector< double > | GetAverageTangoData () |
| std::vector< double > | GetRunAverageTangoData () |
| TObjArray * | SearchTangoIntervals (enumConditions condition=conditionEqual, double value=1, std::vector< int > *mapChannel=nullptr) |
| Function SearchTangoIntervals gets time intervals for defined condition on the parameter values (e.g. | |
| void | PrintTangoIntervalConsole (TObjArray *tango_intervals, TString channel_name="Channel", bool isShowOnlyExists=false) |
| Function displays (in console) time intervals obtained from Tango for a defined condition Parameters: tango_intervals - TObjArray with TObjArray objects containing TangoTimeInterval objects obtained from 'SearchTangoIntervals' function channel_name - name of the dimension to display on the screen, default: Channel isShowOnlyExists - if true, print only intervals which satisfy the condition (skip empty intervals). | |
Static Public Member Functions | |
| static void | PrintTangoArrayConsole (std::vector< TangoData * > vecTangoData) |
| static int | PrintTangoArrayMultiGraph (std::vector< TangoData * > vecTangoData, const char *y_axis="parameter", bool is3D=false) |
| static int | PrintTangoArraySurface (std::vector< TangoData * > vecTangoData, const char *z_axis="parameter", const char *y_axis="channel", const char *draw_option="SURF1", int time_bins=100) |
| Function displays a set of "simple" parameters obtained from Tango, e.g. | |
Private Member Functions | |
| int | SetRunRangeDates (int period_number, int start_run, int end_run) |
| void | InitTangoData () |
| std::vector< double > | GetTimeWeightedAverage (const std::vector< TangoTimeInterval > &time_intervals) |
| void | GetValuePeriod (int i, UInt_t data_start, UInt_t data_end, UInt_t &value_start, UInt_t &value_end) |
| int | GetTangoParameter () |
| void | DeleteTangoParameter () |
Private Attributes | |
| bool | IsOldMySQL = false |
| TString | strSystemName = "" |
| TString | strParameterName = "" |
| TString | strMemberName = "" |
| TString | strUserName = "" |
| TString | strStartDate = "" |
| TString | strEndDate = "" |
| TObjArray * | arrTangoData = nullptr |
| int | iVerbose |
| int | iPeriodNumber = -1 |
| int | iStartRun = -1 |
| int | iEndRun = -1 |
| std::vector< TangoTimeInterval > | vecRunIntervals |
Definition at line 82 of file TangoData.h.
| Enumerator | |
|---|---|
| conditionLess | |
| conditionLessOrEqual | |
| conditionEqual | |
| conditionNotEqual | |
| conditionGreater | |
| conditionGreaterOrEqual | |
| conditionLike | |
| conditionNull | |
| conditionNotNull | |
Definition at line 87 of file TangoData.h.
| TangoData::TangoData | ( | const char * | start_date, |
| const char * | end_date, | ||
| const char * | system_name, | ||
| const char * | parameter_name, | ||
| const char * | member_name = "", | ||
| int | verbose = 0 ) |
TangoData CLASS IMPLEMENTATION.
"2015-03-13 23:00:00") end_date - end time of reading the parameter, the same format (e.g. "2015-03-13 24:00:00") system_name - name of the system, i.e. Tango domain (e.g. "magnet", "fhcal" or "gem") parameter_name - name of hardware parameter stored in Tango, i.e. Tango attribute (e.g. "vch_2_1" for FHCal or "vmon_0" for GEM) member_name - name of the Tango member, i.e. device (e.g. "hv_1" for FHCal or "mod_0" for GEM), it can be given with the Tango family as "family/member" if the member name is not unique in the domain (e.g. "caen_232/mod_2" for CSC or "plane1_top/adcsc_7_temp" for FSD), empty string - the member is not used
Single Constructor: fill Tango data array according to the given parameters Tango database connection is defined in the 'tango_db_settings.h' file Parameters: start_date - time from which to start reading the parameter, format: "YYYY-MM-DD HH:MM:SS" (e.g. "2015-03-13 23:00:00") end_date - end time of reading the parameter, the same format (e.g. "2015-03-13 24:00:00") system_name - name of the system, i.e. Tango domain (e.g. "magnet", "fhcal" or "gem") parameter_name - name of hardware parameter stored in Tango, i.e. Tango attribute (e.g. "vch_2_1" for FHCal or "vmon_0" for GEM) member_name - name of the Tango member, i.e. device (e.g. "hv_1" for FHCal or "mod_0" for GEM), it can be given with the Tango family as "family/member" if the member name is not unique in the domain (e.g. "caen_232/mod_2" for CSC or "plane1_top/adcsc_7_temp" for FSD), empty string - the member is not used
Definition at line 80 of file TangoData.cxx.
References InitTangoData(), iVerbose, parameter_name, strEndDate, strMemberName, strParameterName, strStartDate, strSystemName, strUserName, and system_name.
Referenced by PrintTangoArraySurface().
| TangoData::TangoData | ( | int | period_number, |
| int | start_run, | ||
| int | end_run, | ||
| const char * | system_name, | ||
| const char * | parameter_name, | ||
| const char * | member_name = "", | ||
| int | verbose = 0 ) |
Run Range Constructor: fill Tango data array for the time interval from the start time of the first run to the end time of the last run of the given range (the gaps between runs are included) The run times are taken from the Unified Condition Database (UniRun) Parameters: period_number - period (session) number of the runs (e.g.
8) start_run - number of the first run of the range (e.g. 6000) end_run - number of the last run of the range (set equal to start_run to read a single run) system_name, parameter_name, member_name, verbose - the same as in the constructor above Use GetRunAverageTangoData() to average the parameter only over the time of the runs
8) start_run - number of the first run of the range (e.g. 6000) end_run - number of the last run of the range (set equal to start_run to read a single run) system_name, parameter_name, member_name, verbose - the same as in the time interval constructor Use GetRunAverageTangoData() to average the parameter only over the time of the runs
Definition at line 107 of file TangoData.cxx.
References iEndRun, InitTangoData(), iPeriodNumber, iStartRun, iVerbose, parameter_name, SetRunRangeDates(), strMemberName, strParameterName, strSystemName, strUserName, and system_name.
|
virtual |
Definition at line 127 of file TangoData.cxx.
References arrTangoData.
|
private |
Definition at line 1328 of file TangoData.cxx.
References arrTangoData, iEndRun, iPeriodNumber, IsOldMySQL, iStartRun, strEndDate, strParameterName, strStartDate, strSystemName, and vecRunIntervals.
Referenced by GetTangoParameter().
| vector< double > TangoData::GetAverageTangoData | ( | ) |
Definition at line 1039 of file TangoData.cxx.
References arrTangoData, TangoTimeParameter::double_parameter_value, GetTimeWeightedAverage(), i, IsOldMySQL, iVerbose, strEndDate, and strStartDate.
Referenced by show_avg_field(), show_field_graph(), show_field_graph(), and write_avg_field_db().
|
inline |
Definition at line 144 of file TangoData.h.
References strEndDate.
Referenced by GetRangeSuffix(), and PrintTangoArraySurface().
|
inline |
Definition at line 151 of file TangoData.h.
References iEndRun.
Referenced by GetRangeSuffix().
| TString TangoData::GetFullName | ( | ) |
Definition at line 135 of file TangoData.cxx.
References strMemberName, strParameterName, and strSystemName.
Referenced by GetArrayTitle(), and GetTangoParameter().
|
inline |
Definition at line 147 of file TangoData.h.
References strMemberName.
Referenced by GetArrayTitle(), and GetSourceName().
|
inline |
Definition at line 146 of file TangoData.h.
References strParameterName.
Referenced by GetArrayDataName(), GetArrayTitle(), and GetDataName().
|
inline |
Definition at line 149 of file TangoData.h.
References iPeriodNumber.
Referenced by GetRangeSuffix().
| vector< double > TangoData::GetRunAverageTangoData | ( | ) |
Definition at line 1081 of file TangoData.cxx.
References arrTangoData, GetTimeWeightedAverage(), and vecRunIntervals.
|
inline |
Definition at line 143 of file TangoData.h.
References strStartDate.
Referenced by GetRangeSuffix(), and PrintTangoArraySurface().
|
inline |
Definition at line 150 of file TangoData.h.
References iStartRun.
Referenced by GetRangeSuffix().
|
inline |
Definition at line 145 of file TangoData.h.
References strSystemName.
Referenced by GetArrayTitle(), and GetSourceName().
|
inline |
Definition at line 141 of file TangoData.h.
References arrTangoData.
Referenced by DrawFHCalHV(), DrawGemHV(), GetValueCount(), PrintTangoArraySurface(), show_avg_field(), show_field_graph(), show_field_graph(), tango_gem_trip(), tango_gem_u(), tango_gem_u(), and write_avg_field_db().
|
private |
Definition at line 258 of file TangoData.cxx.
References arrTangoData, TDatime::AsSQLString(), TString::Atoi(), TangoTimeParameter::bool_parameter_value, TString::Contains(), TDatime::Convert(), TString::Data(), DeleteTangoParameter(), TangoTimeParameter::double_parameter_value, TString::Format(), TSQLServer::GetDB(), TSQLStatement::GetDouble(), GetFullName(), TSQLStatement::GetInt(), TSQLStatement::GetNumAffectedRows(), TangoConnection::GetSQLServer(), TSQLStatement::GetString(), TSQLServer::GetTables(), IsOldMySQL, iVerbose, TangoConnection::MySQL, TSQLStatement::NextResultRow(), TangoConnection::Open(), TangoTimeParameter::parameter_time, TSQLStatement::Process(), TDatime::Set(), TSQLServer::Statement(), TSQLStatement::StoreResult(), strEndDate, strMemberName, strParameterName, strStartDate, strSystemName, Tango_Bool, Tango_Bool_Array, TANGO_DB_HOST_b2020, TANGO_DB_NAME_b2020, TANGO_DB_PASSWORD_b2020, TANGO_DB_USERNAME_b2020, Tango_Double, and Tango_Double_Array.
Referenced by InitTangoData().
|
private |
Definition at line 1101 of file TangoData.cxx.
References arrTangoData, TDatime::Convert(), TangoTimeParameter::double_parameter_value, GetValuePeriod(), i, iVerbose, max(), min(), strEndDate, and strStartDate.
Referenced by GetAverageTangoData(), and GetRunAverageTangoData().
|
inline |
Definition at line 152 of file TangoData.h.
References strUserName.
|
private |
Definition at line 1157 of file TangoData.cxx.
References arrTangoData, and i.
Referenced by GetTimeWeightedAverage(), and PrintTangoArraySurface().
|
private |
Definition at line 242 of file TangoData.cxx.
References GetTangoParameter(), IsOldMySQL, iVerbose, and strStartDate.
Referenced by TangoData(), and TangoData().
|
static |
Definition at line 555 of file TangoData.cxx.
Referenced by tango_gem_trip(), tango_gem_u(), and tango_gem_u().
|
static |
Definition at line 812 of file TangoData.cxx.
References TMultiGraph::Add(), AddStepPoint(), arrTangoData, TPad::BuildLegend(), TAxis::CenterLabels(), TAxis::CenterTitle(), TDatime::Convert(), CreateTangoCanvas(), TString::Data(), TMultiGraph::Draw(), TString::Format(), GetArrayDataName(), GetArrayTitle(), TMultiGraph::GetXaxis(), TMultiGraph::GetYaxis(), i, TPad::Modified(), TAttAxis::SetLabelOffset(), TAttAxis::SetLabelSize(), TAttLine::SetLineColor(), TAttLine::SetLineWidth(), TLegend::SetMargin(), TAttAxis::SetNdivisions(), TAxis::SetTimeDisplay(), TAxis::SetTimeFormat(), TAxis::SetTimeOffset(), TGraph::SetTitle(), TNamed::SetTitle(), TAttAxis::SetTitleOffset(), and x.
Referenced by DrawFHCalHV(), DrawGemHV(), tango_gem_trip(), tango_gem_u(), and tango_gem_u().
|
static |
FHCal or GEM high voltages, graphically as 2D Surface (X - time, Y - channel, i.e. index of the parameter in the array, Z - parameter value) The time interval of the first parameter is divided into equal time bins, and every bin is filled with the time-weighted average value of the channel in the bin (every value is valid up to the next time point) Parameters: z_axis - label of Z axis (parameter values), y_axis - label of Y axis (channels) draw_option - draw option of the 2D histogram: "SURF1" - surface (default), "LEGO2" - columns, "COLZ" - 2D color map, etc. time_bins - number of the time bins Returns: 0 - in case of the success, < 0 - if an error occured
FHCal or GEM high voltages, graphically as 2D Surface (X - time, Y - channel, i.e. index of the parameter in the array, Z - value of the parameter) The time interval of the first parameter is divided into equal time bins, and every bin is filled with the time-weighted average value of the channel in the bin (every value is valid up to the next time point) Parameters: z_axis - label of Z axis (parameter values), y_axis - label of Y axis (channels) draw_option - draw option of the 2D histogram: "SURF1" - surface (default), "LEGO2" - columns, "COLZ" - 2D color map, etc. time_bins - number of the time bins Returns: 0 - in case of the success, < 0 - if an error occured
Definition at line 922 of file TangoData.cxx.
References TangoData(), TH1::AddDirectory(), TH1::AddDirectoryStatus(), TObjArray::At(), TAxis::CenterTitle(), TString::Contains(), TDatime::Convert(), CreateTangoCanvas(), TH1::Draw(), GetArrayDataName(), GetArrayTitle(), GetEndDate(), TObjArray::GetEntriesFast(), TH1::GetMinimum(), GetStartDate(), GetTangoData(), GetValuePeriod(), TH1::GetXaxis(), TH1::GetYaxis(), TH1::GetZaxis(), i, max(), min(), TPad::Modified(), TH2::SetBinContent(), TAttAxis::SetLabelSize(), TH1::SetMinimum(), TAttAxis::SetNdivisions(), TAttPad::SetRightMargin(), TH1::SetStats(), TAxis::SetTimeDisplay(), TAxis::SetTimeFormat(), TAxis::SetTimeOffset(), TNamed::SetTitle(), TAttAxis::SetTitleOffset(), and TString::ToLower().
Referenced by DrawFHCalHV(), and DrawGemHV().
| void TangoData::PrintTangoDataConsole | ( | ) |
Definition at line 528 of file TangoData.cxx.
References arrTangoData, TDatime::AsSQLString(), TangoTimeParameter::double_parameter_value, i, and TangoTimeParameter::parameter_time.
Referenced by tango_gem_u(), and tango_gem_u().
| int TangoData::PrintTangoDataMultiGraph | ( | const char * | y_axis = "parameter", |
| bool | is3D = false ) |
Definition at line 723 of file TangoData.cxx.
References TMultiGraph::Add(), AddStepPoint(), arrTangoData, TPad::BuildLegend(), TAxis::CenterLabels(), TAxis::CenterTitle(), TDatime::Convert(), CreateTangoCanvas(), TString::Data(), TangoTimeParameter::double_parameter_value, TMultiGraph::Draw(), TString::Format(), GetDataName(), TMultiGraph::GetXaxis(), TMultiGraph::GetYaxis(), i, TPad::Modified(), TangoTimeParameter::parameter_time, TAttAxis::SetLabelOffset(), TAttAxis::SetLabelSize(), TAttLine::SetLineColor(), TAttLine::SetLineWidth(), TLegend::SetMargin(), TAttAxis::SetNdivisions(), TAxis::SetTimeDisplay(), TAxis::SetTimeFormat(), TAxis::SetTimeOffset(), TGraph::SetTitle(), TNamed::SetTitle(), TAttAxis::SetTitleOffset(), strStartDate, and x.
Referenced by show_field_graph(), show_field_graph(), tango_gem_u(), and tango_gem_u().
| void TangoData::PrintTangoDataSurface | ( | const char * | y_axis = "tango parameter" | ) |
Definition at line 652 of file TangoData.cxx.
References arrTangoData, TAxis::CenterLabels(), TAxis::CenterTitle(), TDatime::Convert(), CreateTangoCanvas(), TangoTimeParameter::double_parameter_value, TGraph2D::Draw(), GetDataName(), TGraph2D::GetXaxis(), TGraph2D::GetYaxis(), TGraph2D::GetZaxis(), i, TPad::Modified(), TangoTimeParameter::parameter_time, TAttAxis::SetLabelOffset(), TAttAxis::SetLabelSize(), TAttAxis::SetNdivisions(), TGraph2D::SetPoint(), TAxis::SetTimeDisplay(), TAxis::SetTimeFormat(), TAxis::SetTimeOffset(), TGraph2D::SetTitle(), TNamed::SetTitle(), and TAttAxis::SetTitleOffset().
| void TangoData::PrintTangoIntervalConsole | ( | TObjArray * | tango_intervals, |
| TString | channel_name = "Channel", | ||
| bool | isShowOnlyExists = false ) |
Definition at line 1304 of file TangoData.cxx.
References TDatime::AsSQLString(), TObjArray::At(), TString::Data(), TangoTimeInterval::end_time, TObjArray::GetEntriesFast(), i, and TangoTimeInterval::start_time.
Referenced by tango_gem_trip().
| TObjArray * TangoData::SearchTangoIntervals | ( | enumConditions | condition = conditionEqual, |
| double | value = 1, | ||
| std::vector< int > * | mapChannel = nullptr ) |
Function SearchTangoIntervals gets time intervals for defined condition on the parameter values NOTE: it works only if channel count is constant during given time period Parameters: condition - condition of time interval sampling, default: conditionEqual (the possible list is presented above in 'enumConditions', except conditionLike, conditionNull and conditionNotNull) value - numeric value for the condition with which the comparison is performed, default: 1 (true); boolean values of the parameter are compared as 0 (false) and 1 (true) mapChannel - vector of integer values (map) to change the order of result TObjArray-s in the common result array, if, for example, channels go in a different sequence; nullptr - if not used Returns common TObjArray with TObjArray objects containing TangoTimeInterval for every channel (i.e.
the intervals where a GEM channel was switched off: pw_N parameter, conditionEqual, value = 0) NOTE: it works only if channel count is constant during given time period Parameters: condition - condition of time interval sampling, default: conditionEqual (the possible list is presented above in 'enumConditions', except conditionLike, conditionNull and conditionNotNull) value - numeric value for the condition with which the comparison is performed, default: 1 (true); boolean values of the parameter are compared as 0 (false) and 1 (true) mapChannel - vector of integer values (map) to change the order of result TObjArray-s in the common result array, if, for example, channels go in a different sequence; nullptr - if not used Returns common TObjArray with TObjArray objects containing TangoTimeInterval for every channel (i.e. conditionally TObjArray<TObjArray<TangoTimeInterval*>>). If there are no intervals found, it returns an empty TObjArray with zero elements. In case of errors it returns nullptr
conditionally TObjArray<TObjArray<TangoTimeInterval*>>). If there are no intervals found, it returns an empty TObjArray with zero elements. In case of errors it returns nullptr
Definition at line 1180 of file TangoData.cxx.
References TObjArray::Add(), arrTangoData, TObjArray::At(), conditionEqual, conditionGreater, conditionGreaterOrEqual, conditionLess, conditionLessOrEqual, conditionLike, conditionNotEqual, conditionNotNull, conditionNull, TDatime::Convert(), TangoTimeParameter::double_parameter_value, TObjArray::GetEntriesFast(), i, IsOldMySQL, TangoTimeParameter::parameter_time, TDatime::Set(), and TCollection::SetOwner().
Referenced by tango_gem_trip().
|
private |
Definition at line 154 of file TangoData.cxx.
References TDatime::AsSQLString(), cached_end_date, cached_end_run, cached_period, cached_run_intervals, cached_start_date, cached_start_run, UniRun::GetEndDatetime(), UniRun::GetRun(), UniRun::GetRunNumbers(), UniRun::GetStartDatetime(), i, iVerbose, UniqueRunNumber::run_number, strEndDate, strStartDate, and vecRunIntervals.
Referenced by TangoData().
|
inline |
Definition at line 153 of file TangoData.h.
References strUserName.
|
private |
Definition at line 230 of file TangoData.h.
Referenced by ~TangoData(), DeleteTangoParameter(), GetAverageTangoData(), GetRunAverageTangoData(), GetTangoData(), GetTangoParameter(), GetTimeWeightedAverage(), GetValuePeriod(), PrintTangoArrayMultiGraph(), PrintTangoDataConsole(), PrintTangoDataMultiGraph(), PrintTangoDataSurface(), and SearchTangoIntervals().
|
private |
Definition at line 233 of file TangoData.h.
Referenced by TangoData(), DeleteTangoParameter(), and GetEndRun().
|
private |
Definition at line 233 of file TangoData.h.
Referenced by TangoData(), DeleteTangoParameter(), and GetPeriodNumber().
|
private |
Definition at line 227 of file TangoData.h.
Referenced by DeleteTangoParameter(), GetAverageTangoData(), GetTangoParameter(), InitTangoData(), and SearchTangoIntervals().
|
private |
Definition at line 233 of file TangoData.h.
Referenced by TangoData(), DeleteTangoParameter(), and GetStartRun().
|
private |
Definition at line 231 of file TangoData.h.
Referenced by TangoData(), TangoData(), GetAverageTangoData(), GetTangoParameter(), GetTimeWeightedAverage(), InitTangoData(), and SetRunRangeDates().
|
private |
Definition at line 229 of file TangoData.h.
Referenced by TangoData(), DeleteTangoParameter(), GetAverageTangoData(), GetEndDate(), GetTangoParameter(), GetTimeWeightedAverage(), and SetRunRangeDates().
|
private |
Definition at line 228 of file TangoData.h.
Referenced by TangoData(), TangoData(), GetFullName(), GetMemberName(), and GetTangoParameter().
|
private |
Definition at line 228 of file TangoData.h.
Referenced by TangoData(), TangoData(), DeleteTangoParameter(), GetFullName(), GetParameterName(), and GetTangoParameter().
|
private |
Definition at line 228 of file TangoData.h.
Referenced by TangoData(), DeleteTangoParameter(), GetAverageTangoData(), GetStartDate(), GetTangoParameter(), GetTimeWeightedAverage(), InitTangoData(), PrintTangoDataMultiGraph(), and SetRunRangeDates().
|
private |
Definition at line 228 of file TangoData.h.
Referenced by TangoData(), TangoData(), DeleteTangoParameter(), GetFullName(), GetSystemName(), and GetTangoParameter().
|
private |
Definition at line 228 of file TangoData.h.
Referenced by TangoData(), TangoData(), GetUserName(), and SetUserName().
|
private |
Definition at line 234 of file TangoData.h.
Referenced by DeleteTangoParameter(), GetRunAverageTangoData(), and SetRunRangeDates().