CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
TotemTimingDQMSource Class Reference
Inheritance diagram for TotemTimingDQMSource:
DQMOneEDAnalyzer< edm::LuminosityBlockCache< totemds::Cache > > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  ChannelPlots
 plots related to one Diamond channel More...
 
struct  GlobalPlots
 plots related to the whole system More...
 
struct  PlanePlots
 plots related to one Diamond plane More...
 
struct  PotPlots
 plots related to one Diamond detector package More...
 

Public Member Functions

 TotemTimingDQMSource (const edm::ParameterSet &)
 
 ~TotemTimingDQMSource () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< totemds::Cache > >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
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::Accumulator, Args... >
 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)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void dqmEndRun (const edm::Run &, const edm::EventSetup &) override
 
std::shared_ptr< totemds::CacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const override
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< totemds::Cache > >
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- 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)
 

Private Attributes

std::unordered_map< unsigned int, ChannelPlotschannelPlots_
 
GlobalPlots globalPlot_
 
double maximumStripAngleForTomography_
 
double minimumStripAngleForTomography_
 
std::unordered_map< unsigned int, PlanePlotsplanePlots_
 
std::unordered_map< unsigned int, PotPlotspotPlots_
 
unsigned int samplesForNoise_
 
edm::TimeValue_t timeOfPreviousEvent_
 
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
 
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
 
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
 
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
 
unsigned int verbosity_
 
float verticalShiftBot_
 
float verticalShiftTop_
 

Static Private Attributes

static const float COS_8_DEG = 0.990268
 
static const int CTPPS_FAR_RP_ID = 3
 
static const int CTPPS_NEAR_RP_ID = 2
 
static const int CTPPS_NUM_OF_ARMS = 2
 
static const double DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
 
static const double DQM_FRACTION_OF_EVENTS = 1.
 
static const double HIT_RATE_FACTOR = DQM_FRACTION_OF_EVENTS / SEC_PER_LUMI_SECTION
 
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1. / DISPLAY_RESOLUTION_FOR_HITS_MM
 
static const double LHC_CLOCK_PERIOD_NS = 24.95
 
static const double SAMPIC_ADC_V = 1. / 256
 
static const double SAMPIC_MAX_NUMBER_OF_SAMPLES = 64
 
static const double SAMPIC_SAMPLING_PERIOD_NS = 1. / 7.8e9
 
static const double SEC_PER_LUMI_SECTION = 23.31
 
static const float SIN_8_DEG = -0.139173
 
static const double TOMOGRAPHY_RESOLUTION_MM = 1
 
static const int TOTEM_STATION_210 = 0
 
static const int TOTEM_STATION_220 = 2
 
static const int TOTEM_STRIP_MAX_RP_ID = 5
 
static const int TOTEM_STRIP_MIN_RP_ID = 4
 
static const int TOTEM_TIMING_BOT_RP_ID = 1
 
static const int TOTEM_TIMING_FED_ID_45 = FEDNumbering::MAXTotemRPTimingVerticalFEDID
 
static const int TOTEM_TIMING_FED_ID_56 = FEDNumbering::MINTotemRPTimingVerticalFEDID
 
static const int TOTEM_TIMING_NUM_OF_CHANNELS = 12
 
static const int TOTEM_TIMING_NUM_OF_PLANES = 4
 
static const int TOTEM_TIMING_STATION_ID = 2
 
static const int TOTEM_TIMING_TOP_RP_ID = 0
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< totemds::Cache > >
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 Attributes inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< totemds::Cache > >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 49 of file TotemTimingDQMSource.cc.

Constructor & Destructor Documentation

TotemTimingDQMSource::TotemTimingDQMSource ( const edm::ParameterSet ps)

Definition at line 404 of file TotemTimingDQMSource.cc.

