Skip to content

Commit

Permalink
Merge pull request #6615 from audrium/ZDCLowGainFraction_new_cond
Browse files Browse the repository at this point in the history
new condition object (ZDC Low Gain Fraction) added for HCAL
  • Loading branch information
cmsbuild committed Jan 29, 2015
2 parents 325523f + 2f23fdc commit c9367e8
Show file tree
Hide file tree
Showing 26 changed files with 319 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h
Expand Up @@ -79,6 +79,9 @@ namespace HcalDbASCIIIO {
bool getObject (std::istream& fInput, HcalLongRecoParams* fObject);
bool dumpObject (std::ostream& fOutput, const HcalLongRecoParams& fObject);

bool getObject (std::istream& fInput, HcalZDCLowGainFractions* fObject);
bool dumpObject (std::ostream& fOutput, const HcalZDCLowGainFractions& fObject);

bool getObject (std::istream& fInput, HcalTimingParams* fObject);
bool dumpObject (std::ostream& fOutput, const HcalTimingParams& fObject);

Expand Down
4 changes: 4 additions & 0 deletions CalibCalorimetry/HcalAlgos/src/HcalDbASCIIIO.cc
Expand Up @@ -376,6 +376,9 @@ bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalTimeCorrs& fObj
bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalZSThresholds* fObject) {return getHcalSingleIntObject (fInput, fObject, new HcalZSThreshold); }
bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalZSThresholds& fObject) {return dumpHcalSingleIntObject (fOutput, fObject); }

bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalZDCLowGainFractions* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalZDCLowGainFraction); }
bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalZDCLowGainFractions& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }

bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalValidationCorrs* fObject) {return getHcalSingleFloatObject (fInput, fObject, new HcalValidationCorr); }
bool HcalDbASCIIIO::dumpObject (std::ostream& fOutput, const HcalValidationCorrs& fObject) {return dumpHcalSingleFloatObject (fOutput, fObject); }
bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalCholeskyMatrices* fObject) {return getHcalMatrixObject (fInput, fObject, new HcalCholeskyMatrix); }
Expand Down Expand Up @@ -608,6 +611,7 @@ bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalLongRecoParams* fObject
}
return true;
}

bool HcalDbASCIIIO::getObject (std::istream& fInput, HcalTimingParams* fObject)
{
if (!fObject) return false; // fObject = new HcalTimingParams();
Expand Down
19 changes: 19 additions & 0 deletions CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc
Expand Up @@ -247,6 +247,10 @@ HcalHardcodeCalibrations::HcalHardcodeCalibrations ( const edm::ParameterSet& iC
setWhatProduced (this, &HcalHardcodeCalibrations::produceLongRecoParams);
findingRecord <HcalLongRecoParamsRcd> ();
}
if ((*objectName == "ZDCLowGainFractions") || all) {
setWhatProduced (this, &HcalHardcodeCalibrations::produceZDCLowGainFractions);
findingRecord <HcalZDCLowGainFractionsRcd> ();
}
if ((*objectName == "MCParams") || all) {
setWhatProduced (this, &HcalHardcodeCalibrations::produceMCParams);
findingRecord <HcalMCParamsRcd> ();
Expand Down Expand Up @@ -636,6 +640,21 @@ std::auto_ptr<HcalLongRecoParams> HcalHardcodeCalibrations::produceLongRecoParam
return result;
}

std::auto_ptr<HcalZDCLowGainFractions> HcalHardcodeCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rec) {
edm::LogInfo("HCAL") << "HcalHardcodeCalibrations::produceZDCLowGainFractions-> ...";
edm::ESHandle<HcalTopology> htopo;
rec.getRecord<IdealGeometryRecord>().get(htopo);
const HcalTopology* topo=&(*htopo);

std::auto_ptr<HcalZDCLowGainFractions> result (new HcalZDCLowGainFractions (topo));
std::vector <HcalGenericDetId> cells = allCells(*topo);
for (std::vector <HcalGenericDetId>::const_iterator cell = cells.begin (); cell != cells.end (); cell++) {
HcalZDCLowGainFraction item(cell->rawId(),0.0);
result->addValues(item);
}
return result;
}

