CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 APVShotsAnalyzer (const edm::ParameterSet &)
 
 ~APVShotsAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 SiStripDetCablingRcd &iRcd)
 

Private Attributes

edm::EDGetTokenT< APVCyclePhaseCollection_apvphasecollToken
 
TH2F * _channelvsfed
 
const SiStripDetCabling_detCabling = nullptr
 The cabling object. More...
 
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd_detCablingToken
 
edm::ESWatcher< SiStripDetCablingRcd_detCablingWatcher
 
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
 
edm::ESGetToken< TkDetMap, TrackerTopologyRcd_tkDetMapToken
 
bool _useCabling
 
TH1F * _whichAPV
 
TH1F ** _whichAPVrun
 
bool _zs
 
std::unique_ptr< TkHistoMaptkhisto
 
std::unique_ptr< TkHistoMaptkhisto2
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

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

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

Definition at line 69 of file APVShotsAnalyzer.cc.

Constructor & Destructor Documentation

◆ APVShotsAnalyzer()

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

Definition at line 140 of file APVShotsAnalyzer.cc.

References updateDetCabling().

142  consumes<edm::DetSetVector<SiStripDigi> >(iConfig.getParameter<edm::InputTag>("digiCollection"))),
143  _historyProductToken(consumes<EventWithHistory>(iConfig.getParameter<edm::InputTag>("historyProduct"))),
144  _apvphasecollToken(consumes<APVCyclePhaseCollection>(iConfig.getParameter<edm::InputTag>("apvPhaseCollection"))),
146  _useCabling(iConfig.getUntrackedParameter<bool>("useCabling", true)),
148  : decltype(_detCablingWatcher){}),
150  _phasepart(iConfig.getUntrackedParameter<std::string>("phasePartition", "None")),
151  _zs(iConfig.getUntrackedParameter<bool>("zeroSuppressed", true)),
152  _suffix(iConfig.getParameter<std::string>("mapSuffix")),
153  _nevents(0),
155  //now do what ever initialization is needed
156  usesResource(TFileService::kSharedResource);
157 
158  if (!_zs)
159  _suffix += "_notZS";
160 
162 
163  _nShots = tfserv->make<TH1F>("nShots", "Number of Shots per event", 200, -0.5, 199.5);
164  _nShots->GetXaxis()->SetTitle("Shots");
165  _nShots->GetYaxis()->SetTitle("Events");
166  _nShots->StatOverflows(kTRUE);
167 
168  _whichAPV = tfserv->make<TH1F>("whichAPV", "APV with shots", 6, -0.5, 5.5);
169  _whichAPV->GetXaxis()->SetTitle("APV");
170  _whichAPV->GetYaxis()->SetTitle("Shots");
171 
172  _stripMult = tfserv->make<TH1F>("stripMultiplicity", "Shot Strip Multiplicity", 129, -0.5, 128.5);
173  _stripMult->GetXaxis()->SetTitle("Number of Strips");
174  _stripMult->GetYaxis()->SetTitle("Shots");
175 
176  _median = tfserv->make<TH1F>("median", "APV Shot charge median", 256, -0.5, 255.5);
177  _median->GetXaxis()->SetTitle("Charge [ADC]");
178  _median->GetYaxis()->SetTitle("Shots");
179 
180  _subDetector = tfserv->make<TH1F>("subDets", "SubDetector Shot distribution", 10, -0.5, 9.5);
181  _subDetector->GetYaxis()->SetTitle("Shots");
182 
183  _nShotsbxcycle = tfserv->make<TProfile>("nShotsBXcycle", "Number of shots vs APV cycle bin", 70, -0.5, 69.5);
184  _nShotsbxcycle->GetXaxis()->SetTitle("Event BX mod(70)");
185  _nShotsbxcycle->GetYaxis()->SetTitle("APV shots");
186 
187  _nShotsdbx = tfserv->make<TProfile>("nShotsDBX", "Number of shots vs #Delta(BX)", 1000, -0.5, 999.5);
188  _nShotsdbx->GetXaxis()->SetTitle("Event #Delta(BX)");
189  _nShotsdbx->GetYaxis()->SetTitle("APV shots");
190 
192  tfserv->make<TProfile>("nShotsDBXincycle", "Number of shots vs #Delta(BX) w.r.t. APV cycle", 1000, -0.5, 999.5);
193  _nShotsdbxincycle->GetXaxis()->SetTitle("Event #Delta(BX) w.r.t. APV cycle");
194  _nShotsdbxincycle->GetYaxis()->SetTitle("APV shots");
195 
197  tfserv->make<TProfile>("nShotsBXcycleprev", "Number of shots vs APV cycle bin of previous L1A", 70, -0.5, 69.5);
198  _nShotsbxcycleprev->GetXaxis()->SetTitle("Previous L1A BX mod(70)");
199  _nShotsbxcycleprev->GetYaxis()->SetTitle("APV shots");
200 
202  tfserv->make<TProfile>("nShotsDBXprev", "Number of shots vs #Delta(BX) of previous L1A", 1000, -0.5, 999.5);
203  _nShotsdbxprev->GetXaxis()->SetTitle("Previous L1A #Delta(BX)");
204  _nShotsdbxprev->GetYaxis()->SetTitle("APV shots");
205 
206  _nShotsdbxincycleprev = tfserv->make<TProfile>(
207  "nShotsDBXincycleprev", "Number of shots vs #Delta(BX) w.r.t. APV cycle of previous L1A", 1000, -0.5, 999.5);
208  _nShotsdbxincycleprev->GetXaxis()->SetTitle("Previous L1A #Delta(BX) w.r.t. APV cycle");
209  _nShotsdbxincycleprev->GetYaxis()->SetTitle("APV shots");
210 
211  _nShotsrun = _rhm.makeTH1F("nShotsrun", "Number of Shots per event", 200, -0.5, 199.5);
213  _rhm.makeTProfile("nShotsVsTimerun", "Mean number of shots vs orbit number", 4 * 500, 0, 500 * 262144);
214  _whichAPVrun = _rhm.makeTH1F("whichAPVrun", "APV with shots", 6, -0.5, 5.5);
215  _stripMultrun = _rhm.makeTH1F("stripMultiplicityrun", "Shot Strip Multiplicity", 129, -0.5, 128.5);
216  _medianrun = _rhm.makeTH1F("medianrun", "APV Shot charge median", 256, -0.5, 255.5);
217  _subDetectorrun = _rhm.makeTH1F("subDetsrun", "SubDetector Shot distribution", 10, -0.5, 9.5);
218 
219  if (_useCabling) {
220  _fed = tfserv->make<TH1F>("fed", "FED Shot distribution", 440, 50, 490);
221  _fed->GetYaxis()->SetTitle("Shots");
222  _fedrun = _rhm.makeTH1F("fedrun", "FED Shot distribution", 440, 50, 490);
223 
224  _channelvsfed =
225  tfserv->make<TH2F>("channelvsfed", "Channel vs FED Shot distribution", 440, 50, 490, 97, -0.5, 96.5);
226  _channelvsfed->GetXaxis()->SetTitle("FED");
227  _channelvsfed->GetYaxis()->SetTitle("Channel");
228 
229  _nShotsVsFED =
230  tfserv->make<TH2F>("nShotsVsFED", "Number of Shots per event vs fedid", 440, 50, 490, 200, -0.5, 199.5);
231  _nShotsVsFED->GetXaxis()->SetTitle("fedId");
232  _nShots->GetYaxis()->SetTitle("Shots");
233  _nShots->GetZaxis()->SetTitle("Events");
234  _nShotsVsFED->StatOverflows(kTRUE);
235 
236  _medianVsFED = tfserv->make<TH2F>("medianVsFED", "APV Shot charge median vs fedid", 440, 50, 490, 256, -0.5, 255.5);
237  _medianVsFED->GetXaxis()->SetTitle("fedId");
238  _medianVsFED->GetYaxis()->SetTitle("Charge [ADC]");
239  _median->GetZaxis()->SetTitle("Shots");
240  }
241 
242  tkhisto = nullptr;
243  tkhisto2 = nullptr;
244 }
static const std::string kSharedResource
Definition: TFileService.h:76
std::unique_ptr< TkHistoMap > tkhisto
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TProfile ** _nShotsVsTimerun
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > _detCablingToken
TProfile * _nShotsbxcycleprev
TProfile * _nShotsdbxincycle
edm::ESWatcher< SiStripDetCablingRcd > _detCablingWatcher
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
edm::EDGetTokenT< EventWithHistory > _historyProductToken
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > _tkDetMapToken
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void updateDetCabling(const SiStripDetCablingRcd &iRcd)
TProfile * _nShotsbxcycle
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
TProfile * _nShotsdbxincycleprev
const std::string _phasepart
TProfile * _nShotsdbxprev
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
RunHistogramManager _rhm
std::unique_ptr< TkHistoMap > tkhisto2
edm::EDGetTokenT< APVCyclePhaseCollection > _apvphasecollToken
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > _digicollectionToken

