79 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 1)),
80 whichRcd(iConfig.getUntrackedParameter<
std::
string>(
"RcdName")) {
89 if (
whichRcd ==
"SiPixelQualityRcd") {
91 }
else if (
whichRcd ==
"SiPixelQualityFromDbRcd") {
94 throw cms::Exception(
"LogicalError") <<
"SiPixelBadModuleReader::analyze, unsupported RcdName value " <<
whichRcd 95 <<
".\n Please check the configuration." << std::endl;
99 edm::LogInfo(
"SiPixelBadModuleReader") <<
"[SiPixelBadModuleReader::analyze] End Reading SiPixelBadModule" 107 fs->make<TH2F>(
"dead_modules_BPIX_lay1",
"Dead modules in BPIX Layer 1", 112, -28., 28., 100, -3.2, 3.2);
109 fs->make<TH2F>(
"dead_modules_BPIX_lay2",
"Dead modules in BPIX Layer 2", 112, -28., 28., 100, -3.2, 3.2);
111 fs->make<TH2F>(
"dead_modules_BPIX_lay3",
"Dead modules in BPIX Layer 3", 112, -28., 28., 100, -3.2, 3.2);
113 fs->make<TH2F>(
"dead_modules_minusZ_disk1",
"Dead modules in FPIX minus Z disk 1", 80, -18., 18., 80, -18., 18.);
115 fs->make<TH2F>(
"dead_modules_minusZ_disk2",
"Dead modules in FPIX minus Z disk 2", 80, -18., 18., 80, -18., 18.);
117 fs->make<TH2F>(
"dead_modules_plusZ_disk1",
"Dead modules in FPIX plus Z disk 1", 80, -18., 18., 80, -18., 18.);
119 fs->make<TH2F>(
"dead_modules_plusZ_disk2",
"Dead modules in BPIX plus Z disk 2", 80, -18, 18., 80, -18., 18.);
121 gStyle->SetPalette(1);
123 std::vector<SiPixelQuality::disabledModuleType> disabledModules = SiPixelBadModule_->
getBadComponentList();
126 std::ofstream debugout(
"BadModuleDebug.txt");
127 debugout <<
"Values stored in DB, in human readable form: " << std::endl;
128 for (
size_t id = 0;
id < disabledModules.size();
id++) {
140 errorstring =
"whole";
142 errorstring =
"tbmA";
144 errorstring =
"tbmB";
146 errorstring =
"none";
148 debugout <<
" " << std::endl;
149 debugout <<
" " << std::endl;
150 debugout <<
"DetID: " << badmodule.
DetID <<
" and this has an error type of '" << errorstring <<
"'" << std::endl;
151 debugout <<
"The bad ROCs are: " << std::endl;
152 for (
unsigned short n = 0;
n < 16;
n++) {
153 unsigned short mask = 1 <<
n;
155 debugout <<
n <<
", ";
157 debugout << std::endl;
158 debugout << ttopo.
print(badmodule.
DetID) << std::endl;
159 const auto &plane =
geom->idToDet(badmodule.
DetID)->surface();
160 debugout <<
"phiSpan " << plane.phiSpan().first <<
"," << plane.phiSpan().second << std::endl;
161 debugout <<
"rSpan " << plane.rSpan().first <<
"," << plane.rSpan().second << std::endl;
162 debugout <<
"zSpan " << plane.zSpan().first <<
"," << plane.zSpan().second << std::endl;
163 debugout <<
" " << std::endl;
164 debugout <<
" " << std::endl;
171 for (TrackerGeometry::DetContainer::const_iterator it =
geom->dets().begin(); it !=
geom->dets().end(); it++) {
172 if (dynamic_cast<PixelGeomDetUnit const *>((*it)) !=
nullptr) {
174 uint32_t
id =
detId();
183 float detX = detR *
cos(detPhi);
184 float detY = detR *
sin(detPhi);
301 std::ofstream txtout(
"BadModuleSummary.txt");
302 txtout <<
"The total number of modules is: " << nmodules << std::endl;
303 txtout <<
"The total number of completely dead modules is: " << nbadmodules << std::endl;
304 txtout <<
"The total number of partially dead modules is: " << npartialbad << std::endl;
static const std::string kSharedResource
~SiPixelBadModuleReader() override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
TH2F * _TH2F_dead_modules_BPIX_lay2
const uint32_t printdebug_
Geom::Phi< T > phi() const
std::string print(DetId detid) const
const edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > badModuleFromDBToken
Sin< T >::type sin(const T &t)
TH2F * _TH2F_dead_modules_FPIX_plusZ_disk1
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingToken
bool IsModuleBad(const uint32_t &detid) const
const std::string whichRcd
const edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > badModuleToken
void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< disabledModuleType > getBadComponentList() const
TH2F * _TH2F_dead_modules_FPIX_minusZ_disk2
int diskName() const
disk id
HalfCylinder halfCylinder() const
Cos< T >::type cos(const T &t)
TH2F * _TH2F_dead_modules_FPIX_minusZ_disk1
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken
const Plane & surface() const
The nominal surface of the GeomDet.
const PositionType & position() const
TH2F * _TH2F_dead_modules_FPIX_plusZ_disk2
int layerName() const
layer id
short getBadRocs(const uint32_t &detid) const
TH2F * _TH2F_dead_modules_BPIX_lay3
SiPixelBadModuleReader(const edm::ParameterSet &)
TH2F * _TH2F_dead_modules_BPIX_lay1