std::auto_ptr<HcalMCParams> HcalHardcodeCalibrations::produceMCParams (const HcalMCParamsRcd& rec) {


Expand Down
3 changes: 3 additions & 0 deletions CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.h
Expand Up @@ -35,6 +35,7 @@ class HcalDcsRcd;
class HcalDcsMapRcd;
class HcalRecoParamsRcd;
class HcalLongRecoParamsRcd;
class HcalZDCLowGainFractionsRcd;
class HcalMCParamsRcd;
class HcalFlagHFDigiTimeParamsRcd;
class HcalTimingParamsRcd;
Expand Down Expand Up @@ -78,6 +79,8 @@ class HcalHardcodeCalibrations : public edm::ESProducer,
std::auto_ptr<HcalRecoParams> produceRecoParams (const HcalRecoParamsRcd& rcd);
std::auto_ptr<HcalTimingParams> produceTimingParams (const HcalTimingParamsRcd& rcd);
std::auto_ptr<HcalLongRecoParams> produceLongRecoParams (const HcalLongRecoParamsRcd& rcd);
std::auto_ptr<HcalZDCLowGainFractions> produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rcd);

std::auto_ptr<HcalMCParams> produceMCParams (const HcalMCParamsRcd& rcd);
std::auto_ptr<HcalFlagHFDigiTimeParams> produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rcd);

Expand Down
14 changes: 13 additions & 1 deletion CalibCalorimetry/HcalPlugins/src/HcalTextCalibrations.cc
Expand Up @@ -123,6 +123,10 @@ HcalTextCalibrations::HcalTextCalibrations ( const edm::ParameterSet& iConfig )
setWhatProduced (this, &HcalTextCalibrations::produceLongRecoParams);
findingRecord <HcalLongRecoParamsRcd> ();
}
else if (objectName == "ZDCLowGainFractions") {
setWhatProduced (this, &HcalTextCalibrations::produceZDCLowGainFractions);
findingRecord <HcalZDCLowGainFractionsRcd> ();
}
else if (objectName == "MCParams") {
setWhatProduced (this, &HcalTextCalibrations::produceMCParams);
findingRecord <HcalMCParamsRcd> ();
Expand All @@ -137,7 +141,7 @@ HcalTextCalibrations::HcalTextCalibrations ( const edm::ParameterSet& iConfig )
<< "Pedestals PedestalWidths Gains GainWidths QIEData ChannelQuality ElectronicsMap "
<< "ZSThresholds RespCorrs LUTCorrs PFCorrs TimeCorrs L1TriggerObjects "
<< "ValidationCorrs LutMetadata DcsValues DcsMap CholeskyMatrices CovarianceMatrices "
<< "RecoParams LongRecoParams FlagHFDigiTimeParams MCParams "
<< "RecoParams LongRecoParams ZDCLowGainFraction FlagHFDigiTimeParams MCParams "
<< std::endl;
}
}
Expand Down Expand Up @@ -331,6 +335,14 @@ std::auto_ptr<HcalLongRecoParams> HcalTextCalibrations::produceLongRecoParams (c
const HcalTopology* topo=&(*htopo);
return produce_impl<HcalLongRecoParams> (topo,mInputs ["LongRecoParams"]);
}

std::auto_ptr<HcalZDCLowGainFractions> HcalTextCalibrations::produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rcd) {
edm::ESHandle<HcalTopology> htopo;
rcd.getRecord<IdealGeometryRecord>().get(htopo);
const HcalTopology* topo=&(*htopo);
return produce_impl<HcalZDCLowGainFractions> (topo,mInputs ["ZDCLowGainFractions"]);
}

