CMS 3D CMS Logo

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

#include <DPGAnalysis/SiStripTools/plugins/APVShotsAnalyzer.cc>

Inheritance diagram for APVShotsAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 APVShotsAnalyzer (const edm::ParameterSet &)
 
 ~APVShotsAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
void updateDetCabling (const edm::EventSetup &setup)
 

Private Attributes

edm::EDGetTokenT< APVCyclePhaseCollection_apvphasecollToken
 
uint32_t _cacheIdDet
 DB cache ID used to establish if the cabling has changed during the run. More...
 
TH2F * _channelvsfed
 
const SiStripDetCabling_detCabling
 The cabling object. More...
 
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > _digicollectionToken
 
TH1F * _fed
 
TH1F ** _fedrun
 
edm::EDGetTokenT< EventWithHistory_historyProductToken
 
TH1F * _median
 
TH1F ** _medianrun
 
TH2F * _medianVsFED
 
int _nevents
 
TH1F * _nShots
 
TProfile * _nShotsbxcycle
 
TProfile * _nShotsbxcycleprev
 
TProfile * _nShotsdbx
 
TProfile * _nShotsdbxincycle
 
TProfile * _nShotsdbxincycleprev
 
TProfile * _nShotsdbxprev
 
TH1F ** _nShotsrun
 
TH2F * _nShotsVsFED
 
TProfile ** _nShotsVsTimerun
 
const std::string _phasepart
 
RunHistogramManager _rhm
 
TH1F * _stripMult
 
TH1F ** _stripMultrun
 
TH1F * _subDetector
 
TH1F ** _subDetectorrun
 
std::string _suffix
 
bool _useCabling
 
TH1F * _whichAPV
 
TH1F ** _whichAPVrun
 
bool _zs
 
std::unique_ptr< TkHistoMaptkhisto
 
std::unique_ptr< TkHistoMaptkhisto2
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 68 of file APVShotsAnalyzer.cc.

Constructor & Destructor Documentation

◆ APVShotsAnalyzer()

APVShotsAnalyzer::APVShotsAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 139 of file APVShotsAnalyzer.cc.

