Static Public Member Functions | List of all members
dbutils::hw::APD Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/DatabaseUtils/cxx/include/Hardware/Installation.h"

Static Public Member Functions

static bool Installed (int detid, std::string dcmName, int dcmPort, std::string &id, std::string ts="now")
 
static bool GetAllInstalled (int detid, std::vector< std::string > &dcmName, std::vector< int > &dcmPort, std::vector< std::string > &id, std::string ts="now")
 

Detailed Description

Definition at line 37 of file Installation.h.

Member Function Documentation

bool dbutils::hw::APD::GetAllInstalled ( int  detid,
std::vector< std::string > &  dcmName,
std::vector< int > &  dcmPort,
std::vector< std::string > &  id,
std::string  ts = "now" 
)
static

Definition at line 105 of file Installation.cpp.

References nova::database::Row::Col(), nova::database::Column::Get(), nova::database::Table::GetRow(), MECModelEnuComparisons::i, novadaq::cnv::kNDOS, nova::database::Table::LoadFromDB(), nova::database::Table::NRow(), dbutils::hw::Util::PositionTable(), r(), nova::database::Table::SetValidityRange(), nova::database::Table::SetValiditySQL(), string, and confusionMatrixTree::t.

109  {
111 
112  if (detid == novadaq::cnv::kNDOS) {
113  t->SetValidityRange("hw_type","APD");
114  std::string vld = "install_date < '" + ts + "' and (remove_date is NULL or remove_date > '" + ts + "')";
115  t->SetValiditySQL(vld);
116  t->LoadFromDB();
117  if (t->NRow() == 0) return false;
119 
120  std::string dName;
121  std::string id;
122  int dPort;
123  bool ok=true;
124  for (int i=0; i<t->NRow(); ++i) {
125  r = t->GetRow(i);
126  ok &= r->Col("hw_id")->Get(id);
127  ok &= r->Col("dcm_name")->Get(dName);
128  ok &= r->Col("dcm_port")->Get(dPort);
129  if (ok) {
130  dcmName.push_back(dName);
131  dcmPort.push_back(dPort);
132  febid.push_back(id);
133  }
134  }
135  delete t;
136  return ok;
137  }
138 
139  return false;
140  }
::xsd::cxx::tree::id< char, ncname > id
Definition: Database.h:165
static nova::database::Table * PositionTable(int detid)
Definition: Installation.cpp:9
Row * GetRow(int i)
Definition: Table.cpp:804
bool SetValidityRange(std::string cname, T start, T end)
Definition: Table.h:206
void SetValiditySQL(std::string cmd)
Definition: Table.h:195
Prototype Near Detector on the surface at FNAL.
bool Get(T &val) const
Definition: Column.h:53
TRandom3 r(0)
Column & Col(int i)
Definition: Row.h:51
enum BeamMode string
bool dbutils::hw::APD::Installed ( int  detid,
std::string  dcmName,
int  dcmPort,
std::string id,
std::string  ts = "now" 
)
static

Definition at line 83 of file Installation.cpp.

References nova::database::Row::Col(), nova::database::Column::Get(), nova::database::Table::GetRow(), novadaq::cnv::kNDOS, nova::database::Table::LoadFromDB(), nova::database::Table::NRow(), dbutils::hw::Util::PositionTable(), r(), nova::database::Table::SetValidityRange(), nova::database::Table::SetValiditySQL(), string, and confusionMatrixTree::t.

85  {
87 
88  if (detid == novadaq::cnv::kNDOS) {
89  t->SetValidityRange("hw_type","APD");
90  t->SetValidityRange("dcm_name",dcmName);
91  t->SetValidityRange("dcm_port",dcmPort);
92  std::string vld = "install_date < '" + ts + "' and (remove_date is NULL or remove_date > '" + ts + "')";
93  t->SetValiditySQL(vld);
94  t->LoadFromDB();
95  if (t->NRow() != 1) return false;
96  nova::database::Row* r = t->GetRow(0);
97  bool ok = r->Col("hw_id")->Get(id);
98  delete t;
99  return ok;
100  }
101 
102  return false;
103  }
static nova::database::Table * PositionTable(int detid)
Definition: Installation.cpp:9
Row * GetRow(int i)
Definition: Table.cpp:804
bool SetValidityRange(std::string cname, T start, T end)
Definition: Table.h:206
void SetValiditySQL(std::string cmd)
Definition: Table.h:195
Prototype Near Detector on the surface at FNAL.
bool Get(T &val) const
Definition: Column.h:53
TRandom3 r(0)
Column & Col(int i)
Definition: Row.h:51
enum BeamMode string

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