40 .getParameter<std::vector<edm::InputTag>>(
"badPixelFEDChannelCollections");
46 .getUntrackedParameter<edm::InputTag>(
"pixelClusterLabel");
52 produces<SiPixelDetectorStatus, edm::Transition::EndLuminosityBlock>(
"siPixelStatus");
61 GlobalCache
const* iCache) {
66 auto returnValue = std::make_shared<SiPixelTopoFinder>();
68 returnValue->init(trackerGeometry, trackerTopology, cablingMap);
76 edm::LogInfo(
"SiPixelStatusProducer") <<
"beginRun: update the std::map for pixel geo/topo " << std::endl;
91 edm::LogInfo(
"SiPixelStatusProducer") <<
"beginlumi instance" << std::endl;
95 for (
unsigned int itDetId = 0; itDetId <
fDetIds_.size(); ++itDetId) {
107 edm::LogInfo(
"SiPixelStatusProducer") <<
"start cluster analyzer " << std::endl;
119 <<
" edmNew::DetSetVector<SiPixelCluster> " <<
fPixelClusterLabel_ <<
" does not exist!" << std::endl;
126 for (
const auto&
clusters : *hClusterColl) {
130 int colsperroc =
fSensors_[detid].second;
136 std::map<int, int> rocIds_detid;
143 const std::vector<SiPixelCluster::Pixel>& pixvector = clu.pixels();
144 for (
unsigned int i = 0;
i < pixvector.size(); ++
i) {
145 int mr0 = pixvector[
i].x;
146 int mc0 = pixvector[
i].y;
148 int irow = mr0 / rowsperroc;
149 int icol = mc0 / colsperroc;
152 if (rocIds_detid.find(
key) != rocIds_detid.end()) {
167 <<
" edmNew::DetSetVector<SiPixelCluster> " <<
fPixelClusterLabel_ <<
" is NOT Valid!" << std::endl;
177 if (!
iEvent.getByToken(tk, pixelFEDChannelCollectionHandle)) {
179 <<
" PixelFEDChannelCollection with index " << tk.index() <<
" does NOT exist!" << std::endl;
183 iEvent.getByToken(tk, pixelFEDChannelCollectionHandle);
184 if (!pixelFEDChannelCollectionHandle.
isValid()) {
186 <<
" PixelFEDChannelCollection with index " << tk.index() <<
" is NOT valid!" << std::endl;
191 std::map<int, std::vector<PixelFEDChannel>> tmpFEDerror25;
192 for (
const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
194 for (
const auto& ch : disabledChannels) {
196 int detid =
detId.rawId();
202 tmpFEDerror25[detid].push_back(ch);
211 std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
213 int detid = itFEDerror25->first;
214 if (tmpFEDerror25.find(detid) != tmpFEDerror25.end()) {
215 std::vector<PixelFEDChannel> chs = itFEDerror25->second;
216 std::vector<PixelFEDChannel> chs_tmp = tmpFEDerror25[detid];
218 std::vector<PixelFEDChannel> chs_common;
219 for (
unsigned int ich = 0; ich < chs.size(); ich++) {
222 for (
unsigned int ich_tmp = 0; ich_tmp < chs_tmp.size(); ich_tmp++) {
225 chs_common.push_back(ch);
231 if (chs_common.empty())
262 std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
265 int detid = itFEDerror25->first;
266 std::vector<PixelFEDChannel> chs = itFEDerror25->second;
267 for (
unsigned int ich = 0; ich < chs.size(); ich++) {
279 std::vector<SiPixelDetectorStatus>* siPixelDetectorStatusVtr)
const {
284 siPixelDetectorStatusVtr->push_back(
fDet_);
289 return int(icol + irow * nROCcolumns);
static std::shared_ptr< SiPixelTopoFinder > globalBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup, GlobalCache const *iCache)
void addModule(int detid, int nrocs)
std::map< int, std::pair< int, int > > fSensors_
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
badPixelFEDChannelCollectionLabels
std::vector< int > fDetIds_
edm::ESGetToken< SiPixelFedCablingMap, SiPixelFedCablingMapRcd > siPixelFedCablingMapToken_
void fillFEDerror25(int detid, PixelFEDChannel ch)
unsigned long int ftotalevents_
void fillDIGI(int detid, int roc)
~SiPixelStatusProducer() override
std::unordered_map< uint32_t, unsigned int > fFedIds_
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) final
SiPixelDetectorStatus fDet_
void setNevents(unsigned long int N)
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_
key
prepare the HTCondor submission files and eventually submit them
#define DEFINE_FWK_MODULE(type)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Log< level::Info, false > LogInfo
edm::InputTag fPixelClusterLabel_
std::map< int, std::vector< PixelFEDChannel > > fFEDerror25_
std::map< int, std::pair< int, int > > fSensorLayout_
void accumulate(edm::Event const &iEvent, edm::EventSetup const &iSetup) final
SiPixelStatusProducer(edm::ParameterSet const &iPSet, SiPixelStatusCache const *)
void beginRun(edm::Run const &, edm::EventSetup const &) final
void endLuminosityBlockSummary(edm::LuminosityBlock const &iLumi, edm::EventSetup const &, std::vector< SiPixelDetectorStatus > *siPixelDetectorStatusVtr) const final
std::map< int, std::map< int, int > > fRocIds_
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) final
virtual int indexROC(int irow, int icol, int nROCcolumns) final
Log< level::Warning, false > LogWarning