141  consumes<edm::DetSetVector<SiStripDigi> >(iConfig.getParameter<edm::InputTag>("digiCollection"))),
142  _historyProductToken(consumes<EventWithHistory>(iConfig.getParameter<edm::InputTag>("historyProduct"))),
143  _apvphasecollToken(consumes<APVCyclePhaseCollection>(iConfig.getParameter<edm::InputTag>("apvPhaseCollection"))),
144  _phasepart(iConfig.getUntrackedParameter<std::string>("phasePartition", "None")),
145  _zs(iConfig.getUntrackedParameter<bool>("zeroSuppressed", true)),
146  _suffix(iConfig.getParameter<std::string>("mapSuffix")),
147  _nevents(0),
149  _useCabling(iConfig.getUntrackedParameter<bool>("useCabling", true)),
150  _cacheIdDet(0),
151  _detCabling(nullptr) {
152  //now do what ever initialization is needed
153 
154  if (!_zs)
155  _suffix += "_notZS";
156 
158 
159  _nShots = tfserv->make<TH1F>("nShots", "Number of Shots per event", 200, -0.5, 199.5);
160  _nShots->GetXaxis()->SetTitle("Shots");
161  _nShots->GetYaxis()->SetTitle("Events");
162  _nShots->StatOverflows(kTRUE);
163 
164  _whichAPV = tfserv->make<TH1F>("whichAPV", "APV with shots", 6, -0.5, 5.5);
165  _whichAPV->GetXaxis()->SetTitle("APV");
166  _whichAPV->GetYaxis()->SetTitle("Shots");
167 
168  _stripMult = tfserv->make<TH1F>("stripMultiplicity", "Shot Strip Multiplicity", 129, -0.5, 128.5);
169  _stripMult->GetXaxis()->SetTitle("Number of Strips");
170  _stripMult->GetYaxis()->SetTitle("Shots");
171 
172  _median = tfserv->make<TH1F>("median", "APV Shot charge median", 256, -0.5, 255.5);
173  _median->GetXaxis()->SetTitle("Charge [ADC]");
174  _median->GetYaxis()->SetTitle("Shots");
175 
176  _subDetector = tfserv->make<TH1F>("subDets", "SubDetector Shot distribution", 10, -0.5, 9.5);
177  _subDetector->GetYaxis()->SetTitle("Shots");
178 
179  _nShotsbxcycle = tfserv->make<TProfile>("nShotsBXcycle", "Number of shots vs APV cycle bin", 70, -0.5, 69.5);
180  _nShotsbxcycle->GetXaxis()->SetTitle("Event BX mod(70)");
181  _nShotsbxcycle->GetYaxis()->SetTitle("APV shots");
182 
183  _nShotsdbx = tfserv->make<TProfile>("nShotsDBX", "Number of shots vs #Delta(BX)", 1000, -0.5, 999.5);
184  _nShotsdbx->GetXaxis()->SetTitle("Event #Delta(BX)");
185  _nShotsdbx->GetYaxis()->SetTitle("APV shots");
186 
188  tfserv->make<TProfile>("nShotsDBXincycle", "Number of shots vs #Delta(BX) w.r.t. APV cycle", 1000, -0.5, 999.5);
189  _nShotsdbxincycle->GetXaxis()->SetTitle("Event #Delta(BX) w.r.t. APV cycle");
190  _nShotsdbxincycle->GetYaxis()->SetTitle("APV shots");
191 
193  tfserv->make<TProfile>("nShotsBXcycleprev", "Number of shots vs APV cycle bin of previous L1A", 70, -0.5, 69.5);
194  _nShotsbxcycleprev->GetXaxis()->SetTitle("Previous L1A BX mod(70)");
195  _nShotsbxcycleprev->GetYaxis()->SetTitle("APV shots");
196 
198  tfserv->make<TProfile>("nShotsDBXprev", "Number of shots vs #Delta(BX) of previous L1A", 1000, -0.5, 999.5);
199  _nShotsdbxprev->GetXaxis()->SetTitle("Previous L1A #Delta(BX)");
200  _nShotsdbxprev->GetYaxis()->SetTitle("APV shots");
201 
202  _nShotsdbxincycleprev = tfserv->make<TProfile>(
203  "nShotsDBXincycleprev", "Number of shots vs #Delta(BX) w.r.t. APV cycle of previous L1A", 1000, -0.5, 999.5);
204  _nShotsdbxincycleprev->GetXaxis()->SetTitle("Previous L1A #Delta(BX) w.r.t. APV cycle");
205  _nShotsdbxincycleprev->GetYaxis()->SetTitle("APV shots");
206 
207  _nShotsrun = _rhm.makeTH1F("nShotsrun", "Number of Shots per event", 200, -0.5, 199.5);
209  _rhm.makeTProfile("nShotsVsTimerun", "Mean number of shots vs orbit number", 4 * 500, 0, 500 * 262144);
210  _whichAPVrun = _rhm.makeTH1F("whichAPVrun", "APV with shots", 6, -0.5, 5.5);
211  _stripMultrun = _rhm.makeTH1F("stripMultiplicityrun", "Shot Strip Multiplicity", 129, -0.5, 128.5);
212  _medianrun = _rhm.makeTH1F("medianrun", "APV Shot charge median", 256, -0.5, 255.5);
213  _subDetectorrun = _rhm.makeTH1F("subDetsrun", "SubDetector Shot distribution", 10, -0.5, 9.5);
214 
215  if (_useCabling) {
216  _fed = tfserv->make<TH1F>("fed", "FED Shot distribution", 440, 50, 490);
217  _fed->GetYaxis()->SetTitle("Shots");
218  _fedrun = _rhm.makeTH1F("fedrun", "FED Shot distribution", 440, 50, 490);
219 
220  _channelvsfed =
221  tfserv->make<TH2F>("channelvsfed", "Channel vs FED Shot distribution", 440, 50, 490, 97, -0.5, 96.5);
222  _channelvsfed->GetXaxis()->SetTitle("FED");
223  _channelvsfed->GetYaxis()->SetTitle("Channel");
224 
225  _nShotsVsFED =
226  tfserv->make<TH2F>("nShotsVsFED", "Number of Shots per event vs fedid", 440, 50, 490, 200, -0.5, 199.5);
227  _nShotsVsFED->GetXaxis()->SetTitle("fedId");
228  _nShots->GetYaxis()->SetTitle("Shots");
229  _nShots->GetZaxis()->SetTitle("Events");
230  _nShotsVsFED->StatOverflows(kTRUE);
231 
232  _medianVsFED = tfserv->make<TH2F>("medianVsFED", "APV Shot charge median vs fedid", 440, 50, 490, 256, -0.5, 255.5);
233  _medianVsFED->GetXaxis()->SetTitle("fedId");
234  _medianVsFED->GetYaxis()->SetTitle("Charge [ADC]");
235  _median->GetZaxis()->SetTitle("Shots");
236  }
237 
238  tkhisto = nullptr;
239  tkhisto2 = nullptr;
240 }

