///////////////////////////////////////////////////////////////////// // PixModuleGroup.h // version 1.0.1 ///////////////////////////////////////////////////////////////////// // // 08/04/03 Version 1.0 (PM) // Initial release // // 14/04/03 Version 1.0.1 (CS) // Added Configuration DataBase // //! Class for a group of module connected to the same controller #ifndef _PIXLIB_MODULEGROUP //se non hai definito qst cosa, leggila qua #define _PIXLIB_MODULEGROUP #include #include #include #include #include #include "processor.h" #include "serialStreams.h" #include "scanControl.h" #include "Bits/Bits.h" namespace SctPixelRod { //forward declaration (attento, se dichiaro cose di queste classi non ti arrabbiare) class VmeInterface; } namespace PixLib { class PixConfDBInterface; class DBInquire; class PixController; class PixModule; class PixBoc; class Config; class PixScan; class Histo; class PixDcsChan; class PixModuleGroup { //definisco la classe public: typedef std::vector::iterator moduleIterator; //iteratore a vettore di puntat a PixM. //metodi speciali PixModuleGroup(PixConfDBInterface *db, DBInquire *dbInquire, SctPixelRod::VmeInterface &vme); //! Constructor from db PixModuleGroup(PixConfDBInterface *db, SctPixelRod::VmeInterface &vme); //! Default constructor //ci possono essere piu` costruttori, in questo caso il primo usa il db, il secondo no ~PixModuleGroup(); //! Destructor void initHW(); //! (re)initialize void testHW(); //! hardware test void init(); //! full init //Metodi // Accessors SctPixelRod::VmeInterface &getVmeInterface() { return m_vmeIf; }; PixConfDBInterface *getPixConfDB() { return m_db; }; PixController *getPixController() { return m_pixCtrl; }; std::string getRodName() { return m_rodName; }; std::string getName() { return m_name; }; PixModule* module(int im); moduleIterator modBegin() { return m_modules.begin(); }; moduleIterator modEnd() { return m_modules.end(); }; PixBoc* getPixBoc() { return m_pixBoc; }; //JW: NULL zurückgeben! Config &config() { return *m_config; }; // Config methods void readConfig(DBInquire *dbi); //! read a configuration from the DB void writeConfig(DBInquire *dbi); //! write the current configuration to the DB void downloadConfig(); //! write the current configuration into the PixController void configure(); //! load the current configuration into the actual phisical modules void storeConfig(std::string cfgName); //! give the current config a name void recallConfig(std::string cfgName); //! recall a named config void readDbInquire(); //Scan Methods void initScan(PixScan *scn); //! prepares the module group for the scan void scanLoopStart(int nloop, PixScan *scn); //! prepares the module group for the beginning of a particular loop void scanLoopEnd(int nloop, PixScan *scn); //! will perform the end-of-loop actions void prepareStep(int nloop, PixScan *scn); //! sets the variables values void scanExecute(PixScan *scn); //! executes a step of the scan void scanTerminate(PixScan *scn); //! terminates a step of the scan void terminateScan(PixScan *scn); //! end-of-scan cleanup void setupMasks(int nloop, PixScan *scn); //! prepares the masks void setupScanVariable(int nloop, PixScan *scn); //! prepares the system for the execution of a single step // Loop action specific methods void prepareTDACTuning(int nloop, PixScan *scn); void prepareTDACFastTuning(int nloop, PixScan *scn); //void prepareOccSumming(int nloop, PixScan *scn); void prepareTDACTuningBisection(int nloop, PixScan *scn); void prepareGDACTuning(int nloop, PixScan *scn); void prepareGDACFastTuning(int nloop, PixScan *scn); void prepareFDACTuning(int nloop, PixScan *scn); void prepareIFTuning(int nloop, PixScan *scn); void prepareT0Set(int nloop, PixScan *scn); void prepareIncrTdac(int nloop, PixScan *scn); void TOTcalib_FEI4(int nloop, PixScan *scn, PixController *ctrl); // analysis for FE-I4 TOT calibration void endTDACTuning(int nloop, PixScan *scn); void endTDACFastTuning(int nloop, PixScan *scn); void endOccSumming(int nloop, PixScan *scn); void endTDACTuningBisection(int nloop, PixScan *scn); void endGDACTuning(int nloop, PixScan *scn); void endGDACFastTuning(int nloop, PixScan *scn); void endFDACTuning(int nloop, PixScan *scn); void endFDACTuningAlt(int nloop, PixScan *scn); void endIFTuning(int nloop, PixScan *scn); void endT0Set(int nloop, PixScan *scn); void endIncrTdac(int nloop, PixScan *scn); void mccDelFit(int nloop, PixScan *scn); void fitCalib(int nloop, PixScan *scn); // DCS interface loading void setDcsChan(int modID, PixDcsChan *dcsChan); // helper function void fillHistosPerDc(PixScan &scn, int ife, Histo *his, double value); int getTriggerDelay(){return m_triggerDelay;}; private: PixConfDBInterface *m_db; SctPixelRod::VmeInterface &m_vmeIf; std::string m_name; std::string m_rodName; PixController *m_pixCtrl; std::vector m_modules; std::vector m_dcsChans; std::set m_confNames; //! the set of configurations stored in PixModuleGroup DBInquire* m_dbInquire; PixBoc *m_pixBoc; Config *m_config; bool m_execToTerminate; int m_triggerDelay; }; } #endif