408  // tokenTrack_(consumes<edm::DetSetVector<TotemTimingLocalTrack>>(
409  // ps.getParameter<edm::InputTag>("tagLocalTracks"))),
410  tokenFEDInfo_(consumes<std::vector<TotemFEDInfo>>(ps.getParameter<edm::InputTag>("tagFEDInfo"))),
411  minimumStripAngleForTomography_(ps.getParameter<double>("minimumStripAngleForTomography")),
412  maximumStripAngleForTomography_(ps.getParameter<double>("maximumStripAngleForTomography")),
413  samplesForNoise_(ps.getUntrackedParameter<unsigned int>("samplesForNoise", 5)),
414  verbosity_(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::TimeValue_t timeOfPreviousEvent_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
TotemTimingDQMSource::~TotemTimingDQMSource ( )
override

Definition at line 419 of file TotemTimingDQMSource.cc.

419 {}

Member Function Documentation

void TotemTimingDQMSource::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprotected

Definition at line 481 of file TotemTimingDQMSource.cc.

References amcDumpToRaw_cfi::boardId, edm::EventBase::bunchCrossing(), channelPlots_, MillePedeFileConverter_cfg::e, geometry, edm::EventSetup::get(), edm::Event::getLuminosityBlock(), mps_fire::i, edm::LuminosityBlock::index(), INV_DISPLAY_RESOLUTION_FOR_HITS_MM, edm::HandleBase::isValid(), LHC_CLOCK_PERIOD_NS, maximumStripAngleForTomography_, minimumStripAngleForTomography_, TotemTimingRecHit::NO_T_AVAILABLE, planePlots_, potPlots_, TrackInfoProducer_cfi::rechits, SAMPIC_ADC_V, samplesForNoise_, CTPPSGeometry::sensor(), TotemTimingDetId::setChannel(), TotemRPDetId::setPlane(), TotemTimingDetId::setPlane(), edm::EventBase::time(), timeOfPreviousEvent_, tokenDigi_, tokenFEDInfo_, tokenLocalTrack_, tokenRecHit_, TOTEM_STATION_210, TOTEM_STATION_220, TOTEM_STRIP_MAX_RP_ID, TOTEM_TIMING_BOT_RP_ID, TOTEM_TIMING_TOP_RP_ID, DetGeomDesc::translation(), validateGeometry_cfg::valid, edm::Timestamp::value(), verbosity_, verticalShiftBot_, verticalShiftTop_, x, and y.

481  {
482  // get event setup data
484  eventSetup.get<VeryForwardRealGeometryRecord>().get(geometry);
485 
486  // get event data
488  event.getByToken(tokenLocalTrack_, stripTracks);
489 
491  event.getByToken(tokenDigi_, timingDigis);
492 
494  event.getByToken(tokenFEDInfo_, fedInfo);
495 
497  event.getByToken(tokenRecHit_, timingRecHits);
498 
499  // edm::Handle<edm::DetSetVector<TotemTimingLocalTrack>> timingLocalTracks;
500  // event.getByToken(timingLocalTracks, timingLocalTracks);
501 
502  // check validity
503  bool valid = true;
504  valid &= timingDigis.isValid();
505  valid &= fedInfo.isValid();
506 
507  if (!valid) {
508  if (verbosity_) {
509  edm::LogProblem("TotemTimingDQMSource") << "ERROR in TotemTimingDQMSource::analyze > some of the required inputs "
510  "are not valid. Skipping this event.\n"
511  << " timingDigis.isValid = " << timingDigis.isValid() << "\n"
512  << " fedInfo.isValid = " << fedInfo.isValid();
513  }
514 
515  return;
516  }
517 
518  // Using TotemTimingDigi
519  std::set<uint8_t> boardSet;
520  std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
521  std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
522 
523  auto lumiCache = luminosityBlockCache(event.getLuminosityBlock().index());
524  for (const auto &digis : *timingDigis) {
525  const TotemTimingDetId detId(digis.detId());
526  TotemTimingDetId detId_pot(digis.detId());
527  detId_pot.setPlane(0);
528  detId_pot.setChannel(0);
529  TotemTimingDetId detId_plane(digis.detId());
530  detId_plane.setChannel(0);
531 
532  for (const auto &digi : digis) {
533  // Pot Plots
534  if (potPlots_.find(detId_pot) != potPlots_.end()) {
535  potPlots_[detId_pot].activityPerBX->Fill(event.bunchCrossing());
536 
537  potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
538 
539  for (auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
540  potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
541 
542  float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
543  potPlots_[detId_pot].digiSent->Fill(boardId, digi.hardwareChannelId());
544  if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
545  // This guarantees that every board is counted only once
546  boardSet.insert(digi.eventInfo().hardwareId());
547  std::bitset<16> chMap(digi.eventInfo().channelMap());
548  for (int i = 0; i < 16; ++i) {
549  if (chMap.test(i)) {
550  potPlots_[detId_pot].digiAll->Fill(boardId, i);
551  }
552  }
553  }
554 
555  potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
556  }
557 
558  // Plane Plots
559  if (planePlots_.find(detId_plane) != planePlots_.end()) {
560  planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
561 
562  if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
563  channelsPerPlane[detId_plane]++;
564  else
565  channelsPerPlane[detId_plane] = 0;
566  }
567 
568  // Channel Plots
569  if (channelPlots_.find(detId) != channelPlots_.end()) {
570  channelPlots_[detId].activityPerBX->Fill(event.bunchCrossing());
571 
572  for (auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
573  channelPlots_[detId].dataSamplesRaw->Fill(*it);
574  for (unsigned short i = 0; i < samplesForNoise_; ++i)
575  channelPlots_[detId].noiseSamples->Fill(SAMPIC_ADC_V * digi.sampleAt(i));
576 
577  unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
578  channelPlots_[detId].cellOfMax->Fill((int)cellOfMax);
579 
580  if (timeOfPreviousEvent_ != 0)
581  channelPlots_[detId].hitTime->Fill(1e-3 * LHC_CLOCK_PERIOD_NS *
582  (event.time().value() - timeOfPreviousEvent_));
583  ++(lumiCache->hitsCounterMap[detId]);
584  }
585  }
586  }
587  // End digis
588 
589  for (const auto &rechits : *timingRecHits) {
590  const TotemTimingDetId detId(rechits.detId());
591  TotemTimingDetId detId_pot(rechits.detId());
592  detId_pot.setPlane(0);
593  detId_pot.setChannel(0);
594  TotemTimingDetId detId_plane(rechits.detId());
595  detId_plane.setChannel(0);
596 
597  for (const auto &rechit : rechits) {
598  if (potPlots_.find(detId_pot) != potPlots_.end()) {
599  potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
600 
601  TH2F *hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F();
602  TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
603  float yCorrected = rechit.y();
604  yCorrected += (detId.rp() == TOTEM_TIMING_TOP_RP_ID) ? verticalShiftTop_ : verticalShiftBot_;
605  float x_shift = detId.plane();
606  x_shift += (rechit.x() > 2) ? 0.25 : 0;
607  int startBin = hitHistoTmpYAxis->FindBin(yCorrected - 0.5 * rechit.yWidth());
608  int numOfBins = rechit.yWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
609  for (int i = 0; i < numOfBins; ++i) {
610  potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
611  hitHistoTmpYAxis->GetBinCenter(startBin + i));
612  potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift,
613  hitHistoTmpYAxis->GetBinCenter(startBin + i));
614  }
615 
616  //All plots with Time
617  if (rechit.time() != TotemTimingRecHit::NO_T_AVAILABLE) {
618  for (int i = 0; i < numOfBins; ++i)
619  potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
620  hitHistoTmpYAxis->GetBinCenter(startBin + i));
621 
622  potPlots_[detId_pot].recHitTime->Fill(rechit.time());
623  potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
624 
625  // Plane Plots
626  if (planePlots_.find(detId_plane) != planePlots_.end()) {
627  // Visualization tricks
628  float x_shift = (rechit.x() > 2) ? 15 : 0;
629  TH1F *hitProfileHistoTmp = planePlots_[detId_plane].hitProfile->getTH1F();
630  int numOfBins = rechit.yWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
631  if (detId.rp() == TOTEM_TIMING_TOP_RP_ID) {
632  float yCorrected = rechit.y() + verticalShiftTop_ - 0.5 * rechit.yWidth() + x_shift;
633  int startBin = hitProfileHistoTmp->FindBin(yCorrected);
634  for (int i = 0; i < numOfBins; ++i)
635  hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin + i));
636  } else {
637  float yCorrected = rechit.y() + verticalShiftBot_ + 0.5 * rechit.yWidth() + (15 - x_shift);
638  int startBin = hitProfileHistoTmp->FindBin(yCorrected);
639  int totBins = hitProfileHistoTmp->GetNbinsX();
640  for (int i = 0; i < numOfBins; ++i)
641  hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(totBins - startBin + i));
642  }
643 
644  if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
645  channelsPerPlaneWithTime[detId_plane]++;
646  else
647  channelsPerPlaneWithTime[detId_plane] = 0;
648  }
649 
650  if (channelPlots_.find(detId) != channelPlots_.end()) {
651  potPlots_[detId_pot].tirggerCellTime->Fill(rechit.sampicThresholdTime());
652  channelPlots_[detId].tirggerCellTime->Fill(rechit.sampicThresholdTime());
653  channelPlots_[detId].recHitTime->Fill(rechit.time());
654  channelPlots_[detId].amplitude->Fill(rechit.amplitude());
655  }
656  }
657  }
658  }
659  }
660  // End RecHits
661 
662  // Tomography of timing using strips
663  for (const auto &rechits : *timingRecHits) {
664  const TotemTimingDetId detId(rechits.detId());
665  TotemTimingDetId detId_pot(rechits.detId());
666  detId_pot.setPlane(0);
667  detId_pot.setChannel(0);
668  TotemTimingDetId detId_plane(rechits.detId());
669  detId_plane.setChannel(0);
670 
671  float y_shift = (detId.rp() == TOTEM_TIMING_TOP_RP_ID) ? 20 : 5;
672 
673  for (const auto &rechit : rechits) {
674  if (rechit.time() != TotemTimingRecHit::NO_T_AVAILABLE && potPlots_.find(detId_pot) != potPlots_.end() &&
675  planePlots_.find(detId_plane) != planePlots_.end() && channelPlots_.find(detId) != channelPlots_.end()) {
676  if (stripTracks.isValid()) {
677  for (const auto &ds : *stripTracks) {
678  const CTPPSDetId stripId(ds.detId());
679  // mean position of U and V planes
680  TotemRPDetId plId_V(stripId);
681  plId_V.setPlane(0);
682  TotemRPDetId plId_U(stripId);
683  plId_U.setPlane(1);
684 
685  double rp_x = 0;
686  double rp_y = 0;
687  try {
688  rp_x = (geometry->sensor(plId_V)->translation().x() + geometry->sensor(plId_U)->translation().x()) / 2;
689  rp_y = (geometry->sensor(plId_V)->translation().y() + geometry->sensor(plId_U)->translation().y()) / 2;
690  } catch (const cms::Exception &) {
691  continue;
692  }
693 
694  for (const auto &striplt : ds) {
695  if (striplt.isValid() && stripId.arm() == detId.arm()) {
696  if (striplt.tx() > maximumStripAngleForTomography_ || striplt.ty() > maximumStripAngleForTomography_)
697  continue;
698  if (striplt.tx() < minimumStripAngleForTomography_ || striplt.ty() < minimumStripAngleForTomography_)
699  continue;
700  if (stripId.rp() - detId.rp() == (TOTEM_STRIP_MAX_RP_ID - TOTEM_TIMING_BOT_RP_ID)) {
701  double x = striplt.x0() - rp_x;
702  double y = striplt.y0() - rp_y;
703  if (stripId.station() == TOTEM_STATION_210) {
704  potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane() * 50, y + y_shift);
705  channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
706  } else if (stripId.station() == TOTEM_STATION_220) {
707  potPlots_[detId_pot].stripTomography220->Fill(x + detId.plane() * 50, y + y_shift);
708  channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
709  }
710  }
711  }
712  }
713  }
714  }
715  }
716  }
717  }
718 
719  for (auto &plt : potPlots_) {
720  plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
721  plt.second.planesWithDigisSet.clear();
722  plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
723  plt.second.planesWithTimeSet.clear();
724  }
725 
726  for (const auto &plt : channelsPerPlane) {
727  planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
728  }
729  for (const auto &plt : channelsPerPlaneWithTime) {
730  planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
731  }
732 
733  timeOfPreviousEvent_ = event.time().value();
734 }
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
static const double LHC_CLOCK_PERIOD_NS
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
static const int TOTEM_STRIP_MAX_RP_ID
static const int TOTEM_STATION_210
Translation translation() const
Definition: DetGeomDesc.h:65
void setChannel(uint32_t channel)
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
LuminosityBlockIndex index() const
std::unordered_map< unsigned int, PlanePlots > planePlots_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
int bunchCrossing() const
Definition: EventBase.h:64
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
static const int TOTEM_STATION_220
Event setup record containing the real (actual) geometry information.
void setPlane(uint32_t channel)
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:98
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
bool isValid() const
Definition: HandleBase.h:70
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
static const double SAMPIC_ADC_V
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
ESHandle< TrackerGeometry > geometry
T get() const
Definition: EventSetup.h:73
edm::TimeValue_t timeOfPreviousEvent_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int TOTEM_TIMING_BOT_RP_ID
TimeValue_t value() const
Definition: Timestamp.h:45
edm::Timestamp time() const
Definition: EventBase.h:60
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void TotemTimingDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 445 of file TotemTimingDQMSource.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::cd(), channelPlots_, CTPPS_NUM_OF_ARMS, globalPlot_, planePlots_, potPlots_, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), TOTEM_TIMING_BOT_RP_ID, TOTEM_TIMING_NUM_OF_CHANNELS, TOTEM_TIMING_NUM_OF_PLANES, TOTEM_TIMING_STATION_ID, and TOTEM_TIMING_TOP_RP_ID.

