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:
DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > 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 DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 () 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginLuminosityBlock (const edm::LuminosityBlock &, 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 endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
- 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)
 

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
 
static const double INV_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
 
static const int TOTEM_TIMING_FED_ID_56
 
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 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 DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 42 of file TotemTimingDQMSource.cc.

Constructor & Destructor Documentation

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

Definition at line 409 of file TotemTimingDQMSource.cc.

411  ps.getParameter<edm::InputTag>("tagLocalTrack"))),
413  ps.getParameter<edm::InputTag>("tagDigi"))),
415  ps.getParameter<edm::InputTag>("tagRecHits"))),
416  // tokenTrack_(consumes<edm::DetSetVector<TotemTimingLocalTrack>>(
417  // ps.getParameter<edm::InputTag>("tagLocalTracks"))),
418  tokenFEDInfo_(consumes<std::vector<TotemFEDInfo>>(
419  ps.getParameter<edm::InputTag>("tagFEDInfo"))),
421  ps.getParameter<double>("minimumStripAngleForTomography")),
423  ps.getParameter<double>("maximumStripAngleForTomography")),
425  ps.getUntrackedParameter<unsigned int>("samplesForNoise", 5)),
426  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 431 of file TotemTimingDQMSource.cc.

431 {}

Member Function Documentation

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

Definition at line 499 of file TotemTimingDQMSource.cc.

References edm::EventBase::bunchCrossing(), channelPlots_, MillePedeFileConverter_cfg::e, geometry, edm::EventSetup::get(), CTPPSGeometry::getSensor(), mps_fire::i, 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_, 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(), edm::Timestamp::value(), verbosity_, verticalShiftBot_, verticalShiftTop_, x, and y.

