#include <EcalDccWeightBuilder.h>
Public Member Functions | |
void | analyze (const edm::Event &event, const edm::EventSetup &es) |
EcalDccWeightBuilder (edm::ParameterSet const &ps) | |
virtual | ~EcalDccWeightBuilder () |
Public Member Functions inherited from edm::EDAnalyzer | |
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
EDAnalyzer () | |
ModuleDescription const & | moduleDescription () const |
std::string | workerType () const |
virtual | ~EDAnalyzer () |
Public Member Functions inherited from edm::EDConsumerBase | |
std::vector< ConsumesInfo > | consumesInfo () const |
EDConsumerBase () | |
ProductHolderIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
void | itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
void | itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const |
std::vector < ProductHolderIndexAndSkipBit > const & | itemsToGetFromEvent () const |
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
void | modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const |
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
bool | registeredToConsume (ProductHolderIndex, bool, BranchType) const |
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
void | updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &) |
virtual | ~EDConsumerBase () |
Private Types | |
enum | mode_t { WEIGHTS_FROM_CONFIG, COMPUTE_WEIGHTS } |
Private Member Functions | |
void | computeAllWeights (bool withIntercalib) |
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_ |
const EcalElectronicsMapping * | ecalElectronicsMap_ |
EcalIntercalibConstantMap | emptyCalibMap_ |
std::map< DetId, std::vector < int > > | encodedWeights_ |
edm::ESHandle< CaloGeometry > | geom_ |
mode_t | imode_ |
std::vector< double > | inputWeights_ |
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::EDAnalyzer | |
typedef EDAnalyzer | ModuleType |
Static Public Member Functions inherited from edm::EDAnalyzer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &) |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
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 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) |
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 45 of file EcalDccWeightBuilder.cc.
References COMPUTE_WEIGHTS, edm::hlt::Exception, imode_, inputWeights_, mode_, nDccWeights_, and WEIGHTS_FROM_CONFIG.
|
inlinevirtual |
|
virtual |
Analyze method called by the event loop.
event | CMSSW event |
es | event setup |
Implements edm::EDAnalyzer.
Definition at line 84 of file EcalDccWeightBuilder.cc.
References calibMap_, computeAllWeights(), dccWeightsWithIntercalib_, ecalElectronicsMap_, geom_, edm::EventSetup::get(), EcalCondObjectContainer< T >::getMap(), patZpeak::handle, intercalib(), edm::ESHandle< class >::product(), writeToAsciiFile_, writeToDB_, writeToRootFile_, writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
|
private |
Definition at line 112 of file EcalDccWeightBuilder.cc.
References assert(), CaloSimParameters::binOfMaximum(), COMPUTE_WEIGHTS, computeWeights(), filterCSVwithJSON::copy, gather_cfg::cout, dcc1stSample_, alignCSCRings::e, DetId::Ecal, EcalBarrel, EcalEndcap, encodedWeights_, cppFunctionSkipper::exception, edm::hlt::Exception, geom_, i, imode_, inputWeights_, intercalib(), 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 222 of file EcalDccWeightBuilder.cc.
References i, alignCSCRings::s, EcalShapeBase::timeToRise(), and tzero.
Referenced by computeAllWeights().
|
private |
Definition at line 637 of file EcalDccWeightBuilder.cc.
References gather_cfg::cout, EcalElectronicsId::dccId(), EcalBarrel, ecalElectronicsMap_, HLT_25ns14e33_v1_cff::fedId, EcalElectronicsMapping::getElectronicsId(), EcalElectronicsId::stripId(), DetId::subdetId(), EcalElectronicsId::towerId(), and EcalElectronicsId::xtalId().
Referenced by writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
|
private |
Definition at line 260 of file EcalDccWeightBuilder.cc.
References weightScale_.
Referenced by unbiasWeights().
|
private |
Definition at line 256 of file EcalDccWeightBuilder.cc.
References 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 368 of file EcalDccWeightBuilder.cc.
References calibMap_, gather_cfg::cout, EcalBarrel, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), DetId::rawId(), and DetId::subdetId().
Referenced by analyze(), and 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 266 of file EcalDccWeightBuilder.cc.
References i, j, and std::swap().
Referenced by unbiasWeights().
|
private |
Definition at line 303 of file EcalDccWeightBuilder.cc.
References decodeWeight(), encodeWeight(), i, and sort().
Referenced by computeAllWeights().
|
private |
Definition at line 395 of file EcalDccWeightBuilder.cc.
References asciiOutputFileName_, comment, dbId(), dbTag_, dbVersion_, dcc1stSample_, ecalDccFedIdMax, ecalDccFedIdMin, encodedWeights_, edm::hlt::Exception, HLT_25ns14e33_v1_cff::fedId, mergeVDriftHistosByStation::file, MainPageGenerator::fName, i, python.multivaluedict::map(), DetId::rawId(), sqlMode_, and create_public_pileup_plots::weights.
Referenced by analyze().
|
private |
Definition at line 543 of file EcalDccWeightBuilder.cc.
References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, dbId(), dbPassword_, dbSid_, dbTag_, dbUser_, dbVersion_, dcc1stSample_, alignCSCRings::e, ecalDccFedIdMax, ecalDccFedIdMin, encodedWeights_, cmsRelvalreport::exit, HLT_25ns14e33_v1_cff::fedId, convertXMLtoSQLite_cfg::fileName, lut2db_cfg::filePrefix, ODFEWeightsInfo::getId(), i, EcalCondDBInterface::insertConfigDataArraySet(), EcalCondDBInterface::insertConfigSet(), python.multivaluedict::map(), nDccs, PasswordReader::readPassword(), 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 create_public_pileup_plots::weights.
Referenced by analyze().
|
private |
Definition at line 480 of file EcalDccWeightBuilder.cc.
References filterCSVwithJSON::copy, dbId(), encodedWeights_, edm::hlt::Exception, HLT_25ns14e33_v1_cff::fedId, mergeVDriftHistosByStation::file, MainPageGenerator::fName, python.multivaluedict::map(), rootOutputFileName_, edmStreamStallGrapher::t, and create_public_pileup_plots::weights.
Referenced by analyze().
|
private |
Definition at line 122 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile().
|
private |
Definition at line 133 of file EcalDccWeightBuilder.h.
Referenced by analyze(), and intercalib().
|
private |
Definition at line 126 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 124 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 127 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 125 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 128 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 110 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 118 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
staticprivate |
Definition at line 141 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
staticprivate |
Definition at line 140 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile(), and writeWeightToDB().
|
private |
Definition at line 138 of file EcalDccWeightBuilder.h.
|
private |
Definition at line 134 of file EcalDccWeightBuilder.h.
|
private |
Definition at line 135 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
|
private |
Definition at line 131 of file EcalDccWeightBuilder.h.
Referenced by analyze(), and computeAllWeights().
|
private |
Definition at line 117 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), and EcalDccWeightBuilder().
|
private |
weights used in weightFromConfig mode.
Definition at line 115 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), and EcalDccWeightBuilder().
|
private |
Definition at line 116 of file EcalDccWeightBuilder.h.
Referenced by EcalDccWeightBuilder().
|
staticprivate |
Definition at line 142 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToDB().
|
private |
Definition at line 112 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights(), and EcalDccWeightBuilder().
|
private |
Definition at line 123 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToRootFile().
|
private |
Definition at line 111 of file EcalDccWeightBuilder.h.
Referenced by computeAllWeights().
|
private |
Definition at line 129 of file EcalDccWeightBuilder.h.
Referenced by writeWeightToAsciiFile().
|
staticprivate |
Definition at line 137 of file EcalDccWeightBuilder.h.
Referenced by decodeWeight(), and encodeWeight().
|
private |
Definition at line 120 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 119 of file EcalDccWeightBuilder.h.
Referenced by analyze().
|
private |
Definition at line 121 of file EcalDccWeightBuilder.h.
Referenced by analyze().