|
|
Go to the documentation of this file. 1 #ifndef PixelConfigFile_h
2 #define PixelConfigFile_h
48 #include <sys/types.h>
62 static std::vector<std::pair<std::string, unsigned int> >
getAliases() {
64 std::vector<std::pair<std::string, unsigned int> >
tmp;
65 for (
unsigned int i = 0;
i < aliases.
nAliases();
i++) {
66 std::pair<std::string, unsigned int> apair(aliases.
name(
i), aliases.
key(
i));
76 std::vector<std::pair<std::string, std::string> >& versionAliases) {
82 versionAliases =
alias->versionAliases();
88 std::map<std::string, unsigned int>
tmp;
89 for (
unsigned int i = 0;
i < aliases.
nAliases();
i++) {
117 std::vector<std::pair<std::string, std::string> > versionaliases) {
119 for (
unsigned int i = 0;
i < versionaliases.size();
i++) {
142 static unsigned int makeKey(std::vector<std::pair<std::string, unsigned int> > versions) {
145 for (
unsigned int i = 0;
i < versions.size();
i++) {
168 <<
"]\t[PixelConfigFile::getConfig()]\t\t\t\t Waiting for other thread to complete reading"
178 static int first = 1;
180 directory = std::getenv(
"PIXELCONFIGURATIONBASE");
206 static int first = 1;
210 directory = std::getenv(
"PIXELCONFIGURATIONBASE");
242 unsigned int theKey =
key.key();
246 unsigned int last =
path.find_last_of(
"/");
247 assert(
last != (
unsigned int)std::string::npos);
252 unsigned int slashpos =
base.find_last_of(
"/");
253 if (slashpos == (
unsigned int)std::string::npos) {
254 std::cout <<
"[pos::PixelConfigFile::getPath()]\t\t\tOn path:" <<
path << std::endl;
255 std::cout <<
"[pos::PixelConfigFile::getPath()]\t\t\tRecall that you need a trailing /" << std::endl;
272 std::ostringstream s1;
277 directory = std::getenv(
"PIXELCONFIGURATIONBASE");
287 unsigned int theKey =
key.key();
295 unsigned int last =
path.find_last_of(
"/");
296 assert(
last != (
unsigned int)std::string::npos);
301 unsigned int slashpos =
base.find_last_of(
"/");
302 if (slashpos == (
unsigned int)std::string::npos) {
303 std::cout <<
"[pos::PixelConfigFile::get()]\t\t\tAsking for data of type:" <<
typeid(
data).
name() << std::endl;
304 std::cout <<
"[pos::PixelConfigFile::get()]\t\t\tOn path:" <<
path << std::endl;
305 std::cout <<
"[pos::PixelConfigFile::get()]\t\t\tRecall that you need a trailing /" << std::endl;
319 std::cout <<
"[PixelConfigFile.h::get] error loading config list. " << theKey <<
" " <<
dir <<
" " <<
version
325 std::ostringstream s1;
330 directory = std::getenv(
"PIXELCONFIGURATIONBASE");
390 std::ifstream calibin(calibfile.c_str());
391 if (calibin.good()) {
394 calibfile =
fullpath +
"delay25.dat";
396 std::ifstream delayin(calibfile.c_str());
397 if (delayin.good()) {
400 calibfile =
fullpath +
"fedtestdac.dat";
402 std::ifstream delayin(calibfile.c_str());
403 if (delayin.good()) {
406 throw std::runtime_error(
407 "[pos::PixelConfigFile::get()]\t\t\tCan't find calibration file calib.dat or delay25.dat or "
459 std::cout <<
"[pos::PixelConfigFile::get()]\t\t\tNo match" << std::endl;
463 std::cout <<
"[PixelConfigFile::get] Caught exception while constructing configuration object. Will rethrow."
472 std::string mthn =
"]\t[pos::PixelConfigFile::configurationDataExists()]\t ";
474 unsigned int theKey =
key.key();
478 unsigned int last =
path.find_last_of(
"/");
479 assert(
last != (
unsigned int)std::string::npos);
484 unsigned int slashpos =
base.find_last_of(
"/");
485 if (slashpos == (
unsigned int)std::string::npos) {
486 std::cout << __LINE__ << mthn <<
"Asking for data of type:" <<
typeid(
data).
name() << std::endl;
487 std::cout << __LINE__ << mthn <<
"On path:" <<
path << std::endl;
488 std::cout << __LINE__ << mthn <<
"Recall that you need a trailing /" << std::endl;
508 std::ostringstream s1;
513 directory = std::getenv(
"PIXELCONFIGURATIONBASE");
559 std::ifstream calibin(calibfile.c_str());
560 if (calibin.good()) {
561 std::cout << __LINE__ << mthn <<
"Found " << calibfile << std::endl;
564 calibfile =
fullpath +
"delay25.dat";
565 std::ifstream delayin(calibfile.c_str());
566 if (delayin.good()) {
567 std::cout << __LINE__ << mthn <<
"Found " << calibfile << std::endl;
570 calibfile =
fullpath +
"fedtestdac.dat";
571 std::ifstream delayin(calibfile.c_str());
572 if (delayin.good()) {
573 std::cout << __LINE__ << mthn <<
"Found " << calibfile << std::endl;
576 std::cout << mthn <<
"Can't find calibration file calib.dat or delay25.dat or fedtestdac.dat"
583 std::cout << __LINE__ << mthn <<
"No match of class type" << std::endl;
614 std::string mthn =
"]\t[pos::PixelConfigFile::get()]\t\t\t\t ";
616 unsigned int last =
path.find_last_of(
"/");
617 assert(
last != (
unsigned int)std::string::npos);
622 unsigned int slashpos =
base.find_last_of(
"/");
636 std::ostringstream s1;
641 directory = std::getenv(
"PIXELCONFIGURATIONBASE");
700 std::ifstream calibin(calibfile.c_str());
701 if (calibin.good()) {
704 calibfile =
fullpath +
"delay25.dat";
706 std::ifstream delayin(calibfile.c_str());
707 if (delayin.good()) {
710 calibfile =
fullpath +
"fedtestdac.dat";
712 std::ifstream delayin(calibfile.c_str());
713 if (delayin.good()) {
716 std::cout << __LINE__ << mthn <<
"Can't find calibration file calib.dat or delay25.dat or fedtestdac.dat"
769 std::cout << __LINE__ << mthn <<
"No class match" << std::endl;
778 typename std::map<std::string, T*>::iterator iObject = pixelObjects.begin();
780 for (; iObject != pixelObjects.end(); ++iObject) {
781 get(iObject->second, iObject->first,
key);
792 std::cout <<
"[pos::PixelConfigFile::makeNewVersion()]\t\tThe path:" <<
path <<
" does not exist." << std::endl;
793 std::cout <<
"[pos::PixelConfigFile::makeNewVersion()]\t\tFull path:" <<
directory << std::endl;
800 std::ostringstream s1;
805 }
while (
stat(
dir.c_str(), &stbuf) == 0);
815 object->writeASCII(
dir);
821 std::cout <<
"[pos::PixelConfigFile::put()]\t\t# of objects to write: " <<
objects.size() << std::endl;
824 for (
unsigned int i = 0;
i <
objects.size();
i++) {
This is the documentation about PixelNameTranslation...
static void get(T *&data, std::string path, unsigned int version)
static std::vector< std::string > getVersionAliases(std::string path)
This class specifies which delay25 channels are delayed over the entire pixel detector and by how muc...
This class provide a base class for the pixel ROC dac data for the pixel FEC configuration.
static void get(std::map< std::string, T * > &pixelObjects, PixelConfigKey key)
This is the documentation about PixelMaskBase...
This is the documentation about PixelDetectorConfig...
This class implements the configuration key which actually just is an integer.
static int makeNewVersion(std::string path, std::string &dir)
void updateConfigAlias(std::string path, unsigned int version, std::string alias, PixelConfigList &config)
U second(std::pair< T, U > const &p)
This class provides a base class for the pixel trim data for the pixel FEC configuration.
static std::string getPath(std::string path, PixelConfigKey key)
static pos::pathVersionAliasMmap getVersionData()
This is the documentation about PixelTBMSettings...
This class specifies which TKFEC boards are used and how they are addressed.
This class provides a translation from the naming documents standard to specify the ROC to the corres...
This is the documentation about PixelMaskAllPixels...
This class implements the configuration key which actually just is an integer.
static void get(T *&data, std::string path, PixelConfigKey key)
pathVersionAliasMmap getVersionData()
static PixelConfigList & getConfig()
static bool configurationDataExists(T *&data, std::string path, PixelConfigKey key)
static unsigned int makeKey(std::vector< std::pair< std::string, unsigned int > > versions)
void insertVersionAlias(PixelVersionAlias &anAlias)
PixelConfigAlias * versionAliases(std::string aliasName)
static bool getVersionAliases(std::string configAlias, unsigned int &key, std::vector< std::pair< std::string, std::string > > &versionAliases)
The class to handle 'aliases.txt'.
void readfile(std::string filename)
This is the documentation about PixelLTCConfig...
static void addAlias(std::string alias, unsigned int key, std::vector< std::pair< std::string, std::string > > versionaliases)
Base class for pixel calibration procedures.
This class implements the steps that are used in a scan over Threshold and CalDelay.
This class specifies which FEC boards are used and how they are addressed.
static void forceConfigReload(bool m)
This file contains the base class for "pixel configuration data" management.
This class implements the steps that are used in a scan over Threshold and CalDelay.
unsigned int getVersion(std::string path, std::string alias)
This class manages data and files used in the Delay25 calibration.
std::vector< pathAliasPair > getConfigAliases(std::string path)
This class specifies which detector components are used in the configuration (and eventually should s...
static bool & getForceAliasesReload()
This is the documentation about PixelFEDCard...
static PixelAliasList & getAlias()
static void addAlias(std::string alias, unsigned int key)
std::map< std::string, vectorVAPairs > pathVersionAliasMmap
static std::map< std::string, unsigned int > getAliases_map()
static int put(const T *object, std::string path)
static PixelConfigList & configList()
This is the documentation about PixelFEDConfig...
static std::vector< pathAliasPair > getConfigAliases(std::string path)
This class is responsible for manipulating the DACsettings of a ROC.
std::string name(unsigned int i)
This class specifies which TKFEC boards are used and how they are addressed.
std::vector< std::string > getVersionAliases(std::string path)
void addVersionAlias(std::string path, std::string alias)
This is the documentation about PixelLowVoltageMap...
char data[epos_bytes_allocation]
void insertAlias(PixelConfigAlias &anAlias)
This class manages data and files used in the Delay25 calibration.
static std::vector< std::pair< std::string, unsigned int > > getVersions(pos::PixelConfigKey key)
static pos::pathVersionAliasMmap getVersionData(std::string koc)
This class specifies which FEC boards are used and how they are addressed.
static void forceAliasesReload(bool m)
This class provides the mapping between portcards and the modules controlled by the card.
This is the documentation about PixelNameTranslation...
std::vector< std::pair< std::string, unsigned int > > versions()
This class specifies the maximum Vsf setting that should be used for each ROC.
static int put(std::vector< T * > objects, std::string path)
static void addVersionAlias(std::string path, unsigned int version, std::string alias)
This class implements the steps that are used in a scan over Threshold and CalDelay.
This is the documentation about PixelMaxVsf...
This class specifies which delay25 channels are delayed over the entire pixel detector and by how muc...
static std::vector< std::pair< std::string, unsigned int > > getAliases()
static bool & getForceConfigReload()
This class specifies the settings on the TKPCIFEC and the settings on the portcard.
static unsigned int getVersion(std::string path, std::string alias)
unsigned int key(unsigned int i)