References _channelvsfed, _fed, _fedrun, _median, _medianrun, _medianVsFED, _nShots, _nShotsbxcycle, _nShotsbxcycleprev, _nShotsdbx, _nShotsdbxincycle, _nShotsdbxincycleprev, _nShotsdbxprev, _nShotsrun, _nShotsVsFED, _nShotsVsTimerun, _rhm, _stripMult, _stripMultrun, _subDetector, _subDetectorrun, _suffix, _useCabling, _whichAPV, _whichAPVrun, _zs, TFileService::make(), RunHistogramManager::makeTH1F(), RunHistogramManager::makeTProfile(), tkhisto, and tkhisto2.

◆ ~APVShotsAnalyzer()

APVShotsAnalyzer::~APVShotsAnalyzer ( )
override

Definition at line 242 of file APVShotsAnalyzer.cc.

242  {
243  // do anything here that needs to be done at desctruction time
244  // (e.g. close files, deallocate resources etc.)
245  if (_detCabling)
246  _detCabling = nullptr;
247 }

References _detCabling.

Member Function Documentation

◆ analyze()

void APVShotsAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 254 of file APVShotsAnalyzer.cc.

254  {
255  using namespace edm;
256 
257  if (_useCabling) {
258  //retrieve cabling
259  updateDetCabling(iSetup);
260  }
261 
262  if (!(tkhisto && tkhisto2)) {
263  edm::ESHandle<TkDetMap> tkDetMapHandle;
264  iSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
265  const TkDetMap* tkDetMap = tkDetMapHandle.product();
266 
267  tkhisto = std::make_unique<TkHistoMap>(tkDetMap, "ShotMultiplicity", "ShotMultiplicity", -1);
268  tkhisto2 = std::make_unique<TkHistoMap>(tkDetMap, "StripMultiplicity", "StripMultiplicity", -1);
269  }
270 
271  _nevents++;
272 
274  iEvent.getByToken(_historyProductToken, he);
275 
277  iEvent.getByToken(_apvphasecollToken, apvphase);
278 
279  int thephase = APVCyclePhaseCollection::invalid;
280  if (apvphase.isValid() && !apvphase.failedToGet()) {
281  thephase = apvphase->getPhase(_phasepart);
282  }
283  bool isphaseok = (thephase != APVCyclePhaseCollection::invalid && thephase != APVCyclePhaseCollection::multiphase &&
285 
287  iEvent.getByToken(_digicollectionToken, digis);
288 
289  // loop on detector with digis
290 
291  int nshots = 0;
292  std::vector<int> nshotsperFed;
293 
294  const uint16_t lNumFeds = sistrip::FED_ID_MAX - sistrip::FED_ID_MIN + 1;
295  if (_useCabling) {
296  nshotsperFed.resize(lNumFeds, 0);
297  }
298 
299  APVShotFinder apvsf(*digis, _zs);
300  const std::vector<APVShot>& shots = apvsf.getShots();
301 
302  for (std::vector<APVShot>::const_iterator shot = shots.begin(); shot != shots.end(); ++shot) {
303  if (shot->isGenuine()) {
304  //get the fedid from the detid
305 
306  uint32_t det = shot->detId();
307  if (_useCabling) {
308  int apvPair = shot->apvNumber() / 2;
309  LogDebug("APVPair") << apvPair;
310 
311  const FedChannelConnection& theConn = _detCabling->getConnection(det, apvPair);
312 
313  int lChannelId = -1;
314  int thelFEDId = -1;
315  if (theConn.isConnected()) {
316  lChannelId = theConn.fedCh();
317  thelFEDId = theConn.fedId();
318  } else {
319  edm::LogWarning("ConnectionNotFound")
320  << "connection of det " << det << " APV pair " << apvPair << " not found";
321  }
322  LogDebug("FED channels") << thelFEDId << " " << lChannelId;
323 
324  const std::vector<const FedChannelConnection*>& conns = _detCabling->getConnections(det);
325 
326  if (!(conns.size()))
327  continue;
328  uint16_t lFedId = 0;
329  for (uint32_t ch = 0; ch < conns.size(); ch++) {
330  if (conns[ch] && conns[ch]->isConnected()) {
331  LogDebug("Dump") << *(conns[ch]);
332  LogDebug("ReadyForFEDid") << "Ready for FED id " << ch;
333  lFedId = conns[ch]->fedId();
334  LogDebug("FEDid") << "obtained FED id " << ch << " " << lFedId;
335  //uint16_t lFedCh = conns[ch]->fedCh();
336 
337  if (lFedId < sistrip::FED_ID_MIN || lFedId > sistrip::FED_ID_MAX) {
338  edm::LogWarning("InvalidFEDid") << lFedId << " for detid " << det << " connection " << ch;
339  continue;
340  } else
341  break;
342  }
343  }
344  if (lFedId < sistrip::FED_ID_MIN || lFedId > sistrip::FED_ID_MAX) {
345  edm::LogWarning("NoValidFEDid") << lFedId << "found for detid " << det;
346  continue;
347  }
348 
349  if (lFedId != thelFEDId) {
350  edm::LogWarning("FEDidMismatch") << " Mismatch in FED id for det " << det << " APV pair " << apvPair << " : "
351  << lFedId << " vs " << thelFEDId;
352  }
353 
354  LogDebug("FillingArray") << nshotsperFed.size() << " " << lFedId - sistrip::FED_ID_MIN;
355  ++nshotsperFed[lFedId - sistrip::FED_ID_MIN];
356 
357  LogDebug("ReadyToBeFilled") << " ready to be filled with " << thelFEDId << " " << lChannelId;
358  _channelvsfed->Fill(thelFEDId, lChannelId);
359  LogDebug("Filled") << " filled with " << thelFEDId << " " << lChannelId;
360 
361  _fed->Fill(lFedId);
362 
363  if (_fedrun && *_fedrun)
364  (*_fedrun)->Fill(lFedId);
365  _medianVsFED->Fill(lFedId, shot->median());
366  }
367 
368  ++nshots;
369 
370  _whichAPV->Fill(shot->apvNumber());
371  _median->Fill(shot->median());
372  _stripMult->Fill(shot->nStrips());
373  _subDetector->Fill(shot->subDet());
374 
375  if (_whichAPVrun && *_whichAPVrun)
376  (*_whichAPVrun)->Fill(shot->apvNumber());
377  if (_medianrun && *_medianrun)
378  (*_medianrun)->Fill(shot->median());
380  (*_stripMultrun)->Fill(shot->nStrips());
382  (*_subDetectorrun)->Fill(shot->subDet());
383 
384  tkhisto2->fill(det, shot->nStrips());
385  ;
386  tkhisto->add(det, 1);
387  }
388  }
389 
390  _nShots->Fill(nshots);
391  if (_nShotsrun && *_nShotsrun)
392  (*_nShotsrun)->Fill(nshots);
393 
394  _nShotsdbx->Fill(he->deltaBX(), nshots);
395  _nShotsdbxprev->Fill(he->deltaBX(), nshots);
396  if (isphaseok) {
397  _nShotsbxcycle->Fill(he->absoluteBXinCycle(thephase) % 70, nshots);
398  _nShotsdbxincycle->Fill(he->deltaBXinCycle(thephase), nshots);
399  _nShotsbxcycleprev->Fill(he->absoluteBXinCycle(1, thephase) % 70, nshots);
400  _nShotsdbxincycleprev->Fill(he->deltaBXinCycle(1, 2, thephase), nshots);
401  }
402 
403  if (_useCabling) {
404  for (uint16_t lFed(0); lFed < lNumFeds; lFed++) {
405  _nShotsVsFED->Fill(lFed + sistrip::FED_ID_MIN, nshotsperFed[lFed]);
406  }
407  }
408 
410  (*_nShotsVsTimerun)->Fill(iEvent.orbitNumber(), nshots);
411 }

References _apvphasecollToken, _channelvsfed, _detCabling, _digicollectionToken, _fed, _fedrun, _historyProductToken, _median, _medianrun, _medianVsFED, _nevents, _nShots, _nShotsbxcycle, _nShotsbxcycleprev, _nShotsdbx, _nShotsdbxincycle, _nShotsdbxincycleprev, _nShotsdbxprev, _nShotsrun, _nShotsVsFED, _nShotsVsTimerun, _phasepart, _stripMult, _stripMultrun, _subDetector, _subDetectorrun, _useCabling, _whichAPV, _whichAPVrun, _zs, edm::HandleBase::failedToGet(), sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, FedChannelConnection::fedCh(), FedChannelConnection::fedId(), edm::EventSetup::get(), get, SiStripDetCabling::getConnection(), SiStripDetCabling::getConnections(), APVCyclePhaseCollection::getPhase(), APVShotFinder::getShots(), hcalSimParameters_cfi::he, iEvent, APVCyclePhaseCollection::invalid, FedChannelConnection::isConnected(), edm::HandleBase::isValid(), LogDebug, APVCyclePhaseCollection::multiphase, APVCyclePhaseCollection::nopartition, edm::ESHandle< T >::product(), tkhisto, tkhisto2, and updateDetCabling().

◆ beginJob()

void APVShotsAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 457 of file APVShotsAnalyzer.cc.

457 {}

◆ beginRun()

void APVShotsAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 413 of file APVShotsAnalyzer.cc.

413  {
414  _rhm.beginRun(iRun);
415 
416  if (_nShotsrun && *_nShotsrun) {
417  (*_nShotsrun)->GetXaxis()->SetTitle("Shots");
418  (*_nShotsrun)->GetYaxis()->SetTitle("Events");
419  (*_nShotsrun)->StatOverflows(kTRUE);
420  }
421 
423  (*_nShotsVsTimerun)->GetXaxis()->SetTitle("Orbit");
424  (*_nShotsVsTimerun)->GetYaxis()->SetTitle("Number of Shots");
425  (*_nShotsVsTimerun)->SetCanExtend(TH1::kXaxis);
426  }
427 
428  if (_whichAPVrun && *_whichAPVrun) {
429  (*_whichAPVrun)->GetXaxis()->SetTitle("APV");
430  (*_whichAPVrun)->GetYaxis()->SetTitle("Shots");
431  }
432 
433  if (_stripMultrun && *_stripMultrun) {
434  (*_stripMultrun)->GetXaxis()->SetTitle("Number of Strips");
435  (*_stripMultrun)->GetYaxis()->SetTitle("Shots");
436  }
437 
438  if (_medianrun && *_medianrun) {
439  (*_medianrun)->GetXaxis()->SetTitle("Charge [ADC]");
440  (*_medianrun)->GetYaxis()->SetTitle("Shots");
441  }
442 
444  (*_subDetectorrun)->GetYaxis()->SetTitle("Shots");
445  }
446 
447  if (_useCabling) {
448  if (_fedrun && *_fedrun) {
449  (*_fedrun)->GetYaxis()->SetTitle("Shots");
450  }
451  }
452 }