445  {
446  ibooker.cd();
447  ibooker.setCurrentFolder("CTPPS");
448 
449  globalPlot_ = GlobalPlots(ibooker);
450 
451  for (unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm) {
452  for (unsigned short rp = TOTEM_TIMING_TOP_RP_ID; rp <= TOTEM_TIMING_BOT_RP_ID; ++rp) {
453  const TotemTimingDetId rpId(arm, TOTEM_TIMING_STATION_ID, rp);
454  potPlots_[rpId] = PotPlots(ibooker, rpId);
455  for (unsigned short pl = 0; pl < TOTEM_TIMING_NUM_OF_PLANES; ++pl) {
456  const TotemTimingDetId plId(arm, TOTEM_TIMING_STATION_ID, rp, pl);
457  planePlots_[plId] = PlanePlots(ibooker, plId);
458  for (unsigned short ch = 0; ch < TOTEM_TIMING_NUM_OF_CHANNELS; ++ch) {
459  const TotemTimingDetId chId(arm, TOTEM_TIMING_STATION_ID, rp, pl, ch);
460  channelPlots_[chId] = ChannelPlots(ibooker, chId);
461  }
462  }
463  }
464  }
465 }
std::unordered_map< unsigned int, PlanePlots > planePlots_
static const int CTPPS_NUM_OF_ARMS
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
static const int TOTEM_TIMING_STATION_ID
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
static const int TOTEM_TIMING_NUM_OF_PLANES
static const int TOTEM_TIMING_BOT_RP_ID
static const int TOTEM_TIMING_NUM_OF_CHANNELS
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void TotemTimingDQMSource::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 423 of file TotemTimingDQMSource.cc.

