CMS 3D CMS Logo

CondDBImport.cc
Go to the documentation of this file.
1 //
2 
3 //TO DO: add the comparison between stored object and input object - bool cond::serialization::equal( obj,read_back_copy )
4 #define IMPORT_PAYLOAD_CASE(TYPENAME) \
5  if (inputTypeName == #TYPENAME) { \
6  match = true; \
7  const TYPENAME& obj = *static_cast<const TYPENAME*>(inputPtr); \
8  payloadId = destination.storePayload(obj, boost::posix_time::microsec_clock::universal_time()); \
9  }
10 
12 
15 #include "CondFormats.h"
16 
17 //
18 #include <memory>
19 #include <sstream>
20 
21 namespace cond {
22 
23  namespace persistency {
24 
25  std::pair<std::string, std::shared_ptr<void> > fetchIfExists(const cond::Hash& payloadId,
26  Session& session,
27  bool& exists) {
28  std::shared_ptr<void> payloadPtr;
30  cond::Binary streamerInfo;
31  std::string payloadTypeName;
32  exists = session.fetchPayloadData(payloadId, payloadTypeName, data, streamerInfo);
33  if (exists) {
34  return fetchOne(payloadTypeName, data, streamerInfo, payloadPtr);
35  } else
36  return std::make_pair(std::string(""), std::shared_ptr<void>());
37  }
38 
40  const cond::Hash& sourcePayloadId,
41  const std::string& inputTypeName,
42  const void* inputPtr,
44  cond::Hash payloadId("");
45  bool newInsert = false;
46  bool match = false;
47  if (inputPtr) {
49  IMPORT_PAYLOAD_CASE(std::vector<unsigned long long>)
252  if (inputTypeName == "L1TriggerKeyList") {
253  match = true;
254  throwException("Import of \"L1TriggerKeyList\" type payloads is not supported.", "import");
255  }
256  //IMPORT_PAYLOAD_CASE( L1TriggerKeyList )
270  //IMPORT_PAYLOAD_CASE( PerformancePayload )
341  if (inputTypeName == "PhysicsTools::Calibration::Histogram3D<double,double,double,double>") {
342  match = true;
345  payloadId = destination.storePayload(obj, boost::posix_time::microsec_clock::universal_time());
346  }
347  if (inputTypeName == "PhysicsTools::Calibration::Histogram2D<double,double,double>") {
348  match = true;
351  payloadId = destination.storePayload(obj, boost::posix_time::microsec_clock::universal_time());
352  }
353  if (inputTypeName == "std::vector<unsignedlonglong,std::allocator<unsignedlonglong>>") {
354  match = true;
355  const std::vector<unsigned long long>& obj = *static_cast<const std::vector<unsigned long long>*>(inputPtr);
356  payloadId = destination.storePayload(obj, boost::posix_time::microsec_clock::universal_time());
357  }
358 
359  if (!match)
360  throwException("Payload type \"" + inputTypeName + "\" is unknown.", "import");
361  }
362  return payloadId;
363  }
364 
365  } // namespace persistency
366 } // namespace cond
PerformancePayloadFromTFormula
Definition: PerformancePayloadFromTFormula.h:17
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
ESGain
Definition: ESGain.h:7
SiPixelCPEGenericErrorParm
Definition: SiPixelCPEGenericErrorParm.h:15
CSCDBChipSpeedCorrection
Definition: CSCDBChipSpeedCorrection.h:9
DTTtrig
Definition: DTTtrig.h:68
ESMissingEnergyCalibration
Definition: ESMissingEnergyCalibration.h:7
CentralityTable
Definition: CentralityTable.h:7
L1MuCSCTFConfiguration
Definition: L1MuCSCTFConfiguration.h:9
TrackerDetToDTCELinkCablingMap
Definition: TrackerDetToDTCELinkCablingMap.h:29
EcalTPGWeightIdMap
Definition: EcalTPGWeightIdMap.h:10
HcalRespCorrs
Definition: HcalRespCorrs.h:17
CastorGainWidths
Definition: CastorGainWidths.h:18
SiPixel2DTemplateDBObject
Definition: SiPixel2DTemplateDBObject.h:16
L1GtPrescaleFactors
Definition: L1GtPrescaleFactors.h:32
HcalMCParams
Definition: HcalMCParams.h:9
JetCorrectorParametersCollection
Definition: JetCorrectorParameters.h:139
JME::JetResolutionObject
Definition: JetResolutionObject.h:116
L1CaloHcalScale
Definition: L1CaloHcalScale.h:28
DTCELinkId
Definition: DTCELinkId.h:28
CSCRecoDigiParameters
Definition: CSCRecoDigiParameters.h:18
L1CaloEcalScale
Definition: L1CaloEcalScale.h:28
TrackProbabilityCalibration
Definition: TrackProbabilityCalibration.h:11
CSCBadStrips
Definition: CSCBadStrips.h:8
PTrackerParameters
Definition: PTrackerParameters.h:6
EcalPulseShape
Definition: EcalPulseShapes.h:8
DYTParamObject
Definition: DYTParamObject.h:8
Exception.h
cond::Hash
std::string Hash
Definition: Types.h:43
PerformanceWorkingPoint
Definition: PerformanceWorkingPoint.h:8
DTDeadFlag
Definition: DTDeadFlag.h:66
SiStripNoises
Definition: SiStripNoises.h:25
cond::Binary
Definition: Binary.h:15
cond::persistency::fetchOne
std::pair< std::string, std::shared_ptr< void > > fetchOne(const std::string &payloadTypeName, const cond::Binary &data, const cond::Binary &streamerInfo, std::shared_ptr< void > payloadPtr)
Definition: CondDBFetch.cc:23
METCorrectorParametersCollection
Definition: METCorrectorParameters.h:106
EcalTPGSpike
Definition: EcalTPGSpike.h:9
HcalTPParameters
Definition: HcalTPParameters.h:10
L1TUtmCutValue
Definition: L1TUtmCutValue.h:19
HcalTPChannelParameters
Definition: HcalTPChannelParameters.h:8
ESThresholds
Definition: ESThresholds.h:7
RPCObImon
Definition: RPCObCond.h:15
GBRForest
Definition: GBRForest.h:25
EcalTPGFineGrainStripEE
Definition: EcalTPGFineGrainStripEE.h:9
L1GtParameters
Definition: L1GtParameters.h:33
L1TUtmScale
Definition: L1TUtmScale.h:23
L1MuDTExtLut
Definition: L1MuDTExtLut.h:39
SiPixelFEDChannelContainer
Definition: SiPixelFEDChannelContainer.h:12
L1GtBoardMaps
Definition: L1GtBoardMaps.h:33
AlignmentErrors
Definition: AlignmentErrors.h:10
EcalSampleMask
Definition: EcalSampleMask.h:16
DTRecoUncertainties
Definition: DTRecoUncertainties.h:19
L1TMuonGlobalParams
Definition: L1TMuonGlobalParams.h:21
EcalTPGFineGrainEBIdMap
Definition: EcalTPGFineGrainEBIdMap.h:10
EcalFunParams
Definition: EcalFunctionParameters.h:11
RPCAMCLinkMap
Definition: RPCAMCLinkMap.h:11
cond::persistency::fetchIfExists
std::pair< std::string, std::shared_ptr< void > > fetchIfExists(const cond::Hash &payloadId, Session &session, bool &exists)
Definition: CondDBImport.cc:25
RPCObStatus
Definition: RPCObCond.h:49
EcalTimeOffsetConstant
Definition: EcalTimeOffsetConstant.h:13
PhysicsTFormulaPayload
Definition: PhysicsTFormulaPayload.h:9
L1RCTChannelMask
Definition: L1RCTChannelMask.h:7
L1MuDTTFMasks
Definition: L1MuDTTFMasks.h:36
AlignPCLThresholds
Definition: AlignPCLThresholds.h:11
lumi::LumiSectionData
Definition: LumiSectionData.h:69
L1MuGMTScales
Definition: L1MuGMTScales.h:34
EcalADCToGeVConstant
Definition: EcalADCToGeVConstant.h:13
RPCClusterSize
Definition: RPCClusterSize.h:10
HcalChannelQuality
Definition: HcalChannelQuality.h:17
DTMtime
Definition: DTMtime.h:68
RPCObTemp
Definition: RPCObCond.h:66
MuScleFitDBobject
Definition: MuScleFitDBobject.h:8
SiPixelCalibConfiguration
Definition: SiPixelCalibConfiguration.h:19
l1t::CaloConfig
Definition: CaloConfig.h:24
CSCBadChambers
Definition: CSCBadChambers.h:9
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
EcalTPGWeightGroup
Definition: EcalTPGWeightGroup.h:13
L1MuDTPtaLut
Definition: L1MuDTPtaLut.h:39
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalTPGLutGroup
Definition: EcalTPGLutGroup.h:13
L1MuGMTChannelMask
Definition: L1MuGMTChannelMask.h:25
L1TriggerKey
Definition: L1TriggerKey.h:23
L1RPCConfig
Definition: L1RPCConfig.h:29
SiStripBadStrip
Definition: SiStripBadStrip.h:30
CSCDBGains
Definition: CSCDBGains.h:9
PCaloGeometry
Definition: PCaloGeometry.h:9
CSCDDUMap
Definition: CSCDDUMap.h:9
SiPhase2OuterTrackerLorentzAngle
Definition: SiPhase2OuterTrackerLorentzAngle.h:26
EcalCondTowerObjectContainer
Definition: EcalCondTowerObjectContainer.h:13
L1TUtmTriggerMenu
Definition: L1TUtmTriggerMenu.h:25
L1RCTNoisyChannelMask
Definition: L1RCTNoisyChannelMask.h:7
SiPixelDynamicInefficiency
Definition: SiPixelDynamicInefficiency.h:11
CSCDBCrosstalk
Definition: CSCDBCrosstalk.h:9
HcalPedestalWidths
Definition: HcalPedestalWidths.h:17
HcalPFCorrs
Definition: HcalPFCorrs.h:17
L1TGlobalParameters
Definition: L1TGlobalParameters.h:7
HcalPedestals
Definition: HcalPedestals.h:20
EcalTPGSlidingWindow
Definition: EcalTPGSlidingWindow.h:9
CSCDBGasGainCorrection
Definition: CSCDBGasGainCorrection.h:9
EcalTPGFineGrainTowerEE
Definition: EcalTPGFineGrainTowerEE.h:9
L1MuTriggerPtScale
Definition: L1MuTriggerPtScale.h:33
RunInfo
Definition: RunInfo.h:18
HcalLUTCorrs
Definition: HcalLUTCorrs.h:20
CTPPSPixelAnalysisMask
Channel-mask mapping.
Definition: CTPPSPixelAnalysisMask.h:34
SiStripLorentzAngle
Definition: SiStripLorentzAngle.h:26
HcalL1TriggerObjects
Definition: HcalL1TriggerObjects.h:14
PerformancePayloadFromTable
Definition: PerformancePayloadFromTable.h:15
DYTThrObject
Definition: DYTThrObject.h:8
DTLVStatus
Definition: DTLVStatus.h:63
RPCEMap
Definition: RPCEMap.h:13
HBHENegativeEFilter
Definition: HBHENegativeEFilter.h:16
CSCDBPedestals
Definition: CSCDBPedestals.h:9
SiPixelGainCalibrationForHLT
Definition: SiPixelGainCalibrationForHLT.h:29
PHGCalParameters
Definition: PHGCalParameters.h:9
RPCStripNoises
Definition: RPCStripNoises.h:10
L1TGlobalPrescalesVetos
Definition: L1TGlobalPrescalesVetos.h:13
HcalItemCollById< HFPhase1PMTData >
QGLikelihoodSystematicsObject
QGLikelihoodSystematicsObject containing the parameters for the systematic smearing.
Definition: QGLikelihoodObject.h:38
CondFormats.h
SiPixelLorentzAngle
Definition: SiPixelLorentzAngle.h:11
source
static const std::string source
Definition: EdmProvDump.cc:47
L1TMuonOverlapParams
Definition: L1TMuonOverlapParams.h:14
RPCObFebmap
Definition: RPCObFebmap.h:15
SiPixelGainCalibrationOffline
Definition: SiPixelGainCalibrationOffline.h:29
EcalPulseSymmCovariance
Definition: EcalPulseSymmCovariances.h:9
CSCChamberIndex
Definition: CSCChamberIndex.h:9
L1GtTriggerMask
Definition: L1GtTriggerMask.h:33
GBRForestD
Definition: GBRForestD.h:27
L1TUtmCondition
Definition: L1TUtmCondition.h:23
ESRecHitRatioCuts
Definition: ESRecHitRatioCuts.h:7
L1TUtmAlgorithm
Definition: L1TUtmAlgorithm.h:21
L1GtStableParameters
Definition: L1GtStableParameters.h:33
AlCaRecoTriggerBits
Definition: AlCaRecoTriggerBits.h:9
EcalTimeBiasCorrections
Definition: EcalTimeBiasCorrections.h:16
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
CastorPedestals
Definition: CastorPedestals.h:18
L1GctJetFinderParams
Definition: L1GctJetFinderParams.h:10
EcalTPGLutIdMap
Definition: EcalTPGLutIdMap.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelVCal
Definition: SiPixelVCal.h:9
QGLikelihoodCategory
Category structure: ranges associated with QGLikelihood histograms.
Definition: QGLikelihoodObject.h:9
cond
Definition: plugin.cc:23
RPCObGas
Definition: RPCObGas.h:15
SiPixelQuality
Definition: SiPixelQuality.h:27
CSCChamberTimeCorrections
Definition: CSCChamberTimeCorrections.h:9
RPFlatParams
Definition: RPFlatParams.h:7
Serialization.h
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
L1RPCHwConfig
Definition: L1RPCHwConfig.h:65
HcalDcsValues
Definition: HcalDcsValues.h:25
DTTPGParameters
Definition: DTTPGParameters.h:62
CSCBadWires
Definition: CSCBadWires.h:8
L1CaloGeometry
Definition: L1CaloGeometry.h:33
EcalTPGFineGrainEBGroup
Definition: EcalTPGFineGrainEBGroup.h:13
L1TGlobalPrescalesVetosFract
Definition: L1TGlobalPrescalesVetosFract.h:13
cond::persistency::Session
Definition: Session.h:63
L1RPCBxOrConfig
Definition: L1RPCBxOrConfig.h:26
CSCDBNoiseMatrix
Definition: CSCDBNoiseMatrix.h:9
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
MixingModuleConfig
Definition: MixingModuleConfig.h:71
ESTimeSampleWeights
Definition: ESTimeSampleWeights.h:7
CSCChamberMap
Definition: CSCChamberMap.h:11
HcalInterpolatedPulseColl
Definition: HcalInterpolatedPulseColl.h:8
HcalGainWidths
Definition: HcalGainWidths.h:17
MagFieldConfig
Definition: MagFieldConfig.h:26
CTPPSPixelGainCalibrations
Definition: CTPPSPixelGainCalibrations.h:8
SiPixelTemplateDBObject
Definition: SiPixelTemplateDBObject.h:16
DropBoxMetadata
Definition: DropBoxMetadata.h:17
L1MuDTEtaPatternLut
Definition: L1MuDTEtaPatternLut.h:40
PhysicsTools::Calibration::Histogram2D
Definition: Histogram2D.h:20
DTKeyedConfig
Definition: DTKeyedConfig.h:35
L1CaloEtScale
Definition: L1CaloEtScale.h:29
SiStripDetVOff
Definition: SiStripDetVOff.h:31
CastorRecoParams
Definition: CastorRecoParams.h:9
RPCLBLinkMap
Definition: RPCLBLinkMap.h:11
HcalTimeCorrs
Definition: HcalTimeCorrs.h:17
AlignmentSurfaceDeformations
Definition: AlignmentSurfaceDeformations.h:20
L1TUtmObject
Definition: L1TUtmObject.h:23
cond::persistency::Session::fetchPayloadData
bool fetchPayloadData(const cond::Hash &payloadHash, std::string &payloadType, cond::Binary &payloadData, cond::Binary &streamerInfoData)
Definition: Session.cc:185
CastorGains
Definition: CastorGains.h:18
IMPORT_PAYLOAD_CASE
#define IMPORT_PAYLOAD_CASE(TYPENAME)
Definition: CondDBImport.cc:4
BeamSpotObjects
Definition: BeamSpotObjects.h:20
ESMIPToGeVConstant
Definition: ESMIPToGeVConstant.h:7
L1MuTriggerScales
Definition: L1MuTriggerScales.h:33
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
ESCondObjectContainer
Definition: ESCondObjectContainer.h:11
PerformancePayloadFromBinnedTFormula
Definition: PerformancePayloadFromBinnedTFormula.h:17
CastorChannelQuality
Definition: CastorChannelQuality.h:17
HcalQIEData
Definition: HcalQIEData.h:24
MEtXYcorrectParametersCollection
Definition: MEtXYcorrectParameters.h:111
SiPixelFedCablingMap
Definition: SiPixelFedCablingMap.h:19
L1RPCHsbConfig
Definition: L1RPCHsbConfig.h:26
EcalTPGPhysicsConst
Definition: EcalTPGPhysicsConst.h:9
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
HLTMuonOfflineAnalyzer_cff.destination
destination
Definition: HLTMuonOfflineAnalyzer_cff.py:50
CondDBImport.h
EcalSRSettings
Definition: EcalSRSettings.h:29
SiStripThreshold
Definition: __init__.py:1
EcalTPGTowerStatus
Definition: EcalTPGTowerStatus.h:9
SiPixelQualityProbabilities
Definition: SiPixelQualityProbabilities.h:10
HcalFlagHFDigiTimeParams
Definition: HcalFlagHFDigiTimeParams.h:9
RPCObUXC
Definition: RPCObUXC.h:15
HcalLutMetadata
Definition: HcalLutMetadata.h:15
l1t::CaloParams
Definition: CaloParams.h:25
RPCObVmon
Definition: RPCObCond.h:32
RPCObPVSSmap
Definition: RPCObPVSSmap.h:16
BeamSpotOnlineObjects
Definition: BeamSpotOnlineObjects.h:25
HcalZDCLowGainFractions
Definition: HcalZDCLowGainFractions.h:9
DTHVStatus
Definition: DTHVStatus.h:70
HcalParameters
Definition: HcalParameters.h:6
CTPPSPixelDAQMapping
The mapping between FramePosition and ROCInfo.
Definition: CTPPSPixelDAQMapping.h:40
OOTPileupCorrectionBuffer
Definition: OOTPileupCorrectionBuffer.h:14
HcalGains
Definition: HcalGains.h:17
HcalRecoParams
Definition: HcalRecoParams.h:9
DTT0
Definition: DTT0.h:48
L1TUtmBin
Definition: L1TUtmBin.h:19
HcalFrontEndMap
Definition: HcalFrontEndMap.h:23
CTPPSRPAlignmentCorrectionsData
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
Definition: CTPPSRPAlignmentCorrectionsData.h:24
PhysicsTools::Calibration::MVAComputerContainer
Definition: MVAComputer.h:250
QGLikelihoodObject
QGLikelihoodObject containing valid range and entries with category and histogram (mean is not used a...
Definition: QGLikelihoodObject.h:22
RPCDCCLinkMap
Definition: RPCDCCLinkMap.h:11
L1RCTParameters
Definition: L1RCTParameters.h:27
StorableDoubleMap< AbsOOTPileupCorrection >
cond::persistency::throwException
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:12
PhysicsTools::Calibration::Histogram3D
Definition: Histogram3D.h:24
CastorPedestalWidths
Definition: CastorPedestalWidths.h:18
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1MuCSCPtLut
Definition: L1MuCSCPtLut.h:11
EcalTPGStripStatus
Definition: EcalTPGStripStatus.h:9
CSCCrateMap
Definition: CSCCrateMap.h:11
SiPixelGenErrorDBObject
Definition: SiPixelGenErrorDBObject.h:16
EcalPulseCovariance
Definition: EcalPulseCovariances.h:9
L1MuDTPhiLut
Definition: L1MuDTPhiLut.h:40
CastorElectronicsMap
Definition: CastorElectronicsMap.h:30
L1TMuonBarrelParams
Definition: L1TMuonBarrelParams.h:23
DTRecoConditions
Definition: DTRecoConditions.h:28
SiStripPedestals
Definition: SiStripPedestals.h:27
ESEEIntercalibConstants
Definition: ESEEIntercalibConstants.h:7
L1GctChannelMask
Definition: L1GctChannelMask.h:8
LHCOpticalFunctionsSetCollection
Collection of optical functions for two crossing angle values and various scoring planes....
Definition: LHCOpticalFunctionsSetCollection.h:16
HcalLongRecoParams
Definition: HcalLongRecoParams.h:9
RPCObGasMix
Definition: RPCObGasMix.h:15
CastorSaturationCorrs
Definition: CastorSaturationCorrs.h:9
EcalLaserAPDPNRatios
Definition: EcalLaserAPDPNRatios.h:14
PPSTimingCalibration
Definition: PPSTimingCalibration.h:17
CSCL1TPParameters
Definition: CSCL1TPParameters.h:14
CastorQIEData
Definition: CastorQIEData.h:25
cond::BaseKeyed
Definition: BaseKeyed.h:14
HcalZSThresholds
Definition: HcalZSThresholds.h:17
L1MuCSCTFAlignment
Definition: L1MuCSCTFAlignment.h:8
PhysicsTGraphPayload
Definition: PhysicsTGraphPayload.h:22
L1TUtmCut
Definition: L1TUtmCut.h:21
L1MuGMTParameters
Definition: L1MuGMTParameters.h:25
L1MuDTQualPatternLut
Definition: L1MuDTQualPatternLut.h:41
HcalSiPMParameters
Definition: HcalSiPMParameters.h:8
SiStripLatency
Definition: SiStripLatency.h:59
SiStripApvGain
Definition: SiStripApvGain.h:25
PGeometricDet
Definition: PGeometricDet.h:9
L1RPCConeDefinition
Definition: L1RPCConeDefinition.h:8
SiStripBackPlaneCorrection
Definition: SiStripBackPlaneCorrection.h:27
Alignments
Definition: Alignments.h:10
DTCCBConfig
Definition: DTCCBConfig.h:60
L1MuDTTFParameters
Definition: L1MuDTTFParameters.h:36
RecoIdealGeometry
Definition: RecoIdealGeometry.h:28
EcalTBWeights
Definition: EcalTBWeights.h:15
EcalTimeDependentCorrections
Definition: EcalTimeDependentCorrections.h:14
DTReadOutMapping
Definition: DTReadOutMapping.h:62
FileBlob
Definition: FileBlob.h:10
SiStripApvSimulationParameters
Definition: SiStripApvSimulationParameters.h:17
EcalSamplesCorrelation
Definition: EcalSamplesCorrelation.h:16
DTStatusFlag
Definition: DTStatusFlag.h:74
SiStripConfObject
Definition: SiStripConfObject.h:31
L1GtPsbSetup
Definition: L1GtPsbSetup.h:32
HcalSiPMCharacteristics
Definition: HcalSiPMCharacteristics.h:18