Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:51

0001 #ifndef CALIBRATION_CATEGORY_H
0002 #define CALIBRATION_CATEGORY_H
0003 #include <map>
0004 #include <string>
0005 #include <xercesc/dom/DOM.hpp>
0006 #include <xercesc/util/XMLString.hpp>
0007 #include <cstdlib>
0008 #include "CalibrationXML.h"
0009 
0010 class CalibratedObject;
0011 
0012 /** This class defines a category.
0013 * The class is templated on the CI (category input) 
0014 * To actually use that class you have to inherit from it and implement the pure
0015 * virtual functions.
0016 */
0017 
0018 template <class CI>
0019 class CalibrationCategory {
0020 public:
0021   typedef XERCES_CPP_NAMESPACE::DOMElement DOMElement;
0022   typedef CI Input;
0023 
0024   CalibrationCategory();
0025 
0026   virtual ~CalibrationCategory();
0027 
0028   /** 
0029 * Should returun true if the CI input match that category 
0030 */
0031   virtual bool match(const CI& calibrationInput) const = 0;  //Not implemented here
0032 
0033   virtual std::string name() { return "BaseCalibrationCategory"; }  //Set it to pure virtual?
0034 
0035 protected:
0036   /** Read category parameters from XML
0037 */
0038   virtual void readFromDOM(DOMElement* dom) = 0;  //Not implemented
0039                                                   /** Save category parameters to XML
0040 */
0041   virtual void saveToDOM(DOMElement* dom) = 0;    //Not implemented
0042 
0043   virtual void dump() {}
0044 };
0045 
0046 template <class CI>
0047 CalibrationCategory<CI>::CalibrationCategory() {}
0048 
0049 template <class CI>
0050 CalibrationCategory<CI>::~CalibrationCategory() {}
0051 
0052 #endif