References relativeConstraints::geom, edm::EventSetup::get(), DetGeomDesc::params(), edm::ESHandle< T >::product(), CTPPSGeometry::sensorNoThrow(), TOTEM_TIMING_BOT_RP_ID, TOTEM_TIMING_STATION_ID, TOTEM_TIMING_TOP_RP_ID, DetGeomDesc::translation(), verticalShiftBot_, and verticalShiftTop_.

423  {
424  // Get detector shifts from the geometry (if present)
426  iSetup.get<VeryForwardRealGeometryRecord>().get(geometry_);
427  const CTPPSGeometry *geom = geometry_.product();
430  verticalShiftTop_ = 0;
431  verticalShiftBot_ = 0;
432  {
433  const DetGeomDesc *det_top = geom->sensorNoThrow(detid_top);
434  if (det_top) {
435  verticalShiftTop_ = det_top->translation().y() + det_top->params().at(1);
436  }
437  const DetGeomDesc *det_bot = geom->sensorNoThrow(detid_bot);
438  if (det_bot)
439  verticalShiftBot_ = det_bot->translation().y() + det_bot->params().at(1);
440  }
441 }
Translation translation() const
Definition: DetGeomDesc.h:65
Event setup record containing the real (actual) geometry information.
static const int TOTEM_TIMING_STATION_ID
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
static const int TOTEM_TIMING_TOP_RP_ID
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
T get() const
Definition: EventSetup.h:73
std::vector< double > params() const
Definition: DetGeomDesc.h:67
static const int TOTEM_TIMING_BOT_RP_ID
T const * product() const
Definition: ESHandle.h:86
const DetGeomDesc * sensorNoThrow(unsigned int id) const
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void TotemTimingDQMSource::dqmEndRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 784 of file TotemTimingDQMSource.cc.