501 {
502  // get event setup data
504  eventSetup.get<VeryForwardRealGeometryRecord>().get(geometry);
505 
506  // get event data
508  event.getByToken(tokenLocalTrack_, stripTracks);
509 
511  event.getByToken(tokenDigi_, timingDigis);
512 
514  event.getByToken(tokenFEDInfo_, fedInfo);
515 
517  event.getByToken(tokenRecHit_, timingRecHits);
518 
519  // edm::Handle<edm::DetSetVector<TotemTimingLocalTrack>> timingLocalTracks;
520  // event.getByToken(timingLocalTracks, timingLocalTracks);
521 
522  // check validity
523  bool valid = true;
524  valid &= timingDigis.isValid();
525  valid &= fedInfo.isValid();
526 
527  if (!valid)
528  {
529  if (verbosity_)
530  {
531  edm::LogProblem("TotemTimingDQMSource")
532  << "ERROR in TotemTimingDQMSource::analyze > some of the required inputs "
533  "are not valid. Skipping this event.\n"
534  << " timingDigis.isValid = " << timingDigis.isValid() << "\n"
535  << " fedInfo.isValid = " << fedInfo.isValid();
536  }
537 
538  return;
539  }
540 
541  // Using TotemTimingDigi
542  std::set<uint8_t> boardSet;
543  std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
544  std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
545 
546  for (const auto &digis : *timingDigis)
547  {
548  const TotemTimingDetId detId(digis.detId());
549  TotemTimingDetId detId_pot(digis.detId());
550  detId_pot.setPlane(0);
551  detId_pot.setChannel(0);
552  TotemTimingDetId detId_plane(digis.detId());
553  detId_plane.setChannel(0);
554 
555  for (const auto &digi : digis)
556  {
557  // Pot Plots
558  if (potPlots_.find(detId_pot) != potPlots_.end())
559  {
560  potPlots_[detId_pot].activityPerBX->Fill(event.bunchCrossing());
561 
562  potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
563 
564  for (auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
565  potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
566 
567  float boardId = digi.getEventInfo().getHardwareBoardId() +
568  0.5 * digi.getEventInfo().getHardwareSampicId();
569  potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
570  if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
571  {
572  // This guarantees that every board is counted only once
573  boardSet.insert(digi.getEventInfo().getHardwareId());
574  std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
575  for (int i = 0; i < 16; ++i)
576  {
577  if (chMap.test(i))
578  {
579  potPlots_[detId_pot].digiAll->Fill(boardId, i);
580  }
581  }
582  }
583 
584  potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
585  }
586 
587  // Plane Plots
588  if (planePlots_.find(detId_plane) != planePlots_.end())
589  {
590  planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
591 
592  if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
593  channelsPerPlane[detId_plane]++;
594  else
595  channelsPerPlane[detId_plane] = 0;
596  }
597 
598  // Channel Plots
599  if (channelPlots_.find(detId) != channelPlots_.end()) {
600  channelPlots_[detId].activityPerBX->Fill(event.bunchCrossing());
601 
602  for (auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
603  channelPlots_[detId].dataSamplesRaw->Fill(*it);
604  for (unsigned short i = 0; i < samplesForNoise_; ++i)
605  channelPlots_[detId].noiseSamples->Fill(SAMPIC_ADC_V *
606  digi.getSampleAt(i));
607 
608  unsigned int cellOfMax =
609  std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
610  digi.getSamplesBegin();
611  channelPlots_[detId].cellOfMax->Fill((int)cellOfMax);
612 
613  if (timeOfPreviousEvent_ != 0)
614  channelPlots_[detId].hitTime->Fill(
615  1e-3 * LHC_CLOCK_PERIOD_NS *
616  (event.time().value() - timeOfPreviousEvent_));
617  ++(channelPlots_[detId].hitsCounterPerLumisection);
618  }
619  }
620  }
621  // End digis
622 
623  for (const auto &rechits : *timingRecHits)
624  {
625  const TotemTimingDetId detId(rechits.detId());
626  TotemTimingDetId detId_pot(rechits.detId());
627  detId_pot.setPlane(0);
628  detId_pot.setChannel(0);
629  TotemTimingDetId detId_plane(rechits.detId());
630  detId_plane.setChannel(0);
631 
632  for (const auto &rechit : rechits)
633  {
634  if (potPlots_.find(detId_pot) != potPlots_.end())
635  {
636  potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
637 
638 
639  TH2F *hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F();
640  TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
641  float yCorrected = rechit.getY();
642  yCorrected += (detId.rp()==TOTEM_TIMING_TOP_RP_ID)?
645  float x_shift = detId.plane();
646  x_shift += (rechit.getX()>2)? 0.25 : 0;
647  int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
648  int numOfBins = rechit.getYWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
649  for ( int i=0; i<numOfBins; ++i)
650  {
651  potPlots_[detId_pot].hitDistribution2d->Fill(
652  detId.plane() + 0.25 * (rechit.getX()>2),
653  hitHistoTmpYAxis->GetBinCenter(startBin+i) );
654  potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
655  x_shift,
656  hitHistoTmpYAxis->GetBinCenter(startBin+i) );
657  }
658 
659  //All plots with Time
660  if ( rechit.getT() != TotemTimingRecHit::NO_T_AVAILABLE )
661  {
662  for ( int i=0; i<numOfBins; ++i)
663  potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
664  detId.plane() + 0.25 * (rechit.getX()>2),
665  hitHistoTmpYAxis->GetBinCenter(startBin+i) );
666 
667  potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
668  potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
669 
670  // Plane Plots
671  if (planePlots_.find(detId_plane) != planePlots_.end())
672  {
673  // Visualization tricks
674  float x_shift = (rechit.getX()>2)? 15 : 0;
675  TH1F *hitProfileHistoTmp = planePlots_[detId_plane].hitProfile->getTH1F();
676  int numOfBins = rechit.getYWidth()*INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
677  if (detId.rp()==TOTEM_TIMING_TOP_RP_ID)
678  {
679  float yCorrected = rechit.getY()+verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
680  int startBin = hitProfileHistoTmp->FindBin(yCorrected);
681  for ( int i=0; i<numOfBins; ++i)
682  hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+i) );
683  }
684  else
685  {
686  float yCorrected = rechit.getY()+verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
687  int startBin = hitProfileHistoTmp->FindBin(yCorrected);
688  int totBins = hitProfileHistoTmp->GetNbinsX();
689  for ( int i=0; i<numOfBins; ++i)
690  hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+i) );
691  }
692 
693  if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
694  channelsPerPlaneWithTime[detId_plane]++;
695  else
696  channelsPerPlaneWithTime[detId_plane] = 0;
697  }
698 
699  if (channelPlots_.find(detId) != channelPlots_.end())
700  {
701  potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
702  channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
703  channelPlots_[detId].recHitTime->Fill(rechit.getT());
704  channelPlots_[detId].amplitude->Fill(rechit.getAmplitude());
705  }
706  }
707  }
708  }
709  }
710  // End RecHits
711 
712  // Tomography of timing using strips
713  for (const auto &rechits : *timingRecHits)
714  {
715  const TotemTimingDetId detId(rechits.detId());
716  TotemTimingDetId detId_pot(rechits.detId());
717  detId_pot.setPlane(0);
718  detId_pot.setChannel(0);
719  TotemTimingDetId detId_plane(rechits.detId());
720  detId_plane.setChannel(0);
721 
722  float y_shift=(detId.rp()==TOTEM_TIMING_TOP_RP_ID)?20:5;
723 
724  for (const auto &rechit : rechits)
725  {
726  if (rechit.getT() != TotemTimingRecHit::NO_T_AVAILABLE &&
727  potPlots_.find(detId_pot) != potPlots_.end() &&
728  planePlots_.find(detId_plane) != planePlots_.end() &&
729  channelPlots_.find(detId) != channelPlots_.end() )
730  {
731  if ( stripTracks.isValid() )
732  {
733  for (const auto &ds : *stripTracks) {
734  const CTPPSDetId stripId(ds.detId());
735  // mean position of U and V planes
736  TotemRPDetId plId_V(stripId);
737  plId_V.setPlane(0);
738  TotemRPDetId plId_U(stripId);
739  plId_U.setPlane(1);
740 
741  double rp_x = 0;
742  double rp_y = 0;
743  try
744  {
745  rp_x = (geometry->getSensor(plId_V)->translation().x() +
746  geometry->getSensor(plId_U)->translation().x())/2;
747  rp_y = (geometry->getSensor(plId_V)->translation().y() +
748  geometry->getSensor(plId_U)->translation().y())/2;
749  }
750  catch(const cms::Exception &)
751  {
752  continue;
753  }
754 
755  for (const auto &striplt : ds) {
756  if (striplt.isValid() && stripId.arm() == detId.arm()) {
757  if (striplt.getTx() > maximumStripAngleForTomography_ ||
758  striplt.getTy() > maximumStripAngleForTomography_)
759  continue;
760  if (striplt.getTx() < minimumStripAngleForTomography_ ||
761  striplt.getTy() < minimumStripAngleForTomography_)
762  continue;
763  if (stripId.rp() - detId.rp() ==
765  {
766  double x = striplt.getX0() - rp_x;
767  double y = striplt.getY0() - rp_y;
768  if (stripId.station() == TOTEM_STATION_210)
769  {
770  potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
771  channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
772  }
773  else if (stripId.station() == TOTEM_STATION_220)
774  {
775  potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
776  channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
777  }
778  }
779  }
780  }
781  }
782  }
783  }
784  }
785  }
786 
787 
788  for (auto &plt : potPlots_) {
789  plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
790  plt.second.planesWithDigisSet.clear();
791  plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
792  plt.second.planesWithTimeSet.clear();
793  }
794 
795  for (const auto &plt : channelsPerPlane) {
796  planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
797  }
798  for (const auto &plt : channelsPerPlaneWithTime) {
799  planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
800  }
801 
802  timeOfPreviousEvent_ = event.time().value();
803 }
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
void setChannel(uint32_t channel)
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
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:66
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
static const int TOTEM_STATION_220
Event setup record containing the real (actual) geometry information.
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
void setPlane(uint32_t channel)
DDTranslation translation() const
Definition: DetGeomDesc.h:84
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
bool isValid() const
Definition: HandleBase.h:74
const T & get() const
Definition: EventSetup.h:59
static const double SAMPIC_ADC_V
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
ESHandle< TrackerGeometry > geometry
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:56
edm::Timestamp time() const
Definition: EventBase.h:61
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void TotemTimingDQMSource::beginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