References _fedrun, _medianrun, _nShotsrun, _nShotsVsTimerun, _rhm, _stripMultrun, _subDetectorrun, _useCabling, _whichAPVrun, and RunHistogramManager::beginRun().

◆ endJob()

void APVShotsAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 460 of file APVShotsAnalyzer.cc.

460  {
461  edm::LogInfo("EndOfJob") << _nevents << " analyzed events";
462 
464  TrackerMap tkmap, tkmap2;
465 
466  tkmap.setPalette(1);
467  tkmap2.setPalette(1);
468  tkhisto->dumpInTkMap(&tkmap);
469  tkhisto2->dumpInTkMap(&tkmap2);
470  std::string tkshotmultmapname = "ShotMultiplicity_" + _suffix + ".png";
471  tkmap.save(true, 0, 0, tkshotmultmapname);
472  std::string tkstripmultmapname = "StripMultiplicity_" + _suffix + ".png";
473  tkmap2.save(true, 0, 0, tkstripmultmapname);
474 
475  std::string rootmapname = "TKMap_" + _suffix + ".root";
476  tkhisto->save(rootmapname);
477  tkhisto2->save(rootmapname);
478 }

References _nevents, _suffix, TrackerMap::save(), TrackerMap::setPalette(), AlCaHLTBitMon_QueryRunRegistry::string, tkhisto, and tkhisto2.