References DEFINE_FWK_MODULE.

784 {}
std::shared_ptr< totemds::Cache > TotemTimingDQMSource::globalBeginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
) const
overrideprotected

Definition at line 469 of file TotemTimingDQMSource.cc.

References ztail::d, plotFactory::plot, and potPlots_.

470  {
471  auto d = std::make_shared<totemds::Cache>();
472  d->hitDistribution2dMap.reserve(potPlots_.size());
473  for (auto &plot : potPlots_)
474  d->hitDistribution2dMap[plot.first] =
475  std::unique_ptr<TH2F>(static_cast<TH2F *>(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
476  return d;
477 }
std::unordered_map< unsigned int, PotPlots > potPlots_
d
Definition: ztail.py:151
void TotemTimingDQMSource::globalEndLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
overrideprotected

Definition at line 738 of file TotemTimingDQMSource.cc.

References CTPPSDetId::arm(), TotemTimingDetId::channel(), channelPlots_, TotemTimingDQMSource::GlobalPlots::digiSentPercentage, dqm::impl::MonitorElement::getTH2F(), globalPlot_, HIT_RATE_FACTOR, edm::LuminosityBlock::index(), TotemTimingDetId::plane(), plotFactory::plot, potPlots_, dqm::impl::MonitorElement::Reset(), and CTPPSDetId::rp().

738  {
739  auto lumiCache = luminosityBlockCache(iLumi.index());
740  for (auto &plot : potPlots_) {
741  *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]);
742  }
743 
745  TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F();
746  for (auto &plot : potPlots_) {
747  TH2F *hitHistoTmp = plot.second.digiSentPercentage->getTH2F();
748  TH2F *histoSent = plot.second.digiSent->getTH2F();
749  TH2F *histoAll = plot.second.digiAll->getTH2F();
750 
751  hitHistoTmp->Divide(histoSent, histoAll);
752  hitHistoTmp->Scale(100);
753  hitHistoGlobalTmp->Add(hitHistoTmp, 1);
754 
755  plot.second.baseline->Reset();
756  plot.second.noiseRMS->Reset();
757  plot.second.meanAmplitude->Reset();
758  plot.second.cellOfMax->Reset();
759  plot.second.hitRate->Reset();
760  TotemTimingDetId rpId(plot.first);
761  for (auto &chPlot : channelPlots_) {
762  TotemTimingDetId chId(chPlot.first);
763  if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) {
764  plot.second.baseline->Fill(chId.plane(), chId.channel(), chPlot.second.noiseSamples->getTH1F()->GetMean());
765  plot.second.noiseRMS->Fill(chId.plane(), chId.channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS());
766  plot.second.meanAmplitude->Fill(chId.plane(), chId.channel(), chPlot.second.amplitude->getTH1F()->GetMean());
767  plot.second.cellOfMax->Fill(chId.plane(), chId.channel(), chPlot.second.cellOfMax->getTH1F()->GetMean());
768  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first];
769  plot.second.hitRate->Fill(chId.plane(), chId.channel(), (double)hitsCounterPerLumisection * HIT_RATE_FACTOR);
770  }
771  }
772  }
773 
774  for (auto &plot : channelPlots_) {
775  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first];
776  if (hitsCounterPerLumisection != 0) {
777  plot.second.hitRate->Fill((double)hitsCounterPerLumisection * HIT_RATE_FACTOR);
778  }
779  }
780 }
LuminosityBlockIndex index() const
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
static const double HIT_RATE_FACTOR
virtual void Reset()
reset ME (ie. contents, errors, etc)
std::unordered_map< unsigned int, PotPlots > potPlots_
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...

