test
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
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 endJob () 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,
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_
 
edm::EDGetTokenT
< FEDRawDataCollection
rawDataToken_
 
bool writeDQMStore_
 

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: 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 127 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_, rawDataToken_, and writeDQMStore_.

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

Definition at line 179 of file SiStripCMMonitor.cc.

180 {
181 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 190 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< class >::product(), rawDataToken_, FEDRawData::size(), updateCabling(), and makeHLTPrescaleTable::values.

192 {
193  //Retrieve tracker topology from geometry
194  edm::ESHandle<TrackerTopology> tTopoHandle;
195  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
196  const TrackerTopology* const tTopo = tTopoHandle.product();
197 
198  //static bool firstEvent = true;
199  //static bool isBeingFilled = false;
200  //update cabling
201  updateCabling(iSetup);
202 
203  //get raw data
204  edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
205  iEvent.getByToken(rawDataToken_,rawDataCollectionHandle);
206  const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
207 
208  //FED errors
209  FEDErrors lFedErrors;
210 
211  //loop over siStrip FED IDs
212  for (unsigned int fedId = FEDNumbering::MINSiStripFEDID;
214  fedId++) {//loop over FED IDs
215  const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
216 
217  //create an object to fill all errors
218  lFedErrors.initialiseFED(fedId,cabling_,tTopo);
219 
220  //Do detailed check
221  //first check if data exists
222  bool lDataExist = lFedErrors.checkDataPresent(fedData);
223  if (!lDataExist) {
224  continue;
225  }
226 
227  std::auto_ptr<const sistrip::FEDBuffer> buffer;
228 
229  if (!lFedErrors.fillFatalFEDErrors(fedData,0)) {
230  continue;
231  }
232  else {
233  //need to construct full object to go any further
234  buffer.reset(new sistrip::FEDBuffer(fedData.data(),fedData.size(),true));
235  bool channelLengthsOK = buffer->checkChannelLengthsMatchBufferLength();
236  bool channelPacketCodesOK = buffer->checkChannelPacketCodes();
237  bool feLengthsOK = buffer->checkFEUnitLengths();
238  if ( !channelLengthsOK ||
239  !channelPacketCodesOK ||
240  !feLengthsOK ) {
241  continue;
242  }
243  }
244 
245  std::ostringstream infoStream;
246 
247 
248  if (printDebug_ > 1) {
249  infoStream << " --- Processing FED #" << fedId << std::endl;
250  }
251 
252 
253  std::vector<CMHistograms::CMvalues> values;
254 
255  for (unsigned int iCh = 0;
256  iCh < sistrip::FEDCH_PER_FED;
257  iCh++) {//loop on channels
258 
259  const FedChannelConnection & lConnection = cabling_->fedConnection(fedId,iCh);
260  bool connected = lConnection.isConnected();
261 
262  //std::cout << "FedID " << fedId << ", ch " << iCh << ", nAPVPairs " << lConnection.nApvPairs() << " apvPairNumber " << lConnection.apvPairNumber() << std::endl;
263 
264  if (!connected) {
265  continue;
266  }
267 
268  uint32_t lDetId = lConnection.detId();
269  unsigned short nChInModule = lConnection.nApvPairs();
270 
271  if (!lDetId || lDetId == sistrip::invalid32_) continue;
272 
273  bool lFailUnpackerChannelCheck = !buffer->channelGood(iCh) && connected;
274 
275  if (lFailUnpackerChannelCheck) {
276  continue;
277  }
278 
279 
280  //short lAPVPair = lConnection.apvPairNumber();
281  //short lSubDet = DetId(lDetId).subdetId();
282 
283 // if (firstEvent){
284 // infoStream << "Subdet " << lSubDet << ", " ;
285 // if (lSubDet == 3) {
286 //
287 // infoStream << "TIB layer " << tTopo->tibLayer(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
288 // }
289 // else if (lSubDet == 4) {
290 //
291 // infoStream << "TID side " << tTopo->tibSide(lDetId) << " wheel " << tTopo->tibWheel(lDetId) << ", ring " << tTopo->tibRing(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
292 // }
293 // else if (lSubDet == 5) {
294 //
295 // infoStream << "TOB side " << tTopo->tibRod(lDetId)[0] << " layer " << tTopo->tibLayer(lDetId) << ", rod " << tTopo->tibRodNumber(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
296 // }
297 // else if (lSubDet == 6) {
298 //
299 // infoStream << "TEC side " << tTopo->tibSide(lDetId) << " wheel " << tTopo->tibWheel(lDetId) << ", petal " << tTopo->tibPetalNumber(lDetId) << ", ring " << tTopo->tibRing(lDetId) << ", fedID " << fedId << ", channel " << iCh << std::endl;
300 // }
301 // isBeingFilled=true;
302 // }
303 
304  std::ostringstream lMode;
305  lMode << buffer->readoutMode();
306  if (printDebug_ > 1) {
307  static bool lFirst = true;
308  if (lFirst) {
309  std::cout << "Readout mode: " << lMode.str() << std::endl;
310  lFirst = false;
311  }
312 
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_) lTime = iEvent.id().event();
349  else if (fillWithLocalEvtNum_) lTime = evt_;//iEvent.id().event();
350  else lTime = iEvent.orbitNumber()/11223.;
351 
352  cmHists_.fillHistograms(values,lTime,fedId);
353 
354  //if (printDebug_ > 0 && isBeingFilled && firstEvent) edm::LogVerbatim("SiStripMonitorHardware") << infoStream.str();
355 
356 
357 
358  }//loop on FEDs
359 
360 
361  //if (isBeingFilled)
362  //firstEvent = false;
363 
364  evt_++;
365 
366 }//analyze method
EventNumber_t event() const
Definition: EventID.h:44
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:434
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::EDGetTokenT< FEDRawDataCollection > rawDataToken_
int orbitNumber() const
Definition: EventBase.h:63
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:28
tuple cout
Definition: gather_cfg.py:121
void SiStripCMMonitorPlugin::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 370 of file SiStripCMMonitor.cc.

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

371 {
372  //get DQM store
375 
376  cmHists_.bookTopLevelHistograms(dqm_);
377 
378  if (fillAllDetailedHistograms_) cmHists_.bookAllFEDHistograms();
379 
380 }
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void SiStripCMMonitorPlugin::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 384 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_.

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

Definition at line 455 of file SiStripCMMonitor.cc.

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

Referenced by analyze().

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

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

Referenced by analyze().

444 {
445  uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
446  if (cablingCacheId_ != currentCacheId) {
447  edm::ESHandle<SiStripFedCabling> cablingHandle;
448  eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
449  cabling_ = cablingHandle.product();
450  cablingCacheId_ = currentCacheId;
451  }
452 }
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 106 of file SiStripCMMonitor.cc.

Referenced by analyze(), and updateCabling().

uint32_t SiStripCMMonitorPlugin::cablingCacheId_
private

Definition at line 105 of file SiStripCMMonitor.cc.

Referenced by updateCabling().

CMHistograms SiStripCMMonitorPlugin::cmHists_
private

Definition at line 111 of file SiStripCMMonitor.cc.

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

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

Definition at line 113 of file SiStripCMMonitor.cc.

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

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

Definition at line 114 of file SiStripCMMonitor.cc.

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

bool SiStripCMMonitorPlugin::doTkHistoMap_
private

Definition at line 109 of file SiStripCMMonitor.cc.

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

DQMStore* SiStripCMMonitorPlugin::dqm_
private

Definition at line 103 of file SiStripCMMonitor.cc.

Referenced by beginJob(), and endJob().

std::string SiStripCMMonitorPlugin::dqmStoreFileName_
private

Definition at line 101 of file SiStripCMMonitor.cc.

Referenced by endJob(), and SiStripCMMonitorPlugin().

unsigned int SiStripCMMonitorPlugin::evt_
private

Definition at line 118 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

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

Definition at line 91 of file SiStripCMMonitor.cc.

bool SiStripCMMonitorPlugin::fillAllDetailedHistograms_
private

Definition at line 93 of file SiStripCMMonitor.cc.

Referenced by beginJob(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithEvtNum_
private

Definition at line 95 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithLocalEvtNum_
private

Definition at line 96 of file SiStripCMMonitor.cc.

Referenced by analyze().

std::string SiStripCMMonitorPlugin::folderName_
private

Definition at line 89 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 116 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

unsigned int SiStripCMMonitorPlugin::printDebug_
private

Definition at line 98 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 SiStripCMMonitorPlugin().

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

Definition at line 87 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::writeDQMStore_
private

Definition at line 100 of file SiStripCMMonitor.cc.

Referenced by endJob(), and SiStripCMMonitorPlugin().