CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SiPixelStatusProducer Class Reference

#include <SiPixelStatusProducer.h>

Inheritance diagram for SiPixelStatusProducer:
edm::stream::EDProducer< edm::GlobalCache< SiPixelStatusCache >, edm::RunCache< SiPixelTopoFinder >, edm::LuminosityBlockSummaryCache< std::vector< SiPixelDetectorStatus > >, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void accumulate (edm::Event const &iEvent, edm::EventSetup const &iSetup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &iLumi, edm::EventSetup const &, std::vector< SiPixelDetectorStatus > *siPixelDetectorStatusVtr) const final
 
 SiPixelStatusProducer (edm::ParameterSet const &iPSet, SiPixelStatusCache const *)
 
 ~SiPixelStatusProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< SiPixelStatusCache >, edm::RunCache< SiPixelTopoFinder >, edm::LuminosityBlockSummaryCache< std::vector< SiPixelDetectorStatus > >, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static std::shared_ptr< std::vector< SiPixelDetectorStatus > > globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< SiPixelTopoFinderglobalBeginRun (edm::Run const &iRun, edm::EventSetup const &iSetup, GlobalCache const *iCache)
 
static void globalEndJob (SiPixelStatusCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &iLumi, edm::EventSetup const &, LuminosityBlockContext const *iContext, std::vector< SiPixelDetectorStatus > const *siPixelDetectorStatusVtr)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *iContext, std::vector< SiPixelDetectorStatus > *)
 
static void globalEndRun (edm::Run const &iRun, edm::EventSetup const &, RunContext const *iContext)
 
static std::unique_ptr< SiPixelStatusCacheinitializeGlobalCache (edm::ParameterSet const &iPSet)
 

Private Member Functions

virtual int indexROC (int irow, int icol, int nROCcolumns) final
 

Private Attributes

int beginLumi_
 
int beginRun_
 
int endLumi_
 
int endRun_
 
SiPixelDetectorStatus fDet_
 
std::vector< int > fDetIds_
 
std::map< int, std::vector< PixelFEDChannel > > fFEDerror25_
 
std::unordered_map< uint32_t, unsigned int > fFedIds_
 
edm::InputTag fPixelClusterLabel_
 
std::map< int, std::map< int, int > > fRocIds_
 
std::map< int, std::pair< int, int > > fSensorLayout_
 
std::map< int, std::pair< int, int > > fSensors_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_
 
unsigned long int ftotalevents_
 
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
 

Static Private Attributes

static const bool debug_ = false
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< SiPixelStatusCache >, edm::RunCache< SiPixelTopoFinder >, edm::LuminosityBlockSummaryCache< std::vector< SiPixelDetectorStatus > >, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 63 of file SiPixelStatusProducer.h.

Constructor & Destructor Documentation

◆ SiPixelStatusProducer()

SiPixelStatusProducer::SiPixelStatusProducer ( edm::ParameterSet const &  iPSet,
SiPixelStatusCache const *  iCache 
)

Definition at line 30 of file SiPixelStatusProducer.cc.

References HLT_2024v14_cff::badPixelFEDChannelCollectionLabels, fPixelClusterLabel_, fSiPixelClusterToken_, edm::ParameterSet::getParameter(), SiPixelStatusCache::siPixelFedCablingMapToken_, submitPVValidationJobs::t, theBadPixelFEDChannelsTokens_, SiPixelStatusCache::trackerGeometryToken_, and SiPixelStatusCache::trackerTopologyToken_.