◆ ~APVShotsAnalyzer()

APVShotsAnalyzer::~APVShotsAnalyzer ( )
override

Definition at line 246 of file APVShotsAnalyzer.cc.

References _detCabling.

246  {
247  // do anything here that needs to be done at desctruction time
248  // (e.g. close files, deallocate resources etc.)
249  if (_detCabling)
250  _detCabling = nullptr;
251 }
const SiStripDetCabling * _detCabling
The cabling object.

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 258 of file APVShotsAnalyzer.cc.

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

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

◆ beginJob()

void APVShotsAnalyzer::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 458 of file APVShotsAnalyzer.cc.

458 {}

◆ beginRun()

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

Definition at line 414 of file APVShotsAnalyzer.cc.

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

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

◆ endJob()

void APVShotsAnalyzer::endJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

◆ endRun()

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

Definition at line 455 of file APVShotsAnalyzer.cc.

455 {}

◆ updateDetCabling()

void APVShotsAnalyzer::updateDetCabling ( const SiStripDetCablingRcd iRcd)
private

Definition at line 481 of file APVShotsAnalyzer.cc.

References _detCabling, _detCablingToken, and edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get().

Referenced by APVShotsAnalyzer().

481 { _detCabling = &iRcd.get(_detCablingToken); }
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > _detCablingToken
const SiStripDetCabling * _detCabling
The cabling object.
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ _apvphasecollToken

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

