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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<typename ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag)
 
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)
 

Detailed Description

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

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

Definition at line 70 of file APVShotsAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 143 of file APVShotsAnalyzer.cc.

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.

143  :
145  _historyProductToken(consumes<EventWithHistory>(iConfig.getParameter<edm::InputTag>("historyProduct"))),
146  _apvphasecollToken(consumes<APVCyclePhaseCollection>(iConfig.getParameter<edm::InputTag>("apvPhaseCollection"))),
147  _phasepart(iConfig.getUntrackedParameter<std::string>("phasePartition","None")),
148  _zs(iConfig.getUntrackedParameter<bool>("zeroSuppressed",true)),
149  _suffix(iConfig.getParameter<std::string>("mapSuffix")),
150  _nevents(0),
152  _useCabling(iConfig.getUntrackedParameter<bool>("useCabling",true)),
153  _cacheIdDet(0),
154  _detCabling(nullptr)
155 {
156  //now do what ever initialization is needed
157 
158  if(!_zs) _suffix += "_notZS";
159 
161 
162  _nShots = tfserv->make<TH1F>("nShots","Number of Shots per event",200,-0.5,199.5);
163  _nShots->GetXaxis()->SetTitle("Shots"); _nShots->GetYaxis()->SetTitle("Events");
164  _nShots->StatOverflows(kTRUE);
165 
166  _whichAPV = tfserv->make<TH1F>("whichAPV","APV with shots",6,-0.5,5.5);
167  _whichAPV->GetXaxis()->SetTitle("APV"); _whichAPV->GetYaxis()->SetTitle("Shots");
168 
169  _stripMult = tfserv->make<TH1F>("stripMultiplicity","Shot Strip Multiplicity",129,-0.5,128.5);
170  _stripMult->GetXaxis()->SetTitle("Number of Strips"); _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]"); _median->GetYaxis()->SetTitle("Shots");
174 
175  _subDetector = tfserv->make<TH1F>("subDets","SubDetector Shot distribution",10,-0.5,9.5);
176  _subDetector->GetYaxis()->SetTitle("Shots");
177 
178  _nShotsbxcycle = tfserv->make<TProfile>("nShotsBXcycle","Number of shots vs APV cycle bin",70,-0.5,69.5);
179  _nShotsbxcycle->GetXaxis()->SetTitle("Event BX mod(70)"); _nShotsbxcycle->GetYaxis()->SetTitle("APV shots");
180 
181  _nShotsdbx = tfserv->make<TProfile>("nShotsDBX","Number of shots vs #Delta(BX)",1000,-0.5,999.5);
182  _nShotsdbx->GetXaxis()->SetTitle("Event #Delta(BX)"); _nShotsdbx->GetYaxis()->SetTitle("APV shots");
183 
184  _nShotsdbxincycle = tfserv->make<TProfile>("nShotsDBXincycle","Number of shots vs #Delta(BX) w.r.t. APV cycle",1000,-0.5,999.5);
185  _nShotsdbxincycle->GetXaxis()->SetTitle("Event #Delta(BX) w.r.t. APV cycle"); _nShotsdbxincycle->GetYaxis()->SetTitle("APV shots");
186 
187  _nShotsbxcycleprev = tfserv->make<TProfile>("nShotsBXcycleprev","Number of shots vs APV cycle bin of previous L1A",70,-0.5,69.5);
188  _nShotsbxcycleprev->GetXaxis()->SetTitle("Previous L1A BX mod(70)"); _nShotsbxcycleprev->GetYaxis()->SetTitle("APV shots");
189 
190  _nShotsdbxprev = tfserv->make<TProfile>("nShotsDBXprev","Number of shots vs #Delta(BX) of previous L1A",1000,-0.5,999.5);
191  _nShotsdbxprev->GetXaxis()->SetTitle("Previous L1A #Delta(BX)"); _nShotsdbxprev->GetYaxis()->SetTitle("APV shots");
192 
193  _nShotsdbxincycleprev = tfserv->make<TProfile>("nShotsDBXincycleprev","Number of shots vs #Delta(BX) w.r.t. APV cycle of previous L1A",1000,-0.5,999.5);
194  _nShotsdbxincycleprev->GetXaxis()->SetTitle("Previous L1A #Delta(BX) w.r.t. APV cycle"); _nShotsdbxincycleprev->GetYaxis()->SetTitle("APV shots");
195 
196  _nShotsrun = _rhm.makeTH1F("nShotsrun","Number of Shots per event",200,-0.5,199.5);
197  _nShotsVsTimerun = _rhm.makeTProfile("nShotsVsTimerun","Mean number of shots vs orbit number",4*500,0,500*262144);
198  _whichAPVrun = _rhm.makeTH1F("whichAPVrun","APV with shots",6,-0.5,5.5);
199  _stripMultrun = _rhm.makeTH1F("stripMultiplicityrun","Shot Strip Multiplicity",129,-0.5,128.5);
200  _medianrun = _rhm.makeTH1F("medianrun","APV Shot charge median",256,-0.5,255.5);
201  _subDetectorrun = _rhm.makeTH1F("subDetsrun","SubDetector Shot distribution",10,-0.5,9.5);
202 
203  if (_useCabling) {
204  _fed = tfserv->make<TH1F>("fed","FED Shot distribution",440,50,490);
205  _fed->GetYaxis()->SetTitle("Shots");
206  _fedrun = _rhm.makeTH1F("fedrun","FED Shot distribution",440,50,490);
207 
208  _channelvsfed = tfserv->make<TH2F>("channelvsfed","Channel vs FED Shot distribution",440,50,490,97,-0.5,96.5);
209  _channelvsfed->GetXaxis()->SetTitle("FED"); _channelvsfed->GetYaxis()->SetTitle("Channel");
210 
211 
212  _nShotsVsFED = tfserv->make<TH2F>("nShotsVsFED","Number of Shots per event vs fedid",440,50,490,200,-0.5,199.5);
213  _nShotsVsFED->GetXaxis()->SetTitle("fedId"); _nShots->GetYaxis()->SetTitle("Shots"); _nShots->GetZaxis()->SetTitle("Events");
214  _nShotsVsFED->StatOverflows(kTRUE);
215 
216  _medianVsFED = tfserv->make<TH2F>("medianVsFED","APV Shot charge median vs fedid",440,50,490,256,-0.5,255.5);
217  _medianVsFED->GetXaxis()->SetTitle("fedId");_medianVsFED->GetYaxis()->SetTitle("Charge [ADC]"); _median->GetZaxis()->SetTitle("Shots");
218  }
219 
220  tkhisto = nullptr;
221  tkhisto2 = nullptr;
222 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< TkHistoMap > tkhisto
TProfile ** _nShotsVsTimerun
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TProfile * _nShotsbxcycleprev
TProfile * _nShotsdbxincycle
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
edm::EDGetTokenT< EventWithHistory > _historyProductToken
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
TProfile * _nShotsbxcycle
TProfile ** makeTProfile(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
const SiStripDetCabling * _detCabling
The cabling object.
TProfile * _nShotsdbxincycleprev
const std::string _phasepart
TProfile * _nShotsdbxprev
RunHistogramManager _rhm
std::unique_ptr< TkHistoMap > tkhisto2
edm::EDGetTokenT< APVCyclePhaseCollection > _apvphasecollToken
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > _digicollectionToken
uint32_t _cacheIdDet
DB cache ID used to establish if the cabling has changed during the run.
APVShotsAnalyzer::~APVShotsAnalyzer ( )
override

Definition at line 225 of file APVShotsAnalyzer.cc.

References _detCabling.

226 {
227 
228  // do anything here that needs to be done at desctruction time
229  // (e.g. close files, deallocate resources etc.)
230  if ( _detCabling ) _detCabling = nullptr;
231 
232 }
const SiStripDetCabling * _detCabling
The cabling object.

Member Function Documentation

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

Definition at line 241 of file APVShotsAnalyzer.cc.

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, EventWithHistory::absoluteBXinCycle(), EventWithHistory::deltaBX(), EventWithHistory::deltaBXinCycle(), edm::HandleBase::failedToGet(), sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, FedChannelConnection::fedCh(), FedChannelConnection::fedId(), edm::EventSetup::get(), edm::Event::getByToken(), SiStripDetCabling::getConnection(), SiStripDetCabling::getConnections(), APVCyclePhaseCollection::getPhase(), APVShotFinder::getShots(), hcalSimParameters_cfi::he, APVCyclePhaseCollection::invalid, FedChannelConnection::isConnected(), edm::HandleBase::isValid(), LogDebug, APVCyclePhaseCollection::multiphase, APVCyclePhaseCollection::nopartition, edm::EventBase::orbitNumber(), edm::ESHandle< T >::product(), tkhisto, tkhisto2, and updateDetCabling().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 452 of file APVShotsAnalyzer.cc.

453 {
454 
455 }
void APVShotsAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivate

Definition at line 404 of file APVShotsAnalyzer.cc.

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

405 {
406 
407 
408  _rhm.beginRun(iRun);
409 
410  if(_nShotsrun && *_nShotsrun) {
411  (*_nShotsrun)->GetXaxis()->SetTitle("Shots"); (*_nShotsrun)->GetYaxis()->SetTitle("Events");
412  (*_nShotsrun)->StatOverflows(kTRUE);
413  }
414 
416  (*_nShotsVsTimerun)->GetXaxis()->SetTitle("Orbit"); (*_nShotsVsTimerun)->GetYaxis()->SetTitle("Number of Shots");
417  (*_nShotsVsTimerun)->SetCanExtend(TH1::kXaxis);
418  }
419 
420  if(_whichAPVrun && *_whichAPVrun) {
421  (*_whichAPVrun)->GetXaxis()->SetTitle("APV"); (*_whichAPVrun)->GetYaxis()->SetTitle("Shots");
422  }
423 
424  if(_stripMultrun && *_stripMultrun) {
425  (*_stripMultrun)->GetXaxis()->SetTitle("Number of Strips"); (*_stripMultrun)->GetYaxis()->SetTitle("Shots");
426  }
427 
428  if(_medianrun && *_medianrun) {
429  (*_medianrun)->GetXaxis()->SetTitle("Charge [ADC]"); (*_medianrun)->GetYaxis()->SetTitle("Shots");
430  }
431 
433  (*_subDetectorrun)->GetYaxis()->SetTitle("Shots");
434  }
435 
436  if (_useCabling) {
437  if(_fedrun && *_fedrun) {
438  (*_fedrun)->GetYaxis()->SetTitle("Shots");
439  }
440  }
441 
442 }
TProfile ** _nShotsVsTimerun
void beginRun(const edm::Run &iRun)
RunHistogramManager _rhm
void APVShotsAnalyzer::endJob ( )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

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

