CMS 3D CMS Logo

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

#include <DQM/SiStripMonitorHardware/plugins/SiStripCMMonitor.cc>

Inheritance diagram for SiStripCMMonitorPlugin:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  Statistics
 

Public Member Functions

 SiStripCMMonitorPlugin (const edm::ParameterSet &)
 
 ~SiStripCMMonitorPlugin ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void fillMaps (uint32_t aDetId, unsigned short aChInModule, std::pair< uint16_t, uint16_t > aMedians)
 
void updateCabling (const edm::EventSetup &eventSetup)
 

Private Attributes

const SiStripFedCablingcabling_
 
uint32_t cablingCacheId_
 
CMHistograms cmHists_
 
std::map< unsigned int, StatisticsCommonModes_
 
std::map< unsigned int, StatisticsCommonModesAPV0minusAPV1_
 
bool doTkHistoMap_
 
edm::EventNumber_t evt_
 
std::vector< unsigned int > fedIdVec_
 
bool fillAllDetailedHistograms_
 
bool fillWithEvtNum_
 
bool fillWithLocalEvtNum_
 
std::string folderName_
 
std::pair< uint16_t, uint16_t > prevMedians_ [FEDNumbering::MAXSiStripFEDID+1][sistrip::FEDCH_PER_FED]
 
unsigned int printDebug_
 
edm::InputTag rawDataTag_
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::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)
 
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: DQM source application to monitor common mode for SiStrip data

Definition at line 62 of file SiStripCMMonitor.cc.

Constructor & Destructor Documentation

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

Definition at line 123 of file SiStripCMMonitor.cc.

References cmHists_, CommonModes_, CommonModesAPV0minusAPV1_, doTkHistoMap_, evt_, sistrip::FEDCH_PER_FED, fillAllDetailedHistograms_, fillWithEvtNum_, folderName_, LogTrace, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, NULL, prevMedians_, printDebug_, rawDataTag_, and rawDataToken_.

124  : rawDataTag_(iConfig.getUntrackedParameter<edm::InputTag>("RawDataTag",edm::InputTag("source",""))),
125  folderName_(iConfig.getUntrackedParameter<std::string>("HistogramFolderName","SiStrip/ReadoutView/CMMonitoring")),
126  fedIdVec_(iConfig.getUntrackedParameter<std::vector<unsigned int> >("FedIdVec")),
127  fillAllDetailedHistograms_(iConfig.getUntrackedParameter<bool>("FillAllDetailedHistograms",false)),
128  fillWithEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithEventNumber",false)),
129  fillWithLocalEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithLocalEventNumber",false)),
130  printDebug_(iConfig.getUntrackedParameter<unsigned int>("PrintDebugMessages",1)),
131  cablingCacheId_(0)
132 
133 {
134  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag_);
135  //print config to debug log
136  std::ostringstream debugStream;
137  if (printDebug_>1) {
138  debugStream << "[SiStripCMMonitorPlugin]Configuration for SiStripCMMonitorPlugin: " << std::endl
139  << "[SiStripCMMonitorPlugin]\tRawDataTag: " << rawDataTag_ << std::endl
140  << "[SiStripCMMonitorPlugin]\tHistogramFolderName: " << folderName_ << std::endl
141  << "[SiStripCMMonitorPlugin]\tFillAllDetailedHistograms? " << (fillAllDetailedHistograms_ ? "yes" : "no") << std::endl
142  << "[SiStripCMMonitorPlugin]\tFillWithEventNumber?" << (fillWithEvtNum_ ? "yes" : "no") << std::endl
143  << "[SiStripCMMonitorPlugin]\tPrintDebugMessages? " << (printDebug_ ? "yes" : "no") << std::endl;
144  }
145 
146  std::ostringstream* pDebugStream = (printDebug_>1 ? &debugStream : NULL);
147 
148  cmHists_.initialise(iConfig,pDebugStream);
149 
150  doTkHistoMap_ = cmHists_.tkHistoMapEnabled();
151 
152  CommonModes_.clear();
154 
155  for (unsigned int fedId(FEDNumbering::MINSiStripFEDID); fedId <= FEDNumbering::MAXSiStripFEDID; fedId++){
156  for (unsigned int iCh(0); iCh<sistrip::FEDCH_PER_FED; iCh++){
157  prevMedians_[fedId][iCh] = std::pair<uint16_t,uint16_t>(0,0);
158  }
159  }
160 
161 
162  if (printDebug_)
163  LogTrace("SiStripMonitorHardware") << debugStream.str();
164 
165  evt_ = 0;
166 
167 }
T getUntrackedParameter(std::string const &, T const &) const
std::pair< uint16_t, uint16_t > prevMedians_[FEDNumbering::MAXSiStripFEDID+1][sistrip::FEDCH_PER_FED]
#define NULL
Definition: scimark2.h:8
std::vector< unsigned int > fedIdVec_
std::map< unsigned int, Statistics > CommonModesAPV0minusAPV1_
edm::EventNumber_t evt_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
#define LogTrace(id)
std::map< unsigned int, Statistics > CommonModes_
static const uint16_t FEDCH_PER_FED
SiStripCMMonitorPlugin::~SiStripCMMonitorPlugin ( )

