#include <EcalDccWeightBuilder.h>
Private Types | |
enum | mode_t { WEIGHTS_FROM_CONFIG, COMPUTE_WEIGHTS } |
Private Member Functions | |
void | computeAllWeights (bool withIntercalib, const edm::EventSetup &es) |
void | computeWeights (const EcalShapeBase &shape, int binOfMax, double timePhase, int iFirst0, int nWeights, int iSkip0, std::vector< double > &result) |
void | dbId (const DetId &detId, int &fedId, int &smId, int &ruId, int &xtalId) const |
double | decodeWeight (int W) |
int | encodeWeight (double w) |
double | intercalib (const DetId &detId) |
template<class T > | |
void | sort (const std::vector< T > &a, std::vector< int > &s, bool decreasingOrder=false) |
void | unbiasWeights (std::vector< double > &weights, std::vector< int32_t > *encodedWeigths) |
void | writeWeightToAsciiFile () |
void | writeWeightToDB () |
void | writeWeightToRootFile () |
Private Attributes | |
std::string | asciiOutputFileName_ |
EcalIntercalibConstantMap & | calibMap_ |
std::string | dbPassword_ |
std::string | dbSid_ |
std::string | dbTag_ |
std::string | dbUser_ |
int | dbVersion_ |
int | dcc1stSample_ |
bool | dccWeightsWithIntercalib_ |
EBShape | ebShape_ |
const EcalElectronicsMapping * | ecalElectronicsMap_ |
EEShape | eeShape_ |
EcalIntercalibConstantMap | emptyCalibMap_ |
std::map< DetId, std::vector< int > > | encodedWeights_ |
edm::ESHandle< CaloGeometry > | geom_ |
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > | geometryToken_ |
mode_t | imode_ |
std::vector< double > | inputWeights_ |
const edm::ESGetToken< EcalIntercalibConstants, EcalIntercalibConstantsRcd > | intercalibConstToken_ |
const edm::ESGetToken< EcalElectronicsMapping, EcalMappingRcd > | mappingToken_ |
std::string | mode_ |
int | nDccWeights_ |
std::string | rootOutputFileName_ |
int | sampleToSkip_ |
bool | sqlMode_ |
bool | writeToAsciiFile_ |
bool | writeToDB_ |
bool | writeToRootFile_ |
Static Private Attributes | |
static const int | ecalDccFedIdMax = 654 |
static const int | ecalDccFedIdMin = 601 |
static const int | nDccs = ecalDccFedIdMax - ecalDccFedIdMin + 1 |
static const double | weightScale_ = 1024. |
Additional Inherited Members | |
Public Types inherited from edm::one::EDAnalyzerBase | |
typedef EDAnalyzerBase | ModuleType |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Static Public Member Functions inherited from edm::one::EDAnalyzerBase | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
template<BranchType B = InEvent> | |
EDConsumerBaseAdaptor< B > | consumes (edm::InputTag tag) noexcept |
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
ConsumesCollector | consumesCollector () |
Use a ConsumesCollector to gather consumes information from helper functions. More... | |
template<typename ProductType , BranchType B = InEvent> | |
void | consumesMany () |
void | consumesMany (const TypeToGet &id) |
template<BranchType B> | |
void | consumesMany (const TypeToGet &id) |
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes () |
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag const &tag) |
template<Transition Tr = Transition::Event> | |
constexpr auto | esConsumes () |
template<Transition Tr = Transition::Event> | |
auto | esConsumes (ESInputTag tag) |
template<Transition Tr = Transition::Event> | |
ESGetTokenGeneric | esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey) |
Used with EventSetupRecord::doGet. More... | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
void | resetItemsToGetFrom (BranchType iType) |
Definition at line 27 of file EcalDccWeightBuilder.h.
|
private |
Enumerator | |
---|---|
WEIGHTS_FROM_CONFIG | |
COMPUTE_WEIGHTS |
Definition at line 29 of file EcalDccWeightBuilder.h.
EcalDccWeightBuilder::EcalDccWeightBuilder | ( | edm::ParameterSet const & | ps | ) |
Constructs an EcalDccWeightBuilder
ps | CMSSW mondule configuration |
Definition at line 38 of file EcalDccWeightBuilder.cc.
References COMPUTE_WEIGHTS, Exception, imode_, inputWeights_, mode_, nDccWeights_, and WEIGHTS_FROM_CONFIG.
|
inlineoverride |
|
overridevirtual |
Analyze method called by the event loop.
event | CMSSW event |
es | event setup |
Implements edm::one::EDAnalyzerBase.
Definition at line 77 of file EcalDccWeightBuilder.cc.
References calibMap_, computeAllWeights(), dccWeightsWithIntercalib_, ecalElectronicsMap_, geom_, geometryToken_, edm::EventSetup::getData(), edm::EventSetup::getHandle(), EcalCondObjectContainer< T >::getMap(), intercalibConstToken_, mappingToken_, writeToAsciiFile_, writeToDB_, writeToRootFile_, writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
|
private |
Definition at line 102 of file EcalDccWeightBuilder.cc.
References cms::cuda::assert(), CaloSimParameters::binOfMaximum(), COMPUTE_WEIGHTS, computeWeights(), filterCSVwithJSON::copy, dcc1stSample_, MillePedeFileConverter_cfg::e, ebShape_, DetId::Ecal, EcalBarrel, EcalEndcap, eeShape_, encodedWeights_, cppFunctionSkipper::exception, Exception, geom_, CaloGeometry::getValidDetIds(), mps_fire::i, LEDCalibrationChannels::ieta, imode_, inputWeights_, intercalib(), LEDCalibrationChannels::iphi, SiStripPI::min, nDccWeights_, sampleToSkip_, EcalSimParameterMap::simParameters(), CaloSimParameters::timePhase(), unbiasWeights(), w(), and WEIGHTS_FROM_CONFIG.
Referenced by analyze().
|
private |
Weight computation
shape | signal shape to use for weight computation |
binOfMax | time bin which shall contain the pulse peak |
timePhase | signal phase. First sample corresponds to t = ((binOfMax-1)*25+timePhase) ns in the time reference of EcalShapeBase. |
iFirst | first sample the weights must be applied to |
nWeights | number of weights |
iSkip0 | if greater than 0, the corresponding sample will not be used (weights forced to 0). |
result | [out] vector filled with computed weights. The vector is resized to the number of weights |
Definition at line 194 of file EcalDccWeightBuilder.cc.
References mps_fire::i, mps_fire::result, alignCSCRings::s, ecalSimParameterMap_cff::timePhase, EcalShapeBase::timeToRise(), and tzero.
Referenced by computeAllWeights().
|
private |
Definition at line 559 of file EcalDccWeightBuilder.cc.
References EcalElectronicsId::dccId(), EcalBarrel, ecalElectronicsMap_, l1tstage2_dqm_sourceclient-live_cfg::fedId, EcalElectronicsMapping::getElectronicsId(), EcalElectronicsId::stripId(), DetId::subdetId(), EcalElectronicsId::towerId(), and EcalElectronicsId::xtalId().
Referenced by writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
|
private |
Definition at line 231 of file EcalDccWeightBuilder.cc.
References weightScale_.
Referenced by unbiasWeights().
|
private |
Definition at line 229 of file EcalDccWeightBuilder.cc.
References w(), and weightScale_.
Referenced by unbiasWeights().
|
private |
Retrieve intercalibration coefficent for channel detId.
detId | ID of the channel the intercalibration coef. must be retrieved for. |
Definition at line 308 of file EcalDccWeightBuilder.cc.
References calibMap_, EcalBarrel, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), DetId::rawId(), and DetId::subdetId().
Referenced by computeAllWeights().
|
private |
Vector index sorting.
vector | of values | |
[out] | sorted | index of the vector |
decreasingOrder | switch to use decreasing order instead of default increasing order |
Definition at line 234 of file EcalDccWeightBuilder.cc.
References a, mps_fire::i, dqmiolumiharvest::j, alignCSCRings::s, and std::swap().
Referenced by unbiasWeights().
|
private |
Definition at line 256 of file EcalDccWeightBuilder.cc.
References decodeWeight(), encodeWeight(), mps_fire::i, sort(), and HLT_2022v11_cff::weights.
Referenced by computeAllWeights().
|
private |
Definition at line 333 of file EcalDccWeightBuilder.cc.
References asciiOutputFileName_, dbId(), dbTag_, dbVersion_, dcc1stSample_, ecalDccFedIdMax, ecalDccFedIdMin, encodedWeights_, Exception, l1tstage2_dqm_sourceclient-live_cfg::fedId, geometryDiff::file, MainPageGenerator::fName, mps_fire::i, genParticles_cff::map, DetId::rawId(), sqlMode_, and HLT_2022v11_cff::weights.
Referenced by analyze().
|
private |
Definition at line 470 of file EcalDccWeightBuilder.cc.
References dbId(), dbPassword_, dbSid_, dbTag_, dbUser_, dbVersion_, dcc1stSample_, MillePedeFileConverter_cfg::e, ecalDccFedIdMax, ecalDccFedIdMin, test_db_connect::econn, encodedWeights_, beamvalidation::exit(), l1tstage2_dqm_sourceclient-live_cfg::fedId, MillePedeFileConverter_cfg::fileName, ODFEWeightsInfo::getId(), mps_fire::i, genParticles_cff::map, nDccs, IODConfig::setConfigTag(), ODWeightsDat::setCrystalId(), ODWeightsDat::setFedId(), ODWeightsDat::setId(), ODWeightsDat::setSMId(), ODWeightsDat::setTTId(), ODFEWeightsInfo::setVersion(), ODWeightsDat::setWeight0(), ODWeightsDat::setWeight1(), ODWeightsDat::setWeight2(), ODWeightsDat::setWeight3(), ODWeightsDat::setWeight4(), ODWeightsDat::setWeight5(), AlCaHLTBitMon_QueryRunRegistry::string, w(), and HLT_2022v11_cff::weights.
Referenced by analyze().
|
private |
Definition at line 417 of file EcalDccWeightBuilder.cc.
References visDQMUpload::buf, filterCSVwithJSON::copy, dbId(), encodedWeights_, Exception, l1tstage2_dqm_sourceclient-live_cfg::fedId, geometryDiff::file, MainPageGenerator::fName, genParticles_cff::map, rootOutputFileName_, submitPVValidationJobs::t, and HLT_2022v11_cff::weights.
Referenced by analyze().
|
private |
Definition at line 117 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile().
|
private |
Definition at line 132 of file EcalDccWeightBuilder.h.
Referenced by analyze(), and intercalib().
|
private |
Definition at line 121 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 119 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 122 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 120 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 123 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 105 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 113 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 136 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights().
|
staticprivate |
Definition at line 143 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
staticprivate |
Definition at line 142 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 140 of file EcalDccWeightBuilder.h.
|
private |
Definition at line 137 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights().
|
private |
Definition at line 133 of file EcalDccWeightBuilder.h.
|
private |
Definition at line 134 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
|
private |
Definition at line 130 of file EcalDccWeightBuilder.h.
Referenced by analyze(), and computeAllWeights().
|
private |
Definition at line 126 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 112 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), and EcalDccWeightBuilder().
|
private |
weights used in weightFromConfig mode.
Definition at line 110 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), and EcalDccWeightBuilder().
|
private |
Definition at line 128 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 127 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 111 of file EcalDccWeightBuilder.h.
Referenced by EcalDccWeightBuilder().
|
staticprivate |
Definition at line 144 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 107 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), and EcalDccWeightBuilder().
|
private |
Definition at line 118 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToRootFile().
|
private |
Definition at line 106 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights().
|
private |
Definition at line 124 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile().
|
staticprivate |
Definition at line 139 of file EcalDccWeightBuilder.h.
Referenced by decodeWeight(), and encodeWeight().
|
private |
Definition at line 115 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 114 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 116 of file EcalDccWeightBuilder.h.
Referenced by analyze().