Definition at line 490 of file TotemTimingDQMSource.cc.

References plotFactory::plot, and potPlots_.

492 {
493  for ( auto& plot : potPlots_ )
494  plot.second.hitDistribution2d_lumisection->Reset();
495 }
std::unordered_map< unsigned int, PotPlots > potPlots_
void TotemTimingDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 458 of file TotemTimingDQMSource.cc.

References DQMStore::IBooker::cd(), channelPlots_, CTPPS_NUM_OF_ARMS, globalPlot_, planePlots_, potPlots_, 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.

461 {
462  ibooker.cd();
463  ibooker.setCurrentFolder("CTPPS");
464 
465  globalPlot_ = GlobalPlots(ibooker);
466 
467  for (unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm)
468  {
469  for (unsigned short rp = TOTEM_TIMING_TOP_RP_ID;
470  rp <= TOTEM_TIMING_BOT_RP_ID; ++rp)
471  {
472  const TotemTimingDetId rpId(arm, TOTEM_TIMING_STATION_ID, rp);
473  potPlots_[rpId] = PotPlots(ibooker, rpId);
474  for (unsigned short pl = 0; pl < TOTEM_TIMING_NUM_OF_PLANES; ++pl)
475  {
476  const TotemTimingDetId plId(arm, TOTEM_TIMING_STATION_ID, rp, pl);
477  planePlots_[plId] = PlanePlots(ibooker, plId);
478  for (unsigned short ch = 0; ch < TOTEM_TIMING_NUM_OF_CHANNELS; ++ch)
479  {
480  const TotemTimingDetId chId(arm, TOTEM_TIMING_STATION_ID, rp, pl, ch);
481  channelPlots_[chId] = ChannelPlots(ibooker, chId);
482  }
483  }
484  }
485  }
486 }
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_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
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 435 of file TotemTimingDQMSource.cc.

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