30  {
31  //NOTE: Token for all stream replicas are identical and constructors for the replicas are called
32  // sequentially so there is no race condition.
33  iCache->trackerGeometryToken_ = esConsumes<edm::Transition::BeginRun>();
34  iCache->trackerTopologyToken_ = esConsumes<edm::Transition::BeginRun>();
35  iCache->siPixelFedCablingMapToken_ = esConsumes<edm::Transition::BeginRun>();
36 
37  /* badPixelFEDChannelCollections */
38  std::vector<edm::InputTag> badPixelFEDChannelCollectionLabels =
39  iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
40  .getParameter<std::vector<edm::InputTag>>("badPixelFEDChannelCollections");
42  theBadPixelFEDChannelsTokens_.push_back(consumes<PixelFEDChannelCollection>(t));
43 
44  /* pixel clusters */
45  fPixelClusterLabel_ = iConfig.getParameter<edm::ParameterSet>("SiPixelStatusProducerParameters")
46  .getUntrackedParameter<edm::InputTag>("pixelClusterLabel");
47  fSiPixelClusterToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(fPixelClusterLabel_);
48 
49  //debug_ = iConfig.getUntrackedParameter<bool>("debug");
50 
51  /* register products */
52  produces<SiPixelDetectorStatus, edm::Transition::EndLuminosityBlock>("siPixelStatus");
53 }
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_

◆ ~SiPixelStatusProducer()

SiPixelStatusProducer::~SiPixelStatusProducer ( )
override

Definition at line 55 of file SiPixelStatusProducer.cc.

55 {}

Member Function Documentation

◆ accumulate()

void SiPixelStatusProducer::accumulate ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
final

Definition at line 106 of file SiPixelStatusProducer.cc.

References bsc_activity_cfg::clusters, hcalRecHitTable_cff::detId, ALCARECOPPSCalTrackBasedSel_cff::detid, fDet_, PixelFEDChannel::fed, fFEDerror25_, SiPixelDetectorStatus::fillDIGI(), fPixelClusterLabel_, fRocIds_, fSensorLayout_, fSensors_, fSiPixelClusterToken_, ftotalevents_, mps_fire::i, iEvent, indexROC(), edm::HandleBase::isValid(), submitPVResolutionJobs::key, PixelFEDChannel::link, PixelMapPlotter::roc, and theBadPixelFEDChannelsTokens_.

