CMS 3D CMS Logo

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

Classes

struct  Statistics
 

Public Member Functions

 SiStripCMMonitorPlugin (const edm::ParameterSet &)
 
 ~SiStripCMMonitorPlugin ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
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,
Statistics
CommonModes_
 
std::map< unsigned int,
Statistics
CommonModesAPV0minusAPV1_
 
bool doTkHistoMap_
 
DQMStoredqm_
 
std::string dqmStoreFileName_
 
unsigned int 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_
 
bool writeDQMStore_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 61 of file SiStripCMMonitor.cc.

Constructor & Destructor Documentation

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

Definition at line 126 of file SiStripCMMonitor.cc.

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

127  : rawDataTag_(iConfig.getUntrackedParameter<edm::InputTag>("RawDataTag",edm::InputTag("source",""))),
128  folderName_(iConfig.getUntrackedParameter<std::string>("HistogramFolderName","SiStrip/ReadoutView/CMMonitoring")),
129  fedIdVec_(iConfig.getUntrackedParameter<std::vector<unsigned int> >("FedIdVec")),
130  fillAllDetailedHistograms_(iConfig.getUntrackedParameter<bool>("FillAllDetailedHistograms",false)),
131  fillWithEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithEventNumber",false)),
132  fillWithLocalEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithLocalEventNumber",false)),
133  printDebug_(iConfig.getUntrackedParameter<unsigned int>("PrintDebugMessages",1)),
134  writeDQMStore_(iConfig.getUntrackedParameter<bool>("WriteDQMStore",false)),
135  dqmStoreFileName_(iConfig.getUntrackedParameter<std::string>("DQMStoreFileName","DQMStore.root")),
136  dqm_(0),
137  cablingCacheId_(0)
138 
139 {
140  //print config to debug log
141  std::ostringstream debugStream;
142  if (printDebug_>1) {
143  debugStream << "[SiStripCMMonitorPlugin]Configuration for SiStripCMMonitorPlugin: " << std::endl
144  << "[SiStripCMMonitorPlugin]\tRawDataTag: " << rawDataTag_ << std::endl
145  << "[SiStripCMMonitorPlugin]\tHistogramFolderName: " << folderName_ << std::endl
146  << "[SiStripCMMonitorPlugin]\tFillAllDetailedHistograms? " << (fillAllDetailedHistograms_ ? "yes" : "no") << std::endl
147  << "[SiStripCMMonitorPlugin]\tFillWithEventNumber?" << (fillWithEvtNum_ ? "yes" : "no") << std::endl
148  << "[SiStripCMMonitorPlugin]\tPrintDebugMessages? " << (printDebug_ ? "yes" : "no") << std::endl
149  << "[SiStripCMMonitorPlugin]\tWriteDQMStore? " << (writeDQMStore_ ? "yes" : "no") << std::endl;
150  if (writeDQMStore_) debugStream << "[SiStripCMMonitorPlugin]\tDQMStoreFileName: " << dqmStoreFileName_ << std::endl;
151  }
152 
153  std::ostringstream* pDebugStream = (printDebug_>1 ? &debugStream : NULL);
154 
155  cmHists_.initialise(iConfig,pDebugStream);
156 
157  doTkHistoMap_ = cmHists_.tkHistoMapEnabled();
158 
159  CommonModes_.clear();
161 
162  for (unsigned int fedId(FEDNumbering::MINSiStripFEDID); fedId <= FEDNumbering::MAXSiStripFEDID; fedId++){
163  for (unsigned int iCh(0); iCh<sistrip::FEDCH_PER_FED; iCh++){
164  prevMedians_[fedId][iCh] = std::pair<uint16_t,uint16_t>(0,0);
165  }
166  }
167 
168 
169  if (printDebug_) {
170  LogTrace("SiStripMonitorHardware") << debugStream.str();
171  }
172 
173  evt_ = 0;
174 
175 }
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_
#define LogTrace(id)
std::map< unsigned int, Statistics > CommonModes_
static const uint16_t FEDCH_PER_FED
SiStripCMMonitorPlugin::~SiStripCMMonitorPlugin ( )

Definition at line 177 of file SiStripCMMonitor.cc.