◆ endRun()

void APVShotsAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 454 of file APVShotsAnalyzer.cc.

454 {}

◆ updateDetCabling()

void APVShotsAnalyzer::updateDetCabling ( const edm::EventSetup setup)
private

Definition at line 480 of file APVShotsAnalyzer.cc.

480  {
481  if (_useCabling) {
482  uint32_t cache_id = setup.get<SiStripDetCablingRcd>().cacheIdentifier(); //.get( cabling_ );
483 
484  if (_cacheIdDet != cache_id) { // If the cache ID has changed since the last update...
485  // Update the cabling object
488  _detCabling = c.product();
489  _cacheIdDet = cache_id;
490  } // end of new cache ID check
491  }
492 }

References _cacheIdDet, _detCabling, _useCabling, HltBtagPostValidation_cff::c, get, and singleTopDQM_cfi::setup.

Referenced by analyze().

Member Data Documentation

◆ _apvphasecollToken

edm::EDGetTokenT<APVCyclePhaseCollection> APVShotsAnalyzer::_apvphasecollToken
private

Definition at line 86 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _cacheIdDet

uint32_t APVShotsAnalyzer::_cacheIdDet
private

DB cache ID used to establish if the cabling has changed during the run.

Definition at line 124 of file APVShotsAnalyzer.cc.