106  {
107  edm::LogInfo("SiPixelStatusProducer") << "start cluster analyzer " << std::endl;
108 
109  /* count number of events for the current module instance in the luminosityBlock */
110  ftotalevents_++;
111 
112  /* ----------------------------------------------------------------------
113  -- Pixel cluster analysis
114  ----------------------------------------------------------------------*/
115 
117  if (!iEvent.getByToken(fSiPixelClusterToken_, hClusterColl)) {
118  edm::LogWarning("SiPixelStatusProducer")
119  << " edmNew::DetSetVector<SiPixelCluster> " << fPixelClusterLabel_ << " does not exist!" << std::endl;
120  return;
121  }
122 
123  iEvent.getByToken(fSiPixelClusterToken_, hClusterColl);
124 
125  if (hClusterColl.isValid()) {
126  for (const auto& clusters : *hClusterColl) { /*loop over different clusters in a clusters vector (module)*/
127  for (const auto& clu : clusters) { /*loop over cluster in a given detId (module)*/
128  int detid = clusters.detId();
129  int rowsperroc = fSensors_[detid].first;
130  int colsperroc = fSensors_[detid].second;
131 
132  //int nROCrows = fSensorLayout_[detid].first;
133  int nROCcolumns = fSensorLayout_[detid].second;
134 
135  int roc(-1);
136  std::map<int, int> rocIds_detid;
137  if (fRocIds_.find(detid) != fRocIds_.end()) {
138  rocIds_detid = fRocIds_[detid];
139  }
140 
141  /* A module is made with a few ROCs
142  Need to convert global row/column (on a module) to local row/column (on a ROC) */
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; /* constant column direction is along x-axis */
146  int mc0 = pixvector[i].y; /* constant row direction is along y-axis */
147 
148  int irow = mr0 / rowsperroc;
149  int icol = mc0 / colsperroc;
150 
151  int key = indexROC(irow, icol, nROCcolumns);
152  if (rocIds_detid.find(key) != rocIds_detid.end()) {
153  roc = rocIds_detid[key];
154  }
155 
157 
158  } /* loop over pixels in a cluster */
159 
160  } /* loop over cluster in a detId (module) */
161 
162  } /* loop over detId-grouped clusters in cluster detId-grouped clusters-vector* */
163 
164  } /* hClusterColl.isValid() */
165  else {
166  edm::LogWarning("SiPixelStatusProducer")
167  << " edmNew::DetSetVector<SiPixelCluster> " << fPixelClusterLabel_ << " is NOT Valid!" << std::endl;
168  }
169 
170  /*|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
171 
172  /* FEDerror25 per-ROC per-event */
173  edm::Handle<PixelFEDChannelCollection> pixelFEDChannelCollectionHandle;
174 
175  /* look over different resouces of tokens */
177  if (!iEvent.getByToken(tk, pixelFEDChannelCollectionHandle)) {
178  edm::LogWarning("SiPixelStatusProducer")
179  << " PixelFEDChannelCollection with index " << tk.index() << " does NOT exist!" << std::endl;
180  continue;
181  }
182 
183  iEvent.getByToken(tk, pixelFEDChannelCollectionHandle);
184  if (!pixelFEDChannelCollectionHandle.isValid()) {
185  edm::LogWarning("SiPixelStatusProducer")
186  << " PixelFEDChannelCollection with index " << tk.index() << " is NOT valid!" << std::endl;
187  continue;
188  }
189 
190  /* FEDerror channels for the current events */
191  std::map<int, std::vector<PixelFEDChannel>> tmpFEDerror25;
192  for (const auto& disabledChannels : *pixelFEDChannelCollectionHandle) {
193  /* loop over different PixelFED in a PixelFED vector (module) */
194  for (const auto& ch : disabledChannels) {
195  DetId detId = disabledChannels.detId();
196  int detid = detId.rawId();
197 
198  if (ftotalevents_ == 1) {
199  /* FEDerror25 channels for the "first" event in the lumi section (first for the current instance of the module) */
200  fFEDerror25_[detid].push_back(ch);
201  } else
202  tmpFEDerror25[detid].push_back(ch);
203 
204  } /* loop over different PixelFED in a PixelFED vector (different channel for a module) */
205 
206  } /* loop over different (different DetId) PixelFED vectors in PixelFEDChannelCollection */
207 
208  /* Compare the current FEDerror list with the first event's FEDerror list
209  * and save the common channels */
210  if (!tmpFEDerror25.empty() && !fFEDerror25_.empty()) {
211  std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
212  for (itFEDerror25 = fFEDerror25_.begin(); itFEDerror25 != fFEDerror25_.end(); 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];
217 
218  std::vector<PixelFEDChannel> chs_common;
219  for (unsigned int ich = 0; ich < chs.size(); ich++) {
220  PixelFEDChannel ch = chs[ich];
221  /* loop over the current FEDerror25 channels, save the common FED channels */
222  for (unsigned int ich_tmp = 0; ich_tmp < chs_tmp.size(); ich_tmp++) {
223  PixelFEDChannel ch_tmp = chs_tmp[ich_tmp];
224  if ((ch.fed == ch_tmp.fed) && (ch.link == ch_tmp.link)) { /* the same FED channel */
225  chs_common.push_back(ch);
226  break;
227  }
228  }
229  }
230  /* remove the full module from FEDerror25 list if no common channels are left */
231  if (chs_common.empty())
232  fFEDerror25_.erase(itFEDerror25);
233  /* otherwise replace with the common channels */
234  else {
235  fFEDerror25_[detid].clear();
236  fFEDerror25_[detid] = chs_common;
237  }
238  } else { /* remove the full module from FEDerror25 list if the module doesn't appear in the current event's FEDerror25 list */
239  fFEDerror25_.erase(itFEDerror25);
240  }
241 
242  } /* loop over modules that have FEDerror25 in the first event in the lumi section */
243 
244  } /* non-empty FEDerror lists */
245 
246  } /* look over different resouces of takens */
247 
248  /* Caveat
249  no per-event collection put into iEvent
250  If use produce() function and no collection is put into iEvent, produce() will not run in unScheduled mode
251  Now since CMSSW_10_1_X, the accumulate() function will run whatsoever in the unScheduled mode
252  Accumulate() is NOT available for releases BEFORE CMSSW_10_1_X */
253 }
std::map< int, std::pair< int, int > > fSensors_
unsigned int fed
unsigned long int ftotalevents_
unsigned int link
void fillDIGI(int detid, int roc)
int iEvent
Definition: GenABIO.cc:224
SiPixelDetectorStatus fDet_
std::vector< edm::EDGetTokenT< PixelFEDChannelCollection > > theBadPixelFEDChannelsTokens_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fSiPixelClusterToken_
key
prepare the HTCondor submission files and eventually submit them
Log< level::Info, false > LogInfo
std::map< int, std::vector< PixelFEDChannel > > fFEDerror25_
Definition: DetId.h:17
std::map< int, std::pair< int, int > > fSensorLayout_
bool isValid() const
Definition: HandleBase.h:70
std::map< int, std::map< int, int > > fRocIds_
virtual int indexROC(int irow, int icol, int nROCcolumns) final
Log< level::Warning, false > LogWarning

