#include <EcalDccWeightBuilder.h>
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 |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
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, Exception, imode_, inputWeights_, mode_, nDccWeights_, and WEIGHTS_FROM_CONFIG.
|
inlinevirtual |
Destructor
Definition at line 40 of file EcalDccWeightBuilder.h.
References a, analyze(), computeAllWeights(), computeWeights(), dbId(), decodeWeight(), encodeWeight(), l1t::stage2::layer2::fedId, intercalib(), mps_fire::result, alignCSCRings::s, sort(), ecalSimParameterMap_cff::timePhase, unbiasWeights(), w, create_public_lumi_plots::weights, writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
void EcalDccWeightBuilder::analyze | ( | const edm::Event & | event, |
const edm::EventSetup & | es | ||
) |
Analyze method called by the event loop.
event | CMSSW event |
es | event setup |
Definition at line 84 of file EcalDccWeightBuilder.cc.
References calibMap_, computeAllWeights(), dccWeightsWithIntercalib_, ecalElectronicsMap_, geom_, edm::EventSetup::get(), EcalCondObjectContainer< T >::getMap(), cmsBatch::handle, intercalib(), edm::ESHandle< T >::product(), writeToAsciiFile_, writeToDB_, writeToRootFile_, writeWeightToAsciiFile(), writeWeightToDB(), and writeWeightToRootFile().
Referenced by ~EcalDccWeightBuilder().
|
private |
Definition at line 112 of file EcalDccWeightBuilder.cc.
References CaloSimParameters::binOfMaximum(), COMPUTE_WEIGHTS, computeWeights(), popcon2dropbox::copy(), gather_cfg::cout, dcc1stSample_, MillePedeFileConverter_cfg::e, DetId::Ecal, EcalBarrel, EcalEndcap, encodedWeights_, cppFunctionSkipper::exception, Exception, geom_, CaloGeometry::getValidDetIds(), mps_fire::i, imode_, inputWeights_, intercalib(), min(), nDccWeights_, hcalRecAlgoESProd_cfi::phase, sampleToSkip_, EcalSimParameterMap::simParameters(), CaloSimParameters::timePhase(), unbiasWeights(), w, and WEIGHTS_FROM_CONFIG.
Referenced by analyze(), and ~EcalDccWeightBuilder().
|
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 mps_fire::i, alignCSCRings::s, combinedConstraintHelpers::sum2(), EcalShapeBase::timeToRise(), and tzero.
Referenced by computeAllWeights(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 637 of file EcalDccWeightBuilder.cc.
References gather_cfg::cout, EcalElectronicsId::dccId(), EcalBarrel, ecalElectronicsMap_, l1t::stage2::layer2::fedId, EcalElectronicsMapping::getElectronicsId(), EcalElectronicsId::stripId(), DetId::subdetId(), EcalElectronicsId::towerId(), and EcalElectronicsId::xtalId().
Referenced by writeWeightToAsciiFile(), writeWeightToDB(), writeWeightToRootFile(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 260 of file EcalDccWeightBuilder.cc.
References weightScale_.
Referenced by unbiasWeights(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 256 of file EcalDccWeightBuilder.cc.
References weightScale_.
Referenced by unbiasWeights(), and ~EcalDccWeightBuilder().
|
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(), computeAllWeights(), and ~EcalDccWeightBuilder().
|
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 mps_fire::i, and std::swap().
Referenced by unbiasWeights(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 303 of file EcalDccWeightBuilder.cc.
References decodeWeight(), encodeWeight(), mps_fire::i, and sort().
Referenced by computeAllWeights(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 395 of file EcalDccWeightBuilder.cc.
References asciiOutputFileName_, comment, dbId(), dbTag_, dbVersion_, dcc1stSample_, tablePrinter::delim, ecalDccFedIdMax, ecalDccFedIdMin, encodedWeights_, Exception, l1t::stage2::layer2::fedId, FrontierConditions_GlobalTag_cff::file, mps_fire::i, genParticles_cff::map, DetId::rawId(), sqlMode_, and create_public_lumi_plots::weights.
Referenced by analyze(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 543 of file EcalDccWeightBuilder.cc.
References MessageLogger_cfi::cerr, gather_cfg::cout, dbId(), dbPassword_, dbSid_, dbTag_, dbUser_, dbVersion_, dcc1stSample_, MillePedeFileConverter_cfg::e, ecalDccFedIdMax, ecalDccFedIdMin, encodedWeights_, cmsRelvalreport::exit, l1t::stage2::layer2::fedId, MillePedeFileConverter_cfg::fileName, ODFEWeightsInfo::getId(), mps_fire::i, EcalCondDBInterface::insertConfigDataArraySet(), EcalCondDBInterface::insertConfigSet(), genParticles_cff::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_lumi_plots::weights.
Referenced by analyze(), writeWeightToRootFile(), and ~EcalDccWeightBuilder().
|
private |
Definition at line 480 of file EcalDccWeightBuilder.cc.
References popcon2dropbox::copy(), dbId(), encodedWeights_, Exception, l1t::stage2::layer2::fedId, FrontierConditions_GlobalTag_cff::file, genParticles_cff::map, rootOutputFileName_, lumiQTWidget::t, create_public_lumi_plots::weights, and writeWeightToDB().
Referenced by analyze(), and ~EcalDccWeightBuilder().
|
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().