Definition at line 445 of file APVShotsAnalyzer.cc.

446 {
447 }
void APVShotsAnalyzer::updateDetCabling ( const edm::EventSetup setup)
private

Definition at line 481 of file APVShotsAnalyzer.cc.

References _cacheIdDet, _detCabling, _useCabling, EnergyCorrector::c, DEFINE_FWK_MODULE, edm::EventSetup::get(), and edm::ESHandle< T >::product().

Referenced by analyze().

482 {
483  if (_useCabling){
484  uint32_t cache_id = setup.get<SiStripDetCablingRcd>().cacheIdentifier();//.get( cabling_ );
485 
486  if ( _cacheIdDet != cache_id ) { // If the cache ID has changed since the last update...
487  // Update the cabling object
489  setup.get<SiStripDetCablingRcd>().get( c );
490  _detCabling = c.product();
491  _cacheIdDet = cache_id;
492  } // end of new cache ID check
493  }
494 }
const SiStripDetCabling * _detCabling
The cabling object.
T get() const
Definition: EventSetup.h:68
uint32_t _cacheIdDet
DB cache ID used to establish if the cabling has changed during the run.
T const * product() const
Definition: ESHandle.h:84

Member Data Documentation

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

Definition at line 89 of file APVShotsAnalyzer.cc.