Referenced by updateDetCabling().

◆ _channelvsfed

TH2F* APVShotsAnalyzer::_channelvsfed
private

Definition at line 98 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _detCabling

const SiStripDetCabling* APVShotsAnalyzer::_detCabling
private

The cabling object.

Definition at line 125 of file APVShotsAnalyzer.cc.

Referenced by analyze(), updateDetCabling(), and ~APVShotsAnalyzer().

◆ _digicollectionToken

edm::EDGetTokenT<edm::DetSetVector<SiStripDigi> > APVShotsAnalyzer::_digicollectionToken
private

Definition at line 84 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _fed

TH1F* APVShotsAnalyzer::_fed
private

Definition at line 97 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _fedrun

TH1F** APVShotsAnalyzer::_fedrun
private

Definition at line 118 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _historyProductToken

edm::EDGetTokenT<EventWithHistory> APVShotsAnalyzer::_historyProductToken
private

Definition at line 85 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _median

TH1F* APVShotsAnalyzer::_median
private

Definition at line 95 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _medianrun

TH1F** APVShotsAnalyzer::_medianrun
private

Definition at line 116 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _medianVsFED

TH2F* APVShotsAnalyzer::_medianVsFED
private

Definition at line 107 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nevents

int APVShotsAnalyzer::_nevents
private

Definition at line 90 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and endJob().

◆ _nShots

TH1F* APVShotsAnalyzer::_nShots
private

Definition at line 92 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsbxcycle

TProfile* APVShotsAnalyzer::_nShotsbxcycle
private

Definition at line 100 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsbxcycleprev

TProfile* APVShotsAnalyzer::_nShotsbxcycleprev
private

Definition at line 103 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsdbx

TProfile* APVShotsAnalyzer::_nShotsdbx
private

Definition at line 101 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsdbxincycle

TProfile* APVShotsAnalyzer::_nShotsdbxincycle
private

Definition at line 102 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsdbxincycleprev

TProfile* APVShotsAnalyzer::_nShotsdbxincycleprev
private

Definition at line 105 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsdbxprev

TProfile* APVShotsAnalyzer::_nShotsdbxprev
private

Definition at line 104 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsrun

TH1F** APVShotsAnalyzer::_nShotsrun
private

Definition at line 112 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _nShotsVsFED

TH2F* APVShotsAnalyzer::_nShotsVsFED
private

Definition at line 108 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _nShotsVsTimerun

TProfile** APVShotsAnalyzer::_nShotsVsTimerun
private

Definition at line 113 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _phasepart

const std::string APVShotsAnalyzer::_phasepart
private

Definition at line 87 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _rhm

RunHistogramManager APVShotsAnalyzer::_rhm
private

Definition at line 110 of file APVShotsAnalyzer.cc.

Referenced by APVShotsAnalyzer(), and beginRun().

◆ _stripMult

TH1F* APVShotsAnalyzer::_stripMult
private

Definition at line 94 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _stripMultrun

TH1F** APVShotsAnalyzer::_stripMultrun
private

Definition at line 115 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _subDetector

TH1F* APVShotsAnalyzer::_subDetector
private

Definition at line 96 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _subDetectorrun

TH1F** APVShotsAnalyzer::_subDetectorrun
private

Definition at line 117 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _suffix

std::string APVShotsAnalyzer::_suffix
private

Definition at line 89 of file APVShotsAnalyzer.cc.