Definition at line 169 of file SiStripCMMonitor.cc.

170 {
171 }

Member Function Documentation

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

Definition at line 195 of file SiStripCMMonitor.cc.

References cabling_, cmHists_, sistrip::FEDChannel::cmMedian(), gather_cfg::cout, FEDRawData::data(), FedChannelConnection::detId(), edm::EventID::event(), evt_, sistrip::FEDCH_PER_FED, SiStripFedCabling::fedConnection(), FEDRawDataCollection::FEDData(), fillMaps(), fillWithEvtNum_, fillWithLocalEvtNum_, edm::EventSetup::get(), edm::Event::getByToken(), edm::EventBase::id(), sistrip::invalid32_, FedChannelConnection::isConnected(), sistrip::FEDChannel::length(), FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, FedChannelConnection::nApvPairs(), edm::EventBase::orbitNumber(), prevMedians_, printDebug_, edm::ESHandle< T >::product(), rawDataToken_, FEDRawData::size(), updateCabling(), and MuonErrorMatrixValues_cff::values.

197 {
198  //Retrieve tracker topology from geometry
199  edm::ESHandle<TrackerTopology> tTopoHandle;
200  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
201  const TrackerTopology* const tTopo = tTopoHandle.product();
202 
203  //static bool firstEvent = true;
204  //static bool isBeingFilled = false;
205  //update cabling
206  updateCabling(iSetup);
207 
208  //get raw data
209  edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
210  iEvent.getByToken(rawDataToken_,rawDataCollectionHandle);
211  const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
212 
213  //FED errors
214  FEDErrors lFedErrors;
215 
216  //loop over siStrip FED IDs
217  for (unsigned int fedId = FEDNumbering::MINSiStripFEDID;
219  fedId++) {//loop over FED IDs
220  const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
221 
222  //create an object to fill all errors
223  lFedErrors.initialiseFED(fedId,cabling_,tTopo);
224 
225  //Do detailed check
226  //first check if data exists
227  bool lDataExist = lFedErrors.checkDataPresent(fedData);
228  if (!lDataExist) {
229  continue;
230  }
231 
232  std::auto_ptr<const sistrip::FEDBuffer> buffer;
233 
234  if (!lFedErrors.fillFatalFEDErrors(fedData,0)) {
235  continue;
236  }
237  else {
238  //need to construct full object to go any further
239  buffer.reset(new sistrip::FEDBuffer(fedData.data(),fedData.size(),true));
240  bool channelLengthsOK = buffer->checkChannelLengthsMatchBufferLength();
241  bool channelPacketCodesOK = buffer->checkChannelPacketCodes();
242  bool feLengthsOK = buffer->checkFEUnitLengths();
243  if ( !channelLengthsOK ||
244  !channelPacketCodesOK ||
245  !feLengthsOK ) {
246  continue;
247  }
248  }
249 
250  std::ostringstream infoStream;
251 
252 
253  if (printDebug_ > 1) {
254  infoStream << " --- Processing FED #" << fedId << std::endl;
255  }
256 
257 
258  std::vector<CMHistograms::CMvalues> values;
259 
260  for (unsigned int iCh = 0;
261  iCh < sistrip::FEDCH_PER_FED;
262  iCh++) {//loop on channels
263 
264  const FedChannelConnection & lConnection = cabling_->fedConnection(fedId,iCh);
265  bool connected = lConnection.isConnected();
266 
267  //std::cout << "FedID " << fedId << ", ch " << iCh << ", nAPVPairs " << lConnection.nApvPairs() << " apvPairNumber " << lConnection.apvPairNumber() << std::endl;
268 
269  if (!connected) {
270  continue;
271  }
272 
273  uint32_t lDetId = lConnection.detId();
274  unsigned short nChInModule = lConnection.nApvPairs();
275 
276  if (!lDetId || lDetId == sistrip::invalid32_) continue;
277 
278  bool lFailUnpackerChannelCheck = !buffer->channelGood(iCh) && connected;
279 
280  if (lFailUnpackerChannelCheck) {
281  continue;
282  }
283 
284 
285  //short lAPVPair = lConnection.apvPairNumber();
286  //short lSubDet = DetId(lDetId).subdetId();
287 
288 // if (firstEvent){
289 // infoStream << "Subdet " << lSubDet << ", " ;
290 // if (lSubDet == 3) {
291 //
292 // infoStream << "TIB layer " << tTopo->tibLayer(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
293 // }
294 // else if (lSubDet == 4) {
295 //
296 // infoStream << "TID side " << tTopo->tibSide(lDetId) << " wheel " << tTopo->tibWheel(lDetId) << ", ring " << tTopo->tibRing(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
297 // }
298 // else if (lSubDet == 5) {
299 //
300 // infoStream << "TOB side " << tTopo->tibRod(lDetId)[0] << " layer " << tTopo->tibLayer(lDetId) << ", rod " << tTopo->tibRodNumber(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
301 // }
302 // else if (lSubDet == 6) {
303 //
304 // infoStream << "TEC side " << tTopo->tibSide(lDetId) << " wheel " << tTopo->tibWheel(lDetId) << ", petal " << tTopo->tibPetalNumber(lDetId) << ", ring " << tTopo->tibRing(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
305 // }
306 // isBeingFilled=true;
307 // }
308 
309  std::ostringstream lMode;
310  lMode << buffer->readoutMode();
311  if (evt_ == 0 && printDebug_ > 1)
312  std::cout << "Readout mode: " << lMode.str() << std::endl;
313 
314 
315  const sistrip::FEDChannel & lChannel = buffer->channel(iCh);
316  std::pair<uint16_t,uint16_t> medians = std::pair<uint16_t,uint16_t>(0,0);
317 
318  if (lMode.str().find("Zero suppressed") != lMode.str().npos && lMode.str().find("lite") == lMode.str().npos) medians = std::pair<uint16_t,uint16_t>(lChannel.cmMedian(0),lChannel.cmMedian(1));
319 
320  CMHistograms::CMvalues lVal;
321  lVal.ChannelID = iCh;
322  lVal.Medians = std::pair<uint16_t,uint16_t>(medians.first,medians.second);
323  lVal.PreviousMedians = prevMedians_[fedId][iCh];
324 
325 // if (medians.second-medians.first > 26){
326 // std::ostringstream info;
327 // if (medians.second-medians.first > 44) info << " --- Second bump: event " << iEvent.id().event() << ", FED/Channel " << fedId << "/" << iCh << ", delta=" << medians.second-medians.first << std::endl;
328 // else info << " --- First bump: event " << iEvent.id().event() << ", FED/Channel " << fedId << "/" << iCh << ", delta=" << medians.second-medians.first << std::endl;
329 // edm::LogVerbatim("SiStripMonitorHardware") << info.str();
330 // }
331 
332  if (printDebug_ > 1) {
333  if (lChannel.length() > 7) {
334  infoStream << "Medians for channel #" << iCh << " (length " << lChannel.length() << "): " << medians.first << ", " << medians.second << std::endl;
335  }
336  }
337 
338  values.push_back(lVal);
339 
340  //if (iEvent.id().event() > 1000)
341  fillMaps(lDetId,nChInModule,medians);
342 
343  prevMedians_[fedId][iCh] = std::pair<uint16_t,uint16_t>(medians.first,medians.second);
344 
345  }//loop on channels
346 
347  float lTime = 0;
348  if (fillWithEvtNum_) {
349  // casting from unsigned long long to a float here
350  // doing it explicitely
351  lTime = static_cast<float>(iEvent.id().event());
352  } else {
353  if (fillWithLocalEvtNum_) {
354  // casting from unsigned long long to a float here
355  // doing it explicitely
356  lTime = static_cast<float>(evt_);
357  } else {
358  lTime = iEvent.orbitNumber()/11223.;
359  }
360  }
361 
362  cmHists_.fillHistograms(values,lTime,fedId);
363 
364  //if (printDebug_ > 0 && isBeingFilled && firstEvent) edm::LogVerbatim("SiStripMonitorHardware") << infoStream.str();
365 
366 
367 
368  }//loop on FEDs
369 
370 
371  //if (isBeingFilled)
372  //firstEvent = false;
373 
374  evt_++;
375 
376 }//analyze method
EventNumber_t event() const
Definition: EventID.h:41
std::pair< uint16_t, uint16_t > prevMedians_[FEDNumbering::MAXSiStripFEDID+1][sistrip::FEDCH_PER_FED]
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
static const uint32_t invalid32_
Definition: Constants.h:15
void fillMaps(uint32_t aDetId, unsigned short aChInModule, std::pair< uint16_t, uint16_t > aMedians)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
uint16_t cmMedian(const uint8_t apvIndex) const
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void updateCabling(const edm::EventSetup &eventSetup)
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
edm::EventNumber_t evt_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
int orbitNumber() const
Definition: EventBase.h:67
const T & get() const
Definition: EventSetup.h:56
const uint16_t & nApvPairs() const
const SiStripFedCabling * cabling_
edm::EventID id() const
Definition: EventBase.h:60
static const uint16_t FEDCH_PER_FED
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
T const * product() const
Definition: ESHandle.h:86
void SiStripCMMonitorPlugin::bookHistograms ( DQMStore::IBooker ,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 179 of file SiStripCMMonitor.cc.

References cmHists_, fillAllDetailedHistograms_, folderName_, and DQMStore::IBooker::setCurrentFolder().

180 {
181  ibooker.setCurrentFolder(folderName_);
182 
183  cmHists_.bookTopLevelHistograms(ibooker);
184 
185  if (fillAllDetailedHistograms_) cmHists_.bookAllFEDHistograms(ibooker);
186 }
void SiStripCMMonitorPlugin::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprivate

Definition at line 188 of file SiStripCMMonitor.cc.

189 {
190 
191 }
void SiStripCMMonitorPlugin::fillMaps ( uint32_t  aDetId,
unsigned short  aChInModule,
std::pair< uint16_t, uint16_t >  aMedians 
)
private

Definition at line 451 of file SiStripCMMonitor.cc.

References CommonModes_, CommonModesAPV0minusAPV1_, SiStripCMMonitorPlugin::Statistics::Counter, DEFINE_FWK_MODULE, doTkHistoMap_, SiStripCMMonitorPlugin::Statistics::Mean, SiStripCMMonitorPlugin::Statistics::Rms, and edm::second().

Referenced by analyze().

452 {
453 
454  if (doTkHistoMap_){//if TkHistMap is enabled
455  std::pair<std::map<unsigned int,Statistics>::iterator,bool> alreadyThere[2];
456 
457  Statistics lStat;
458  lStat.Mean = (aMedians.first+aMedians.second)*1./(2*aChInModule);
459  lStat.Rms = (aMedians.first+aMedians.second)*(aMedians.first+aMedians.second)*1./(4*aChInModule);
460  lStat.Counter = 1./aChInModule;
461 
462  alreadyThere[0] = CommonModes_.insert(std::pair<unsigned int,Statistics>(aDetId,lStat));
463  if (!alreadyThere[0].second) {
464  ((alreadyThere[0].first)->second).Mean += (aMedians.first+aMedians.second)*1./(2*aChInModule);
465  ((alreadyThere[0].first)->second).Rms += (aMedians.first+aMedians.second)*(aMedians.first+aMedians.second)*1./(4*aChInModule);
466  ((alreadyThere[0].first)->second).Counter += 1./aChInModule;
467  }
468 
469  lStat.Mean = (aMedians.first-aMedians.second)*1./aChInModule;
470  lStat.Rms = (aMedians.first-aMedians.second)*(aMedians.first-aMedians.second)*1./aChInModule;
471  lStat.Counter = 1./aChInModule;
472 
473  alreadyThere[1] = CommonModesAPV0minusAPV1_.insert(std::pair<unsigned int,Statistics>(aDetId,lStat));
474  if (!alreadyThere[1].second) {
475  ((alreadyThere[1].first)->second).Mean += (aMedians.first-aMedians.second)*1./aChInModule;
476  ((alreadyThere[1].first)->second).Rms += (aMedians.first-aMedians.second)*(aMedians.first-aMedians.second)*1./aChInModule;
477  ((alreadyThere[1].first)->second).Counter += 1./aChInModule;
478  }
479 
480  }
481 
482 }
std::map< unsigned int, Statistics > CommonModesAPV0minusAPV1_
U second(std::pair< T, U > const &p)
std::map< unsigned int, Statistics > CommonModes_
void SiStripCMMonitorPlugin::updateCabling ( const edm::EventSetup eventSetup)
private

Definition at line 439 of file SiStripCMMonitor.cc.

References cabling_, cablingCacheId_, edm::EventSetup::get(), and edm::ESHandle< T >::product().

Referenced by analyze().

440 {
441  uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
442  if (cablingCacheId_ != currentCacheId) {
443  edm::ESHandle<SiStripFedCabling> cablingHandle;
444  eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
445  cabling_ = cablingHandle.product();
446  cablingCacheId_ = currentCacheId;
447  }
448 }
const T & get() const
Definition: EventSetup.h:56
const SiStripFedCabling * cabling_
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

const SiStripFedCabling* SiStripCMMonitorPlugin::cabling_
private

Definition at line 102 of file SiStripCMMonitor.cc.

Referenced by analyze(), and updateCabling().

uint32_t SiStripCMMonitorPlugin::cablingCacheId_
private

Definition at line 101 of file SiStripCMMonitor.cc.

Referenced by updateCabling().

CMHistograms SiStripCMMonitorPlugin::cmHists_
private

Definition at line 107 of file SiStripCMMonitor.cc.

Referenced by analyze(), bookHistograms(), and SiStripCMMonitorPlugin().

std::map<unsigned int,Statistics> SiStripCMMonitorPlugin::CommonModes_
private

Definition at line 109 of file SiStripCMMonitor.cc.

Referenced by fillMaps(), and SiStripCMMonitorPlugin().

std::map<unsigned int,Statistics> SiStripCMMonitorPlugin::CommonModesAPV0minusAPV1_
private

Definition at line 110 of file SiStripCMMonitor.cc.

Referenced by fillMaps(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::doTkHistoMap_
private

Definition at line 105 of file SiStripCMMonitor.cc.

Referenced by fillMaps(), and SiStripCMMonitorPlugin().

edm::EventNumber_t SiStripCMMonitorPlugin::evt_
private

Definition at line 114 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

std::vector<unsigned int> SiStripCMMonitorPlugin::fedIdVec_
private

Definition at line 92 of file SiStripCMMonitor.cc.

bool SiStripCMMonitorPlugin::fillAllDetailedHistograms_
private

Definition at line 94 of file SiStripCMMonitor.cc.

Referenced by bookHistograms(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithEvtNum_
private

Definition at line 96 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithLocalEvtNum_
private

Definition at line 97 of file SiStripCMMonitor.cc.

Referenced by analyze().

std::string SiStripCMMonitorPlugin::folderName_
private

Definition at line 90 of file SiStripCMMonitor.cc.

Referenced by bookHistograms(), and SiStripCMMonitorPlugin().

std::pair<uint16_t,uint16_t> SiStripCMMonitorPlugin::prevMedians_[FEDNumbering::MAXSiStripFEDID+1][sistrip::FEDCH_PER_FED]
private

Definition at line 112 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

unsigned int SiStripCMMonitorPlugin::printDebug_
private

Definition at line 99 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

edm::InputTag SiStripCMMonitorPlugin::rawDataTag_
private

Definition at line 87 of file SiStripCMMonitor.cc.

Referenced by SiStripCMMonitorPlugin().

edm::EDGetTokenT<FEDRawDataCollection> SiStripCMMonitorPlugin::rawDataToken_
private

Definition at line 88 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().