Referenced by analyze().

uint32_t APVShotsAnalyzer::_cacheIdDet
private

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

Definition at line 127 of file APVShotsAnalyzer.cc.

Referenced by updateDetCabling().

TH2F* APVShotsAnalyzer::_channelvsfed
private

Definition at line 101 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

const SiStripDetCabling* APVShotsAnalyzer::_detCabling
private

The cabling object.

Definition at line 128 of file APVShotsAnalyzer.cc.

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

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

Definition at line 87 of file APVShotsAnalyzer.cc.

Referenced by analyze().

TH1F* APVShotsAnalyzer::_fed
private

Definition at line 100 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TH1F** APVShotsAnalyzer::_fedrun
private

Definition at line 121 of file APVShotsAnalyzer.cc.

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

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

Definition at line 88 of file APVShotsAnalyzer.cc.

Referenced by analyze().

TH1F* APVShotsAnalyzer::_median
private

Definition at line 98 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TH1F** APVShotsAnalyzer::_medianrun
private

Definition at line 119 of file APVShotsAnalyzer.cc.

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

TH2F* APVShotsAnalyzer::_medianVsFED
private

Definition at line 110 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

int APVShotsAnalyzer::_nevents
private

Definition at line 93 of file APVShotsAnalyzer.cc.

Referenced by analyze().

