37 printdebug_(
p.getUntrackedParameter<
bool>(
"printDebug",
true)) {
38 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker")
39 <<
"SiPixelBadFEDChannelSimulationSanityChecker" << std::endl;
43 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker")
44 <<
"~SiPixelBadFEDChannelSimulationSanityChecker " << std::endl;
48 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker")
49 <<
"### SiPixelBadFEDChannelSimulationSanityChecker::analyze ###" << std::endl;
50 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker") <<
" I AM IN RUN NUMBER " <<
e.id().run() << std::endl;
51 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker") <<
" ---EVENT NUMBER " <<
e.id().event() << std::endl;
57 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker") <<
"Record \"SiPixelStatusScenariosRcd" 58 <<
"\" does not exist " << std::endl;
69 edm::LogWarning(
"SiPixelQualityProbabilitiesTestReader") <<
"Record \"SiPixelStatusScenarioProbabilityRcd>" 70 <<
"\" does not exist " << std::endl;
80 std::vector<std::string> allScenariosInProb;
82 for (
auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
84 for (
const auto&
entry : it->second) {
86 auto probability =
entry.second;
87 if (probability != 0) {
88 if (
std::find(allScenariosInProb.begin(), allScenariosInProb.end(),
scenario) == allScenariosInProb.end()) {
89 allScenariosInProb.push_back(
scenario);
103 std::copy_if(allScenariosInProb.begin(),
104 allScenariosInProb.end(),
107 return (
std::find(allScenarios.begin(), allScenarios.end(),
arg) == allScenarios.end());
113 <<
"Pretty worrying! the scenario: " <<
entry <<
" is not found in the map!!" << std::endl;
116 edm::LogVerbatim(
"SiPixelBadFEDChannelSimulationSanityChecker") <<
" This scenario is found in: " << std::endl;
117 for (
auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
118 int PUbin = it->first;
120 for (
const auto& pair : it->second) {
121 if (pair.first ==
entry) {
123 <<
" - PU bin " << PUbin <<
" with probability: " << pair.second << std::endl;
129 <<
"==============================================" << std::endl;
133 <<
" ====> A total of " <<
notFound.size() <<
" scenarios are not found in the map!" << std::endl;
137 <<
"=================================================================================" << std::endl;
138 edm::LogInfo(
"SiPixelBadFEDChannelSimulationSanityChecker")
139 <<
" All scenarios in probability record are found in the scenario map, (all is good)!" << std::endl;
141 <<
"=================================================================================" << std::endl;
147 desc.setComment(
"Tries sanity of Pixel Stuck TBM simulation");
148 desc.addUntracked<
bool>(
"printDebug",
true);
149 descriptions.
add(
"SiPixelBadFEDChannelSimulationSanityChecker",
desc);
const TypeTag & type() const
Log< level::Info, true > LogVerbatim
const edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd > siPixelBadFEDChToken_
std::map< unsigned int, probabilityVec > probabilityMap
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
const SiPixelBadFEDChannelsScenarioMap & getScenarioMap() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const edm::ESGetToken< SiPixelQualityProbabilities, SiPixelStatusScenarioProbabilityRcd > siPixelQPToken_
#define DEFINE_FWK_MODULE(type)
~SiPixelBadFEDChannelSimulationSanityChecker() override
Log< level::Info, false > LogInfo
const probabilityMap & getProbability_Map() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static const GlobalPoint notFound(0, 0, 0)
std::vector< std::string > getScenarioList() const
heterocontainer::HCTypeTag TypeTag
SiPixelBadFEDChannelSimulationSanityChecker(edm::ParameterSet const &p)
std::unordered_map< std::string, SiPixelFEDChannelCollection > SiPixelBadFEDChannelsScenarioMap
Log< level::Warning, false > LogWarning
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag