83 : conf_(conf), tkGeomToken_(
esConsumes()), SiPixelGainCalibrationService_(conf, consumesCollector()) {
94 unsigned int nmodules = 0;
95 uint32_t nchannels = 0;
101 edm::LogInfo(
"SiPixelCondObjReader") <<
"[SiPixelCondObjReader::beginJob] End Reading CondObjects" << std::endl;
105 edm::LogInfo(
"SiPixelCondObjReader") <<
" There are " << tkgeom->
dets().size() <<
" detectors" << std::endl;
112 "Summary_dead",
"Dead pixel fraction (0=dead, 1=alive)", vdetId_.size() + 1, 0, vdetId_.size() + 1);
114 "Dead pixel fraction (0=dead, 1=alive)",
119 "Summary_noisy",
"Noisy pixel fraction (0=noisy, 1=alive)", vdetId_.size() + 1, 0, vdetId_.size() + 1);
121 "Noisy pixel fraction (0=noisy, 1=alive)",
125 _TH1F_Gains_sum = fs->
make<TH1F>(
"Summary_Gain",
"Gain Summary", vdetId_.size() + 1, 0, vdetId_.size() + 1);
127 fs->
make<TH1F>(
"Summary_Pedestal",
"Pedestal Summary", vdetId_.size() + 1, 0, vdetId_.size() + 1);
135 TTree *
tree =
new TTree(
"tree",
"tree");
137 double gainmeanfortree, gainrmsfortree, pedmeanfortree, pedrmsfortree;
138 tree->Branch(
"detid", &detid,
"detid/I");
139 tree->Branch(
"ped_mean", &pedmeanfortree,
"ped_mean/D");
140 tree->Branch(
"ped_rms", &pedrmsfortree,
"ped_rms/D");
141 tree->Branch(
"gain_mean", &gainmeanfortree,
"gain_mean/D");
142 tree->Branch(
"gain_rms", &gainrmsfortree,
"gain_rms/D");
146 for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(); detid_iter != vdetId_.end();
150 sprintf(name,
"Pedestals_%d", detid);
152 sprintf(name,
"Gains_%d", detid);
155 DetId detIdObject(detid);
158 if (_PixelGeomDetUnit ==
nullptr) {
159 edm::LogError(
"SiPixelCondObjDisplay") <<
"[SiPixelCondObjReader::beginJob] the detID " << detid
160 <<
" doesn't seem to belong to Tracker" << std::endl;
174 int nrows = topol.
nrows();
176 float nchannelspermod = 0;
178 for (
int col_iter = 0; col_iter < ncols; col_iter++) {
179 for (
int row_iter = 0; row_iter < nrows; row_iter++) {
197 _TH1F_Gains_all->Fill(gain);
200 _TH1F_Gains_bpix->Fill(gain);
202 _TH1F_Gains_fpix->Fill(gain);
206 _TH1F_Pedestals_all->Fill(ped);
210 _TH1F_Pedestals_bpix->Fill(ped);
212 _TH1F_Pedestals_fpix->Fill(ped);
222 _TH1F_Noisy_sum->SetBinContent(ibin,
_noisyfrac_m[detid]);
224 _TH1F_Gains_sum->SetBinContent(ibin,
_TH1F_Gains_m[detid]->GetMean());
225 _TH1F_Gains_sum->SetBinError(ibin,
_TH1F_Gains_m[detid]->GetRMS());
234 <<
"DetId " << detid <<
" GainMean " << gainmeanfortree <<
" RMS " << gainrmsfortree <<
" PedMean "
235 << pedmeanfortree <<
" RMS " << pedrmsfortree << std::endl;
241 edm::LogInfo(
"SiPixelCondObjReader") <<
"[SiPixelCondObjReader::analyze] ---> PIXEL Modules " << nmodules
243 edm::LogInfo(
"SiPixelCondObjReader") <<
"[SiPixelCondObjReader::analyze] ---> PIXEL Channels " << nchannels
246 edm::LogPrint(
"SiPixelCondObjReader") <<
" ---> SUMMARY :" << std::endl;
247 edm::LogPrint(
"SiPixelCondObjReader") <<
"Encounted " << ndead <<
" dead pixels" << std::endl;
248 edm::LogPrint(
"SiPixelCondObjReader") <<
"Encounted " << nnoisy <<
" noisy pixels" << std::endl;
250 <<
"The Gain Mean is " << _TH1F_Gains_all->GetMean() <<
" with rms " << _TH1F_Gains_all->GetRMS() << std::endl;
251 edm::LogPrint(
"SiPixelCondObjReader") <<
" in BPIX " << _TH1F_Gains_bpix->GetMean() <<
" with rms "
252 << _TH1F_Gains_bpix->GetRMS() << std::endl;
253 edm::LogPrint(
"SiPixelCondObjReader") <<
" in FPIX " << _TH1F_Gains_fpix->GetMean() <<
" with rms "
254 << _TH1F_Gains_fpix->GetRMS() << std::endl;
255 edm::LogPrint(
"SiPixelCondObjReader") <<
"The Ped Mean is " << _TH1F_Pedestals_all->GetMean() <<
" with rms "
256 << _TH1F_Pedestals_all->GetRMS() << std::endl;
257 edm::LogPrint(
"SiPixelCondObjReader") <<
" in BPIX " << _TH1F_Pedestals_bpix->GetMean() <<
" with rms "
258 << _TH1F_Pedestals_bpix->GetRMS() << std::endl;
259 edm::LogPrint(
"SiPixelCondObjReader") <<
" in FPIX " << _TH1F_Pedestals_fpix->GetMean() <<
" with rms "
260 << _TH1F_Pedestals_fpix->GetRMS() << std::endl;
static const std::string kSharedResource
TH1F * _TH1F_Pedestals_sum
T getUntrackedParameter(std::string const &, T const &) const
TH1F * _TH1F_Pedestals_fpix
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual int ncolumns() const =0
#define DEFINE_FWK_MODULE(type)
std::vector< uint32_t > getDetIds() override
std::map< uint32_t, double > _noisyfrac_m
virtual int nrows() const =0
T * make(const Args &...args) const
make new ROOT object
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Log< level::Error, false > LogError
bool getData(T &iHolder) const
float getGain(const uint32_t &detID, const int &col, const int &row) override
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
SiPixelCondObjReader(const edm::ParameterSet &iConfig)
void setESObjects(const edm::EventSetup &es) override
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
T * make(const Args &...args) const
make new ROOT object
Log< level::Warning, true > LogPrint
std::map< uint32_t, TH1F * > _TH1F_Gains_m
Log< level::Info, false > LogInfo
TH1F * _TH1F_Pedestals_bpix
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
~SiPixelCondObjReader() override=default
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
TH1F * _TH1F_Pedestals_all
std::map< uint32_t, TH1F * > _TH1F_Pedestals_m
float getPedestal(const uint32_t &detID, const int &col, const int &row) override
std::map< uint32_t, double > _deadfrac_m
bool isDead(const uint32_t &detID, const int &col, const int &row) override
void analyze(const edm::Event &, const edm::EventSetup &) override
SiPixelGainCalibrationService SiPixelGainCalibrationService_
bool isNoisy(const uint32_t &detID, const int &col, const int &row) override