◆ beginLuminosityBlock()

void SiPixelStatusProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
final

Definition at line 90 of file SiPixelStatusProducer.cc.

References SiPixelDetectorStatus::addModule(), ALCARECOPPSCalTrackBasedSel_cff::detid, fDet_, fDetIds_, fFEDerror25_, fSensorLayout_, ftotalevents_, and DeadROCCounter::nrocs.

90  {
91  edm::LogInfo("SiPixelStatusProducer") << "beginlumi instance" << std::endl;
92 
93  /* initialize fDet_ with a set of modules(detIds) and clean the fFEDerror25_ */
95  for (unsigned int itDetId = 0; itDetId < fDetIds_.size(); ++itDetId) {
96  int detid = fDetIds_[itDetId];
97  int nrocs = fSensorLayout_[detid].first * fSensorLayout_[detid].second;
98 
100  }
101 
102  fFEDerror25_.clear();
103  ftotalevents_ = 0;
104 }
void addModule(int detid, int nrocs)
std::vector< int > fDetIds_
unsigned long int ftotalevents_
SiPixelDetectorStatus fDet_
Log< level::Info, false > LogInfo
std::map< int, std::vector< PixelFEDChannel > > fFEDerror25_
std::map< int, std::pair< int, int > > fSensorLayout_

◆ beginRun()

void SiPixelStatusProducer::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
final

Definition at line 72 of file SiPixelStatusProducer.cc.

References fDetIds_, fFedIds_, fRocIds_, fSensorLayout_, and fSensors_.

72  {
73  /*Is it good to pass the objects stored in runCache to set class private members values *
74  or just call runCahche every time in the calss function?*/
75 
76  edm::LogInfo("SiPixelStatusProducer") << "beginRun: update the std::map for pixel geo/topo " << std::endl;
77  /* update the std::map for pixel geo/topo */
78  /* vector of all <int> detIds */
79  fDetIds_ = runCache()->getDetIds(); //getDetIds();
80  /* ROC size (number of row, number of columns for each det id) */
81  fSensors_ = runCache()->getSensors();
82  /* the roc layout on a module */
83  fSensorLayout_ = runCache()->getSensorLayout();
84  /* fedId as a function of detId */
85  fFedIds_ = runCache()->getFedIds();
86  /* map the index ROC to rocId */
87  fRocIds_ = runCache()->getRocIds();
88 }
std::map< int, std::pair< int, int > > fSensors_
std::vector< int > fDetIds_
std::unordered_map< uint32_t, unsigned int > fFedIds_
Log< level::Info, false > LogInfo
std::map< int, std::pair< int, int > > fSensorLayout_
std::map< int, std::map< int, int > > fRocIds_