437 {
438  // Get detector shifts from the geometry (if present)
440  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry_ );
441  const CTPPSGeometry *geom = geometry_.product();
444  try
445  {
446  const DetGeomDesc* det_top = geom->getSensor( detid_top );
447  verticalShiftTop_ = det_top->translation().y() + det_top->params().at( 1 );
448  const DetGeomDesc* det_bot = geom->getSensor( detid_bot );
449  verticalShiftBot_ = det_bot->translation().y() + det_bot->params().at( 1 );
450  } catch (const cms::Exception &) {
451  verticalShiftTop_ = 0;
452  verticalShiftBot_ = 0;
453  }
454 }
Event setup record containing the real (actual) geometry information.
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
static const int TOTEM_TIMING_STATION_ID
Geometrical description of a sensor.
Definition: DetGeomDesc.h:37
DDTranslation translation() const
Definition: DetGeomDesc.h:84
static const int TOTEM_TIMING_TOP_RP_ID
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
const T & get() const
Definition: EventSetup.h:59
std::vector< double > params() const
Definition: DetGeomDesc.h:89
static const int TOTEM_TIMING_BOT_RP_ID
T const * product() const
Definition: ESHandle.h:86
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void TotemTimingDQMSource::endLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
)
overrideprotected

Definition at line 807 of file TotemTimingDQMSource.cc.

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

808  {
810  TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F();
811  for (auto &plot : potPlots_) {
812  TH2F *hitHistoTmp = plot.second.digiSentPercentage->getTH2F();
813  TH2F *histoSent = plot.second.digiSent->getTH2F();
814  TH2F *histoAll = plot.second.digiAll->getTH2F();
815 
816  hitHistoTmp->Divide(histoSent, histoAll);
817  hitHistoTmp->Scale(100);
818  hitHistoGlobalTmp->Add(hitHistoTmp,1);
819 
820  plot.second.baseline->Reset();
821  plot.second.noiseRMS->Reset();
822  plot.second.meanAmplitude->Reset();
823  plot.second.cellOfMax->Reset();
824  plot.second.hitRate->Reset();
825  TotemTimingDetId rpId(plot.first);
826  for (auto &chPlot : channelPlots_) {
827  TotemTimingDetId chId(chPlot.first);
828  if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) {
829  plot.second.baseline->Fill(
830  chId.plane(), chId.channel(),
831  chPlot.second.noiseSamples->getTH1F()->GetMean());
832  plot.second.noiseRMS->Fill(
833  chId.plane(), chId.channel(),
834  chPlot.second.noiseSamples->getTH1F()->GetRMS());
835  plot.second.meanAmplitude->Fill(
836  chId.plane(), chId.channel(),
837  chPlot.second.amplitude->getTH1F()->GetMean());
838  plot.second.cellOfMax->Fill(
839  chId.plane(), chId.channel(),
840  chPlot.second.cellOfMax->getTH1F()->GetMean());
841  plot.second.hitRate->Fill(
842  chId.plane(), chId.channel(),
843  (double)chPlot.second.hitsCounterPerLumisection * HIT_RATE_FACTOR);
844  }
845  }
846  }
847 
848  for (auto &plot : channelPlots_) {
849  if (plot.second.hitsCounterPerLumisection != 0) {
850  plot.second.hitRate->Fill((double)plot.second.hitsCounterPerLumisection *
852  }
853  plot.second.hitsCounterPerLumisection = 0;
854  }
855 }
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
static const double HIT_RATE_FACTOR
std::unordered_map< unsigned int, PotPlots > potPlots_
void Reset()
reset ME (ie. contents, errors, etc)
TH2F * getTH2F() const
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
void TotemTimingDQMSource::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 859 of file TotemTimingDQMSource.cc.