178 {
179 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 188 of file SiStripCMMonitor.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 368 of file SiStripCMMonitor.cc.

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

369 {
370  //get DQM store
373 
374  cmHists_.bookTopLevelHistograms(dqm_);
375 
376  if (fillAllDetailedHistograms_) cmHists_.bookAllFEDHistograms();
377 
378 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void SiStripCMMonitorPlugin::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 382 of file SiStripCMMonitor.cc.

References cmHists_, CommonModes_, CommonModesAPV0minusAPV1_, SiStripCMMonitorPlugin::Statistics::Counter, cond::rpcobgas::detid, doTkHistoMap_, dqm_, dqmStoreFileName_, SiStripCMMonitorPlugin::Statistics::Mean, timingPdfMaker::mean, python.rootplot.argparse::message, printDebug_, plotscripts::rms(), SiStripCMMonitorPlugin::Statistics::Rms, DQMStore::save(), mathSSE::sqrt(), and writeDQMStore_.

383 {
384 
385  if (doTkHistoMap_) {//if TkHistoMap is enabled
386  std::map<unsigned int,Statistics>::iterator fracIter;
387 
388  //int ele = 0;
389  //int nBadChannels = 0;
390  for (fracIter = CommonModes_.begin(); fracIter!=CommonModes_.end(); fracIter++){
391  uint32_t detid = fracIter->first;
392  //if ((fracIter->second).second != 0) {
393  //std::cout << "------ ele #" << ele << ", Frac for detid #" << detid << " = " <<(fracIter->second).second << "/" << (fracIter->second).first << std::endl;
394  //nBadChannels++;
395  //}
396  float mean = 0;
397  float rms = 0;
398  Statistics lStat = fracIter->second;
399  if (lStat.Counter > 0) mean = lStat.Mean/lStat.Counter;
400  if (lStat.Counter > 1) rms = sqrt(lStat.Rms/(lStat.Counter-1)-(mean*mean));
401  cmHists_.fillTkHistoMap(cmHists_.tkHistoMapPointer(0),detid,mean);
402  cmHists_.fillTkHistoMap(cmHists_.tkHistoMapPointer(1),detid,rms);
403 
404  if (printDebug_ > 1) {
405  std::ostringstream message;
406  message << "TkHistoMap CM: Detid " << detid << ", mean = " << mean << ", rms = " << rms << ", counter = " << lStat.Counter << std::endl;
407  edm::LogVerbatim("SiStripMonitorHardware") << message.str();
408  }
409 
410  //ele++;
411  }
412 
413  for (fracIter = CommonModesAPV0minusAPV1_.begin(); fracIter!=CommonModesAPV0minusAPV1_.end(); fracIter++){
414  uint32_t detid = fracIter->first;
415  //if ((fracIter->second).second != 0) {
416  //std::cout << "------ ele #" << ele << ", Frac for detid #" << detid << " = " <<(fracIter->second).second << "/" << (fracIter->second).first << std::endl;
417  //nBadChannels++;
418  //}
419  float mean = 0;
420  float rms = 0;
421  Statistics lStat = fracIter->second;
422  if (lStat.Counter > 0) mean = lStat.Mean/lStat.Counter;
423  if (lStat.Counter > 1) rms = sqrt(lStat.Rms/(lStat.Counter-1)-(mean*mean));
424  cmHists_.fillTkHistoMap(cmHists_.tkHistoMapPointer(2),detid,mean);
425  cmHists_.fillTkHistoMap(cmHists_.tkHistoMapPointer(3),detid,rms);
426 
427  if (printDebug_ > 1) {
428  std::ostringstream message;
429  message << "TkHistoMap APV0minusAPV1: Detid " << detid << ", mean = " << mean << ", rms = " << rms << ", counter = " << lStat.Counter << std::endl;
430  edm::LogVerbatim("SiStripMonitorHardware") << message.str();
431  }
432 
433  //ele++;
434  }
435 
436  }//if TkHistoMap is enabled
437 
439 }
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
std::map< unsigned int, Statistics > CommonModesAPV0minusAPV1_
T sqrt(T t)
Definition: SSEVec.h:48
std::map< unsigned int, Statistics > CommonModes_
void SiStripCMMonitorPlugin::fillMaps ( uint32_t  aDetId,
unsigned short  aChInModule,
std::pair< uint16_t, uint16_t >  aMedians 
)
private

Definition at line 453 of file SiStripCMMonitor.cc.

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

Referenced by analyze().

454 {
455 
456  if (doTkHistoMap_){//if TkHistMap is enabled
457  std::pair<std::map<unsigned int,Statistics>::iterator,bool> alreadyThere[2];
458 
459  Statistics lStat;
460  lStat.Mean = (aMedians.first+aMedians.second)*1./(2*aChInModule);
461  lStat.Rms = (aMedians.first+aMedians.second)*(aMedians.first+aMedians.second)*1./(4*aChInModule);
462  lStat.Counter = 1./aChInModule;
463 
464  alreadyThere[0] = CommonModes_.insert(std::pair<unsigned int,Statistics>(aDetId,lStat));
465  if (!alreadyThere[0].second) {
466  ((alreadyThere[0].first)->second).Mean += (aMedians.first+aMedians.second)*1./(2*aChInModule);
467  ((alreadyThere[0].first)->second).Rms += (aMedians.first+aMedians.second)*(aMedians.first+aMedians.second)*1./(4*aChInModule);
468  ((alreadyThere[0].first)->second).Counter += 1./aChInModule;
469  }
470 
471  lStat.Mean = (aMedians.first-aMedians.second)*1./aChInModule;
472  lStat.Rms = (aMedians.first-aMedians.second)*(aMedians.first-aMedians.second)*1./aChInModule;
473  lStat.Counter = 1./aChInModule;
474 
475  alreadyThere[1] = CommonModesAPV0minusAPV1_.insert(std::pair<unsigned int,Statistics>(aDetId,lStat));
476  if (!alreadyThere[1].second) {
477  ((alreadyThere[1].first)->second).Mean += (aMedians.first-aMedians.second)*1./aChInModule;
478  ((alreadyThere[1].first)->second).Rms += (aMedians.first-aMedians.second)*(aMedians.first-aMedians.second)*1./aChInModule;
479  ((alreadyThere[1].first)->second).Counter += 1./aChInModule;
480  }
481 
482  }
483 
484 }
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 441 of file SiStripCMMonitor.cc.

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

Referenced by analyze().

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

Member Data Documentation

const SiStripFedCabling* SiStripCMMonitorPlugin::cabling_
private

Definition at line 105 of file SiStripCMMonitor.cc.

Referenced by analyze(), and updateCabling().

uint32_t SiStripCMMonitorPlugin::cablingCacheId_
private

Definition at line 104 of file SiStripCMMonitor.cc.

Referenced by updateCabling().

CMHistograms SiStripCMMonitorPlugin::cmHists_
private

Definition at line 110 of file SiStripCMMonitor.cc.

Referenced by analyze(), beginJob(), endJob(), and SiStripCMMonitorPlugin().

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

Definition at line 112 of file SiStripCMMonitor.cc.

Referenced by endJob(), fillMaps(), and SiStripCMMonitorPlugin().

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

Definition at line 113 of file SiStripCMMonitor.cc.

Referenced by endJob(), fillMaps(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::doTkHistoMap_
private

Definition at line 108 of file SiStripCMMonitor.cc.

Referenced by endJob(), fillMaps(), and SiStripCMMonitorPlugin().

DQMStore* SiStripCMMonitorPlugin::dqm_
private

Definition at line 102 of file SiStripCMMonitor.cc.

Referenced by beginJob(), and endJob().

std::string SiStripCMMonitorPlugin::dqmStoreFileName_
private

Definition at line 100 of file SiStripCMMonitor.cc.

Referenced by endJob(), and SiStripCMMonitorPlugin().

unsigned int SiStripCMMonitorPlugin::evt_
private

Definition at line 117 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

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

Definition at line 90 of file SiStripCMMonitor.cc.

bool SiStripCMMonitorPlugin::fillAllDetailedHistograms_
private

Definition at line 92 of file SiStripCMMonitor.cc.

Referenced by beginJob(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithEvtNum_
private

Definition at line 94 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithLocalEvtNum_
private

Definition at line 95 of file SiStripCMMonitor.cc.

Referenced by analyze().

std::string SiStripCMMonitorPlugin::folderName_
private

Definition at line 88 of file SiStripCMMonitor.cc.

Referenced by beginJob(), and SiStripCMMonitorPlugin().

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

Definition at line 115 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

unsigned int SiStripCMMonitorPlugin::printDebug_
private

Definition at line 97 of file SiStripCMMonitor.cc.

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

edm::InputTag SiStripCMMonitorPlugin::rawDataTag_
private

Definition at line 86 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::writeDQMStore_
private

Definition at line 99 of file SiStripCMMonitor.cc.

Referenced by endJob(), and SiStripCMMonitorPlugin().