◆ endLuminosityBlock()

void SiPixelStatusProducer::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
final

Definition at line 255 of file SiPixelStatusProducer.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, fDet_, fFEDerror25_, SiPixelDetectorStatus::fillFEDerror25(), ftotalevents_, and SiPixelDetectorStatus::setNevents().

255  {
256  /* set total number of events through ftotalevents_ */
258 
259  if (ftotalevents_ > 0) {
260  /* Add FEDerror25 information into SiPixelDetectorStatus fDet_ for FED channels stored in fFEDerror25_ */
261  if (!fFEDerror25_.empty()) { // non-empty FEDerror25
262  std::map<int, std::vector<PixelFEDChannel>>::iterator itFEDerror25;
263  for (itFEDerror25 = fFEDerror25_.begin(); itFEDerror25 != fFEDerror25_.end();
264  itFEDerror25++) { // loop over detIds
265  int detid = itFEDerror25->first;
266  std::vector<PixelFEDChannel> chs = itFEDerror25->second;
267  for (unsigned int ich = 0; ich < chs.size(); ich++) {
268  fDet_.fillFEDerror25(detid, chs[ich]);
269  }
270  } // loop over detIds
271  } // if non-empty FEDerror25
272 
273  } // only for non-zero events
274 }
void fillFEDerror25(int detid, PixelFEDChannel ch)
unsigned long int ftotalevents_
SiPixelDetectorStatus fDet_
void setNevents(unsigned long int N)
std::map< int, std::vector< PixelFEDChannel > > fFEDerror25_

◆ endLuminosityBlockSummary()

void SiPixelStatusProducer::endLuminosityBlockSummary ( edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  ,
std::vector< SiPixelDetectorStatus > *  siPixelDetectorStatusVtr 
) const
final

Definition at line 276 of file SiPixelStatusProducer.cc.

References fDet_, and ftotalevents_.

279  {
280  /*add the Stream's partial information to the full information*/
281 
282  /* only save for the lumi sections with NON-ZERO events */
283  if (ftotalevents_ > 0)
284  siPixelDetectorStatusVtr->push_back(fDet_);
285 }
unsigned long int ftotalevents_
SiPixelDetectorStatus fDet_

◆ fillDescriptions()

static void SiPixelStatusProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 75 of file SiPixelStatusProducer.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

75  {
77  {
79  psd0.addUntracked<edm::InputTag>("pixelClusterLabel", edm::InputTag("siPixelClusters", "", "RECO"));
80  psd0.add<std::vector<edm::InputTag>>("badPixelFEDChannelCollections",
81  {
82  edm::InputTag("siPixelDigis"),
83  });
84  desc.add<edm::ParameterSetDescription>("SiPixelStatusProducerParameters", psd0);
85  }
86  descriptions.add("siPixelStatusProducer", desc);
87  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ globalBeginLuminosityBlockSummary()

static std::shared_ptr<std::vector<SiPixelDetectorStatus> > SiPixelStatusProducer::globalBeginLuminosityBlockSummary ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  ,
LuminosityBlockContext const *   
)
inlinestatic

Definition at line 120 of file SiPixelStatusProducer.h.

121  {
122  return std::make_shared<std::vector<SiPixelDetectorStatus>>();
123  }

◆ globalBeginRun()

std::shared_ptr< SiPixelTopoFinder > SiPixelStatusProducer::globalBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup,
GlobalCache const *  iCache 
)
static

Definition at line 59 of file SiPixelStatusProducer.cc.

References edm::EventSetup::getData().

61  {
62  const TrackerGeometry* trackerGeometry = &iSetup.getData(iCache->trackerGeometryToken_);
63  const TrackerTopology* trackerTopology = &iSetup.getData(iCache->trackerTopologyToken_);
64  const SiPixelFedCablingMap* cablingMap = &iSetup.getData(iCache->siPixelFedCablingMapToken_);
65 
66  auto returnValue = std::make_shared<SiPixelTopoFinder>();
67 
68  returnValue->init(trackerGeometry, trackerTopology, cablingMap);
69  return returnValue;
70 }