References DEFINE_FWK_MODULE.

859 {}

Member Data Documentation

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

Definition at line 204 of file TotemTimingDQMSource.cc.

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

const float TotemTimingDQMSource::COS_8_DEG = 0.990268
staticprivate

Definition at line 90 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 85 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 84 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 76 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const double TotemTimingDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 68 of file TotemTimingDQMSource.cc.

const double TotemTimingDQMSource::DQM_FRACTION_OF_EVENTS = 1.
staticprivate

Definition at line 65 of file TotemTimingDQMSource.cc.

GlobalPlots TotemTimingDQMSource::globalPlot_
private

Definition at line 116 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms(), and endLuminosityBlock().

const double TotemTimingDQMSource::HIT_RATE_FACTOR
staticprivate
Initial value:

Definition at line 67 of file TotemTimingDQMSource.cc.

Referenced by endLuminosityBlock().

const double TotemTimingDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM
staticprivate
const double TotemTimingDQMSource::LHC_CLOCK_PERIOD_NS = 24.95
staticprivate

Definition at line 64 of file TotemTimingDQMSource.cc.

Referenced by analyze().

double TotemTimingDQMSource::maximumStripAngleForTomography_
private

Definition at line 100 of file TotemTimingDQMSource.cc.

Referenced by analyze().

double TotemTimingDQMSource::minimumStripAngleForTomography_
private

Definition at line 99 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 176 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 75 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::SAMPIC_MAX_NUMBER_OF_SAMPLES = 64
staticprivate

Definition at line 74 of file TotemTimingDQMSource.cc.

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

Definition at line 73 of file TotemTimingDQMSource.cc.

unsigned int TotemTimingDQMSource::samplesForNoise_
private

Definition at line 101 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 61 of file TotemTimingDQMSource.cc.

const float TotemTimingDQMSource::SIN_8_DEG = -0.139173
staticprivate

Definition at line 91 of file TotemTimingDQMSource.cc.

edm::TimeValue_t TotemTimingDQMSource::timeOfPreviousEvent_
private

Definition at line 103 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 94 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 97 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 93 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 95 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::TOMOGRAPHY_RESOLUTION_MM = 1
staticprivate
const int TotemTimingDQMSource::TOTEM_STATION_210 = 0
staticprivate

Definition at line 78 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STATION_220 = 2
staticprivate

Definition at line 79 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STRIP_MAX_RP_ID = 5
staticprivate

Definition at line 83 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STRIP_MIN_RP_ID = 4
staticprivate

Definition at line 82 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_BOT_RP_ID = 1
staticprivate

Definition at line 81 of file TotemTimingDQMSource.cc.

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

const int TotemTimingDQMSource::TOTEM_TIMING_FED_ID_45
staticprivate
Initial value:

Definition at line 88 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_FED_ID_56
staticprivate
Initial value:

Definition at line 89 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 87 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const int TotemTimingDQMSource::TOTEM_TIMING_NUM_OF_PLANES = 4
staticprivate

Definition at line 86 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const int TotemTimingDQMSource::TOTEM_TIMING_STATION_ID = 2
staticprivate

Definition at line 77 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

const int TotemTimingDQMSource::TOTEM_TIMING_TOP_RP_ID = 0
staticprivate

Definition at line 80 of file TotemTimingDQMSource.cc.

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

unsigned int TotemTimingDQMSource::verbosity_
private

Definition at line 102 of file TotemTimingDQMSource.cc.

Referenced by analyze().

float TotemTimingDQMSource::verticalShiftBot_
private

Definition at line 105 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

float TotemTimingDQMSource::verticalShiftTop_
private

Definition at line 105 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().