|
| SiStripNoisesFromDBMiscalibrator (const edm::ParameterSet &) |
|
| ~SiStripNoisesFromDBMiscalibrator () override |
|
| EDAnalyzer ()=default |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () final |
|
SerialTaskQueue * | globalRunsQueue () final |
|
bool | wantsGlobalLuminosityBlocks () const final |
|
bool | wantsGlobalRuns () 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 |
|
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> |
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) |
|
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 125 of file SiStripNoisesFromDBMiscalibrator.cc.
130 const auto*
const tTopo = tTopoHandle.
product();
143 std::map<sistripsummary::TrackerRegion, SiStripMiscalibrate::Smearings> mapOfSmearings;
149 bool m_doScale(thePSet.getParameter<
bool>(
"doScale"));
150 bool m_doSmear(thePSet.getParameter<
bool>(
"doSmear"));
151 double m_scaleFactor(thePSet.getParameter<
double>(
"scaleFactor"));
152 double m_smearFactor(thePSet.getParameter<
double>(
"smearFactor"));
155 params.setSmearing(m_doScale, m_doSmear, m_scaleFactor, m_smearFactor);
162 std::map<std::pair<uint32_t, int>,
float> theMap, oldPayloadMap;
164 std::vector<uint32_t> detid;
166 for (
const auto&
d : detid) {
176 for (
unsigned int j = 0;
j <
regions.size();
j++) {
177 bool checkRegion = (mapOfSmearings.count(
regions[
j]) != 0);
193 for (
int it = 0; it < (
range.second -
range.first) * 8 / 9; ++it) {
204 float smearedNoise = CLHEP::RandGauss::shoot(
noise,
params.m_smearFactor);
205 noise = smearedNoise;
215 std::unique_ptr<SiStripNoises> theSiStripNoises;
223 uint32_t cachedId(0);
227 for (
const auto& element : theMap) {
228 uint32_t
DetId = element.first.first;
229 int nstrip = element.first.second;
230 float new_noise = element.second;
231 float old_noise = oldPayloadMap[std::make_pair(
DetId, nstrip)];
234 if (cachedId != 0 &&
DetId != cachedId) {
247 noise_ratio.
add(new_noise / old_noise);
248 o_noise.
add(old_noise);
249 n_noise.
add(new_noise);
256 poolDbService->
writeOne(theSiStripNoises.get(), poolDbService->
currentTime(),
"SiStripNoisesRcd");
258 throw std::runtime_error(
"PoolDBService required.");
References SiStripMiscalibrate::Entry::add(), cond::service::PoolDBOutputService::currentTime(), ztail::d, spr::find(), edm::EventSetup::get(), get, SiStripNoises::getDetIds(), getNewObject(), getNewObject_withDefaults(), SiStripNoises::getNoise(), SiStripNoises::getRange(), SiStripMiscalibrate::getRegionFromString(), SiStripMiscalibrate::getRegionsFromDetId(), edm::Service< T >::isAvailable(), dqmiolumiharvest::j, m_fillDefaults, m_parameters, SiStripMiscalibrate::Entry::mean(), new_payload_map, hgcalDigitizer_cfi::noise, me0TriggerPseudoDigis_cff::nStrips, old_payload_map, CalibrationSummaryClient_cfi::params, edm::ESHandle< T >::product(), FastTimerService_cff::range, ratio_map, HLT_2018_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 294 of file SiStripNoisesFromDBMiscalibrator.cc.
296 std::unique_ptr<SiStripNoises>
obj = std::unique_ptr<SiStripNoises>(
new SiStripNoises());
299 const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>& DetInfos =
reader.getAllData();
301 std::vector<uint32_t> missingDetIds;
303 for (std::map<uint32_t, SiStripDetInfoFileReader::DetInfo>::const_iterator it = DetInfos.begin();
304 it != DetInfos.end();
307 bool isMissing(
false);
309 for (
int t_strip = 0; t_strip < 128 * it->second.nApvs; ++t_strip) {
310 std::pair<uint32_t, int>
index = std::make_pair(it->first, t_strip);
312 if (theMap.find(
index) == theMap.end()) {
313 LogDebug(
"SiStripNoisesFromDBMiscalibrator") <<
"detid " << it->first <<
" \t"
314 <<
" strip " << t_strip <<
" \t"
315 <<
" not found" << std::endl;
318 obj->setData(theDefault, theSiStripVector);
322 obj->setData(
noise, theSiStripVector);
327 missingDetIds.push_back(it->first);
329 if (!
obj->put(it->first, theSiStripVector)) {
331 <<
"[SiStripNoisesFromDBMiscalibrator::analyze] detid already exists" << std::endl;
335 if (!missingDetIds.empty()) {
337 std::stringstream
name;
338 name <<
"missing_modules.txt";
340 if (!
ofile->is_open())
341 throw "cannot open output file!";
342 for (
const auto&
missing : missingDetIds) {
344 (*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().