◆ globalEndJob()

static void SiPixelStatusProducer::globalEndJob ( SiPixelStatusCache const *  )
inlinestatic

Definition at line 118 of file SiPixelStatusProducer.h.

118 { /* Do nothing */ }

◆ globalEndLuminosityBlockProduce()

static void SiPixelStatusProducer::globalEndLuminosityBlockProduce ( edm::LuminosityBlock iLumi,
edm::EventSetup const &  ,
LuminosityBlockContext const *  iContext,
std::vector< SiPixelDetectorStatus > const *  siPixelDetectorStatusVtr 
)
inlinestatic

Definition at line 132 of file SiPixelStatusProducer.h.

References debug_, SiPixelDetectorStatus::dumpToFile(), Hcal_Conditions_forGlobalTag_cff::iLumi, instance, eostools::move(), produceTPGParameters_beamv6_transparency_spikekill_2016_script::outFile, mps_fire::result, writedatasetfile::run, SiPixelDetectorStatus::setLSRange(), SiPixelDetectorStatus::setRunRange(), AlCaHLTBitMon_QueryRunRegistry::string, and SiPixelDetectorStatus::updateDetectorStatus().

135  {
136  edm::LogInfo("SiPixelStatusProducer") << "Global endlumi producer " << std::endl;
137 
138  // only save result for non-zero event lumi block
139  if (!siPixelDetectorStatusVtr->empty()) {
140  int lumi = iLumi.luminosityBlock();
141  int run = iLumi.run();
142 
143  SiPixelDetectorStatus siPixelDetectorStatus = SiPixelDetectorStatus();
144  for (unsigned int instance = 0; instance < siPixelDetectorStatusVtr->size(); instance++) {
145  siPixelDetectorStatus.updateDetectorStatus((*siPixelDetectorStatusVtr)[instance]);
146  }
147 
148  siPixelDetectorStatus.setRunRange(run, run);
149  siPixelDetectorStatus.setLSRange(lumi, lumi);
150 
151  if (debug_) {
152  std::string outTxt = Form("SiPixelDetectorStatus_Run%d_Lumi%d.txt", run, lumi);
153  std::ofstream outFile;
154  outFile.open(outTxt.c_str(), std::ios::app);
155  siPixelDetectorStatus.dumpToFile(outFile);
156  outFile.close();
157  }
158 
159  /* save result */
160  auto result = std::make_unique<SiPixelDetectorStatus>();
161  *result = siPixelDetectorStatus;
162 
163  iLumi.put(std::move(result), std::string("siPixelStatus"));
164  edm::LogInfo("SiPixelStatusProducer")
165  << " lumi-based data stored for run " << run << " lumi " << lumi << std::endl;
166  }
167  }
void updateDetectorStatus(SiPixelDetectorStatus newData)
static PFTauRenderPlugin instance
void dumpToFile(std::ofstream &outFile)
void setLSRange(int ls0, int ls1)
Log< level::Info, false > LogInfo
void setRunRange(int run0, int run1)
def move(src, dest)
Definition: eostools.py:511

◆ globalEndLuminosityBlockSummary()

static void SiPixelStatusProducer::globalEndLuminosityBlockSummary ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  ,
LuminosityBlockContext const *  iContext,
std::vector< SiPixelDetectorStatus > *   
)
inlinestatic

Definition at line 125 of file SiPixelStatusProducer.h.

128  {
129  /* Do nothing */
130  }

◆ globalEndRun()

static void SiPixelStatusProducer::globalEndRun ( edm::Run const &  iRun,
edm::EventSetup const &  ,
RunContext const *  iContext 
)
inlinestatic

Definition at line 114 of file SiPixelStatusProducer.h.

114  {
115  /* Do nothing */
116  }

◆ indexROC()

