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:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

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 one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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
 

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
 

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_
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 500 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.

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

References plotFactory::plot, and potPlots_.

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

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

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

References relativeConstraints::geom, edm::EventSetup::get(), CTPPSGeometry::getSensorNoThrow(), 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  verticalShiftTop_ = 0;
445  verticalShiftBot_ = 0;
446  {
447  const DetGeomDesc* det_top = geom->getSensorNoThrow( detid_top );
448  if(det_top) {
449  verticalShiftTop_ = det_top->translation().y() + det_top->params().at( 1 );
450  }
451  const DetGeomDesc* det_bot = geom->getSensorNoThrow( detid_bot );
452  if(det_bot)
453  verticalShiftBot_ = det_bot->translation().y() + det_bot->params().at( 1 );
454  }
455 }
const DetGeomDesc * getSensorNoThrow(unsigned int id) const
Event setup record containing the real (actual) geometry information.
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
T get() const
Definition: EventSetup.h:62
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 808 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().

809  {
811  TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F();
812  for (auto &plot : potPlots_) {
813  TH2F *hitHistoTmp = plot.second.digiSentPercentage->getTH2F();
814  TH2F *histoSent = plot.second.digiSent->getTH2F();
815  TH2F *histoAll = plot.second.digiAll->getTH2F();
816 
817  hitHistoTmp->Divide(histoSent, histoAll);
818  hitHistoTmp->Scale(100);
819  hitHistoGlobalTmp->Add(hitHistoTmp,1);
820 
821  plot.second.baseline->Reset();
822  plot.second.noiseRMS->Reset();
823  plot.second.meanAmplitude->Reset();
824  plot.second.cellOfMax->Reset();
825  plot.second.hitRate->Reset();
826  TotemTimingDetId rpId(plot.first);
827  for (auto &chPlot : channelPlots_) {
828  TotemTimingDetId chId(chPlot.first);
829  if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) {
830  plot.second.baseline->Fill(
831  chId.plane(), chId.channel(),
832  chPlot.second.noiseSamples->getTH1F()->GetMean());
833  plot.second.noiseRMS->Fill(
834  chId.plane(), chId.channel(),
835  chPlot.second.noiseSamples->getTH1F()->GetRMS());
836  plot.second.meanAmplitude->Fill(
837  chId.plane(), chId.channel(),
838  chPlot.second.amplitude->getTH1F()->GetMean());
839  plot.second.cellOfMax->Fill(
840  chId.plane(), chId.channel(),
841  chPlot.second.cellOfMax->getTH1F()->GetMean());
842  plot.second.hitRate->Fill(
843  chId.plane(), chId.channel(),
844  (double)chPlot.second.hitsCounterPerLumisection * HIT_RATE_FACTOR);
845  }
846  }
847  }
848 
849  for (auto &plot : channelPlots_) {
850  if (plot.second.hitsCounterPerLumisection != 0) {
851  plot.second.hitRate->Fill((double)plot.second.hitsCounterPerLumisection *
853  }
854  plot.second.hitsCounterPerLumisection = 0;
855  }
856 }
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 860 of file TotemTimingDQMSource.cc.

References DEFINE_FWK_MODULE.

860 {}

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().