/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/include/slowControl/SlowControlManager.hh

Go to the documentation of this file.
00001 /* @version $Revision: 1328 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-10-03 17:04:17 +0200 (Mon, 03 Oct 2011) $ */
00002 #ifndef SLOWCONTROLMANAGER_HH
00003 #define SLOWCONTROLMANAGER_HH
00004 
00005 
00006 
00007 #include "mTypes.h"
00008 #include <map>
00009 #include <list>
00010 #include <set>
00011 #include <fstream>
00012 #include "SlowControlEntry.hh"
00013 
00014 class SteerDesc;
00015 class PMParams;
00016 class SCSteerParams;
00017 class ChamberSlowControl;
00018 class MeshParams_t;
00019 class PMSlowControl;
00020 class DriftParams_t;
00021 
00022 #define PM "PM"
00023 //#define CHAMBER "chamber"
00024 #define BOARD "board"
00025 #define PRESSURE "pressure"
00026 #define OVERPRESSURE "overPressure"
00027 #define TEMPERATURE "temperature"
00028 #define TIMESTAMP "timeStamp"
00029 
00030 struct scSorter
00031 {
00032    bool operator() (const SlowControlEntry&  lhs, const SlowControlEntry& rhs) const
00033    {
00034     return lhs.getTimeStamp() > rhs.getTimeStamp();  // du plus grand au plus petit
00035    }
00036 };
00037 
00038 //////////////////////////////////////////////////////////////////////////
00039 ///     CLASS SLOWCONTROL                                               //
00040 //////////////////////////////////////////////////////////////////////////
00041 class SlowControlManager {
00042 //   friend std::ostream& operator <<(std::ostream &out, const Event &x);
00043 
00044   public:
00045     SlowControlManager();
00046     ~SlowControlManager();
00047     i32 readDB(const std::string fileName);
00048     void build(const SteerDesc& sd); // builds reading structure from steer file
00049 
00050     // general parameters
00051     const SlowControlEntry* getEntry(const double timeStamp)const ;
00052     std::set<SlowControlEntry>::const_iterator begin() { return genList.begin(); };
00053     std::set<SlowControlEntry>::const_iterator end() { return genList.end(); };
00054     inline const ui32 getNbEntries() { return genList.size(); }
00055 
00056 
00057   private:
00058  void addSteer(const ui32 scId, const std::string type, const ui32 chamberId,  const ui32 difId,  const ui32 boardId, const ui32 pmId,  const std::string name);
00059 
00060 
00061     // general parameters
00062     void addEntry(const SlowControlEntry& entry);
00063 
00064     // board parameters
00065     const BoardSlowControl& getBoard(const double timeStamp, const ui32 chamberId,  const ui32 difId,  const ui32 boardId)  const  ;
00066     const PMSlowControl& getPM(const double timeStamp, const ui32 id) const  ;
00067 
00068   private:
00069       // Stocked data by timestamp
00070     std::set<SlowControlEntry,scSorter> genList; // contains all slowcontrol sorted by their timestamp
00071 
00072     // For steer file data comprehension
00073     std::list<SCSteerParams> stList;
00074 };
00075 
00076 
00077 #endif
00078 

Generated on Mon Jan 7 13:15:21 2013 for MicromegasFramework by  doxygen 1.4.7