int SiPixelStatusProducer::indexROC ( int  irow,
int  icol,
int  nROCcolumns 
)
finalprivatevirtual

Definition at line 288 of file SiPixelStatusProducer.cc.

References createfilelist::int.

Referenced by accumulate().

288  {
289  return int(icol + irow * nROCcolumns);
290 
291  /* generate the folling roc index that is going to map with ROC id as
292  8 9 10 11 12 13 14 15
293  0 1 2 3 4 5 6 7 */
294 }

◆ initializeGlobalCache()

static std::unique_ptr<SiPixelStatusCache> SiPixelStatusProducer::initializeGlobalCache ( edm::ParameterSet const &  iPSet)
inlinestatic

Definition at line 105 of file SiPixelStatusProducer.h.

105  {
106  edm::LogInfo("SiPixelStatusProducer") << "Init global Cache " << std::endl;
107  return std::make_unique<SiPixelStatusCache>();
108  }
Log< level::Info, false > LogInfo

Member Data Documentation

◆ beginLumi_

int SiPixelStatusProducer::beginLumi_
private

Definition at line 197 of file SiPixelStatusProducer.h.

◆ beginRun_

int SiPixelStatusProducer::beginRun_
private

Definition at line 199 of file SiPixelStatusProducer.h.

◆ debug_

const bool SiPixelStatusProducer::debug_ = false
staticprivate

Definition at line 173 of file SiPixelStatusProducer.h.

Referenced by globalEndLuminosityBlockProduce().

◆ endLumi_

int SiPixelStatusProducer::endLumi_
private

Definition at line 198 of file SiPixelStatusProducer.h.

◆ endRun_

int SiPixelStatusProducer::endRun_
private

Definition at line 200 of file SiPixelStatusProducer.h.

◆ fDet_

SiPixelDetectorStatus SiPixelStatusProducer::fDet_
private

◆ fDetIds_

std::vector<int> SiPixelStatusProducer::fDetIds_
private

Definition at line 184 of file SiPixelStatusProducer.h.

Referenced by beginLuminosityBlock(), and beginRun().

◆ fFEDerror25_

std::map<int, std::vector<PixelFEDChannel> > SiPixelStatusProducer::fFEDerror25_
private

Definition at line 203 of file SiPixelStatusProducer.h.

Referenced by accumulate(), beginLuminosityBlock(), and endLuminosityBlock().

◆ fFedIds_

std::unordered_map<uint32_t, unsigned int> SiPixelStatusProducer::fFedIds_
private

Definition at line 190 of file SiPixelStatusProducer.h.

Referenced by beginRun().

◆ fPixelClusterLabel_

edm::InputTag SiPixelStatusProducer::fPixelClusterLabel_
private

Definition at line 175 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and SiPixelStatusProducer().

◆ fRocIds_

std::map<int, std::map<int, int> > SiPixelStatusProducer::fRocIds_
private

Definition at line 192 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and beginRun().

◆ fSensorLayout_

std::map<int, std::pair<int, int> > SiPixelStatusProducer::fSensorLayout_
private

Definition at line 188 of file SiPixelStatusProducer.h.

Referenced by accumulate(), beginLuminosityBlock(), and beginRun().

◆ fSensors_

std::map<int, std::pair<int, int> > SiPixelStatusProducer::fSensors_
private

Definition at line 186 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and beginRun().

◆ fSiPixelClusterToken_

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > SiPixelStatusProducer::fSiPixelClusterToken_
private

Definition at line 176 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and SiPixelStatusProducer().

◆ ftotalevents_

unsigned long int SiPixelStatusProducer::ftotalevents_
private

◆ theBadPixelFEDChannelsTokens_

std::vector<edm::EDGetTokenT<PixelFEDChannelCollection> > SiPixelStatusProducer::theBadPixelFEDChannelsTokens_
private

Definition at line 177 of file SiPixelStatusProducer.h.

Referenced by accumulate(), and SiPixelStatusProducer().