Member Data Documentation

std::unordered_map<unsigned int, ChannelPlots> TotemTimingDQMSource::channelPlots_
private

Definition at line 203 of file TotemTimingDQMSource.cc.

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

const float TotemTimingDQMSource::COS_8_DEG = 0.990268
staticprivate

Definition at line 94 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 89 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 88 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 80 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const double TotemTimingDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 72 of file TotemTimingDQMSource.cc.

const double TotemTimingDQMSource::DQM_FRACTION_OF_EVENTS = 1.
staticprivate

Definition at line 69 of file TotemTimingDQMSource.cc.

GlobalPlots TotemTimingDQMSource::globalPlot_
private

Definition at line 119 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms(), and globalEndLuminosityBlock().

const double TotemTimingDQMSource::HIT_RATE_FACTOR = DQM_FRACTION_OF_EVENTS / SEC_PER_LUMI_SECTION
staticprivate

Definition at line 71 of file TotemTimingDQMSource.cc.

Referenced by globalEndLuminosityBlock().

const double TotemTimingDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1. / DISPLAY_RESOLUTION_FOR_HITS_MM
staticprivate

Definition at line 75 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::LHC_CLOCK_PERIOD_NS = 24.95
staticprivate

Definition at line 68 of file TotemTimingDQMSource.cc.

