diff --git a/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h b/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h deleted file mode 100644 index c6ea5fb08b964..0000000000000 --- a/CondCore/DTPlugins/interface/DTCompactMapPluginHandler.h +++ /dev/null @@ -1 +0,0 @@ -#error obsolete header diff --git a/CondCore/DTPlugins/interface/DTConfigPluginHandler.h b/CondCore/DTPlugins/interface/DTConfigPluginHandler.h deleted file mode 100644 index c6ea5fb08b964..0000000000000 --- a/CondCore/DTPlugins/interface/DTConfigPluginHandler.h +++ /dev/null @@ -1 +0,0 @@ -#error obsolete header diff --git a/CondFormats/CastorObjects/interface/AllClasses.h b/CondFormats/CastorObjects/interface/AllClasses.h deleted file mode 100644 index ac0d1349110df..0000000000000 --- a/CondFormats/CastorObjects/interface/AllClasses.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CondFormats_CastorObjects_AllClasses_h -#define CondFormats_CastorObjects_AllClasses_h -#include "CondFormats/CastorObjects/interface/AllObjects.h" -/* -class CastorPedestals; -class CastorPedestalWidths; -class CastorGains; -class CastorRawGains; -class CastorGainWidths; -class CastorQIEShape; -class CastorQIEData; -class CastorCalibrationQIEData; -class CastorChannelQuality; -class CastorElectronicsMap; -*/ -#endif diff --git a/CondFormats/Common/interface/Constants.h b/CondFormats/Common/interface/Constants.h deleted file mode 100644 index 8a4253dbcc168..0000000000000 --- a/CondFormats/Common/interface/Constants.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef CondCommon_Constants_h -#define CondCommon_Constants_h -#include -#include -#include - -/* constants other than time used in cond - */ - -namespace cond { - - const std::string invalidToken(" "); - -} - -#endif //CondCommon_Constants_h diff --git a/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h b/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadChannelRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h b/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadFiberRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h b/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripBadModuleRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h b/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripModuleHVRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h b/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripPerformanceSummaryRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h b/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h deleted file mode 100644 index af76e665c008c..0000000000000 --- a/CondFormats/DataRecord/interface/SiStripRunSummaryRcd.h +++ /dev/null @@ -1 +0,0 @@ -#include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" diff --git a/CondFormats/HcalObjects/interface/HcalItemArrayColl.h b/CondFormats/HcalObjects/interface/HcalItemArrayColl.h deleted file mode 100644 index 40997120b675e..0000000000000 --- a/CondFormats/HcalObjects/interface/HcalItemArrayColl.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef CondFormats_HcalObjects_HcalItemArrayColl_h -#define CondFormats_HcalObjects_HcalItemArrayColl_h - -#include "boost/array.hpp" -#include "boost/serialization/access.hpp" -#include "boost/serialization/version.hpp" -#include "boost/serialization/shared_ptr.hpp" -#include "boost/serialization/vector.hpp" -#include "boost/version.hpp" -#if BOOST_VERSION < 106400 -#include "boost/serialization/array.hpp" -#else -#include "boost/serialization/boost_array.hpp" -#endif - -#include -#include -#include - -// -// This collection manages arrays of pointers and references. -// In particular, it can be used for storing objects in -// an inheritance hierarchy by their base pointers. -// The pointee objects are owned by this collection. -// -template -class HcalItemArrayColl { -public: - typedef Item value_type; - typedef std::array, N> InputArray; - static constexpr unsigned arraySize() { return N; } - - // The following method adds a new array of pointers to the collection. - // This class will take ownership of the pointee objects. - void push_back(InputArray& arr) { - StoredArray st; - for (unsigned i = 0; i < N; ++i) - st[i] = std::shared_ptr(arr[i].release()); - data_.push_back(st); - } - - // Other modifiers - inline void clear() { data_.clear(); } - inline void reserve(const unsigned n) { data_.reserve(n); } - - // Some inspectors - inline std::size_t size() const { return data_.size(); } - inline bool empty() const { return data_.empty(); } - - // The following function returns nullptr if - // one of the argument indices is out of range - inline const Item* get(const unsigned itemIndex, const unsigned arrayIndex) const { - if (itemIndex < data_.size() && arrayIndex < N) - return data_[itemIndex][arrayIndex].get(); - else - return nullptr; - } - - // The following function throws an exception if - // one of the argument indices is out of range - inline Item& at(const unsigned itemIndex, const unsigned arrayIndex) const { - return *data_.at(itemIndex).at(arrayIndex); - } - - // Deep comparison for equality is useful for testing serialization - bool operator==(const HcalItemArrayColl& r) const { - const std::size_t sz = data_.size(); - if (sz != r.data_.size()) - return false; - for (std::size_t i = 0; i < sz; ++i) - for (unsigned j = 0; j < N; ++j) - if (!(*data_[i][j] == *r.data_[i][j])) - return false; - return true; - } - - inline bool operator!=(const HcalItemArrayColl& r) const { return !(*this == r); } - -private: - typedef boost::array, N> StoredArray; - std::vector data_; - - friend class boost::serialization::access; - - template - inline void serialize(Archive& ar, unsigned /* version */) { - ar& data_; - } -}; - -// boost serialization version number for this template -namespace boost { - namespace serialization { - template - struct version > { - BOOST_STATIC_CONSTANT(int, value = 1); - }; - } // namespace serialization -} // namespace boost - -#endif // CondFormats_HcalObjects_HcalItemArrayColl_h diff --git a/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h b/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h deleted file mode 100644 index 2c66a4860a717..0000000000000 --- a/CondFormats/HcalObjects/interface/HcalItemArrayCollById.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef CondFormats_HcalObjects_HcalItemArrayCollById_h -#define CondFormats_HcalObjects_HcalItemArrayCollById_h - -#include - -#include "FWCore/Utilities/interface/Exception.h" - -#include "CondFormats/HcalObjects/interface/HcalItemArrayColl.h" -#include "CondFormats/HcalObjects/interface/HcalIndexLookup.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "CondFormats/HcalObjects/interface/HcalDetIdTransform.h" -#include "CondFormats/HcalObjects/interface/AbsHcalAlgoData.h" - -// -// This collection allows lookup of arrays of items by HcalDetId. -// If the given HcalDetId is not explicitly listed in the -// lookup table, default item is returned. -// -// Just like HcalItemArrayColl, this collection works with pointers -// and references only, so it can be used with the inheritance -// scenarios. Note that the ownership of objects is shared with -// the collection provided in the constructor. The default array -// is owned by this collection. Its ownership will also become -// shared if a copy of this collection is made. -// -template -class HcalItemArrayCollById : public AbsHcalAlgoData { -public: - typedef Item value_type; - typedef typename HcalItemArrayColl::InputArray InputArray; - static constexpr unsigned arraySize() { return N; } - - // Dummy constructor. To be used for deserialization only. - inline HcalItemArrayCollById() : transformCode_(HcalDetIdTransform::N_TRANSFORMS) {} - - // Normal constructor - HcalItemArrayCollById(const HcalItemArrayColl& coll, - const HcalIndexLookup& indexLookupTable, - const unsigned detIdTransformCode, - InputArray& defaultFunctors) - : coll_(coll), lookup_(indexLookupTable), transformCode_(detIdTransformCode) { - // Check that the lookup table is valid for this application - if (lookup_.hasDuplicateIds()) - throw cms::Exception( - "In HcalItemArrayCollById constructor:" - " invalid lookup table"); - - // Check that the lookup table is consistent with the size - // of the collection - const unsigned maxIndex = lookup_.largestIndex(); - if (maxIndex != HcalIndexLookup::InvalidIndex && maxIndex >= coll_.size()) - throw cms::Exception( - "In HcalItemArrayCollById constructor:" - " collection and lookup table are inconsistent"); - - HcalDetIdTransform::validateCode(transformCode_); - - // Take care of the default array - setDefault(defaultFunctors); - } - - inline virtual ~HcalItemArrayCollById() {} - - // Modifier for the default array of items - inline void setDefault(InputArray& arr) { - for (unsigned i = 0; i < N; ++i) - default_[i] = std::shared_ptr(arr[i].release()); - } - - // Size of the internal collection, not counting the default - inline std::size_t size() const { return coll_.size(); } - - // Look up the index into the collection by detector id - inline unsigned getIndex(const HcalDetId& id) const { - return lookup_.find(HcalDetIdTransform::transform(id, transformCode_)); - } - - // Item lookup by its index and array index. If item lookup - // by index fails and the array index is not out of bounds, - // default item is returned. - inline const Item* getByIndex(const unsigned itemIndex, const unsigned arrayIndex) const { - const Item* f = coll_.get(itemIndex, arrayIndex); - if (f == nullptr && arrayIndex < N) - f = default_[arrayIndex].get(); - return f; - } - - // The following method will return nullptr if - // there is no corresponding default - inline const Item* getDefault(const unsigned arrayIndex) const { - if (arrayIndex < N) - return default_[arrayIndex].get(); - else - return nullptr; - } - - // Convenience function for getting what we need by id. - // Note that, if you are simply cycling over array indices, - // it will be more efficient to retrieve the item index - // first and then use "getByIndex" method. - inline const Item* get(const HcalDetId& id, const unsigned arrayIndex) const { - return getByIndex(getIndex(id), arrayIndex); - } - - // Similar comment applies here if you are just cycling over array indices - inline const Item& at(const HcalDetId& id, const unsigned arrayIndex) const { - const Item* f = getByIndex(getIndex(id), arrayIndex); - if (f == nullptr) - throw cms::Exception("In HcalItemArrayCollById::at: invalid detector id"); - return *f; - } - -protected: - virtual bool isEqual(const AbsHcalAlgoData& other) const override { - const HcalItemArrayCollById& r = static_cast(other); - if (coll_ != r.coll_) - return false; - if (lookup_ != r.lookup_) - return false; - if (transformCode_ != r.transformCode_) - return false; - for (unsigned j = 0; j < N; ++j) { - // The default may or may not be there - const bool ld = default_[j].get(); - const bool rd = r.default_[j].get(); - if (ld != rd) - return false; - if (ld) - if (!(*default_[j] == *r.default_[j])) - return false; - } - return true; - } - -private: - typedef boost::array, N> StoredArray; - - HcalItemArrayColl coll_; - HcalIndexLookup lookup_; - StoredArray default_; - uint32_t transformCode_; - - friend class boost::serialization::access; - - template - inline void serialize(Archive& ar, unsigned /* version */) { - ar& coll_& lookup_& default_& transformCode_; - } -}; - -// boost serialization version number for this template -namespace boost { - namespace serialization { - template - struct version > { - BOOST_STATIC_CONSTANT(int, value = 1); - }; - } // namespace serialization -} // namespace boost - -#endif // CondFormats_HcalObjects_HcalItemArrayCollById_h diff --git a/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp b/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp deleted file mode 100644 index 45933afa4bbd5..0000000000000 --- a/CondFormats/Serialization/interface/eos/polymorphic_portable_archive.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*****************************************************************************/ -/** - * \file polymorphic_portable_archive.hpp - * \brief Needed for unit tests on portable archives. - * \author christian.pfligersdorffer@gmx.at - * - * Header for testing portable archives with all of the serialization tests. - * Before use copy all hpp files from this directory to your boost folder - * boost_.../libs/serialization/test and run from there a visual studio - * prompt with b2 oder bjam -sBOOST_ARCHIVE_LIST=portable_archive.hpp - * - * \note Since portable archives version 5.0 we depend on program_options! - * Edit libs/serialization/test/Jamfile.v2 and change the requirements to - * : requirements /boost/filesystem /boost/program_options - */ -/****************************************************************************/ - -#pragma warning(disable : 4217 4127 4310 4244 4800 4267) - -// text_archive test header -// include output archive header -#include "portable_oarchive.hpp" -// set name of test output archive -typedef eos::polymorphic_portable_oarchive test_oarchive; -// set name of test output stream -typedef std::ofstream test_ostream; - -// repeat the above for input archive -#include "portable_iarchive.hpp" -typedef eos::polymorphic_portable_iarchive test_iarchive; -typedef std::ifstream test_istream; - -// define open mode for streams -// binary archives should use std::ios_base::binary -#define TEST_STREAM_FLAGS std::ios_base::binary diff --git a/CondFormats/Serialization/interface/eos/portable_archive.hpp b/CondFormats/Serialization/interface/eos/portable_archive.hpp deleted file mode 100644 index f5b51ccb82cee..0000000000000 --- a/CondFormats/Serialization/interface/eos/portable_archive.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*****************************************************************************/ -/** - * \file portable_archive.hpp - * \brief Needed for unit tests on portable archives. - * \author christian.pfligersdorffer@gmx.at - * - * Header for testing portable archives with all of the serialization tests. - * Before use copy all hpp files from this directory to your boost folder - * boost_.../libs/serialization/test and run from there a visual studio - * prompt with b2 oder bjam -sBOOST_ARCHIVE_LIST=portable_archive.hpp - * - * \note Since portable archives version 5.0 we depend on program_options! - * Edit libs/serialization/test/Jamfile.v2 and change the requirements to - * : requirements /boost/filesystem /boost/program_options - */ -/****************************************************************************/ - -#pragma warning(disable : 4217 4127 4310 4244 4800 4267) - -// text_archive test header -// include output archive header -#include "portable_oarchive.hpp" -// set name of test output archive -typedef eos::portable_oarchive test_oarchive; -// set name of test output stream -typedef std::ofstream test_ostream; - -// repeat the above for input archive -#include "portable_iarchive.hpp" -typedef eos::portable_iarchive test_iarchive; -typedef std::ifstream test_istream; - -// define open mode for streams -// binary archives should use std::ios_base::binary -#define TEST_STREAM_FLAGS std::ios_base::binary diff --git a/CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h b/CondFormats/SiPixelObjects/interface/MapPathTodetUnit.h deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h b/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h deleted file mode 100644 index 062fd8546863b..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibConstantsHandler.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - \file - Declaration of class IntercalibConstantsHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibConstantsHandler.h,v 1.1 2008/11/14 15:46:05 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibConstantsHandler_h_ -#define _CondToolsEcal_EcalIntercalibConstantsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibConstantsHandler; - -#endif diff --git a/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h b/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h deleted file mode 100644 index f92ede7ae1f35..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibConstantsMCHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class InterlcalibConstantsMCHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibConstantsMCHandler.h,v 1.1 2009/04/08 15:20:25 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibConstantsMCHandler_h_ -#define _CondToolsEcal_EcalIntercalibConstantsMCHandler_h_ - - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibConstantsMCHandler; - -#endif diff --git a/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h b/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h deleted file mode 100644 index f881eb7356ebf..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibErrorsHandler.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - \file - Declaration of class IntercalibErrorsHandler - - \author Stefano ARGIRO - \version $Id: EcalIntercalibErrorsHandler.h,v 1.1 2008/11/14 15:46:05 argiro Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalIntercalibErrorsHandler_h_ -#define _CondToolsEcal_EcalIntercalibErrorsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalIntercalibErrorsHandler; - -#endif // _CondToolsEcal_EcalIntercalibErrorsHandler_h_ - -// Configure (x)emacs for this file ... -// Local Variables: -// mode:c++ -// compile-command: "scram b" -// End diff --git a/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h b/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h deleted file mode 100644 index eec459e867071..0000000000000 --- a/CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - Translates a EcalIntercalibErrors record to XML - and vice versa - - \author Stefano ARGIRO - \version $Id: EcalIntercalibErrorsXMLTranslator.h,v 1.3 2009/06/30 16:15:16 argiro Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalIntercalibErrorsXMLTranslator_h_ -#define __EcalIntercalibErrorsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalIntercalibErrorsXMLTranslator; - -#endif // __EcalIntercalibErrorsXMLTranslator_h_ diff --git a/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h b/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h deleted file mode 100644 index 509ed640de898..0000000000000 --- a/CondTools/Ecal/interface/EcalPFRecHitThresholdsXMLTranslator.h +++ /dev/null @@ -1,17 +0,0 @@ -/** - Translates a EcalPFRecHitThresholds record to XML - and vice versa - - \author Stefano ARGIRO - \version $Id: EcalPFRecHitThresholdsXMLTranslator.h,v 1.2 2009/06/30 14:40:11 argiro Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalPFRecHitThresholdsXMLTranslator_h_ -#define __EcalPFRecHitThresholdsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalPFRecHitThresholdsXMLTranslator; - -#endif // __EcalPFRecHitThresholdsXMLTranslator_h_ diff --git a/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h b/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h deleted file mode 100644 index f48c154857f93..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibConstantsHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class EcalTimeCalibConstantsHandler - - \author Seth COOPER - \version $Id: EcalTimeCalibConstantsHandler.h,v 1.1 2009/10/26 14:14:11 scooper Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalTimeCalibConstantsHandler_h_ -#define _CondToolsEcal_EcalTimeCalibConstantsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalTimeCalibConstantsHandler; - -#endif - diff --git a/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h b/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h deleted file mode 100644 index 945623f0d7c1c..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Translates an EcalTimeCalibConstants record to XML - and vice versa - - \author Seth COOPER - \version $Id: EcalTimeCalibConstantsXMLTranslator.h,v 1.1 2009/10/26 16:15:16 scooper Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalTimeCalibConstantsXMLTranslator_h_ -#define __EcalTimeCalibConstantsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalTimeCalibConstantsXMLTranslator; - - -#endif // __EcalTimeCalibConstantsXMLTranslator_h_ - diff --git a/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h b/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h deleted file mode 100644 index b6b829e068020..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibErrorsHandler.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - \file - Declaration of class EcalTimeCalibErrorsHandler - - \author Seth COOPER - \version $Id: EcalTimeCalibErrorsHandler.h,v 1.1 2009/10/26 14:14:11 scooper Exp $ - \date 09 Sep 2008 -*/ - -#ifndef _CondToolsEcal_EcalTimeCalibErrorsHandler_h_ -#define _CondToolsEcal_EcalTimeCalibErrorsHandler_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerHandler.h" - -typedef EcalFloatCondObjectContainerHandler EcalTimeCalibErrorsHandler; - -#endif - diff --git a/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h b/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h deleted file mode 100644 index 241363a884e78..0000000000000 --- a/CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h +++ /dev/null @@ -1,19 +0,0 @@ -/** - Translates an EcalTimeCalibErrors record to XML - and vice versa - - \author Seth COOPER - \version $Id: EcalTimeCalibErrorsXMLTranslator.h,v 1.1 2009/10/26 16:15:16 scooper Exp $ - \date 20 Jun 2008 -*/ - -#ifndef __EcalTimeCalibErrorsXMLTranslator_h_ -#define __EcalTimeCalibErrorsXMLTranslator_h_ - -#include "CondTools/Ecal/interface/EcalFloatCondObjectContainerXMLTranslator.h" - -typedef EcalFloatCondObjectContainerXMLTranslator EcalTimeCalibErrorsXMLTranslator; - - -#endif // __EcalTimeCalibErrorsXMLTranslator_h_ - diff --git a/CondTools/Ecal/test/testXMLTranslators.cc b/CondTools/Ecal/test/testXMLTranslators.cc deleted file mode 100644 index cde70f806f3aa..0000000000000 --- a/CondTools/Ecal/test/testXMLTranslators.cc +++ /dev/null @@ -1,472 +0,0 @@ -#include "CondTools/Ecal/interface/EcalADCToGeVXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalIntercalibConstantsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalLinearCorrectionsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalIntercalibErrorsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalWeightGroupXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTBWeightsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalLaserAPDPNRatiosXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTimeCalibConstantsXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalTimeCalibErrorsXMLTranslator.h" - -#include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h" -#include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" -#include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h" - -#include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h" -#include "CondFormats/EcalObjects/interface/EcalTimeCalibErrors.h" - -#include "CondFormats/EcalObjects/interface/EcalXtalGroupId.h" -#include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h" -#include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h" - -#include "CondTools/Ecal/interface/EcalGainRatiosXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalChannelStatusXMLTranslator.h" -#include "CondTools/Ecal/interface/EcalWeightSetXMLTranslator.h" - -#include "CondFormats/EcalObjects/interface/EcalGainRatios.h" -#include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h" - -#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h" -#include "CondFormats/EcalObjects/interface/EcalChannelStatusCode.h" - -#include "CondFormats/EcalObjects/interface/EcalWeightSet.h" -#include "CondTools/Ecal/interface/EcalCondHeader.h" - -#include "CondFormats/EcalObjects/interface/EcalTBWeights.h" - -#include "DataFormats/EcalDetId/interface/EBDetId.h" - - - -#include -using std::cout; -using std::endl; - -#include - -int main(){ - - // Test ADCtoGeV - - EcalCondHeader header; - EcalCondHeader header2; - - - header.method_="testmethod"; - header.version_="testversion"; - header.datasource_="testdata"; - header.since_=123; - header.tag_="testtag"; - header.date_="Mar 24 1973"; - - - - EcalADCToGeVConstant adctogev_constant; - EcalADCToGeVConstant adctogev_constant2; - - adctogev_constant.setEBValue(1.1); - adctogev_constant.setEEValue(2.2); - - std::string adctogevfile("/tmp/EcalADCToGeVConstant.xml"); - std::string adctogevfile2("/tmp/adctogev2.xml"); - - EcalADCToGeVXMLTranslator::writeXML(adctogevfile,header,adctogev_constant); - EcalADCToGeVXMLTranslator::readXML(adctogevfile,header2,adctogev_constant2); - EcalADCToGeVXMLTranslator::writeXML(adctogevfile2,header2,adctogev_constant2); - - - // Test Intercalibration - - - EcalLinearCorrections lin_constants; - EcalIntercalibConstants intercalib_constants; - EcalIntercalibErrors intercalib_errors; - - std::string linfile("/tmp/EcalLinearCorrections.xml"); - std::string intercalibfile("/tmp/EcalIntercalibConstants.xml"); - std::string intercaliberrfile("/tmp/EcalIntercalibErrors.xml"); - std::string intercalibfiledb("/tmp/EcalIntercalibConstantsDB.xml"); - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - - EcalIntercalibConstant intercalib_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalIntercalibConstant lin_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalIntercalibError intercalib_error = intercalib_constant +1; - - lin_constants[rawid]=lin_constant; - intercalib_constants[rawid]=intercalib_constant; - intercalib_errors[rawid] =intercalib_error; - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - EcalLinearCorrection lin_constant = EEDetId::unhashIndex(cellid).ix();; - EcalIntercalibConstant intercalib_constant = EEDetId::unhashIndex(cellid).ix();; - EcalIntercalibError intercalib_error = intercalib_constant +1; - - lin_constants[rawid]=lin_constant; - intercalib_constants[rawid]=intercalib_constant; - intercalib_errors[rawid]=intercalib_error; - } // if - } - - - - EcalLinearCorrectionsXMLTranslator::writeXML(linfile,header, - lin_constants); - - EcalIntercalibConstantsXMLTranslator::writeXML(intercalibfile,header, - intercalib_constants); - - EcalIntercalibErrorsXMLTranslator::writeXML(intercaliberrfile,header, - intercalib_errors); - - EcalIntercalibConstants lin_constants2; - EcalIntercalibConstants intercalib_constants2; - EcalIntercalibErrors intercalib_errors2; - - - EcalLinearCorrectionsXMLTranslator::readXML(linfile,header2, - lin_constants2); - - EcalIntercalibConstantsXMLTranslator::readXML(intercalibfile,header2, - intercalib_constants2); - - EcalIntercalibErrorsXMLTranslator::readXML(intercaliberrfile,header2, - intercalib_errors2); - - std::string linfile2("/tmp/linfile-2.xml"); - std::string intercalibfile2("/tmp/intercalibfile-2.xml"); - std::string intercaliberrfile2("/tmp/intercaliberrfile-2.xml"); - - EcalLinearCorrectionsXMLTranslator::writeXML(linfile2, - header2, - lin_constants2); - EcalIntercalibConstantsXMLTranslator::writeXML(intercalibfile2, - header2, - intercalib_constants2); - - EcalIntercalibErrorsXMLTranslator::writeXML(intercaliberrfile,header2, - intercalib_errors2); - - cout << "Done testing Intercalib abd Linear Corrections" << endl; - - // Test Timing Intercalibration - - - EcalTimeCalibConstants timeCalib_constants; - EcalTimeCalibErrors timeCalib_errors; - - std::string timeCalibFile("/tmp/EcalTimeCalibConstants.xml"); - std::string timeCalibErrFile("/tmp/EcalTimeCalibErrors.xml"); - std::string timeCalibFileDB("/tmp/EcalTimeCalibConstantsDB.xml"); - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - - EcalTimeCalibConstant timeCalib_constant = - EBDetId::unhashIndex(cellid).iphi(); - - EcalTimeCalibError timeCalib_error = timeCalib_constant +1; - - timeCalib_constants[rawid]=timeCalib_constant; - timeCalib_errors[rawid] =timeCalib_error; - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - EcalTimeCalibConstant timeCalib_constant = EEDetId::unhashIndex(cellid).ix();; - EcalTimeCalibError timeCalib_error = timeCalib_constant +1; - - timeCalib_constants[rawid]=timeCalib_constant; - timeCalib_errors[rawid]=timeCalib_error; - } // if - } - - - - EcalTimeCalibConstantsXMLTranslator::writeXML(timeCalibFile,header, - timeCalib_constants); - - EcalTimeCalibErrorsXMLTranslator::writeXML(timeCalibErrFile,header, - timeCalib_errors); - - EcalTimeCalibConstants timeCalib_constants2; - EcalTimeCalibErrors timeCalib_errors2; - - - EcalTimeCalibConstantsXMLTranslator::readXML(timeCalibFile,header2, - timeCalib_constants2); - - EcalTimeCalibErrorsXMLTranslator::readXML(timeCalibErrFile,header, - timeCalib_errors2); - - std::string timeCalibFile2("/tmp/timeCalibFile-2.xml"); - std::string timeCalibErrFile2("/tmp/timeCalibErrFile-2.xml"); - - EcalTimeCalibConstantsXMLTranslator::writeXML(timeCalibFile2, - header2, - timeCalib_constants2); - - EcalTimeCalibErrorsXMLTranslator::writeXML(timeCalibErrFile2,header2, - timeCalib_errors2); - cout << "Done testing timing intercalib " << endl; - - // test xtalgroup - - EcalWeightGroupXMLTranslator grouptrans; - - EcalWeightXtalGroups groups; - - std::string groupfile("/tmp/EcalWeightXtalGroups.xml"); - - for (int cellid = 0 ; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid = EBDetId::unhashIndex(cellid); - // a random gid - EcalXtalGroupId gid( EBDetId::unhashIndex(cellid).iphi()); - groups[rawid]=gid; - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - - if (EEDetId::validHashIndex(cellid)){ - uint32_t rawid = EEDetId::unhashIndex(cellid); - // a random gid - EcalXtalGroupId gid( EEDetId::unhashIndex(cellid).ix()); - groups[rawid]=gid; - } // if - } - - - - grouptrans.writeXML(groupfile,header,groups); - - EcalWeightXtalGroups groups2; - - grouptrans.readXML(groupfile,header2,groups2); - - std::string groupfile2("/tmp/group-2.xml"); - - grouptrans.writeXML(groupfile2,header2,groups2); - - cout << "Done testing groups " << endl; - - EcalGainRatiosXMLTranslator transGainRatios; - - EcalGainRatios gainratios; - - std::string filenamegr("/tmp/EcalGainRatios.xml"); - std::string newfilegr("/tmp/gainratios-2.xml"); - - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - EcalMGPAGainRatio ecalGR; - ecalGR.setGain12Over6(2.); - ecalGR.setGain6Over1(5.); - - gainratios.insert(std::make_pair(EBDetId::unhashIndex(cellid),ecalGR)); - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on EE cells - - if (EEDetId::validHashIndex(cellid)){ - EcalMGPAGainRatio ecalGR; - ecalGR.setGain12Over6(2.); - ecalGR.setGain6Over1(5.); - gainratios.insert(std::make_pair(EEDetId::unhashIndex(cellid),ecalGR)); - } // if - } - - - transGainRatios.writeXML(filenamegr,header,gainratios); - - EcalGainRatios gainratios2; - transGainRatios.readXML(filenamegr,header2,gainratios2); - - - transGainRatios.writeXML(newfilegr,header2,gainratios2); - - - cout << "Done testing gainratios " << endl; - - EcalChannelStatusXMLTranslator transChannelStatus; - - EcalChannelStatus channelstatus; - - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - EcalChannelStatusCode ecalCSC = EcalChannelStatusCode(16); - - uint32_t rawid= EBDetId::unhashIndex(cellid); - - channelstatus[rawid]=ecalCSC; - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on Ee cells - - if (EEDetId::validHashIndex(cellid)){ - - uint32_t rawid= EEDetId::unhashIndex(cellid); - EcalChannelStatusCode ecalCSC = EcalChannelStatusCode(35); - channelstatus[rawid]=ecalCSC; - } // if - } - - std::string cscfile("/tmp/EcalChannelStatus.xml"); - - transChannelStatus.writeXML(cscfile,header,channelstatus); - - EcalChannelStatus channelstatus2; - - transChannelStatus.readXML(cscfile,header2,channelstatus2); - - std::string cscfile2("/tmp/cscfile-2.xml"); - - transChannelStatus.writeXML(cscfile2,header2,channelstatus2); - - - cout << "Done testing channelstatus " << endl; - - EcalTBWeightsXMLTranslator transWeight; - - EcalWeightSet weightset; - - - for(int i=0;i<3;i++) - { - for(int k=0;k<10;k++) - { - weightset.getWeightsBeforeGainSwitch()(i,k) = 1.2*k; - weightset.getWeightsAfterGainSwitch()(i,k) = 1.2*k; - } - } - - - - for(int i=0;i<10;i++) - { - for(int k=0;k<10;k++) - { - weightset.getChi2WeightsBeforeGainSwitch()(i,k) = 1.2*k; - weightset.getChi2WeightsAfterGainSwitch()(i,k) = 1.2*k; - } - } - - EcalXtalGroupId gid=1; - EcalTBWeights::EcalTDCId tid=2; - - - EcalTBWeights tbw; - tbw.setValue(gid,tid,weightset); - - - std::string filew("/tmp/EcalTBWeights.xml"); - std::string filew2("/tmp/tbweight2.xml"); - - transWeight.writeXML(filew,header,tbw); - - - EcalTBWeights tbw2; - - transWeight.readXML(filew,header2,tbw2); - - transWeight.writeXML(filew2,header2,tbw2); - - - // test laser - - std::string filelaser("/tmp/EcalLaserAPDPNratios.xml"); - std::string filelaser2("/tmp/EcalLaserAPDPNratios-2.xml"); - - EcalLaserAPDPNRatios laserrecord1; - EcalLaserAPDPNRatios laserrecord2; - - for (int cellid = 0; - cellid < EBDetId::kSizeForDenseIndexing; - ++cellid){// loop on EB cells - - - uint32_t rawid= EBDetId::unhashIndex(cellid); - - EcalLaserAPDPNRatios::EcalLaserAPDPNpair pair; - pair.p1 =1; - pair.p2 =2; - pair.p3 =3; - - laserrecord1.setValue(rawid,pair); - - } - - for (int cellid = 0; - cellid < EEDetId::kSizeForDenseIndexing; - ++cellid){// loop on Ee cells - - if (EEDetId::validHashIndex(cellid)){ - - uint32_t rawid= EEDetId::unhashIndex(cellid); - EcalLaserAPDPNRatios::EcalLaserAPDPNpair pair; - pair.p1 =1; - pair.p2 =2; - pair.p3 =3; - - laserrecord1.setValue(rawid,pair); - - } // if - } - - EcalLaserAPDPNRatiosXMLTranslator::writeXML(filelaser,header,laserrecord1); - EcalLaserAPDPNRatiosXMLTranslator::readXML(filelaser,header2,laserrecord2); - EcalLaserAPDPNRatiosXMLTranslator::writeXML(filelaser2,header2,laserrecord2); - return 0; -} diff --git a/CondTools/L1Trigger/interface/Interval.h b/CondTools/L1Trigger/interface/Interval.h deleted file mode 100644 index 48217473b3f37..0000000000000 --- a/CondTools/L1Trigger/interface/Interval.h +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef CondTools_L1Trigger_Interval_h -#define CondTools_L1Trigger_Interval_h - -#include -#include - -namespace l1t -{ - /* Template class that will be used to represnt interval from one value to another. - * In general this class is not interested in what interval mark means, most of the time - * it should be number, time or something similar - * - * This class requires that TimeType should have defined operator == and < as defined in STL. - * It is enforced via sserts that start time is less then end time under provided operator <. - * TimeType requires empty constructor. - * - * Payload should have defined copy constructor and assigment operator. - */ - template - class Interval - { - public: - /* Construncts the class with provided start and end times. Payload is created - * with default constructor. - */ - Interval (const TimeType& start, const TimeType& end) - : m_start (start), m_end (end), isInvalid (false) - { assert (m_start <= m_end); } - - /* Constructs the class with given start and end times, as well as given payload. - */ - Interval (const TimeType& start, const TimeType& end, const PayloadType& payload) - : m_start(start), m_end (end), _payload (payload), isInvalid (false) {} - - /* Sets the payload to the given one. */ - void setPayload (const PayloadType& payload) { this->_payload = payload; } - /* Returns the payload */ - const PayloadType& payload () const { return this->_payload; } - - /* Returns start time */ - const TimeType & start () const { return this->m_start; } - /* Returns end time */ - const TimeType & end () const { return this->m_end; } - - /* Static member that will define an invalid interval. Two invalid interfaces are - * always considered equal. - */ - static Interval & invalid (); - - // Operator overloading - bool operator== (const Interval & other) const - { return (this->isInvalid == true && other.isInvalid == true ) || - (this->start () == other.start ()) && (this->end () == other.end () && - this->isInvalid == other.isInvalid); } - - bool operator!= (const Interval & other) const - { return ! (*this == other); } - - protected: - /* Private data */ - TimeType m_start; - TimeType m_end; - PayloadType _payload; - - /* flag that will check if this interval is invalid */ - bool isInvalid; - }; - - /* Manages a list of intervals and provides method to find interval that contains - * some value. - * - * Template parameters are used to manage Interval class, so all requirements to these - * parameters comes from Interval class - */ - template - class IntervalManager - { - public: - /* Adds one given interval to the list of intervals. - */ - void addInterval (const Interval & interval) - { intervalMap.insert (std::make_pair (interval.start (), interval)); } - - /* Removes all stored intervals from the list - */ - void clear () { intervalMap.clear (); } - - /* Returns interval that contaisn given time. If multiple intervals exists - * any of them is returned - */ - const Interval & find (const TimeType & time) const; - - protected: - /* Information to store list of intervals */ - typedef std::map > IntervalMap; - IntervalMap intervalMap; - }; - -} // namespace - -// implementation -#include "CondTools/L1Trigger/src/Interval.icc" - -#endif diff --git a/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h b/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h deleted file mode 100644 index 5ac0c70158af1..0000000000000 --- a/CondTools/RPC/interface/L1RPCHwConfigDBWriter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef L1RPCHWCONFIGDBWRITER -#define L1RPCHWCONFIGDBWRITER - -#include "CondCore/PopCon/interface/PopConAnalyzer.h" -#include "CondTools/RPC/interface/L1RPCHwConfigSourceHandler.h" - - -class L1RPCHwConfigDBWriter : public popcon::PopConAnalyzer -{ - public: - L1RPCHwConfigDBWriter(const edm::ParameterSet&); - private: - void initSource(const edm::Event& evt, const edm::EventSetup& est); - int m_validate; -}; - - -#endif diff --git a/CondTools/RPC/interface/RPCEMapDBWriter.h b/CondTools/RPC/interface/RPCEMapDBWriter.h deleted file mode 100644 index 37175c3ade0b4..0000000000000 --- a/CondTools/RPC/interface/RPCEMapDBWriter.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef RPCEMAPDBWRITER -#define RPCEMAPDBWRITER - -#include "CondCore/PopCon/interface/PopConAnalyzer.h" -#include "CondTools/RPC/interface/RPCEMapSourceHandler.h" - - -class RPCEMapDBWriter : public popcon::PopConAnalyzer -{ - public: - RPCEMapDBWriter(const edm::ParameterSet&); - private: - void initSource(const edm::Event& evt, const edm::EventSetup& est); - int m_validate; -}; - - -#endif diff --git a/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h b/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h deleted file mode 100644 index 115599f4b0aef..0000000000000 --- a/CondTools/SiStrip/interface/SiStripCondObjBuilderBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CondTools_SiStrip_SiStripCondObjBuilderBase_H -#define CondTools_SiStrip_SiStripCondObjBuilderBase_H - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include - -template -class SiStripCondObjBuilderBase { -public: - SiStripCondObjBuilderBase(const edm::ParameterSet& pset) : _pset(pset){}; - virtual ~SiStripCondObjBuilderBase() noexcept(false){}; - - virtual void initialize(){}; - - /** Returns MetaData information in a stringstream */ - virtual void getMetaDataString(std::stringstream& ss){}; - - /** Check MetaData information in a stringstream */ - virtual bool checkForCompatibility(std::string ss) { return true; } - - /** Returns the CondObj */ - virtual void getObj(T*& obj){}; - -protected: - T* obj_; - edm::ParameterSet _pset; -}; - -#endif // CondTools_SiStrip_SiStripCondObjBuilderBase_H diff --git a/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h b/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h deleted file mode 100644 index 7e0b86c9b86d2..0000000000000 --- a/CondTools/SiStrip/interface/SiStripDepCondObjBuilderBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CondTools_SiStrip_SiStripDepCondObjBuilderBase_H -#define CondTools_SiStrip_SiStripDepCondObjBuilderBase_H - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include -#include - -template -class SiStripDepCondObjBuilderBase { -public: - SiStripDepCondObjBuilderBase(const edm::ParameterSet& pset) : _pset(pset){}; - virtual ~SiStripDepCondObjBuilderBase(){}; - - virtual void initialize(){}; - - /** Returns MetaData information in a stringstream */ - virtual void getMetaDataString(std::stringstream& ss){}; - - /** Check MetaData information in a stringstream */ - virtual bool checkForCompatibility(std::string ss) { return true; } - - /** Returns the CondObj */ - virtual void getObj(T*& obj, const D* depObj){}; - -protected: - T* obj_; - edm::ParameterSet _pset; -}; - -#endif // CondTools_SiStrip_SiStripDepCondObjBuilderBase_H diff --git a/OnlineDB/CSCCondDB/interface/AutoCorrMat.h b/OnlineDB/CSCCondDB/interface/AutoCorrMat.h deleted file mode 100644 index 7727adb480b82..0000000000000 --- a/OnlineDB/CSCCondDB/interface/AutoCorrMat.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - Author: Stan Durkin - -*/ - -#include -#include -#define LAYERS_ma 6 -#define STRIPS_ma 80 - -class AutoCorrMat{ - - public: - - AutoCorrMat(){ - for(int i=0;i<12;i++){ - Mat[i]=0.0; - N[i]=0.0; - } - } - - ~AutoCorrMat(){} - - void zero(){ - for(int i=0;i<12;i++){ - Mat[i]=0.0; - N[i]=0.0; - } - for (int i=3;i<12;i++){ - evar[i]=1; - variance[i]=10.0; - mymean[i]=3.2; - } - evt=0; - } - - void add(int *adc){ - int pairs[12][2]={{3,3},{3,4},{4,4},{3,5},{4,5},{5,5},{4,6},{5,6},{6,6},{5,7},{6,7},{7,7}}; - double ped=(adc[0]+adc[1])/2.; - evt++; - - for(int i=3;i<8;i++){ - if(fabs(adc[i]-ped)<25.){ - evar[i]++; - mymean[i] += adc[i]-ped; - variance[i] += (adc[i]-ped)*(adc[i]-ped); - } - } - - for(int i=0;i<12;i++){ - - //Add values within 3 sigma of mean only - float threeSigma0 = 3. * sqrt(variance[pairs[i][0]]/evar[pairs[i][0]]); - float threeSigma1 = 3. * sqrt(variance[pairs[i][1]]/evar[pairs[i][1]]); - - if (fabs(adc[pairs[i][0]]-ped) -#include - - -class Conv{ - - public: - - Conv(){} - - //square wave fcn convoluted with 1/(t+2.5) - float elec(float t,float vs){ - float f; - if (t<=vs){ - f=log(t+2.5)-log(2.5); - } - else{ - f=log(t+2.5)-log(t-50+2.5); - } - return f; - }//end elec - - - //calculate single electron distribution in 6.25 ns steps - void mkbins(float vs){ - int i,k; - float t; - for(i=0;i<120;i++) conve[i]=0.0; - for(i=0;i<120;i++){ - for(k=0;k<16;k++){ - t=(6.25*i)+(k*0.625); - conve[i]=conve[i]+elec(t,vs); - } - } - } //end mkbins - - - //convolution function - void convolution(float *xleft_a, float *xleft_b, float *min_left, float *xright_a, float *xright_b, float *min_right, float *pTime){ - //void(convolution){ - - float max, cross0,cross2,min_l,min_r,sum_x=0.0,sumx2=0.; - float sum_y_left=0.0,sum_y_right=0.0,sum_xy_left=0.0,sum_xy_right=0.0; - float a_left=0.0,a_right=0.0,b_left=0.0,b_right=0.0,chi2_left=0.0,chi2_right=0.0,chi_left=0.0,chi_right=0.0; - float aleft=0.0,aright=0.0,bleft=0.0,bright=0.0; - int i,j,k,l,imax=0; - - for(l=0;l<3;l++){ - for(i=0;i<119;i++)conv[l][i]=0.0; - for(j=0;j<119;j++){ - for(k=0;k<119;k++){ - if(j+k<119)conv[l][j+k]=conv[l][j+k]+convd[l][j]*conve[k]; - } - } - } - max=0; - min_l=9999999999999999.0; - min_r=9999999999999999.0; - for(i=0;i<119;i++){ - if(conv[1][i]>max){ - max=conv[1][i]; - imax=i; - } - } - - //find the max peak time from 3 timebins when line intersects x axis a+b*x=0 -> x=-a/b - float time1=-999.0, time2=-999.0, time3=-999.0; - float data1=-999.0, data2=-999.0, data3=-999.0; - float peakTime=0.0; - - time1=imax-1; - time2=imax; - time3=imax+1; - - data1=conv[1][imax-1]; - data2=conv[1][imax]; - data3=conv[1][imax+1]; - - peakTime=(0.5)*((time1*time1*(data3-data2)+time2*time2*(data1-data3)+time3*time3*(data2-data1))/(time1*(data3-data2)+time2*(data1-data3)+time3*(data2-data1)))*6.25; - - for(l=0;l<3;l++){ - for(i=0;i<119;i++)conv[l][i]=conv[l][i]/max; - } - - int nobs = 0; - for (int j=0; j<119; j++){ - if (conv[1][j]>0.6) nobs++; - } - - for(i=0;i<119;i++){ - cross0=0.0; - cross2=0.0; - - if(conv[1][i]>0.6){ - cross0=conv[0][i]/(conv[0][i]+conv[1][i]+conv[2][i]); - cross2=conv[2][i]/(conv[0][i]+conv[1][i]+conv[2][i]); - - sum_x += i; - sum_y_left += cross0; - sum_y_right += cross2; - sumx2 += i*i; - sum_xy_left += i*cross0; - sum_xy_right += i*cross2; - } - } - - //LMS fitting straight line y=a+b*x - - bleft = ((nobs*sum_xy_left) - (sum_x * sum_y_left))/((nobs*sumx2) - (sum_x*sum_x)); - bright = ((nobs*sum_xy_right) - (sum_x * sum_y_right))/((nobs*sumx2) - (sum_x*sum_x)); - - aleft = ((sum_y_left*sumx2)-(sum_x*sum_xy_left))/((nobs*sumx2)-(sum_x*sum_x)); - aright = ((sum_y_right*sumx2)-(sum_x*sum_xy_right))/((nobs*sumx2)-(sum_x*sum_x)); - - for(i=0;i<119;i++ ){ - chi2_left += (cross0 -(aleft+(bleft*i)))*(cross0 -(aleft+(bleft*i))); - chi2_right += (cross2 -(aright+(bright*i)))*(cross2 -(aright+(bright*i))); - } - - if(chi_left -#include - - -using namespace ROOT::Minuit2; - -class SaturationFcn : public FCNBase{ - - public: - - SaturationFcn(){} - - ~SaturationFcn(){} - - - void set_data(int N,float *charge_ptr,float *adc_ptr){ - - float x[20],y[20]; - - for(int i=0;i& x) const { - double chisq = 0.0; - int N=20; - for(int i=0;i - -#include "OnlineDB/EcalCondDB/interface/IUniqueDBObject.h" - -/** - * Abstract base class for a definition object - */ -class IConfig : public IUniqueDBObject { -}; - -#endif diff --git a/OnlineDB/EcalCondDB/interface/IRunIOV.h b/OnlineDB/EcalCondDB/interface/IRunIOV.h deleted file mode 100644 index b114539609030..0000000000000 --- a/OnlineDB/EcalCondDB/interface/IRunIOV.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef IRUNIOV_H -#define IRUNIOV_H - -#include -#include - -#include "OnlineDB/EcalCondDB/interface/ITag.h" - -typedef int run_t; - -class IIOV; - -class IRunIOV { -public: - virtual ~IRunIOV() {} - - virtual void fetchAt(IIOV* fillIOV, const run_t run, ITag* tag) const noexcept(false) = 0; - - virtual void fetchWithin(std::vector* fillVec, const run_t beginRun, const run_t endRun, ITag* tag) const - noexcept(false) = 0; -}; - -#endif diff --git a/OnlineDB/EcalCondDB/interface/ITimeIOV.h b/OnlineDB/EcalCondDB/interface/ITimeIOV.h deleted file mode 100644 index 7bfe3eff2c1ba..0000000000000 --- a/OnlineDB/EcalCondDB/interface/ITimeIOV.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ITIMEIOV_H -#define ITIMEIOV_H - -#include -#include - -#include "OnlineDB/EcalCondDB/interface/Tm.h" -#include "OnlineDB/EcalCondDB/interface/ITag.h" -#include "OnlineDB/EcalCondDB/interface/IIOV.h" - -class ITimeIOV { -public: - virtual ~ITimeIOV() {} - - virtual void fetchAt(IIOV* fillIOV, const Tm eventTm, ITag* tag) const noexcept(false) = 0; - - virtual void fetchWithin(std::vector* fillVec, const Tm beginTm, const Tm endTm, ITag* tag) const - noexcept(false) = 0; -}; - -#endif diff --git a/OnlineDB/EcalCondDB/interface/all_cali_types.h b/OnlineDB/EcalCondDB/interface/all_cali_types.h deleted file mode 100644 index 9f653882c73e9..0000000000000 --- a/OnlineDB/EcalCondDB/interface/all_cali_types.h +++ /dev/null @@ -1,7 +0,0 @@ -#include "OnlineDB/EcalCondDB/interface/CaliTag.h" -#include "OnlineDB/EcalCondDB/interface/CaliIOV.h" -#include "OnlineDB/EcalCondDB/interface/CaliGeneralDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliCrystalIntercalDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliHVScanRatioDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliGainRatioDat.h" -#include "OnlineDB/EcalCondDB/interface/CaliTempDat.h" diff --git a/OnlineDB/EcalCondDB/interface/all_dcu_types.h b/OnlineDB/EcalCondDB/interface/all_dcu_types.h deleted file mode 100644 index d739ae4adc7ea..0000000000000 --- a/OnlineDB/EcalCondDB/interface/all_dcu_types.h +++ /dev/null @@ -1,11 +0,0 @@ -#include "OnlineDB/EcalCondDB/interface/DCUTag.h" -#include "OnlineDB/EcalCondDB/interface/DCUCCSDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUIOV.h" -#include "OnlineDB/EcalCondDB/interface/DCUCapsuleTempDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUCapsuleTempRawDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUIDarkDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUIDarkPedDat.h" -#include "OnlineDB/EcalCondDB/interface/DCUVFETempDat.h" -#include "OnlineDB/EcalCondDB/interface/DCULVRTempsDat.h" -#include "OnlineDB/EcalCondDB/interface/DCULVRBTempsDat.h" -#include "OnlineDB/EcalCondDB/interface/DCULVRVoltagesDat.h" diff --git a/OnlineDB/EcalCondDB/interface/all_mod_types.h b/OnlineDB/EcalCondDB/interface/all_mod_types.h deleted file mode 100644 index 2755198814870..0000000000000 --- a/OnlineDB/EcalCondDB/interface/all_mod_types.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef ALLMOD -#define ALLMOD - -#include "OnlineDB/EcalCondDB/interface/RunTag.h" -#include "OnlineDB/EcalCondDB/interface/RunIOV.h" -#include "OnlineDB/EcalCondDB/interface/MODRunIOV.h" -#include "OnlineDB/EcalCondDB/interface/RunDat.h" -#include "OnlineDB/EcalCondDB/interface/RunCommentDat.h" -#include "OnlineDB/EcalCondDB/interface/RunPTMTempDat.h" -#include "OnlineDB/EcalCondDB/interface/RunConfigDat.h" -#include "OnlineDB/EcalCondDB/interface/RunFEConfigDat.h" -#include "OnlineDB/EcalCondDB/interface/RunTPGConfigDat.h" -#include "OnlineDB/EcalCondDB/interface/RunH4TablePositionDat.h" -#include "OnlineDB/EcalCondDB/interface/MODCCSTRDat.h" -#include "OnlineDB/EcalCondDB/interface/MODCCSFEDat.h" -#include "OnlineDB/EcalCondDB/interface/MODCCSHFDat.h" -#include "OnlineDB/EcalCondDB/interface/MODDCCOperationDat.h" -#include "OnlineDB/EcalCondDB/interface/MODDCCDetailsDat.h" -#endif - - diff --git a/OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp b/OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp deleted file mode 100644 index e6e7dcc935bda..0000000000000 --- a/OnlineDB/EcalCondDB/test/InsertDCUIdarkPed.cpp +++ /dev/null @@ -1,354 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_dcu_types.h" - - -using namespace std; -using std::string; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp( string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - - DCUIOV makeDCUIOV() - { - LocationDef locdef; - locdef.setLocation("P5_Co"); - DCUTag dcutag; - dcutag.setLocationDef(locdef); - dcutag.setGeneralTag("IDarkPedestalsRun"); - - // Our beginning time will be the current GMT time - // This is the time zone that should be written to the DB! - // (Actually UTC) - Tm since; - since.setToCurrentGMTime(); - - // Our beginning run number will be the seconds representation - // of that time, and we will increment our IoV based on - // a microsecond representation - uint64_t microseconds = since.microsTime(); - startmicros = microseconds; - - // Set the properties of the iov - DCUIOV dcuiov; - - dcuiov.setSince(since); - dcuiov.setDCUTag(dcutag); - - return dcuiov; - } - - - - /** - * Write objects with associated DCUIOVs - * IOVs are written using automatic updating of the 'till', as if - * the time of the end of the run was not known at the time of writing. - */ - - void testWrite(std::string filename) - { - - float temp_vec[61200]; - int ih4_vec[61200]; - int ih4; - float temp; - - for(int ic=0; ic<61200; ic++){ - temp_vec[ic]=0; - ih4_vec[ic]=0; - } - - - cout << "read IDark Pedestal file " << filename << endl; - - - FILE *fin; // input file - fin = fopen(filename.c_str(),"r"); - - char line[256]; - - fgets(line,255,fin); // first is the comment line - - - while(fgets(line,255,fin)) - { - - std::string EBorEE; - std::stringstream aStrStream; - aStrStream << line; - - int ism=0; - aStrStream >> EBorEE >> ism>> ih4 >> temp; - - ih4=ih4-1; // in the file ih4 follows the electronics numbering but plus one - - if (EBorEE == "EB-") ism=ism+18; - - int ic=(ism-1)*1700+ih4; - - temp_vec[ic]=temp; - ih4_vec[ic]=ih4; - - } - fclose(fin); - - - - cout << "Writing DCUCapsuleTempDat objects to database..." << endl; - cout << "Making a DCUIOV..." << flush; - DCUIOV dcuiov = this->makeDCUIOV(); - cout << "Done." << endl; - - this->printIOV(&dcuiov); - - Tm eventTm = dcuiov.getSince(); - DCUTag dcutag = dcuiov.getDCUTag(); - - // Get channel ID for SM 10, crystal c - // int c = 1; - // EcalLogicID ecid; - - cout << "Loading ecal logic id from DB" << endl; - vector ecid_vec; - ecid_vec = econn->getEcalLogicIDSetOrdered("EB_elec_crystal_number", 1, 36, 0, 1699, - EcalLogicID::NULLID,EcalLogicID::NULLID, - "EB_elec_crystal_number",12); - - - map dataset; - - - for (int c=0; c<61200; c++){ - // the channels are turned in phi and eta - - DCUIDarkPedDat capTemp; - capTemp.setPed(temp_vec[c]); - // Fill the dataset - dataset[ecid_vec[c]] = capTemp; - - } - - // Insert the dataset, identifying by iov - cout << "Inserting dataset..." << flush; - econn->insertDataArraySet(&dataset, &dcuiov); - cout << "Done." << endl; - - }; - - - - /** - * Write a data set - */ - template - void testTable(DATT* data, IOVT* iov, EcalLogicID* ecid) - { - tablesTried++; - try { - cout << "Table " << tablesTried << "..." << flush; - map dataset; - dataset[*ecid] = *data; - econn->insertDataSet(&dataset, iov); - cout << "write OK..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, iov); - if (!dataset.size()) { - throw(runtime_error("Zero rows read back")); - } - cout << "read OK" << endl; - tablesOK++; - } catch (runtime_error &e) { - cout << "testTable FAILED: " << e.what() << endl; - } catch (...) { - cout << "testTable FAILED: unknown exception" << endl; - } - } - - - - /** - * Write to each of the data tables - */ - void testAllTables() - { - cout << "Testing writing to all tables..." << endl; - tablesTried = 0; - tablesOK = 0; - - // get a dummy logic ID - EcalLogicID logicID = econn->getEcalLogicID(-1); - - // DCUIOV tables - DCUIOV dcuiov = this->makeDCUIOV(); - - DCUCapsuleTempDat table01; - testTable(&table01, &dcuiov, &logicID); - - DCUCapsuleTempRawDat table02; - testTable(&table02, &dcuiov, &logicID); - - DCUIDarkDat table03; - testTable(&table03, &dcuiov, &logicID); - - DCUIDarkPedDat table04; - testTable(&table04, &dcuiov, &logicID); - - DCUVFETempDat table05; - testTable(&table05, &dcuiov, &logicID); - - DCULVRTempsDat table06; - testTable(&table06, &dcuiov, &logicID); - - DCULVRBTempsDat table07; - testTable(&table07, &dcuiov, &logicID); - - DCULVRVoltagesDat table08; - testTable(&table08, &dcuiov, &logicID); - - cout << "Test of writing to all tables complete" << endl; - cout << tablesOK << " of " << tablesTried << " written to successfully" << endl << endl << endl; - }; - - - -private: - CondDBApp(); // hidden default constructor - EcalCondDBInterface* econn; - string locations[4]; - uint64_t startmicros; - uint64_t endmicros; - run_t startrun; - run_t endrun; - - int tablesTried; - int tablesOK; - - /** - * Iterate through the dataset and print some data - */ - void printDataSet( const map* dataset, int limit = 0 ) const - { - cout << "==========printDataSet()" << endl; - if (dataset->size() == 0) { - cout << "No data in map!" << endl; - } - EcalLogicID ecid; - DCUCapsuleTempDat capsTemp; - - int count = 0; - typedef map< EcalLogicID, DCUCapsuleTempDat >::const_iterator CI; - for (CI p = dataset->begin(); p != dataset->end(); p++) { - count++; - if (limit && count > limit) { return; } - ecid = p->first; - capsTemp = p->second; - - cout << "SM: " << ecid.getID1() << endl; - cout << "Xtal: " << ecid.getID2() << endl; - cout << "capsule temp: " << capsTemp.getCapsuleTemp() << endl; - cout << "========================" << endl; - } - cout << endl; - } - - - /** - * Print out a DCUTag - */ - void printTag( const DCUTag* tag) const - { - cout << endl; - cout << "=============DCUTag:" << endl; - cout << "GeneralTag: " << tag->getGeneralTag() << endl; - cout << "Location: " << tag->getLocationDef().getLocation() << endl; - cout << "====================" << endl; - } - - void printIOV( const DCUIOV* iov) const - { - cout << endl; - cout << "=============DCUIOV:" << endl; - DCUTag tag = iov->getDCUTag(); - printTag(&tag); - cout << "since: " << iov->getSince().str() << endl; - cout << "till: " << iov->getTill().str() << endl; - cout << "====================" << endl; - } -}; - - - -int main (int argc, char* argv[]) -{ - string filename; - string sid; - string user; - string pass; - - - if (argc != 5) { - cout << "Usage:" << endl; - cout << " " << argv[0] << " " << endl; - exit(-1); - } - - sid = argv[1]; - user = argv[2]; - pass = argv[3]; - filename=argv[4]; - - try { - CondDBApp app(sid, user, pass); - - app.testWrite(filename); - - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/OnlineDB/EcalCondDB/test/TestChannelView.cpp b/OnlineDB/EcalCondDB/test/TestChannelView.cpp deleted file mode 100644 index d3b8cb918a53c..0000000000000 --- a/OnlineDB/EcalCondDB/test/TestChannelView.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include -#include -#include -#include -#include - -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_dcu_types.h" - - -using namespace std; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp( string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - /** - * test read - */ - void test() { - cout << "test of the channelview table..." << endl; - - - - // Get channel ID for SM 10, crystal c - // int c = 1; - // EcalLogicID ecid; - vector ecid_vec; - ecid_vec = econn->getEcalLogicIDSet("EB_elec_crystal_number", 10, 10, 1, 10,EcalLogicID::NULLID, EcalLogicID::NULLID,"EB_crystal_number"); - // ecid = econn->getEcalLogicID("EB_crystal_number", 10, c); - for (int i=0; i<(int)ecid_vec.size() ; i++){ - int id1=ecid_vec[i].getID1(); - int id2=ecid_vec[i].getID2(); - int log_id=ecid_vec[i].getLogicID(); - cout << "id1="< " << endl; - exit(-1); - } - - host = argv[1]; - sid = argv[2]; - user = argv[3]; - pass = argv[4]; - - try { - CondDBApp app(sid, user, pass); - - app.test(); - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/OnlineDB/EcalCondDB/test/TestDCU.cpp b/OnlineDB/EcalCondDB/test/TestDCU.cpp deleted file mode 100644 index 3c052c5ffe260..0000000000000 --- a/OnlineDB/EcalCondDB/test/TestDCU.cpp +++ /dev/null @@ -1,315 +0,0 @@ -#include -#include -#include -#include -#include - -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_dcu_types.h" - - -using namespace std; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp( string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - - DCUIOV makeDCUIOV() - { - LocationDef locdef; - locdef.setLocation(locations[3]); - DCUTag dcutag; - dcutag.setLocationDef(locdef); - - - // Our beginning time will be the current GMT time - // This is the time zone that should be written to the DB! - // (Actually UTC) - Tm since; - since.setToCurrentGMTime(); - - // Our beginning run number will be the seconds representation - // of that time, and we will increment our IoV based on - // a microsecond representation - uint64_t microseconds = since.microsTime(); - startmicros = microseconds; - - // Set the properties of the iov - DCUIOV dcuiov; - - dcuiov.setSince(since); - dcuiov.setDCUTag(dcutag); - - return dcuiov; - } - - - - /** - * Write objects with associated DCUIOVs - * IOVs are written using automatic updating of the 'till', as if - * the time of the end of the run was not known at the time of writing. - */ - void testWrite() - { - cout << "Writing DCUCapsuleTempDat objects to database..." << endl; - cout << "Making a DCUIOV..." << flush; - DCUIOV dcuiov = this->makeDCUIOV(); - cout << "Done." << endl; - - this->printIOV(&dcuiov); - - Tm eventTm = dcuiov.getSince(); - DCUTag dcutag = dcuiov.getDCUTag(); - - // Get channel ID for SM 10, crystal c - // int c = 1; - // EcalLogicID ecid; - vector ecid_vec; - ecid_vec = econn->getEcalLogicIDSet("EB_crystal_number", 10, 10, 1, 1700); - // ecid = econn->getEcalLogicID("EB_crystal_number", 10, c); - - - - map dataset; - int count=0; - for (int c=1; c<1701; c++){ - // the channels are turned in phi and eta - DCUCapsuleTempDat capTemp; - - int i = 1; - float val = 0.11111 + i; - capTemp.setCapsuleTemp(val); - - // Fill the dataset - dataset[ecid_vec[count]] = capTemp; - - count++; - } - - // Insert the dataset, identifying by iov - cout << "Inserting dataset..." << flush; - econn->insertDataArraySet(&dataset, &dcuiov); - cout << "Done." << endl; - - // Fetch it back - cout << "Fetching dataset..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, &dcuiov); - cout << "retrieved " << dataset.size() << " channel-value pairs" << endl; - printDataSet(&dataset); - - // Fetch back DCUIOV just written - cout << "Fetching IOV just written..." << flush; - DCUIOV dcuiov_prime = econn->fetchDCUIOV(&dcutag, eventTm); - cout << "Done." << endl << endl << endl; - this->printIOV(&dcuiov_prime); - }; - - - - /** - * Write a data set - */ - template - void testTable(DATT* data, IOVT* iov, EcalLogicID* ecid) - { - tablesTried++; - try { - cout << "Table " << tablesTried << "..." << flush; - map dataset; - dataset[*ecid] = *data; - econn->insertDataSet(&dataset, iov); - cout << "write OK..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, iov); - if (!dataset.size()) { - throw(runtime_error("Zero rows read back")); - } - cout << "read OK" << endl; - tablesOK++; - } catch (runtime_error &e) { - cout << "testTable FAILED: " << e.what() << endl; - } catch (...) { - cout << "testTable FAILED: unknown exception" << endl; - } - } - - - - /** - * Write to each of the data tables - */ - void testAllTables() - { - cout << "Testing writing to all tables..." << endl; - tablesTried = 0; - tablesOK = 0; - - // get a dummy logic ID - EcalLogicID logicID = econn->getEcalLogicID(-1); - - // DCUIOV tables - DCUIOV dcuiov = this->makeDCUIOV(); - - DCUCapsuleTempDat table01; - testTable(&table01, &dcuiov, &logicID); - - DCUCapsuleTempRawDat table02; - testTable(&table02, &dcuiov, &logicID); - - DCUIDarkDat table03; - testTable(&table03, &dcuiov, &logicID); - - DCUIDarkPedDat table04; - testTable(&table04, &dcuiov, &logicID); - - DCUVFETempDat table05; - testTable(&table05, &dcuiov, &logicID); - - DCULVRTempsDat table06; - testTable(&table06, &dcuiov, &logicID); - - DCULVRBTempsDat table07; - testTable(&table07, &dcuiov, &logicID); - - DCULVRVoltagesDat table08; - testTable(&table08, &dcuiov, &logicID); - - cout << "Test of writing to all tables complete" << endl; - cout << tablesOK << " of " << tablesTried << " written to successfully" << endl << endl << endl; - }; - - - -private: - CondDBApp(); // hidden default constructor - EcalCondDBInterface* econn; - string locations[4]; - uint64_t startmicros; - uint64_t endmicros; - run_t startrun; - run_t endrun; - - int tablesTried; - int tablesOK; - - /** - * Iterate through the dataset and print some data - */ - void printDataSet( const map* dataset, int limit = 0 ) const - { - cout << "==========printDataSet()" << endl; - if (dataset->size() == 0) { - cout << "No data in map!" << endl; - } - EcalLogicID ecid; - DCUCapsuleTempDat capsTemp; - - int count = 0; - typedef map< EcalLogicID, DCUCapsuleTempDat >::const_iterator CI; - for (CI p = dataset->begin(); p != dataset->end(); p++) { - count++; - if (limit && count > limit) { return; } - ecid = p->first; - capsTemp = p->second; - - cout << "SM: " << ecid.getID1() << endl; - cout << "Xtal: " << ecid.getID2() << endl; - cout << "capsule temp: " << capsTemp.getCapsuleTemp() << endl; - cout << "========================" << endl; - } - cout << endl; - } - - - /** - * Print out a DCUTag - */ - void printTag( const DCUTag* tag) const - { - cout << endl; - cout << "=============DCUTag:" << endl; - cout << "GeneralTag: " << tag->getGeneralTag() << endl; - cout << "Location: " << tag->getLocationDef().getLocation() << endl; - cout << "====================" << endl; - } - - void printIOV( const DCUIOV* iov) const - { - cout << endl; - cout << "=============DCUIOV:" << endl; - DCUTag tag = iov->getDCUTag(); - printTag(&tag); - cout << "since: " << iov->getSince().str() << endl; - cout << "till: " << iov->getTill().str() << endl; - cout << "====================" << endl; - } -}; - - - -int main (int argc, char* argv[]) -{ - string host; - string sid; - string user; - string pass; - - if (argc != 5) { - cout << "Usage:" << endl; - cout << " " << argv[0] << " " << endl; - exit(-1); - } - - host = argv[1]; - sid = argv[2]; - user = argv[3]; - pass = argv[4]; - - try { - CondDBApp app(sid, user, pass); - - app.testWrite(); - app.testAllTables(); - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -} diff --git a/OnlineDB/EcalCondDB/test/TestMOD.cpp b/OnlineDB/EcalCondDB/test/TestMOD.cpp deleted file mode 100644 index cb21a155d3074..0000000000000 --- a/OnlineDB/EcalCondDB/test/TestMOD.cpp +++ /dev/null @@ -1,265 +0,0 @@ -#include -#include -#include -#include -#include -#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" -#include "OnlineDB/EcalCondDB/interface/all_mod_types.h" - - -using namespace std; - -class CondDBApp { -public: - - /** - * App constructor; Makes the database connection - */ - CondDBApp(string host, string sid, string user, string pass) - { - try { - cout << "Making connection..." << flush; - econn = new EcalCondDBInterface( sid, user, pass ); - cout << "Done." << endl; - } catch (runtime_error &e) { - cerr << e.what() << endl; - exit(-1); - } - - locations[0] = "H4"; - locations[1] = "867-1"; - locations[2] = "867-2"; - locations[3] = "867-3"; - } - - - - /** - * App destructor; Cleans up database connection - */ - ~CondDBApp() - { - delete econn; - } - - - RunIOV makeRunIOV() - { - // The objects necessary to identify a dataset - LocationDef locdef; - RunTypeDef rundef; - RunTag runtag; - - locdef.setLocation(locations[3]); - - rundef.setRunType("TEST"); - - runtag.setLocationDef(locdef); - runtag.setRunTypeDef(rundef); - - // Our beginning time will be the current GMT time - // This is the time zone that should be written to the DB! - // (Actually UTC) - Tm startTm; - startTm.setToCurrentGMTime(); - - // Our beginning run number will be the seconds representation - // of that time, and we will increment our IoV based on - // a microsecond representation - uint64_t microseconds = startTm.microsTime(); - startmicros = microseconds; - run_t run = (int)(microseconds/1000000); - startrun = run; - - cout << "Starting Time: " << startTm.str() << endl; - cout << "Starting Micros: " << startmicros << endl; - cout << "Starting Run: " << startrun << endl; - - // Set the properties of the iov - RunIOV runiov; - - startTm.setToMicrosTime(microseconds); - cout << "Setting run " << run << " run_start " << startTm.str() << endl; - runiov.setRunNumber(run); - runiov.setRunStart(startTm); - runiov.setRunTag(runtag); - - return runiov; - } - - - MODRunIOV makeMODRunIOV(RunIOV* runiov) - { - MODRunIOV modiov; - modiov.setRunIOV(*runiov); - modiov.setSubRunNumber(0); - modiov.setSubRunStart(runiov->getRunStart()); - - return modiov; - } - - - - /** - * Write MODCCSTRDat objects with associated RunIOVs - * IOVs are written using automatic updating of the 'RunEnd', as if - * the time of the end of the run was not known at the time of writing. - */ - void testWrite() - { - cout << "Writing MODCCSTRDat to database..." << endl; - RunIOV runiov = this->makeRunIOV(); - RunTag runtag = runiov.getRunTag(); - run_t run = runiov.getRunNumber(); - - // write to the DB - cout << "Inserting run..." << flush; - econn->insertRunIOV(&runiov); - cout << "Done." << endl; - printIOV(&runiov); - - // fetch it back - cout << "Fetching run by tag just used..." << flush; - RunIOV runiov_prime = econn->fetchRunIOV(&runtag, run); - cout << "Done." << endl; - printIOV(&runiov_prime); - cout << "Fetching run by location..." << flush; - RunIOV runiov_prime2 = econn->fetchRunIOV(runtag.getLocationDef().getLocation(), run); - cout << "Done." << endl; - printIOV(&runiov_prime2); - - // MODitoring Tag and IOV - MODRunIOV modiov = this->makeMODRunIOV(&runiov); - - // Get channel ID for SM 10, crystal c - int c = 1; - EcalLogicID ecid; - ecid = econn->getEcalLogicID("EB_token_ring", 10, c); - - // Set the data - /* MODCCSTRDat d; - map dataset; - int i = 1112287340; - d.setWord(i); - dataset[ecid] = d; - // Insert the dataset, identifying by iov - cout << "Inserting dataset..." << flush; - econn->insertDataSet(&dataset, &modiov); - cout << "Done." << endl; - */ - - // Set the data - MODCCSHFDat dhf; - map datasethf; - std::string fname="/u1/fra/test.txt"; - dhf.setFile(fname); - dhf.setTest(123); - std::cout<< "here it is: " <insertDataSet(&datasethf, &modiov); - cout << "Done." << endl; - - // Fetch it back - /* cout << "Fetching dataset..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, &modiov); - cout << "retrieved " << dataset.size() << " channel-value pairs" << endl; - */ - - cout << "Done." << endl << endl << endl; - }; - - - - /** - * Write a data set - */ - template - void testTable(DATT* data, IOVT* iov, EcalLogicID* ecid) - { - tablesTried++; - try { - cout << "Table " << tablesTried << "..." << flush; - map dataset; - dataset[*ecid] = *data; - econn->insertDataSet(&dataset, iov); - cout << "write OK..." << flush; - dataset.clear(); - econn->fetchDataSet(&dataset, iov); - if (!dataset.size()) { - throw(runtime_error("Zero rows read back")); - } - cout << "read OK" << endl; - tablesOK++; - } catch (runtime_error &e) { - cout << "testTable FAILED: " << e.what() << endl; - } catch (...) { - cout << "testTable FAILED: unknown exception" << endl; - } - } - - - - -private: - CondDBApp(); // hidden default constructor - EcalCondDBInterface* econn; - string locations[4]; - uint64_t startmicros; - uint64_t endmicros; - run_t startrun; - run_t endrun; - - int tablesTried; - int tablesOK; - - - void printIOV( const RunIOV* iov) const - { - cout << endl; - cout << "=============RunIOV:" << endl; - RunTag tag = iov->getRunTag(); - - cout << "Run Number: " << iov->getRunNumber() << endl; - cout << "Run Start: " << iov->getRunStart().str() << endl; - cout << "Run End: " << iov->getRunEnd().str() << endl; - cout << "====================" << endl; - } -}; - - - -int main (int argc, char* argv[]) -{ - string host; - string sid; - string user; - string pass; - - if (argc != 5) { - cout << "Usage:" << endl; - cout << " " << argv[0] << " " << endl; - exit(-1); - } - - host = argv[1]; - sid = argv[2]; - user = argv[3]; - pass = argv[4]; - - try { - CondDBApp app(host, sid, user, pass); - - app.testWrite(); - } catch (exception &e) { - cout << "ERROR: " << e.what() << endl; - } catch (...) { - cout << "Unknown error caught" << endl; - } - - cout << "All Done." << endl; - - return 0; -}