TH1F* APVShotsAnalyzer::_nShots
private

Definition at line 95 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile* APVShotsAnalyzer::_nShotsbxcycle
private

Definition at line 103 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile* APVShotsAnalyzer::_nShotsbxcycleprev
private

Definition at line 106 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile* APVShotsAnalyzer::_nShotsdbx
private

Definition at line 104 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile* APVShotsAnalyzer::_nShotsdbxincycle
private

Definition at line 105 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile* APVShotsAnalyzer::_nShotsdbxincycleprev
private

Definition at line 108 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile* APVShotsAnalyzer::_nShotsdbxprev
private

Definition at line 107 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TH1F** APVShotsAnalyzer::_nShotsrun
private

Definition at line 115 of file APVShotsAnalyzer.cc.

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

TH2F* APVShotsAnalyzer::_nShotsVsFED
private

Definition at line 111 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TProfile** APVShotsAnalyzer::_nShotsVsTimerun
private

Definition at line 116 of file APVShotsAnalyzer.cc.

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

const std::string APVShotsAnalyzer::_phasepart
private

Definition at line 90 of file APVShotsAnalyzer.cc.

Referenced by analyze().

RunHistogramManager APVShotsAnalyzer::_rhm
private

Definition at line 113 of file APVShotsAnalyzer.cc.

Referenced by APVShotsAnalyzer(), and beginRun().

TH1F* APVShotsAnalyzer::_stripMult
private

Definition at line 97 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TH1F** APVShotsAnalyzer::_stripMultrun
private

Definition at line 118 of file APVShotsAnalyzer.cc.

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

TH1F* APVShotsAnalyzer::_subDetector
private

Definition at line 99 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TH1F** APVShotsAnalyzer::_subDetectorrun
private

Definition at line 120 of file APVShotsAnalyzer.cc.

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

std::string APVShotsAnalyzer::_suffix
private

Definition at line 92 of file APVShotsAnalyzer.cc.

Referenced by APVShotsAnalyzer().

bool APVShotsAnalyzer::_useCabling
private

Definition at line 126 of file APVShotsAnalyzer.cc.

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

TH1F* APVShotsAnalyzer::_whichAPV
private

Definition at line 96 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

TH1F** APVShotsAnalyzer::_whichAPVrun
private

Definition at line 117 of file APVShotsAnalyzer.cc.

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

bool APVShotsAnalyzer::_zs
private

Definition at line 91 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

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

Definition at line 123 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().

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

Definition at line 123 of file APVShotsAnalyzer.cc.

Referenced by analyze(), and APVShotsAnalyzer().