std::auto_ptr<HcalTimingParams> HcalTextCalibrations::produceTimingParams (const HcalTimingParamsRcd& rcd) {
edm::ESHandle<HcalTopology> htopo;
rcd.getRecord<IdealGeometryRecord>().get(htopo);
Expand Down
2 changes: 2 additions & 0 deletions CalibCalorimetry/HcalPlugins/src/HcalTextCalibrations.h
Expand Up @@ -33,6 +33,7 @@ class HcalCholeskyMatricesRcd;
class HcalCovarianceMatricesRcd;
class HcalRecoParamsRcd;
class HcalLongRecoParamsRcd;
class HcalZDCLowGainFractionsRcd;
class HcalMCParamsRcd;
class HcalFlagHFDigiTimeParamsRcd;
class HcalTimingParamsRcd;
Expand Down Expand Up @@ -68,6 +69,7 @@ class HcalTextCalibrations : public edm::ESProducer,

std::auto_ptr<HcalRecoParams> produceRecoParams (const HcalRecoParamsRcd& rcd);
std::auto_ptr<HcalLongRecoParams> produceLongRecoParams (const HcalLongRecoParamsRcd& rcd);
std::auto_ptr<HcalZDCLowGainFractions> produceZDCLowGainFractions (const HcalZDCLowGainFractionsRcd& rcd);
std::auto_ptr<HcalMCParams> produceMCParams (const HcalMCParamsRcd& rcd);
std::auto_ptr<HcalFlagHFDigiTimeParams> produceFlagHFDigiTimeParams (const HcalFlagHFDigiTimeParamsRcd& rcd);

Expand Down
1 change: 1 addition & 0 deletions CondCore/HcalPlugins/src/plugin.cc
Expand Up @@ -58,6 +58,7 @@ REGISTER_PLUGIN(HcalCholeskyMatricesRcd,HcalCholeskyMatrices);
REGISTER_PLUGIN(HcalCovarianceMatricesRcd,HcalCovarianceMatrices);
REGISTER_PLUGIN(HcalRecoParamsRcd,HcalRecoParams);
REGISTER_PLUGIN(HcalLongRecoParamsRcd,HcalLongRecoParams);
REGISTER_PLUGIN(HcalZDCLowGainFractionsRcd,HcalZDCLowGainFractions);
REGISTER_PLUGIN(HcalMCParamsRcd,HcalMCParams);
REGISTER_PLUGIN(HcalFlagHFDigiTimeParamsRcd,HcalFlagHFDigiTimeParams);
REGISTER_PLUGIN(HcalTimingParamsRcd,HcalTimingParams);
Expand Down
1 change: 1 addition & 0 deletions CondCore/Utilities/src/CondDBImport.cc
Expand Up @@ -154,6 +154,7 @@ namespace cond {
IMPORT_PAYLOAD_CASE( HcalL1TriggerObjects )
IMPORT_PAYLOAD_CASE( HcalLUTCorrs )
IMPORT_PAYLOAD_CASE( HcalLongRecoParams )
IMPORT_PAYLOAD_CASE( HcalZDCLowGainFractions )
IMPORT_PAYLOAD_CASE( HcalLutMetadata )
IMPORT_PAYLOAD_CASE( HcalMCParams )
IMPORT_PAYLOAD_CASE( HcalPFCorrs )
Expand Down
1 change: 1 addition & 0 deletions CondCore/Utilities/src/CondFormats.h
Expand Up @@ -176,6 +176,7 @@
#include "CondFormats/HcalObjects/interface/HcalL1TriggerObjects.h"
#include "CondFormats/HcalObjects/interface/HcalLUTCorrs.h"
#include "CondFormats/HcalObjects/interface/HcalLongRecoParams.h"
#include "CondFormats/HcalObjects/interface/HcalZDCLowGainFractions.h"
#include "CondFormats/HcalObjects/interface/HcalLutMetadata.h"
#include "CondFormats/HcalObjects/interface/HcalMCParams.h"
#include "CondFormats/HcalObjects/interface/HcalPFCorrs.h"
Expand Down
1 change: 1 addition & 0 deletions CondFormats/DataRecord/doc/DataRecord.doc
Expand Up @@ -160,6 +160,7 @@
- HcalL1TriggerObjectsRcd
- HcalLUTCorrsRcd
- HcalLongRecoParamsRcd
- HcalZDCLowGainFractionsRcd
- HcalLutMetadataRcd
- HcalMCParamsRcd
- HcalPFCorrsRcd
Expand Down
1 change: 1 addition & 0 deletions CondFormats/DataRecord/interface/HcalAllRcds.h
Expand Up @@ -23,6 +23,7 @@
#include "CondFormats/DataRecord/interface/HcalCholeskyMatricesRcd.h"
#include "CondFormats/DataRecord/interface/HcalRecoParamsRcd.h"
#include "CondFormats/DataRecord/interface/HcalLongRecoParamsRcd.h"
#include "CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h"
#include "CondFormats/DataRecord/interface/HcalMCParamsRcd.h"
#include "CondFormats/DataRecord/interface/HcalFlagHFDigiTimeParamsRcd.h"
#include "CondFormats/DataRecord/interface/HcalTimingParamsRcd.h"
Expand Down
26 changes: 26 additions & 0 deletions CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h
@@ -0,0 +1,26 @@
#ifndef HcalZDCLowGainFractionsRcd_H
#define HcalZDCLowGainFractionsRcd_H
// -*- C++ -*-
//
// Package: CondFormats/DataRecord
// Class : HcalZDCLowGainFractionsRcd
//
/**\class HcalZDCLowGainFractionsRcd HcalZDCLowGainFractionsRcd.h CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h
Description: [one line class summary]
Usage:
<usage>
*/
//
// Author: Audrius Mecionis
// Created: Wed, 24 Sep 2014 11:27:57 GMT
//

#include "FWCore/Framework/interface/DependentRecordImplementation.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

class HcalZDCLowGainFractionsRcd : public edm::eventsetup::DependentRecordImplementation<HcalZDCLowGainFractionsRcd, boost::mpl::vector<IdealGeometryRecord> > {};

#endif
15 changes: 15 additions & 0 deletions CondFormats/DataRecord/src/HcalZDCLowGainFractionsRcd.cc
@@ -0,0 +1,15 @@
// -*- C++ -*-
//
// Package: CondFormats/DataRecord
// Class : HcalZDCLowGainFractionsRcd
//
// Implementation:
// [Notes on implementation]
//
// Author: Audrius Mecionis
// Created: Wed, 24 Sep 2014 11:27:57 GMT

#include "CondFormats/DataRecord/interface/HcalZDCLowGainFractionsRcd.h"
#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"

EVENTSETUP_RECORD_REG(HcalZDCLowGainFractionsRcd);
1 change: 1 addition & 0 deletions CondFormats/HcalObjects/interface/AllObjects.h
Expand Up @@ -27,6 +27,7 @@
#include "CondFormats/HcalObjects/interface/HcalCovarianceMatrices.h"
#include "CondFormats/HcalObjects/interface/HcalRecoParams.h"
#include "CondFormats/HcalObjects/interface/HcalLongRecoParams.h"
#include "CondFormats/HcalObjects/interface/HcalZDCLowGainFractions.h"
#include "CondFormats/HcalObjects/interface/HcalMCParams.h"
#include "CondFormats/HcalObjects/interface/HcalFlagHFDigiTimeParams.h"
#include "CondFormats/HcalObjects/interface/HcalTimingParams.h"
Expand Down
31 changes: 31 additions & 0 deletions CondFormats/HcalObjects/interface/HcalZDCLowGainFraction.h
@@ -0,0 +1,31 @@
#ifndef HcalZDCLowGainFraction_h
#define HcalZDCLowGainFraction_h

/**
\class HcalZDCLowGainFraction
\author Audrius Mecionis
POOL object to store lowGainFrac values
*/

#include "CondFormats/Serialization/interface/Serializable.h"

#include <boost/cstdint.hpp>

class HcalZDCLowGainFraction {
public:
HcalZDCLowGainFraction() : mId(0), mValue(0) {}

HcalZDCLowGainFraction(unsigned long fid, float value): mId(fid), mValue(value) {}

uint32_t rawId() const {return mId;}

float getValue() const {return mValue;}

private:
uint32_t mId;
float mValue;

COND_SERIALIZABLE;
};

#endif
26 changes: 26 additions & 0 deletions CondFormats/HcalObjects/interface/HcalZDCLowGainFractions.h
@@ -0,0 +1,26 @@
#ifndef HcalZDCLowGainFractions_h
#define HcalZDCLowGainFractions_h

#include "CondFormats/Serialization/interface/Serializable.h"

#include "CondFormats/HcalObjects/interface/HcalZDCLowGainFraction.h"
#include "CondFormats/HcalObjects/interface/HcalCondObjectContainer.h"


class HcalZDCLowGainFractions: public HcalCondObjectContainer<HcalZDCLowGainFraction>
{
public:
#ifndef HCAL_COND_SUPPRESS_DEFAULT
HcalZDCLowGainFractions():HcalCondObjectContainer<HcalZDCLowGainFraction>(0) {}
#endif
HcalZDCLowGainFractions(const HcalTopology* topo):HcalCondObjectContainer<HcalZDCLowGainFraction>(topo) {}

std::string myname() const {return (std::string)"HcalZDCLowGainFractions";}

private:


COND_SERIALIZABLE;
};
#endif

3 changes: 3 additions & 0 deletions CondFormats/HcalObjects/src/HcalZDCLowGainFraction.cc
@@ -0,0 +1,3 @@
#include "CondFormats/HcalObjects/interface/HcalZDCLowGainFraction.h"


5 changes: 5 additions & 0 deletions CondFormats/HcalObjects/src/HcalZDCLowGainFractions.cc
@@ -0,0 +1,5 @@
// to see it compile

#include "CondFormats/HcalObjects/interface/HcalZDCLowGainFractions.h"


@@ -0,0 +1,5 @@
#include "CondFormats/HcalObjects/interface/HcalZDCLowGainFractions.h"
#include "FWCore/Utilities/interface/typelookup.h"

TYPELOOKUP_DATA_REG(HcalZDCLowGainFractions);

3 changes: 3 additions & 0 deletions CondFormats/HcalObjects/src/classes.h
Expand Up @@ -4,6 +4,9 @@
namespace CondFormats_HcalObjects {
struct dictionary {

HcalZDCLowGainFractions myfracs();
std::vector<HcalZDCLowGainFraction> myfracsVec;

HcalPedestals mypeds();
std::vector<HcalPedestal> mypedsVec;

Expand Down
18 changes: 18 additions & 0 deletions CondFormats/HcalObjects/src/classes_def.xml
Expand Up @@ -310,8 +310,26 @@
<field name="CALIBcontainer" mapping="blob" />
<field name="CASTORcontainer" mapping="blob" />
</class>

<class name="HcalRecoParams" class_version="0"/>

<class name="HcalZDCLowGainFraction"/>
<class name="std::vector<HcalZDCLowGainFraction>"/>
<class name="std::pair<std::string, std::vector<HcalZDCLowGainFraction> >"/>
<class name="std::vector<std::pair<std::string, std::vector<HcalZDCLowGainFraction> > >"/>
<class name="HcalCondObjectContainer<HcalZDCLowGainFraction>">
<field name="HBcontainer" mapping="blob" />
<field name="HEcontainer" mapping="blob" />
<field name="HFcontainer" mapping="blob" />
<field name="HOcontainer" mapping="blob" />
<field name="HTcontainer" mapping="blob" />
<field name="ZDCcontainer" mapping="blob" />
<field name="CALIBcontainer" mapping="blob" />
<field name="CASTORcontainer" mapping="blob" />
</class>
<class name="HcalZDCLowGainFractions" class_version="0"/>


<class name="HcalTimingParam"/>
<class name="std::vector<HcalTimingParam>"/>
<class name="std::pair<std::string, std::vector<HcalTimingParam> >"/>
Expand Down
5 changes: 5 additions & 0 deletions CondFormats/HcalObjects/test/testSerializationHcalObjects.cpp
Expand Up @@ -19,6 +19,7 @@ int main()
testSerialization<HcalCondObjectContainer<HcalL1TriggerObject>>();
testSerialization<HcalCondObjectContainer<HcalLUTCorr>>();
testSerialization<HcalCondObjectContainer<HcalLongRecoParam>>();
testSerialization<HcalCondObjectContainer<HcalZDCLowGainFraction>>();
testSerialization<HcalCondObjectContainer<HcalLutMetadatum>>();
testSerialization<HcalCondObjectContainer<HcalMCParam>>();
testSerialization<HcalCondObjectContainer<HcalPFCorr>>();
Expand Down Expand Up @@ -54,6 +55,8 @@ int main()
testSerialization<HcalLUTCorrs>();
testSerialization<HcalLongRecoParam>();
testSerialization<HcalLongRecoParams>();
testSerialization<HcalZDCLowGainFraction>();
testSerialization<HcalZDCLowGainFractions>();
testSerialization<HcalLutMetadata>();
testSerialization<HcalLutMetadata::NonChannelData>();
testSerialization<HcalLutMetadatum>();
Expand Down Expand Up @@ -113,6 +116,7 @@ int main()
testSerialization<std::vector<HcalL1TriggerObject>>();
testSerialization<std::vector<HcalLUTCorr>>();
testSerialization<std::vector<HcalLongRecoParam>>();
testSerialization<std::vector<HcalZDCLowGainFraction>>();
testSerialization<std::vector<HcalLutMetadatum>>();
testSerialization<std::vector<HcalMCParam>>();
testSerialization<std::vector<HcalPFCorr>>();
Expand All @@ -133,6 +137,7 @@ int main()
testSerialization<std::vector<std::pair<std::string, std::vector<HcalL1TriggerObject>>>>();
testSerialization<std::vector<std::pair<std::string, std::vector<HcalLUTCorr>>>>();
testSerialization<std::vector<std::pair<std::string, std::vector<HcalLongRecoParam>>>>();
testSerialization<std::vector<std::pair<std::string, std::vector<HcalZDCLowGainFraction>>>>();
testSerialization<std::vector<std::pair<std::string, std::vector<HcalLutMetadatum>>>>();
testSerialization<std::vector<std::pair<std::string, std::vector<HcalMCParam>>>>();
testSerialization<std::vector<std::pair<std::string, std::vector<HcalPFCorr>>>>();
Expand Down

0 comments on commit c9367e8

Please sign in to comment.