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;
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) {
173 DetId detId = (*it)->geographicalId();
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
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
uint16_t *__restrict__ id
TH2F * _TH2F_dead_modules_BPIX_lay2
const uint32_t printdebug_
#define DEFINE_FWK_MODULE(type)
const edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > badModuleFromDBToken
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
TH2F * _TH2F_dead_modules_FPIX_plusZ_disk1
const edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingToken
T * make(const Args &...args) const
make new ROOT object
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::string print(DetId detid) const
const std::string whichRcd
const Plane & surface() const
The nominal surface of the GeomDet.
const edm::ESGetToken< SiPixelQuality, SiPixelQualityRcd > badModuleToken
bool getData(T &iHolder) const
void analyze(const edm::Event &, const edm::EventSetup &) override
TH2F * _TH2F_dead_modules_FPIX_minusZ_disk2
Cos< T >::type cos(const T &t)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
TH2F * _TH2F_dead_modules_FPIX_minusZ_disk1
std::pair< float, float > const & phiSpan() const
const std::vector< disabledModuleType > getBadComponentList() const
bool IsModuleBad(const uint32_t &detid) const
const TrackerGeomDet * idToDet(DetId) const override
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tkTopoToken
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken
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
int diskName() const
disk id
SiPixelBadModuleReader(const edm::ParameterSet &)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
HalfCylinder halfCylinder() const
const PositionType & position() const
TH2F * _TH2F_dead_modules_BPIX_lay1