CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 APVShotsAnalyzer (const edm::ParameterSet &)
 
 ~APVShotsAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endJob () override
 
virtual 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
 
TkHistoMaptkhisto
 
TkHistoMaptkhisto2
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 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(0)
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 =new TkHistoMap("ShotMultiplicity","ShotMultiplicity",-1);
221  tkhisto2 =new TkHistoMap("StripMultiplicity","StripMultiplicity",-1);
222 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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)
TkHistoMap * tkhisto2
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.
TkHistoMap * tkhisto
TProfile * _nShotsdbxincycleprev
const std::string _phasepart
TProfile * _nShotsdbxprev
RunHistogramManager _rhm
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 ( )

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 = 0;
231 
232 }
const SiStripDetCabling * _detCabling
The cabling object.

Member Function Documentation

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

Implements edm::EDAnalyzer.

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, TkHistoMap::add(), sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, FedChannelConnection::fedCh(), FedChannelConnection::fedId(), TkHistoMap::fill(), edm::Event::getByToken(), SiStripDetCabling::getConnection(), SiStripDetCabling::getConnections(), APVShotFinder::getShots(), APVCyclePhaseCollection::invalid, FedChannelConnection::isConnected(), LogDebug, APVCyclePhaseCollection::multiphase, APVCyclePhaseCollection::nopartition, edm::EventBase::orbitNumber(), tkhisto, tkhisto2, and updateDetCabling().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 443 of file APVShotsAnalyzer.cc.

444 {
445 
446 }
void APVShotsAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 395 of file APVShotsAnalyzer.cc.

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

396 {
397 
398 
399  _rhm.beginRun(iRun);
400 
401  if(_nShotsrun && *_nShotsrun) {
402  (*_nShotsrun)->GetXaxis()->SetTitle("Shots"); (*_nShotsrun)->GetYaxis()->SetTitle("Events");
403  (*_nShotsrun)->StatOverflows(kTRUE);
404  }
405 
407  (*_nShotsVsTimerun)->GetXaxis()->SetTitle("Orbit"); (*_nShotsVsTimerun)->GetYaxis()->SetTitle("Number of Shots");
408  (*_nShotsVsTimerun)->SetBit(TH1::kCanRebin);
409  }
410 
411  if(_whichAPVrun && *_whichAPVrun) {
412  (*_whichAPVrun)->GetXaxis()->SetTitle("APV"); (*_whichAPVrun)->GetYaxis()->SetTitle("Shots");
413  }
414 
415  if(_stripMultrun && *_stripMultrun) {
416  (*_stripMultrun)->GetXaxis()->SetTitle("Number of Strips"); (*_stripMultrun)->GetYaxis()->SetTitle("Shots");
417  }
418 
419  if(_medianrun && *_medianrun) {
420  (*_medianrun)->GetXaxis()->SetTitle("Charge [ADC]"); (*_medianrun)->GetYaxis()->SetTitle("Shots");
421  }
422 
424  (*_subDetectorrun)->GetYaxis()->SetTitle("Shots");
425  }
426 
427  if (_useCabling) {
428  if(_fedrun && *_fedrun) {
429  (*_fedrun)->GetYaxis()->SetTitle("Shots");
430  }
431  }
432 
433 }
TProfile ** _nShotsVsTimerun
void beginRun(const edm::Run &iRun)
RunHistogramManager _rhm
void APVShotsAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 450 of file APVShotsAnalyzer.cc.

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

450  {
451 
452  edm::LogInfo("EndOfJob") << _nevents << " analyzed events";
453 
455  TrackerMap tkmap,tkmap2;
456 
457  tkmap.setPalette(1);
458  tkmap2.setPalette(1);
459  tkhisto->dumpInTkMap(&tkmap);
460  tkhisto2->dumpInTkMap(&tkmap2);
461  std::string tkshotmultmapname = "ShotMultiplicity_" + _suffix + ".png";
462  tkmap.save(true,0,0,tkshotmultmapname);
463  std::string tkstripmultmapname = "StripMultiplicity_" + _suffix + ".png";
464  tkmap2.save(true,0,0,tkstripmultmapname);
465 
466  std::string rootmapname = "TKMap_"+_suffix+".root";
467  tkhisto->save(rootmapname);
468  tkhisto2->save(rootmapname);
469 }
void save(std::string filename)
Definition: TkHistoMap.cc:57
TkHistoMap * tkhisto2
void setPalette(int numpalette)
Definition: TrackerMap.h:123
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:698
void dumpInTkMap(TrackerMap *tkmap, bool dumpEntries=false)
Definition: TkHistoMap.cc:234
TkHistoMap * tkhisto
void APVShotsAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 436 of file APVShotsAnalyzer.cc.

437 {
438 }
void APVShotsAnalyzer::updateDetCabling ( const edm::EventSetup setup)
private

Definition at line 472 of file APVShotsAnalyzer.cc.

References _cacheIdDet, _detCabling, _useCabling, trackerHits::c, edm::EventSetup::get(), and edm::ESHandle< class >::product().

Referenced by analyze().

473 {
474  if (_useCabling){
475  uint32_t cache_id = setup.get<SiStripDetCablingRcd>().cacheIdentifier();//.get( cabling_ );
476 
477  if ( _cacheIdDet != cache_id ) { // If the cache ID has changed since the last update...
478  // Update the cabling object
480  setup.get<SiStripDetCablingRcd>().get( c );
481  _detCabling = c.product();
482  _cacheIdDet = cache_id;
483  } // end of new cache ID check
484  }
485 }
const SiStripDetCabling * _detCabling
The cabling object.
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
uint32_t _cacheIdDet
DB cache ID used to establish if the cabling has changed during the run.

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(), and endJob().

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(), and endJob().

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().

TkHistoMap* APVShotsAnalyzer::tkhisto
private

Definition at line 123 of file APVShotsAnalyzer.cc.

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

TkHistoMap * APVShotsAnalyzer::tkhisto2
private

Definition at line 123 of file APVShotsAnalyzer.cc.

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