Referenced by APVShotsAnalyzer(), and endJob().

◆ _useCabling

bool APVShotsAnalyzer::_useCabling
private

Definition at line 123 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), beginRun(), and updateDetCabling().

◆ _whichAPV

TH1F* APVShotsAnalyzer::_whichAPV
private

Definition at line 93 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ _whichAPVrun

TH1F** APVShotsAnalyzer::_whichAPVrun
private

Definition at line 114 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and beginRun().

◆ _zs

bool APVShotsAnalyzer::_zs
private

Definition at line 88 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

◆ tkhisto

std::unique_ptr<TkHistoMap> APVShotsAnalyzer::tkhisto
private

Definition at line 120 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and endJob().

◆ tkhisto2

std::unique_ptr<TkHistoMap> APVShotsAnalyzer::tkhisto2
private

Definition at line 120 of file APVShotsAnalyzer.cc.

Referenced by analyze(), APVShotsAnalyzer(), and endJob().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
APVShotsAnalyzer::_nShotsdbxincycleprev
TProfile * _nShotsdbxincycleprev
Definition: APVShotsAnalyzer.cc:105
edm::DetSetVector< SiStripDigi >
APVShotsAnalyzer::_nShotsdbxincycle
TProfile * _nShotsdbxincycle
Definition: APVShotsAnalyzer.cc:102
APVShotsAnalyzer::_nShotsdbxprev
TProfile * _nShotsdbxprev
Definition: APVShotsAnalyzer.cc:104
TrackerMap::setPalette
void setPalette(int numpalette)
Definition: TrackerMap.h:155
APVShotsAnalyzer::_stripMult
TH1F * _stripMult
Definition: APVShotsAnalyzer.cc:94
APVCyclePhaseCollection::multiphase
Definition: APVCyclePhaseCollection.h:21
APVShotsAnalyzer::_nShotsVsFED
TH2F * _nShotsVsFED
Definition: APVShotsAnalyzer.cc:108
APVShotsAnalyzer::_nShotsbxcycle
TProfile * _nShotsbxcycle
Definition: APVShotsAnalyzer.cc:100
APVShotsAnalyzer::_nShotsrun
TH1F ** _nShotsrun
Definition: APVShotsAnalyzer.cc:112
FedChannelConnection::fedCh
const uint16_t & fedCh() const
Definition: FedChannelConnection.h:220
edm
HLT enums.
Definition: AlignableModifier.h:19
APVShotsAnalyzer::_useCabling
bool _useCabling
Definition: APVShotsAnalyzer.cc:123
edm::LogInfo
Definition: MessageLogger.h:254
APVShotsAnalyzer::updateDetCabling
void updateDetCabling(const edm::EventSetup &setup)
Definition: APVShotsAnalyzer.cc:480
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
APVShotsAnalyzer::_medianVsFED
TH2F * _medianVsFED
Definition: APVShotsAnalyzer.cc:107
sistrip::FED_ID_MIN
static const uint16_t FED_ID_MIN
Definition: ConstantsForHardwareSystems.h:21
edm::Handle
Definition: AssociativeIterator.h:50
APVShotsAnalyzer::tkhisto2
std::unique_ptr< TkHistoMap > tkhisto2
Definition: APVShotsAnalyzer.cc:120
APVShotsAnalyzer::_whichAPVrun
TH1F ** _whichAPVrun
Definition: APVShotsAnalyzer.cc:114
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
APVShotsAnalyzer::_detCabling
const SiStripDetCabling * _detCabling
The cabling object.
Definition: APVShotsAnalyzer.cc:125
SiStripDetCabling::getConnection
const FedChannelConnection & getConnection(uint32_t det_id, unsigned short apv_pair) const
Definition: SiStripDetCabling.cc:176
APVShotsAnalyzer::_medianrun
TH1F ** _medianrun
Definition: APVShotsAnalyzer.cc:116
APVShotsAnalyzer::_nShotsdbx
TProfile * _nShotsdbx
Definition: APVShotsAnalyzer.cc:101
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
APVShotsAnalyzer::tkhisto
std::unique_ptr< TkHistoMap > tkhisto
Definition: APVShotsAnalyzer.cc:120
APVShotsAnalyzer::_phasepart
const std::string _phasepart
Definition: APVShotsAnalyzer.cc:87
APVShotsAnalyzer::_nShotsVsTimerun
TProfile ** _nShotsVsTimerun
Definition: APVShotsAnalyzer.cc:113
edm::ESHandle
Definition: DTSurvey.h:22
TkDetMap
Definition: TkDetMap.h:175
TrackerMap
Definition: TrackerMap.h:76
SiStripDetCablingRcd
Definition: SiStripDependentRecords.h:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
FedChannelConnection::isConnected
bool isConnected() const
Definition: FedChannelConnection.h:196
RunHistogramManager::makeTH1F
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
Definition: RunHistogramManager.cc:33
APVShotsAnalyzer::_fed
TH1F * _fed
Definition: APVShotsAnalyzer.cc:97
edm::HandleBase::failedToGet
bool failedToGet() const
Definition: HandleBase.h:72
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
APVShotsAnalyzer::_median
TH1F * _median
Definition: APVShotsAnalyzer.cc:95
APVShotsAnalyzer::_nevents
int _nevents
Definition: APVShotsAnalyzer.cc:90
APVShotsAnalyzer::_digicollectionToken
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > _digicollectionToken
Definition: APVShotsAnalyzer.cc:84
APVShotsAnalyzer::_rhm
RunHistogramManager _rhm
Definition: APVShotsAnalyzer.cc:110
RunHistogramManager::beginRun
void beginRun(const edm::Run &iRun)
Definition: RunHistogramManager.cc:101
edm::Service< TFileService >
iEvent
int iEvent
Definition: GenABIO.cc:224
APVShotsAnalyzer::_whichAPV
TH1F * _whichAPV
Definition: APVShotsAnalyzer.cc:93
APVShotsAnalyzer::_cacheIdDet
uint32_t _cacheIdDet
DB cache ID used to establish if the cabling has changed during the run.
Definition: APVShotsAnalyzer.cc:124
APVShotsAnalyzer::_apvphasecollToken
edm::EDGetTokenT< APVCyclePhaseCollection > _apvphasecollToken
Definition: APVShotsAnalyzer.cc:86
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
APVShotsAnalyzer::_historyProductToken
edm::EDGetTokenT< EventWithHistory > _historyProductToken
Definition: APVShotsAnalyzer.cc:85
sistrip::FED_ID_MAX
static const uint16_t FED_ID_MAX
Definition: ConstantsForHardwareSystems.h:22
TrackerMap.h
APVShotsAnalyzer::_subDetector
TH1F * _subDetector
Definition: APVShotsAnalyzer.cc:96
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
APVShotsAnalyzer::_nShots
TH1F * _nShots
Definition: APVShotsAnalyzer.cc:92
FedChannelConnection::fedId
const uint16_t & fedId() const
Definition: FedChannelConnection.h:219
TrackerMap::save
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
Definition: TrackerMap.cc:810
APVCyclePhaseCollection::nopartition
Definition: APVCyclePhaseCollection.h:21
APVShotsAnalyzer::_stripMultrun
TH1F ** _stripMultrun
Definition: APVShotsAnalyzer.cc:115
hcalSimParameters_cfi.he
he
Definition: hcalSimParameters_cfi.py:75
APVShotFinder
Definition: APVShotFinder.h:16
APVShotsAnalyzer::_suffix
std::string _suffix
Definition: APVShotsAnalyzer.cc:89
APVCyclePhaseCollection::getPhase
const int getPhase(const std::string partition) const
Definition: APVCyclePhaseCollection.cc:5
APVShotsAnalyzer::_channelvsfed
TH2F * _channelvsfed
Definition: APVShotsAnalyzer.cc:98
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
APVShotsAnalyzer::_fedrun
TH1F ** _fedrun
Definition: APVShotsAnalyzer.cc:118
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:126
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
APVShotsAnalyzer::_subDetectorrun
TH1F ** _subDetectorrun
Definition: APVShotsAnalyzer.cc:117
APVCyclePhaseCollection::invalid
Definition: APVCyclePhaseCollection.h:21
edm::InputTag
Definition: InputTag.h:15
APVShotsAnalyzer::_nShotsbxcycleprev
TProfile * _nShotsbxcycleprev
Definition: APVShotsAnalyzer.cc:103
SiStripDetCabling::getConnections
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
Definition: SiStripDetCabling.cc:161
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
RunHistogramManager::makeTProfile
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
Definition: RunHistogramManager.cc:52
APVShotsAnalyzer::_zs
bool _zs
Definition: APVShotsAnalyzer.cc:88