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< edm::LuminosityBlockCache< totemds::Cache > > 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< edm::LuminosityBlockCache< totemds::Cache > >
 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 bookHistograms (DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (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
 

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 50 of file TotemTimingDQMSource.cc.

Constructor & Destructor Documentation

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

Definition at line 415 of file TotemTimingDQMSource.cc.

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

437 {}

Member Function Documentation

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

Definition at line 510 of file TotemTimingDQMSource.cc.

References edm::EventBase::bunchCrossing(), channelPlots_, MillePedeFileConverter_cfg::e, geometry, edm::EventSetup::get(), edm::Event::getLuminosityBlock(), CTPPSGeometry::getSensor(), 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_, 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.

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

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

468 {
469  ibooker.cd();
470  ibooker.setCurrentFolder("CTPPS");
471 
472  globalPlot_ = GlobalPlots(ibooker);
473 
474  for (unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm)
475  {
476  for (unsigned short rp = TOTEM_TIMING_TOP_RP_ID;
477  rp <= TOTEM_TIMING_BOT_RP_ID; ++rp)
478  {
480  potPlots_[rpId] = PotPlots(ibooker, rpId);
481  for (unsigned short pl = 0; pl < TOTEM_TIMING_NUM_OF_PLANES; ++pl)
482  {
483  const TotemTimingDetId plId(arm, TOTEM_TIMING_STATION_ID, rp, pl);
484  planePlots_[plId] = PlanePlots(ibooker, plId);
485  for (unsigned short ch = 0; ch < TOTEM_TIMING_NUM_OF_CHANNELS; ++ch)
486  {
487  const TotemTimingDetId chId(arm, TOTEM_TIMING_STATION_ID, rp, pl, ch);
488  channelPlots_[chId] = ChannelPlots(ibooker, chId);
489  }
490  }
491  }
492  }
493 }
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 441 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_.

443 {
444  // Get detector shifts from the geometry (if present)
446  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry_ );
447  const CTPPSGeometry *geom = geometry_.product();
450  verticalShiftTop_ = 0;
451  verticalShiftBot_ = 0;
452  {
453  const DetGeomDesc* det_top = geom->getSensorNoThrow( detid_top );
454  if(det_top) {
455  verticalShiftTop_ = det_top->translation().y() + det_top->params().at( 1 );
456  }
457  const DetGeomDesc* det_bot = geom->getSensorNoThrow( detid_bot );
458  if(det_bot)
459  verticalShiftBot_ = det_bot->translation().y() + det_bot->params().at( 1 );
460  }
461 }
Translation translation() const
Definition: DetGeomDesc.h:66
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: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:71
std::vector< double > params() const
Definition: DetGeomDesc.h:68
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::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 877 of file TotemTimingDQMSource.cc.

References DEFINE_FWK_MODULE.

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

Definition at line 498 of file TotemTimingDQMSource.cc.

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

500 {
501  auto d = std::make_shared<totemds::Cache>();
502  d->hitDistribution2dMap.reserve(potPlots_.size());
503  for ( auto& plot : potPlots_ )
504  d->hitDistribution2dMap[plot.first] = std::unique_ptr<TH2F>(static_cast<TH2F*>(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
505  return d;
506 }
std::unordered_map< unsigned int, PotPlots > potPlots_
void TotemTimingDQMSource::globalEndLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
overrideprotected

Definition at line 819 of file TotemTimingDQMSource.cc.

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

820  {
821  auto lumiCache = luminosityBlockCache(iLumi.index());
822  for ( auto& plot : potPlots_ ) {
823  *(plot.second.hitDistribution2d_lumisection->getTH2F())=*(lumiCache->hitDistribution2dMap[plot.first]);
824  }
825 
827  TH2F *hitHistoGlobalTmp = globalPlot_.digiSentPercentage->getTH2F();
828  for (auto &plot : potPlots_) {
829  TH2F *hitHistoTmp = plot.second.digiSentPercentage->getTH2F();
830  TH2F *histoSent = plot.second.digiSent->getTH2F();
831  TH2F *histoAll = plot.second.digiAll->getTH2F();
832 
833  hitHistoTmp->Divide(histoSent, histoAll);
834  hitHistoTmp->Scale(100);
835  hitHistoGlobalTmp->Add(hitHistoTmp,1);
836 
837  plot.second.baseline->Reset();
838  plot.second.noiseRMS->Reset();
839  plot.second.meanAmplitude->Reset();
840  plot.second.cellOfMax->Reset();
841  plot.second.hitRate->Reset();
842  TotemTimingDetId rpId(plot.first);
843  for (auto &chPlot : channelPlots_) {
844  TotemTimingDetId chId(chPlot.first);
845  if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) {
846  plot.second.baseline->Fill(
847  chId.plane(), chId.channel(),
848  chPlot.second.noiseSamples->getTH1F()->GetMean());
849  plot.second.noiseRMS->Fill(
850  chId.plane(), chId.channel(),
851  chPlot.second.noiseSamples->getTH1F()->GetRMS());
852  plot.second.meanAmplitude->Fill(
853  chId.plane(), chId.channel(),
854  chPlot.second.amplitude->getTH1F()->GetMean());
855  plot.second.cellOfMax->Fill(
856  chId.plane(), chId.channel(),
857  chPlot.second.cellOfMax->getTH1F()->GetMean());
858  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first];
859  plot.second.hitRate->Fill(
860  chId.plane(), chId.channel(),
861  (double)hitsCounterPerLumisection * HIT_RATE_FACTOR);
862  }
863  }
864  }
865 
866  for (auto &plot : channelPlots_) {
867  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first];
868  if (hitsCounterPerLumisection != 0) {
869  plot.second.hitRate->Fill((double)hitsCounterPerLumisection *
871  }
872  }
873 }
LuminosityBlockIndex index() const
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 ...

Member Data Documentation

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

Definition at line 211 of file TotemTimingDQMSource.cc.

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

const float TotemTimingDQMSource::COS_8_DEG = 0.990268
staticprivate

Definition at line 98 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 93 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 92 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 84 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const double TotemTimingDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 76 of file TotemTimingDQMSource.cc.

const double TotemTimingDQMSource::DQM_FRACTION_OF_EVENTS = 1.
staticprivate

Definition at line 73 of file TotemTimingDQMSource.cc.

GlobalPlots TotemTimingDQMSource::globalPlot_
private

Definition at line 124 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms(), and globalEndLuminosityBlock().

const double TotemTimingDQMSource::HIT_RATE_FACTOR
staticprivate
Initial value:

Definition at line 75 of file TotemTimingDQMSource.cc.

Referenced by globalEndLuminosityBlock().

const double TotemTimingDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM
staticprivate
Initial value:

Definition at line 79 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::LHC_CLOCK_PERIOD_NS = 24.95
staticprivate

Definition at line 72 of file TotemTimingDQMSource.cc.

Referenced by analyze().

double TotemTimingDQMSource::maximumStripAngleForTomography_
private

Definition at line 108 of file TotemTimingDQMSource.cc.

Referenced by analyze().

double TotemTimingDQMSource::minimumStripAngleForTomography_
private

Definition at line 107 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

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

Referenced by analyze().

const double TotemTimingDQMSource::SAMPIC_MAX_NUMBER_OF_SAMPLES = 64
staticprivate

Definition at line 82 of file TotemTimingDQMSource.cc.

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

Definition at line 81 of file TotemTimingDQMSource.cc.

unsigned int TotemTimingDQMSource::samplesForNoise_
private

Definition at line 109 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 69 of file TotemTimingDQMSource.cc.

const float TotemTimingDQMSource::SIN_8_DEG = -0.139173
staticprivate

Definition at line 99 of file TotemTimingDQMSource.cc.

edm::TimeValue_t TotemTimingDQMSource::timeOfPreviousEvent_
private

Definition at line 111 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 102 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 105 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 101 of file TotemTimingDQMSource.cc.

Referenced by analyze().

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

Definition at line 103 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const double TotemTimingDQMSource::TOMOGRAPHY_RESOLUTION_MM = 1
staticprivate

Definition at line 80 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_STATION_210 = 0
staticprivate

Definition at line 86 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STATION_220 = 2
staticprivate

Definition at line 87 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STRIP_MAX_RP_ID = 5
staticprivate

Definition at line 91 of file TotemTimingDQMSource.cc.

Referenced by analyze().

const int TotemTimingDQMSource::TOTEM_STRIP_MIN_RP_ID = 4
staticprivate

Definition at line 90 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_BOT_RP_ID = 1
staticprivate

Definition at line 89 of file TotemTimingDQMSource.cc.

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

const int TotemTimingDQMSource::TOTEM_TIMING_FED_ID_45
staticprivate
Initial value:

Definition at line 96 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_FED_ID_56
staticprivate
Initial value:

Definition at line 97 of file TotemTimingDQMSource.cc.

const int TotemTimingDQMSource::TOTEM_TIMING_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 95 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const int TotemTimingDQMSource::TOTEM_TIMING_NUM_OF_PLANES = 4
staticprivate

Definition at line 94 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms().

const int TotemTimingDQMSource::TOTEM_TIMING_STATION_ID = 2
staticprivate

Definition at line 85 of file TotemTimingDQMSource.cc.

Referenced by bookHistograms(), and dqmBeginRun().

const int TotemTimingDQMSource::TOTEM_TIMING_TOP_RP_ID = 0
staticprivate

Definition at line 88 of file TotemTimingDQMSource.cc.

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

unsigned int TotemTimingDQMSource::verbosity_
private

Definition at line 110 of file TotemTimingDQMSource.cc.

Referenced by analyze().

float TotemTimingDQMSource::verticalShiftBot_
private

Definition at line 113 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

float TotemTimingDQMSource::verticalShiftTop_
private

Definition at line 113 of file TotemTimingDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().