|
| SiStripNoisesFromDBMiscalibrator (const edm::ParameterSet &) |
|
| ~SiStripNoisesFromDBMiscalibrator () override |
|
| EDAnalyzer ()=default |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () final |
|
SerialTaskQueue * | globalRunsQueue () final |
|
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::vector< ModuleDescription const * > &modules, 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 |
|
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, hgcalDigitizer_cfi::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, 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>();
300 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>& DetInfos =
reader.getAllData();
302 std::vector<uint32_t> missingDetIds;
304 for (std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = DetInfos.begin();
305 it != DetInfos.end();
308 bool isMissing(
false);
310 for (
int t_strip = 0; t_strip < 128 * it->second.nApvs; ++t_strip) {
311 std::pair<uint32_t, int>
index = std::make_pair(it->first, t_strip);
313 if (theMap.find(
index) == theMap.end()) {
314 LogDebug(
"SiStripNoisesFromDBMiscalibrator") <<
"detid " << it->first <<
" \t"
315 <<
" strip " << t_strip <<
" \t"
316 <<
" not found" << std::endl;
319 obj->setData(theDefault, theSiStripVector);
323 obj->setData(
noise, theSiStripVector);
328 missingDetIds.push_back(it->first);
330 if (!
obj->put(it->first, theSiStripVector)) {
332 <<
"[SiStripNoisesFromDBMiscalibrator::analyze] detid already exists" << std::endl;
336 if (!missingDetIds.empty()) {
338 std::stringstream
name;
339 name <<
"missing_modules.txt";
341 if (!
ofile->is_open())
342 throw "cannot open output file!";
343 for (
const auto&
missing : missingDetIds) {
345 (*ofile) <<
missing <<
" " << 1 << std::endl;
References fp_, edm::FileInPath::fullPath(), LogDebug, combine::missing, missing_map, Skims_PA_cff::name, hgcalDigitizer_cfi::noise, getGTfromDQMFile::obj, indexGen::ofile, DQM::reader, and pileupReCalc_HLTpaths::trunc.
Referenced by analyze().