Definition at line 87 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _channelvsfed

TH2F* APVShotsAnalyzer::_channelvsfed
private

Definition at line 104 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _detCabling

const SiStripDetCabling* APVShotsAnalyzer::_detCabling = nullptr
private

The cabling object.

Definition at line 92 of file APVShotsAnalyzer.cc.

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

◆ _detCablingToken

edm::ESGetToken<SiStripDetCabling, SiStripDetCablingRcd> APVShotsAnalyzer::_detCablingToken
private

Definition at line 91 of file APVShotsAnalyzer.cc.

Referenced by updateDetCabling().

◆ _detCablingWatcher

edm::ESWatcher<SiStripDetCablingRcd> APVShotsAnalyzer::_detCablingWatcher
private

Definition at line 90 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _digicollectionToken

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

Definition at line 85 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _fed

TH1F* APVShotsAnalyzer::_fed
private

Definition at line 103 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _fedrun

TH1F** APVShotsAnalyzer::_fedrun
private

Definition at line 124 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _historyProductToken

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

Definition at line 86 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _median

TH1F* APVShotsAnalyzer::_median
private

Definition at line 101 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _medianrun

TH1F** APVShotsAnalyzer::_medianrun
private

Definition at line 122 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _medianVsFED

TH2F* APVShotsAnalyzer::_medianVsFED
private

Definition at line 113 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nevents

int APVShotsAnalyzer::_nevents
private

Definition at line 96 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShots

TH1F* APVShotsAnalyzer::_nShots
private

Definition at line 98 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsbxcycle

TProfile* APVShotsAnalyzer::_nShotsbxcycle
private

Definition at line 106 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsbxcycleprev

TProfile* APVShotsAnalyzer::_nShotsbxcycleprev
private

Definition at line 109 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsdbx

TProfile* APVShotsAnalyzer::_nShotsdbx
private

Definition at line 107 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsdbxincycle

TProfile* APVShotsAnalyzer::_nShotsdbxincycle
private

Definition at line 108 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsdbxincycleprev

TProfile* APVShotsAnalyzer::_nShotsdbxincycleprev
private

Definition at line 111 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsdbxprev

TProfile* APVShotsAnalyzer::_nShotsdbxprev
private

Definition at line 110 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsrun

TH1F** APVShotsAnalyzer::_nShotsrun
private

Definition at line 118 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _nShotsVsFED

TH2F* APVShotsAnalyzer::_nShotsVsFED
private

Definition at line 114 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _nShotsVsTimerun

TProfile** APVShotsAnalyzer::_nShotsVsTimerun
private

Definition at line 119 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _phasepart

const std::string APVShotsAnalyzer::_phasepart
private

Definition at line 93 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _rhm

RunHistogramManager APVShotsAnalyzer::_rhm
private

Definition at line 116 of file APVShotsAnalyzer.cc.

Referenced by beginRun().

◆ _stripMult

TH1F* APVShotsAnalyzer::_stripMult
private

Definition at line 100 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _stripMultrun

TH1F** APVShotsAnalyzer::_stripMultrun
private

Definition at line 121 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _subDetector

TH1F* APVShotsAnalyzer::_subDetector
private

Definition at line 102 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _subDetectorrun

TH1F** APVShotsAnalyzer::_subDetectorrun
private

Definition at line 123 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _suffix

std::string APVShotsAnalyzer::_suffix
private

Definition at line 95 of file APVShotsAnalyzer.cc.

◆ _tkDetMapToken

edm::ESGetToken<TkDetMap, TrackerTopologyRcd> APVShotsAnalyzer::_tkDetMapToken
private

Definition at line 88 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _useCabling

bool APVShotsAnalyzer::_useCabling
private

Definition at line 89 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _whichAPV

TH1F* APVShotsAnalyzer::_whichAPV
private

Definition at line 99 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ _whichAPVrun

TH1F** APVShotsAnalyzer::_whichAPVrun
private

Definition at line 120 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and beginRun().

◆ _zs

bool APVShotsAnalyzer::_zs
private

Definition at line 94 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ tkhisto

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

Definition at line 126 of file APVShotsAnalyzer.cc.

Referenced by analyze().

◆ tkhisto2

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

Definition at line 126 of file APVShotsAnalyzer.cc.

Referenced by analyze().