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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  Statistics
 

Public Member Functions

 SiStripCMMonitorPlugin (const edm::ParameterSet &)
 
 ~SiStripCMMonitorPlugin () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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 DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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 117 of file SiStripCMMonitor.cc.

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

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

Definition at line 163 of file SiStripCMMonitor.cc.

163 {}

Member Function Documentation

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

Definition at line 187 of file SiStripCMMonitor.cc.

References edmScanValgrind::buffer, cabling_, cmHists_, sistrip::FEDChannel::cmMedian(), gather_cfg::cout, FEDRawData::data(), FedChannelConnection::detId(), edm::EventID::event(), evt_, sistrip::FEDCH_PER_FED, SiStripFedCabling::fedConnection(), FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, 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 contentValuesCheck::values.

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

References cmHists_, fillAllDetailedHistograms_, folderName_, edm::EventSetup::get(), edm::ESHandle< T >::product(), and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

171  {
172  ibooker.setCurrentFolder(folderName_);
173 
174  edm::ESHandle<TkDetMap> tkDetMapHandle;
175  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
176  const TkDetMap* tkDetMap = tkDetMapHandle.product();
177 
178  cmHists_.bookTopLevelHistograms(ibooker, tkDetMap);
179 
181  cmHists_.bookAllFEDHistograms(ibooker);
182 }
T const * product() const
Definition: ESHandle.h:86
void SiStripCMMonitorPlugin::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprivate

Definition at line 184 of file SiStripCMMonitor.cc.

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

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

431  {
432  if (doTkHistoMap_) { //if TkHistMap is enabled
433  std::pair<std::map<unsigned int, Statistics>::iterator, bool> alreadyThere[2];
434 
435  Statistics lStat;
436  lStat.Mean = (aMedians.first + aMedians.second) * 1. / (2 * aChInModule);
437  lStat.Rms = (aMedians.first + aMedians.second) * (aMedians.first + aMedians.second) * 1. / (4 * aChInModule);
438  lStat.Counter = 1. / aChInModule;
439 
440  alreadyThere[0] = CommonModes_.insert(std::pair<unsigned int, Statistics>(aDetId, lStat));
441  if (!alreadyThere[0].second) {
442  ((alreadyThere[0].first)->second).Mean += (aMedians.first + aMedians.second) * 1. / (2 * aChInModule);
443  ((alreadyThere[0].first)->second).Rms +=
444  (aMedians.first + aMedians.second) * (aMedians.first + aMedians.second) * 1. / (4 * aChInModule);
445  ((alreadyThere[0].first)->second).Counter += 1. / aChInModule;
446  }
447 
448  lStat.Mean = (aMedians.first - aMedians.second) * 1. / aChInModule;
449  lStat.Rms = (aMedians.first - aMedians.second) * (aMedians.first - aMedians.second) * 1. / aChInModule;
450  lStat.Counter = 1. / aChInModule;
451 
452  alreadyThere[1] = CommonModesAPV0minusAPV1_.insert(std::pair<unsigned int, Statistics>(aDetId, lStat));
453  if (!alreadyThere[1].second) {
454  ((alreadyThere[1].first)->second).Mean += (aMedians.first - aMedians.second) * 1. / aChInModule;
455  ((alreadyThere[1].first)->second).Rms +=
456  (aMedians.first - aMedians.second) * (aMedians.first - aMedians.second) * 1. / aChInModule;
457  ((alreadyThere[1].first)->second).Counter += 1. / aChInModule;
458  }
459  }
460 }
std::map< unsigned int, Statistics > CommonModes_
U second(std::pair< T, U > const &p)
std::map< unsigned int, Statistics > CommonModesAPV0minusAPV1_
void SiStripCMMonitorPlugin::updateCabling ( const edm::EventSetup eventSetup)
private

Definition at line 419 of file SiStripCMMonitor.cc.

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

Referenced by analyze().

419  {
420  uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
421  if (cablingCacheId_ != currentCacheId) {
422  edm::ESHandle<SiStripFedCabling> cablingHandle;
423  eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
424  cabling_ = cablingHandle.product();
425  cablingCacheId_ = currentCacheId;
426  }
427 }
const SiStripFedCabling * cabling_
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

const SiStripFedCabling* SiStripCMMonitorPlugin::cabling_
private

Definition at line 98 of file SiStripCMMonitor.cc.

Referenced by analyze(), and updateCabling().

uint32_t SiStripCMMonitorPlugin::cablingCacheId_
private

Definition at line 97 of file SiStripCMMonitor.cc.

Referenced by updateCabling().

CMHistograms SiStripCMMonitorPlugin::cmHists_
private

Definition at line 103 of file SiStripCMMonitor.cc.

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

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

Definition at line 105 of file SiStripCMMonitor.cc.

Referenced by fillMaps(), and SiStripCMMonitorPlugin().

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

Definition at line 106 of file SiStripCMMonitor.cc.

Referenced by fillMaps(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::doTkHistoMap_
private

Definition at line 101 of file SiStripCMMonitor.cc.

Referenced by fillMaps(), and SiStripCMMonitorPlugin().

edm::EventNumber_t SiStripCMMonitorPlugin::evt_
private

Definition at line 110 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

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

Definition at line 88 of file SiStripCMMonitor.cc.

bool SiStripCMMonitorPlugin::fillAllDetailedHistograms_
private

Definition at line 90 of file SiStripCMMonitor.cc.

Referenced by bookHistograms(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithEvtNum_
private

Definition at line 92 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

bool SiStripCMMonitorPlugin::fillWithLocalEvtNum_
private

Definition at line 93 of file SiStripCMMonitor.cc.

Referenced by analyze().

std::string SiStripCMMonitorPlugin::folderName_
private

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

Referenced by analyze(), and SiStripCMMonitorPlugin().

unsigned int SiStripCMMonitorPlugin::printDebug_
private

Definition at line 95 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().

edm::InputTag SiStripCMMonitorPlugin::rawDataTag_
private

Definition at line 83 of file SiStripCMMonitor.cc.

Referenced by SiStripCMMonitorPlugin().

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

Definition at line 84 of file SiStripCMMonitor.cc.

Referenced by analyze(), and SiStripCMMonitorPlugin().