Referenced by analyze().

double TotemTimingDQMSource::maximumStripAngleForTomography_
private

Definition at line 104 of file TotemTimingDQMSource.cc.

Referenced by analyze().

double TotemTimingDQMSource::minimumStripAngleForTomography_
private

Definition at line 103 of file TotemTimingDQMSource.cc.

Referenced by analyze().

std::unordered_map<unsigned int, PlanePlots> TotemTimingDQMSource::planePlots_
private

Definition at line 177 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::unordered_map<unsigned int, PotPlots> TotemTimingDQMSource::potPlots_
private
const double TotemTimingDQMSource::SAMPIC_ADC_V = 1. / 256
staticprivate

Definition at line 79 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::SAMPIC_MAX_NUMBER_OF_SAMPLES = 64
staticprivate

Definition at line 78 of file TotemTimingDQMSource.cc.

const double TotemTimingDQMSource::SAMPIC_SAMPLING_PERIOD_NS = 1. / 7.8e9
staticprivate

Definition at line 77 of file TotemTimingDQMSource.cc.

unsigned int TotemTimingDQMSource::samplesForNoise_
private

Definition at line 105 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 65 of file TotemTimingDQMSource.cc.

const float TotemTimingDQMSource::SIN_8_DEG = -0.139173
staticprivate

Definition at line 95 of file TotemTimingDQMSource.cc.

edm::TimeValue_t TotemTimingDQMSource::timeOfPreviousEvent_
private

Definition at line 107 of file TotemTimingDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<TotemTimingDigi> > TotemTimingDQMSource::tokenDigi_
private

Definition at line 98 of file TotemTimingDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<std::vector<TotemFEDInfo> > TotemTimingDQMSource::tokenFEDInfo_
private

Definition at line 101 of file TotemTimingDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<TotemRPLocalTrack> > TotemTimingDQMSource::tokenLocalTrack_
private

Definition at line 97 of file TotemTimingDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<TotemTimingRecHit> > TotemTimingDQMSource::tokenRecHit_
private

Definition at line 99 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::TOMOGRAPHY_RESOLUTION_MM = 1
staticprivate

Definition at line 76 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_STATION_210 = 0
staticprivate

Definition at line 82 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STATION_220 = 2
staticprivate

Definition at line 83 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STRIP_MAX_RP_ID = 5
staticprivate

Definition at line 87 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STRIP_MIN_RP_ID = 4
staticprivate

Definition at line 86 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_BOT_RP_ID = 1
staticprivate

Definition at line 85 of file TotemTimingDQMSource.cc.

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

const int TotemTimingDQMSource::TOTEM_TIMING_FED_ID_45 = FEDNumbering::MAXTotemRPTimingVerticalFEDID
staticprivate

Definition at line 92 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_FED_ID_56 = FEDNumbering::MINTotemRPTimingVerticalFEDID
staticprivate

Definition at line 93 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 91 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const int TotemTimingDQMSource::TOTEM_TIMING_NUM_OF_PLANES = 4
staticprivate

Definition at line 90 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const int TotemTimingDQMSource::TOTEM_TIMING_STATION_ID = 2
staticprivate

Definition at line 81 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

const int TotemTimingDQMSource::TOTEM_TIMING_TOP_RP_ID = 0
staticprivate

Definition at line 84 of file TotemTimingDQMSource.cc.

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

unsigned int TotemTimingDQMSource::verbosity_
private

Definition at line 106 of file TotemTimingDQMSource.cc.

Referenced by analyze().

float TotemTimingDQMSource::verticalShiftBot_
private

Definition at line 109 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

float TotemTimingDQMSource::verticalShiftTop_
private

Definition at line 109 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().