|
| SiStripNoisesFromDBMiscalibrator (const edm::ParameterSet &) |
|
| ~SiStripNoisesFromDBMiscalibrator () override |
|
| EDAnalyzer ()=default |
|
| EDAnalyzer (const EDAnalyzer &)=delete |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () final |
|
SerialTaskQueue * | globalRunsQueue () final |
|
const EDAnalyzer & | operator= (const EDAnalyzer &)=delete |
|
bool | wantsGlobalLuminosityBlocks () const final |
|
bool | wantsGlobalRuns () const final |
|
bool | wantsInputProcessBlocks () const final |
|
bool | wantsProcessBlocks () const final |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
| EDAnalyzerBase () |
|
ModuleDescription const & | moduleDescription () const |
|
bool | wantsStreamLuminosityBlocks () const |
|
bool | wantsStreamRuns () const |
|
| ~EDAnalyzerBase () override |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
ESProxyIndex const * | esGetTokenIndices (edm::Transition iTrans) const |
|
std::vector< ESProxyIndex > const & | esGetTokenIndicesVector (edm::Transition iTrans) const |
|
std::vector< ESRecordIndex > const & | esGetTokenRecordIndicesVector (edm::Transition iTrans) const |
|
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
|
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
|
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
|
void | modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
void | selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase) |
|
ProductResolverIndexAndSkipBit | uncheckedIndexFrom (EDGetToken) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
void | updateLookup (eventsetup::ESRecordsToProxyIndices const &) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
typedef EDAnalyzerBase | ModuleType |
|
typedef ProductLabels | Labels |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
|
template<BranchType B = InEvent> |
EDConsumerBaseAdaptor< B > | consumes (edm::InputTag tag) noexcept |
|
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<Transition Tr = Transition::Event> |
constexpr auto | esConsumes () noexcept |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes (ESInputTag const &tag) |
|
template<Transition Tr = Transition::Event> |
auto | esConsumes (ESInputTag tag) noexcept |
|
template<Transition Tr = Transition::Event> |
ESGetTokenGeneric | esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey) |
| Used with EventSetupRecord::doGet. More...
|
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
Description: Class to miscalibrate a SiStrip Noise payload from Database
Implementation: Read a SiStrip Noise payload from DB (either central DB or sqlite file) and apply a miscalibration (either an offset / gaussian smearing or both) returns a local sqlite file with the same since of the original payload
Definition at line 51 of file SiStripNoisesFromDBMiscalibrator.cc.
Implements edm::one::EDAnalyzerBase.
Definition at line 129 of file SiStripNoisesFromDBMiscalibrator.cc.
145 std::map<sistripsummary::TrackerRegion, SiStripMiscalibrate::Smearings> mapOfSmearings;
151 bool m_doScale(thePSet.getParameter<
bool>(
"doScale"));
152 bool m_doSmear(thePSet.getParameter<
bool>(
"doSmear"));
153 double m_scaleFactor(thePSet.getParameter<
double>(
"scaleFactor"));
154 double m_smearFactor(thePSet.getParameter<
double>(
"smearFactor"));
157 params.setSmearing(m_doScale, m_doSmear, m_scaleFactor, m_smearFactor);
163 std::map<std::pair<uint32_t, int>,
float> theMap, oldPayloadMap;
165 std::vector<uint32_t> detid;
166 stripNoises.getDetIds(detid);
167 for (
const auto&
d : detid) {
177 for (
unsigned int j = 0;
j <
regions.size();
j++) {
178 bool checkRegion = (mapOfSmearings.count(
regions[
j]) != 0);
194 for (
int it = 0; it < (
range.second -
range.first) * 8 / 9; ++it) {
205 float smearedNoise = CLHEP::RandGauss::shoot(
noise,
params.m_smearFactor);
206 noise = smearedNoise;
216 std::unique_ptr<SiStripNoises> theSiStripNoises;
224 uint32_t cachedId(0);
228 for (
const auto& element : theMap) {
229 uint32_t
DetId = element.first.first;
230 int nstrip = element.first.second;
231 float new_noise = element.second;
232 float old_noise = oldPayloadMap[std::make_pair(
DetId, nstrip)];
235 if (cachedId != 0 &&
DetId != cachedId) {
248 noise_ratio.
add(new_noise / old_noise);
249 o_noise.
add(old_noise);
250 n_noise.
add(new_noise);
257 poolDbService->
writeOne(theSiStripNoises.get(), poolDbService->
currentTime(),
"SiStripNoisesRcd");
259 throw std::runtime_error(
"PoolDBService required.");
References SiStripMiscalibrate::Entry::add(), cond::service::PoolDBOutputService::currentTime(), ztail::d, spr::find(), edm::EventSetup::getData(), getNewObject(), getNewObject_withDefaults(), SiStripMiscalibrate::getRegionFromString(), SiStripMiscalibrate::getRegionsFromDetId(), edm::Service< T >::isAvailable(), dqmiolumiharvest::j, m_fillDefaults, m_noiseToken, m_parameters, m_tTopoToken, SiStripMiscalibrate::Entry::mean(), new_payload_map, gpuVertexFinder::noise, me0TriggerPseudoDigis_cff::nStrips, old_payload_map, CalibrationSummaryClient_cfi::params, FastTimerService_cff::range, ratio_map, HLT_FULL_cff::region, SiStripMiscalibrate::Entry::reset(), scale_map, smear_map, jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().
std::unique_ptr< SiStripNoises > SiStripNoisesFromDBMiscalibrator::getNewObject_withDefaults |
( |
const std::map< std::pair< uint32_t, int >, float > & |
theMap, |
|
|
const float |
theDefault |
|
) |
| |
|
private |
Definition at line 295 of file SiStripNoisesFromDBMiscalibrator.cc.
297 std::unique_ptr<SiStripNoises>
obj = std::make_unique<SiStripNoises>();
299 std::vector<uint32_t> missingDetIds;
303 bool isMissing(
false);
305 for (
int t_strip = 0; t_strip < 128 * it.second.nApvs; ++t_strip) {
306 std::pair<uint32_t, int>
index = std::make_pair(it.first, t_strip);
308 if (theMap.find(
index) == theMap.end()) {
309 LogDebug(
"SiStripNoisesFromDBMiscalibrator") <<
"detid " << it.first <<
" \t"
310 <<
" strip " << t_strip <<
" \t"
311 <<
" not found" << std::endl;
314 obj->setData(theDefault, theSiStripVector);
318 obj->setData(
noise, theSiStripVector);
323 missingDetIds.push_back(it.first);
325 if (!
obj->put(it.first, theSiStripVector)) {
327 <<
"[SiStripNoisesFromDBMiscalibrator::analyze] detid already exists" << std::endl;
331 if (!missingDetIds.empty()) {
333 std::stringstream
name;
334 name <<
"missing_modules.txt";
336 if (!ofile->is_open())
337 throw "cannot open output file!";
338 for (
const auto&
missing : missingDetIds) {
340 (*ofile) <<
missing <<
" " << 1 << std::endl;
References fp_, edm::FileInPath::fullPath(), LogDebug, combine::missing, missing_map, Skims_PA_cff::name, gpuVertexFinder::noise, getGTfromDQMFile::obj, SiStripDetInfoFileReader::read(), and pileupReCalc_HLTpaths::trunc.
Referenced by analyze().