CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
CTPPSDiamondDQMSource Class Reference
Inheritance diagram for CTPPSDiamondDQMSource:
one::DQMEDAnalyzer< edm::LuminosityBlockCache< dds::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

 CTPPSDiamondDQMSource (const edm::ParameterSet &)
 
 ~CTPPSDiamondDQMSource () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< edm::LuminosityBlockCache< dds::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< dds::CacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) const override
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &) override
 

Private Attributes

int centralOOT_
 
std::unordered_map< unsigned int, ChannelPlotschannelPlots_
 
int EC_difference_45_
 
int EC_difference_56_
 
bool excludeMultipleHits_
 
GlobalPlots globalPlot_
 
double horizontalShiftBwDiamondPixels_
 
double horizontalShiftOfDiamond_
 
std::unordered_map< unsigned int, PlanePlotsplanePlots_
 
std::unordered_map< unsigned int, PotPlotspotPlots_
 
std::vector< std::pair< edm::EventRange, int > > runParameters_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
 
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
 
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
 
unsigned int verbosity_
 

Static Private Attributes

static const int CHANNEL_OF_VFAT_CLOCK = 30
 
static const int CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
 
static const int CTPPS_DIAMOND_NUM_OF_PLANES = 4
 
static const int CTPPS_DIAMOND_RP_ID = 6
 
static const int CTPPS_DIAMOND_STATION_ID = 1
 
static const int CTPPS_FAR_RP_ID = 3
 
static const int CTPPS_FED_ID_45 = 583
 
static const int CTPPS_FED_ID_56 = 582
 
static const int CTPPS_NEAR_RP_ID = 2
 
static const int CTPPS_NUM_OF_ARMS = 2
 
static const int CTPPS_PIXEL_STATION_ID = 2
 
static const double DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
 
static const double HPTDC_BIN_WIDTH_NS = 25. / 1024
 
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1. / DISPLAY_RESOLUTION_FOR_HITS_MM
 
static const double SEC_PER_LUMI_SECTION = 23.31
 

Detailed Description

Definition at line 67 of file CTPPSDiamondDQMSource.cc.

Constructor & Destructor Documentation

CTPPSDiamondDQMSource::CTPPSDiamondDQMSource ( const edm::ParameterSet ps)

Definition at line 475 of file CTPPSDiamondDQMSource.cc.

References edm::ParameterSet::getParameter(), muonDTDigis_cfi::pset, and runParameters_.

478  consumes<edm::DetSetVector<CTPPSPixelLocalTrack>>(ps.getParameter<edm::InputTag>("tagPixelLocalTracks"))),
481  consumes<edm::DetSetVector<CTPPSDiamondRecHit>>(ps.getParameter<edm::InputTag>("tagDiamondRecHits"))),
483  consumes<edm::DetSetVector<CTPPSDiamondLocalTrack>>(ps.getParameter<edm::InputTag>("tagDiamondLocalTracks"))),
484  tokenFEDInfo_(consumes<std::vector<TotemFEDInfo>>(ps.getParameter<edm::InputTag>("tagFEDInfo"))),
485  excludeMultipleHits_(ps.getParameter<bool>("excludeMultipleHits")),
486  centralOOT_(-999),
487  verbosity_(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
488  EC_difference_56_(-500),
489  EC_difference_45_(-500) {
490  for (const auto& pset : ps.getParameter<std::vector<edm::ParameterSet>>("offsetsOOT")) {
491  runParameters_.emplace_back(
492  std::make_pair(pset.getParameter<edm::EventRange>("validityRange"), pset.getParameter<int>("centralOOT")));
493  }
494 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
std::vector< std::pair< edm::EventRange, int > > runParameters_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
CTPPSDiamondDQMSource::~CTPPSDiamondDQMSource ( )
override

Definition at line 498 of file CTPPSDiamondDQMSource.cc.

498 {}

Member Function Documentation

void CTPPSDiamondDQMSource::analyze ( const edm::Event event,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 563 of file CTPPSDiamondDQMSource.cc.

References funct::abs(), edm::EventBase::bunchCrossing(), centralOOT_, CHANNEL_OF_VFAT_CLOCK, channelAlignedWithTrack(), channelPlots_, CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_FAR_RP_ID, CTPPS_FED_ID_45, CTPPS_FED_ID_56, CTPPS_PIXEL_STATION_ID, TauDecayModes::dec, EC_difference_45_, EC_difference_56_, excludeMultipleHits_, HcalObjRepresent::Fill(), edm::EventSetup::get(), HPTDCErrorFlags::getErrorId(), edm::Event::getLuminosityBlock(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, HPTDC_BIN_WIDTH_NS, mps_fire::i, edm::LuminosityBlock::index(), edm::eventsetup::heterocontainer::insert(), INV_DISPLAY_RESOLUTION_FOR_HITS_MM, edm::HandleBase::isValid(), PixelTracks_cff::pixelTracks, planePlots_, potPlots_, edm::ESHandle< T >::product(), TrackInfoProducer_cfi::rechits, CTPPSDiamondDetId::setChannel(), CTPPSDiamondDetId::setPlane(), mps_update::status, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, tokenDiamondHit_, tokenDiamondTrack_, tokenDigi_, tokenFEDInfo_, tokenPixelTrack_, tokenStatus_, HiIsolationCommonParameters_cff::track, l1t::tracks, and verbosity_.

563  {
564  // get event data
566  event.getByToken(tokenStatus_, diamondVFATStatus);
567 
569  event.getByToken(tokenPixelTrack_, pixelTracks);
570 
572  event.getByToken(tokenDigi_, diamondDigis);
573 
575  event.getByToken(tokenFEDInfo_, fedInfo);
576 
578  event.getByToken(tokenDiamondHit_, diamondRecHits);
579 
581  event.getByToken(tokenDiamondTrack_, diamondLocalTracks);
582 
584  iSetup.get<VeryForwardRealGeometryRecord>().get(geometry_);
585 
586  // check validity
587  bool valid = true;
588  valid &= diamondVFATStatus.isValid();
589  valid &= pixelTracks.isValid();
590  valid &= diamondDigis.isValid();
591  valid &= fedInfo.isValid();
592  valid &= diamondRecHits.isValid();
593  valid &= diamondLocalTracks.isValid();
594 
595  if (!valid) {
596  if (verbosity_) {
597  edm::LogProblem("CTPPSDiamondDQMSource")
598  << "ERROR in CTPPSDiamondDQMSource::analyze > some of the required inputs are not valid. Skipping this "
599  "event.\n"
600  << " diamondVFATStatus.isValid = " << diamondVFATStatus.isValid() << "\n"
601  << " pixelTracks.isValid = " << pixelTracks.isValid() << "\n"
602  << " diamondDigis.isValid = " << diamondDigis.isValid() << "\n"
603  << " fedInfo.isValid = " << fedInfo.isValid() << "\n"
604  << " diamondRecHits.isValid = " << diamondRecHits.isValid() << "\n"
605  << " diamondLocalTracks.isValid = " << diamondLocalTracks.isValid();
606  }
607 
608  return;
609  }
610 
611  //------------------------------
612  // RP Plots
613  //------------------------------
614 
615  //------------------------------
616  // Correlation Plots
617  //------------------------------
618 
619  // Using CTPPSDiamondDigi
620  for (const auto& digis : *diamondDigis) {
621  const CTPPSDiamondDetId detId(digis.detId());
622  CTPPSDiamondDetId detId_pot(digis.detId());
623 
624  for (const auto& digi : digis) {
625  detId_pot.setPlane(0);
626  detId_pot.setChannel(0);
627  if (detId.channel() == CHANNEL_OF_VFAT_CLOCK)
628  continue;
629  if (potPlots_.find(detId_pot) == potPlots_.end())
630  continue;
631  //Leading without trailing investigation
632  if (digi.getLeadingEdge() != 0 || digi.getTrailingEdge() != 0) {
633  ++(potPlots_[detId_pot].HitCounter);
634  if (digi.getLeadingEdge() != 0) {
635  potPlots_[detId_pot].leadingEdgeCumulative_all->Fill(HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge());
636  }
637  if (digi.getLeadingEdge() != 0 && digi.getTrailingEdge() == 0) {
638  ++(potPlots_[detId_pot].LeadingOnlyCounter);
639  potPlots_[detId_pot].leadingEdgeCumulative_le->Fill(HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge());
640  }
641  if (digi.getLeadingEdge() == 0 && digi.getTrailingEdge() != 0) {
642  ++(potPlots_[detId_pot].TrailingOnlyCounter);
643  potPlots_[detId_pot].trailingEdgeCumulative_te->Fill(HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge());
644  }
645  if (digi.getLeadingEdge() != 0 && digi.getTrailingEdge() != 0) {
646  ++(potPlots_[detId_pot].CompleteCounter);
647  potPlots_[detId_pot].leadingTrailingCorrelationPot->Fill(HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge(),
648  HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge());
649  }
650  }
651 
652  // HPTDC Errors
653  const HPTDCErrorFlags hptdcErrors = digi.getHPTDCErrorFlags();
654  if (detId.channel() == 6 || detId.channel() == 7) // ch6 for HPTDC 0 and ch7 for HPTDC 1
655  {
656  int verticalIndex = 2 * detId.plane() + (detId.channel() - 6);
657  for (unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
658  if (hptdcErrors.getErrorId(hptdcErrorIndex - 1))
659  potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(hptdcErrorIndex, verticalIndex);
660  }
661  if (digi.getMultipleHit())
662  ++(potPlots_[detId_pot].MHCounter);
663  }
664  }
665 
666  // EC Errors
667  for (const auto& vfat_status : *diamondVFATStatus) {
668  const CTPPSDiamondDetId detId(vfat_status.detId());
669  CTPPSDiamondDetId detId_pot(vfat_status.detId());
670  detId_pot.setPlane(0);
671  detId_pot.setChannel(0);
672  for (const auto& status : vfat_status) {
673  if (!status.isOK())
674  continue;
675  if (potPlots_.find(detId_pot) == potPlots_.end())
676  continue;
677  if (channelPlots_.find(detId) == channelPlots_.end())
678  continue;
679 
680  // Check Event Number
681  for (const auto& optorx : *fedInfo) {
682  if (detId.arm() == 1 && optorx.getFEDId() == CTPPS_FED_ID_56) {
683  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.getLV1() & 0xFF) - ((unsigned int)status.getEC() & 0xFF)) &
684  0xFF);
685  if ((static_cast<int>((optorx.getLV1() & 0xFF) - status.getEC()) != EC_difference_56_) &&
686  (static_cast<uint8_t>((optorx.getLV1() & 0xFF) - status.getEC()) < 128))
688  static_cast<int>(optorx.getLV1() & 0xFF) - (static_cast<unsigned int>(status.getEC()) & 0xFF);
689  if (EC_difference_56_ != 1 && EC_difference_56_ != -500 && std::abs(EC_difference_56_) < 127) {
690  if (detId.channel() == 6 || detId.channel() == 7)
691  potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
692  if (verbosity_)
693  edm::LogProblem("CTPPSDiamondDQMSource")
694  << "FED " << CTPPS_FED_ID_56 << ": ECError at EV: 0x" << std::hex << optorx.getLV1()
695  << "\t\tVFAT EC: 0x" << static_cast<unsigned int>(status.getEC()) << "\twith ID: " << std::dec
696  << detId << "\tdiff: " << EC_difference_56_;
697  }
698  } else if (detId.arm() == 0 && optorx.getFEDId() == CTPPS_FED_ID_45) {
699  potPlots_[detId_pot].ECCheck->Fill((int)((optorx.getLV1() & 0xFF) - status.getEC()) & 0xFF);
700  if ((static_cast<int>((optorx.getLV1() & 0xFF) - status.getEC()) != EC_difference_45_) &&
701  (static_cast<uint8_t>((optorx.getLV1() & 0xFF) - status.getEC()) < 128))
703  static_cast<int>(optorx.getLV1() & 0xFF) - (static_cast<unsigned int>(status.getEC()) & 0xFF);
704  if (EC_difference_45_ != 1 && EC_difference_45_ != -500 && std::abs(EC_difference_45_) < 127) {
705  if (detId.channel() == 6 || detId.channel() == 7)
706  potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
707  if (verbosity_)
708  edm::LogProblem("CTPPSDiamondDQMSource")
709  << "FED " << CTPPS_FED_ID_45 << ": ECError at EV: 0x" << std::hex << optorx.getLV1()
710  << "\t\tVFAT EC: 0x" << static_cast<unsigned int>(status.getEC()) << "\twith ID: " << std::dec
711  << detId << "\tdiff: " << EC_difference_45_;
712  }
713  }
714  }
715  }
716  }
717 
718  // Using CTPPSDiamondRecHit
719  std::unordered_map<unsigned int, std::set<unsigned int>> planes;
720  std::unordered_map<unsigned int, std::set<unsigned int>> planes_inclusive;
721 
722  auto lumiCache = luminosityBlockCache(event.getLuminosityBlock().index());
723  for (const auto& rechits : *diamondRecHits) {
724  CTPPSDiamondDetId detId_pot(rechits.detId());
725  detId_pot.setPlane(0);
726  detId_pot.setChannel(0);
727  const CTPPSDiamondDetId detId(rechits.detId());
728 
729  for (const auto& rechit : rechits) {
730  planes_inclusive[detId_pot].insert(detId.plane());
731  if (excludeMultipleHits_ && rechit.getMultipleHits() > 0)
732  continue;
733  if (rechit.getToT() != 0 && centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_)
734  planes[detId_pot].insert(detId.plane());
735 
736  if (potPlots_.find(detId_pot) == potPlots_.end())
737  continue;
738 
739  float UFSDShift = 0.0;
740  if (rechit.getYWidth() < 3)
741  UFSDShift = 0.5; // Display trick for UFSD that have 2 pixels with same X
742 
743  if (rechit.getToT() != 0 && centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_) {
744  TH2F* hitHistoTmp = potPlots_[detId_pot].hitDistribution2d->getTH2F();
745  TAxis* hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
746  int startBin = hitHistoTmpYAxis->FindBin(rechit.getX() - horizontalShiftOfDiamond_ - 0.5 * rechit.getXWidth());
747  int numOfBins = rechit.getXWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
748  for (int i = 0; i < numOfBins; ++i) {
749  hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i));
750  }
751 
752  hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get();
753  hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
754  startBin = hitHistoTmpYAxis->FindBin(rechit.getX() - horizontalShiftOfDiamond_ - 0.5 * rechit.getXWidth());
755  numOfBins = rechit.getXWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
756  for (int i = 0; i < numOfBins; ++i) {
757  hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin + i));
758  }
759  }
760 
761  if (rechit.getToT() != 0) {
762  // Both
763  potPlots_[detId_pot].leadingEdgeCumulative_both->Fill(rechit.getT() + 25 * rechit.getOOTIndex());
764  potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill(rechit.getToT());
765 
766  TH2F* hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
767  TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
768  int startBin =
769  hitHistoOOTTmpYAxis->FindBin(rechit.getX() - horizontalShiftOfDiamond_ - 0.5 * rechit.getXWidth());
770  int numOfBins = rechit.getXWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
771  for (int i = 0; i < numOfBins; ++i) {
772  hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.getOOTIndex(),
773  hitHistoOOTTmpYAxis->GetBinCenter(startBin + i));
774  }
775  } else {
776  if (rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING) {
777  // Only leading
778  TH2F* hitHistoOOTTmp = potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
779  TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
780  int startBin =
781  hitHistoOOTTmpYAxis->FindBin(rechit.getX() - horizontalShiftOfDiamond_ - 0.5 * rechit.getXWidth());
782  int numOfBins = rechit.getXWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
783  for (int i = 0; i < numOfBins; ++i) {
784  hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.getOOTIndex(),
785  hitHistoOOTTmpYAxis->GetBinCenter(startBin + i));
786  }
787  }
788  }
789  if (rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING &&
790  potPlots_[detId_pot].activity_per_bx.count(rechit.getOOTIndex()) > 0)
791  potPlots_[detId_pot].activity_per_bx.at(rechit.getOOTIndex())->Fill(event.bunchCrossing());
792  }
793  }
794 
795  for (const auto& plt : potPlots_) {
796  plt.second.activePlanes->Fill(planes[plt.first].size());
797  plt.second.activePlanesInclusive->Fill(planes_inclusive[plt.first].size());
798  }
799 
800  // Using CTPPSDiamondLocalTrack
801  for (const auto& tracks : *diamondLocalTracks) {
802  CTPPSDiamondDetId detId_pot(tracks.detId());
803  detId_pot.setPlane(0);
804  detId_pot.setChannel(0);
805  const CTPPSDiamondDetId detId(tracks.detId());
806 
807  for (const auto& track : tracks) {
808  if (!track.isValid())
809  continue;
811  continue;
812  if (excludeMultipleHits_ && track.getMultipleHits() > 0)
813  continue;
814  if (potPlots_.find(detId_pot) == potPlots_.end())
815  continue;
816 
817  TH2F* trackHistoOOTTmp = potPlots_[detId_pot].trackDistributionOOT->getTH2F();
818  TAxis* trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
819  int startBin = trackHistoOOTTmpYAxis->FindBin(track.getX0() - horizontalShiftOfDiamond_ - track.getX0Sigma());
820  int numOfBins = 2 * track.getX0Sigma() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
821  for (int i = 0; i < numOfBins; ++i) {
822  trackHistoOOTTmp->Fill(track.getOOTIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin + i));
823  }
824 
825  if (centralOOT_ != -999 && track.getOOTIndex() == centralOOT_) {
826  TH1F* trackHistoInTimeTmp = potPlots_[detId_pot].trackDistribution->getTH1F();
827  int startBin = trackHistoInTimeTmp->FindBin(track.getX0() - horizontalShiftOfDiamond_ - track.getX0Sigma());
828  int numOfBins = 2 * track.getX0Sigma() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
829  for (int i = 0; i < numOfBins; ++i) {
830  trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin + i));
831  }
832  }
833  }
834  }
835 
836  // Channel efficiency using CTPPSDiamondLocalTrack
837  for (const auto& tracks : *diamondLocalTracks) {
838  CTPPSDiamondDetId detId_pot(tracks.detId());
839  detId_pot.setPlane(0);
840  detId_pot.setChannel(0);
841  for (const auto& track : tracks) {
842  // Find hits and planes in the track
843  int numOfHits = 0;
844  std::set<int> planesInTrackSet;
845  for (const auto& vec : *diamondRecHits) {
846  const CTPPSDiamondDetId detid(vec.detId());
847  if (detid.arm() != detId_pot.arm())
848  continue;
849 
850  for (const auto& hit : vec) {
851  // first check if the hit contributes to the track
852  if (track.containsHit(hit)) {
853  ++numOfHits;
854  planesInTrackSet.insert(detid.plane());
855  }
856  }
857  }
858 
859  if (numOfHits > 0 && numOfHits <= 10 && planesInTrackSet.size() > 2) {
860  for (int plane = 0; plane < 4; ++plane) {
861  for (int channel = 0; channel < 12; ++channel) {
862  int map_index = plane * 100 + channel;
863  if (potPlots_[detId_pot].effDoublecountingChMap.find(map_index) ==
864  potPlots_[detId_pot].effDoublecountingChMap.end()) {
865  potPlots_[detId_pot].effTriplecountingChMap[map_index] = 0;
866  potPlots_[detId_pot].effDoublecountingChMap[map_index] = 0;
867  }
868  CTPPSDiamondDetId detId(detId_pot.arm(), CTPPS_DIAMOND_STATION_ID, CTPPS_DIAMOND_RP_ID, plane, channel);
869  if (channelAlignedWithTrack(geometry_.product(), detId, track, 0.2)) {
870  // Channel should fire
871  ++(potPlots_[detId_pot].effDoublecountingChMap[map_index]);
872  for (const auto& rechits : *diamondRecHits) {
873  CTPPSDiamondDetId detId_hit(rechits.detId());
874  if (detId_hit == detId) {
875  for (const auto& rechit : rechits) {
876  if (track.containsHit(rechit, 1)) {
877  // Channel fired
878  ++(potPlots_[detId_pot].effTriplecountingChMap[map_index]);
879  }
880  }
881  }
882  }
883  }
884  }
885  }
886  }
887  }
888  }
889 
890  // Tomography of diamonds using pixel
891  for (const auto& rechits : *diamondRecHits) {
892  CTPPSDiamondDetId detId_pot(rechits.detId());
893  detId_pot.setPlane(0);
894  detId_pot.setChannel(0);
895  const CTPPSDiamondDetId detId(rechits.detId());
896  for (const auto& rechit : rechits) {
897  if (excludeMultipleHits_ && rechit.getMultipleHits() > 0)
898  continue;
899  if (rechit.getToT() == 0)
900  continue;
901  if (!pixelTracks.isValid())
902  continue;
903  if (potPlots_.find(detId_pot) == potPlots_.end())
904  continue;
905 
906  for (const auto& ds : *pixelTracks) {
907  if (ds.size() > 1)
908  continue;
909  const CTPPSPixelDetId pixId(ds.detId());
910  if (pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID)
911  continue;
912  for (const auto& lt : ds) {
913  if (lt.isValid() && pixId.arm() == detId_pot.arm()) {
914  if (rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.getOOTIndex() >= 0 &&
915  potPlots_[detId_pot].pixelTomographyAll.count(rechit.getOOTIndex()) > 0 &&
916  lt.getX0() - horizontalShiftBwDiamondPixels_ < 24)
917  potPlots_[detId_pot]
918  .pixelTomographyAll.at(rechit.getOOTIndex())
919  ->Fill(lt.getX0() - horizontalShiftBwDiamondPixels_ + 25 * detId.plane(), lt.getY0());
920  }
921  }
922  }
923  }
924  }
925 
926  //------------------------------
927  // Clock Plots
928  //------------------------------
929  // Commented out to save space in the DQM files, but code should be kept
930  // for ( const auto& digis : *diamondDigis ) {
931  // const CTPPSDiamondDetId detId( digis.detId() );
932  // CTPPSDiamondDetId detId_pot( digis.detId() );
933  // if ( detId.channel() == CHANNEL_OF_VFAT_CLOCK ) {
934  // detId_pot.setPlane( 0 );
935  // detId_pot.setChannel( 0 );
936  // for ( const auto& digi : digis ) {
937  // if ( digi.getLeadingEdge() != 0 ) {
938  // if ( detId.plane() == 1 ) {
939  // potPlots_[detId_pot].clock_Digi1_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
940  // potPlots_[detId_pot].clock_Digi1_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
941  // }
942  // if ( detId.plane() == 3 ) {
943  // potPlots_[detId_pot].clock_Digi3_le->Fill( HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge() );
944  // potPlots_[detId_pot].clock_Digi3_te->Fill( HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge() );
945  // }
946  // }
947  // }
948  // }
949  // }
950 
951  //------------------------------
952  // Plane Plots
953  //------------------------------
954 
955  // Using CTPPSDiamondDigi
956  std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
957  for (const auto& digis : *diamondDigis) {
958  const CTPPSDiamondDetId detId(digis.detId());
959  CTPPSDiamondDetId detId_plane(digis.detId());
960  for (const auto& digi : digis) {
961  detId_plane.setChannel(0);
962  if (detId.channel() == CHANNEL_OF_VFAT_CLOCK)
963  continue;
964  if (planePlots_.find(detId_plane) == planePlots_.end())
965  continue;
966 
967  if (digi.getLeadingEdge() != 0) {
968  planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill(detId.channel());
969  if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
970  channelsPerPlane[detId_plane]++;
971  else
972  channelsPerPlane[detId_plane] = 0;
973  }
974  }
975  }
976 
977  for (const auto& plt : channelsPerPlane) {
978  planePlots_[plt.first].hit_multiplicity->Fill(plt.second);
979  }
980 
981  // Using CTPPSDiamondRecHit
982  for (const auto& rechits : *diamondRecHits) {
983  CTPPSDiamondDetId detId_plane(rechits.detId());
984  detId_plane.setChannel(0);
985  for (const auto& rechit : rechits) {
986  if (excludeMultipleHits_ && rechit.getMultipleHits() > 0)
987  continue;
988  if (rechit.getToT() == 0)
989  continue;
990  if (planePlots_.find(detId_plane) != planePlots_.end()) {
991  if (centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_) {
992  TH1F* hitHistoTmp = planePlots_[detId_plane].hitProfile->getTH1F();
993  int startBin = hitHistoTmp->FindBin(rechit.getX() - horizontalShiftOfDiamond_ - 0.5 * rechit.getXWidth());
994  int numOfBins = rechit.getXWidth() * INV_DISPLAY_RESOLUTION_FOR_HITS_MM;
995  for (int i = 0; i < numOfBins; ++i) {
996  hitHistoTmp->Fill(hitHistoTmp->GetBinCenter(startBin + i));
997  }
998  }
999  }
1000  }
1001  }
1002 
1003  //Tomography of diamonds using pixel and Efficiency WRT Pixels
1004  for (const auto& ds : *pixelTracks) {
1005  const CTPPSPixelDetId pixId(ds.detId());
1006  if (pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID)
1007  continue;
1008  if (ds.size() > 1)
1009  continue;
1010  for (const auto& lt : ds) {
1011  if (lt.isValid()) {
1012  // For efficieny
1014  potPlots_[detId_pot].pixelTracksMap.Fill(lt.getX0() - horizontalShiftBwDiamondPixels_, lt.getY0());
1015 
1016  std::set<CTPPSDiamondDetId> planesWitHits_set;
1017  for (const auto& rechits : *diamondRecHits) {
1018  CTPPSDiamondDetId detId_plane(rechits.detId());
1019  detId_plane.setChannel(0);
1020  for (const auto& rechit : rechits) {
1021  if (excludeMultipleHits_ && rechit.getMultipleHits() > 0)
1022  continue;
1023  if (rechit.getOOTIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING || rechit.getToT() == 0)
1024  continue;
1025  if (planePlots_.find(detId_plane) == planePlots_.end())
1026  continue;
1027  if (pixId.arm() == detId_plane.arm() && lt.getX0() - horizontalShiftBwDiamondPixels_ < 24) {
1028  planePlots_[detId_plane].pixelTomography_far->Fill(
1029  lt.getX0() - horizontalShiftBwDiamondPixels_ + 25 * rechit.getOOTIndex(), lt.getY0());
1030  if (centralOOT_ != -999 && rechit.getOOTIndex() == centralOOT_)
1031  planesWitHits_set.insert(detId_plane);
1032  }
1033  }
1034  }
1035 
1036  for (auto& planeId : planesWitHits_set)
1037  planePlots_[planeId].pixelTracksMapWithDiamonds.Fill(lt.getX0() - horizontalShiftBwDiamondPixels_,
1038  lt.getY0());
1039  }
1040  }
1041  }
1042 
1043  //------------------------------
1044  // Channel Plots
1045  //------------------------------
1046 
1047  // digi profile cumulative
1048  for (const auto& digis : *diamondDigis) {
1049  const CTPPSDiamondDetId detId(digis.detId());
1050  for (const auto& digi : digis) {
1051  if (detId.channel() == CHANNEL_OF_VFAT_CLOCK)
1052  continue;
1053  if (channelPlots_.find(detId) != channelPlots_.end()) {
1054  // HPTDC Errors
1055  const HPTDCErrorFlags hptdcErrors = digi.getHPTDCErrorFlags();
1056  for (unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
1057  if (hptdcErrors.getErrorId(hptdcErrorIndex - 1))
1058  channelPlots_[detId].HPTDCErrorFlags->Fill(hptdcErrorIndex);
1059  if (digi.getMultipleHit())
1060  ++(channelPlots_[detId].MHCounter);
1061 
1062  // Check dropped trailing edges
1063  if (digi.getLeadingEdge() != 0 || digi.getTrailingEdge() != 0) {
1064  ++(channelPlots_[detId].HitCounter);
1065  if (digi.getLeadingEdge() != 0 && digi.getTrailingEdge() == 0) {
1066  ++(channelPlots_[detId].LeadingOnlyCounter);
1067  channelPlots_[detId].leadingEdgeCumulative_le->Fill(HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge());
1068  }
1069  if (digi.getLeadingEdge() == 0 && digi.getTrailingEdge() != 0) {
1070  ++(channelPlots_[detId].TrailingOnlyCounter);
1071  channelPlots_[detId].trailingEdgeCumulative_te->Fill(HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge());
1072  }
1073  if (digi.getLeadingEdge() != 0 && digi.getTrailingEdge() != 0) {
1074  ++(channelPlots_[detId].CompleteCounter);
1075  channelPlots_[detId].LeadingTrailingCorrelationPerChannel->Fill(
1076  HPTDC_BIN_WIDTH_NS * digi.getLeadingEdge(), HPTDC_BIN_WIDTH_NS * digi.getTrailingEdge());
1077  }
1078  }
1079  }
1080  }
1081  }
1082 
1083  // Using CTPPSDiamondRecHit
1084 
1085  for (const auto& rechits : *diamondRecHits) {
1086  CTPPSDiamondDetId detId(rechits.detId());
1087  for (const auto& rechit : rechits) {
1088  if (excludeMultipleHits_ && rechit.getMultipleHits() > 0)
1089  continue;
1090  if (channelPlots_.find(detId) != channelPlots_.end()) {
1091  if (rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING && rechit.getToT() != 0) {
1092  channelPlots_[detId].leadingEdgeCumulative_both->Fill(rechit.getT() + 25 * rechit.getOOTIndex());
1093  channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill(rechit.getToT());
1094  }
1095  ++(lumiCache->hitsCounterMap[detId]);
1096  }
1097 
1098  if (rechit.getOOTIndex() != CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING &&
1099  channelPlots_[detId].activity_per_bx.count(rechit.getOOTIndex()) > 0)
1100  channelPlots_[detId].activity_per_bx.at(rechit.getOOTIndex())->Fill(event.bunchCrossing());
1101  }
1102  }
1103 
1104  // Tomography of diamonds using pixel
1105  for (const auto& rechits : *diamondRecHits) {
1106  const CTPPSDiamondDetId detId(rechits.detId());
1107  for (const auto& rechit : rechits) {
1108  if (excludeMultipleHits_ && rechit.getMultipleHits() > 0)
1109  continue;
1110  if (rechit.getOOTIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING || rechit.getToT() == 0)
1111  continue;
1112  if (!pixelTracks.isValid())
1113  continue;
1114  if (channelPlots_.find(detId) == channelPlots_.end())
1115  continue;
1116 
1117  for (const auto& ds : *pixelTracks) {
1118  const CTPPSPixelDetId pixId(ds.detId());
1119  if (pixId.station() != CTPPS_PIXEL_STATION_ID || pixId.rp() != CTPPS_FAR_RP_ID)
1120  continue;
1121  if (ds.size() > 1)
1122  continue;
1123  for (const auto& lt : ds) {
1124  if (lt.isValid() && pixId.arm() == detId.arm() && lt.getX0() - horizontalShiftBwDiamondPixels_ < 24)
1125  channelPlots_[detId].pixelTomography_far->Fill(
1126  lt.getX0() - horizontalShiftBwDiamondPixels_ + 25 * rechit.getOOTIndex(), lt.getY0());
1127  }
1128  }
1129  }
1130  }
1131 }
static const int CTPPS_FED_ID_56
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > tokenDiamondHit_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int CHANNEL_OF_VFAT_CLOCK
LuminosityBlockIndex index() const
void setPlane(uint32_t channel)
void setChannel(uint32_t channel)
bool getErrorId(unsigned short id) const
int bunchCrossing() const
Definition: EventBase.h:64
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > tokenDiamondTrack_
Event setup record containing the real (actual) geometry information.
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenPixelTrack_
static const int CTPPS_PIXEL_STATION_ID
static const int CTPPS_DIAMOND_STATION_ID
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > tokenDigi_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:97
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
bool isValid() const
Definition: HandleBase.h:74
static const double HPTDC_BIN_WIDTH_NS
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
bool channelAlignedWithTrack(const CTPPSGeometry *geom, const CTPPSDiamondDetId &detid, const CTPPSDiamondLocalTrack &localTrack, const float tolerance=1)
std::unordered_map< unsigned int, PotPlots > potPlots_
static constexpr int TIMESLICE_WITHOUT_LEADING
static const int CTPPS_FAR_RP_ID
T get() const
Definition: EventSetup.h:71
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::unordered_map< unsigned int, PlanePlots > planePlots_
static const int CTPPS_DIAMOND_RP_ID
static const int CTPPS_FED_ID_45
T const * product() const
Definition: ESHandle.h:86
void CTPPSDiamondDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 529 of file CTPPSDiamondDQMSource.cc.

References DQMStore::IBooker::cd(), channelPlots_, CTPPS_DIAMOND_NUM_OF_CHANNELS, CTPPS_DIAMOND_NUM_OF_PLANES, CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_NUM_OF_ARMS, globalPlot_, planePlots_, potPlots_, year_2016_postTS2_cff::rpId, and DQMStore::IBooker::setCurrentFolder().

529  {
530  ibooker.cd();
531  ibooker.setCurrentFolder("CTPPS");
532 
533  globalPlot_ = GlobalPlots(ibooker);
534 
535  for (unsigned short arm = 0; arm < CTPPS_NUM_OF_ARMS; ++arm) {
537  potPlots_[rpId] = PotPlots(ibooker, rpId);
538  for (unsigned short pl = 0; pl < CTPPS_DIAMOND_NUM_OF_PLANES; ++pl) {
540  planePlots_[plId] = PlanePlots(ibooker, plId);
541  for (unsigned short ch = 0; ch < CTPPS_DIAMOND_NUM_OF_CHANNELS; ++ch) {
543  channelPlots_[chId] = ChannelPlots(ibooker, chId);
544  }
545  }
546  }
547 }
static const int CTPPS_DIAMOND_NUM_OF_PLANES
static const int CTPPS_NUM_OF_ARMS
static const int CTPPS_DIAMOND_NUM_OF_CHANNELS
static const int CTPPS_DIAMOND_STATION_ID
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
std::unordered_map< unsigned int, PotPlots > potPlots_
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::unordered_map< unsigned int, PlanePlots > planePlots_
static const int CTPPS_DIAMOND_RP_ID
void CTPPSDiamondDQMSource::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 502 of file CTPPSDiamondDQMSource.cc.

References centralOOT_, edm::contains(), CTPPS_DIAMOND_RP_ID, CTPPS_DIAMOND_STATION_ID, CTPPS_FAR_RP_ID, CTPPS_PIXEL_STATION_ID, relativeConstraints::geom, edm::EventSetup::get(), CTPPSGeometry::getSensor(), horizontalShiftBwDiamondPixels_, horizontalShiftOfDiamond_, DetGeomDesc::params(), edm::ESHandle< T >::product(), edm::RunBase::run(), runParameters_, and DetGeomDesc::translation().

502  {
503  centralOOT_ = -999;
504  for (const auto& oot : runParameters_) {
505  if (edm::contains(oot.first, edm::EventID(iRun.run(), 0, 1))) {
506  centralOOT_ = oot.second;
507  break;
508  }
509  }
510 
511  // Get detector shifts from the geometry
513  iSetup.get<VeryForwardRealGeometryRecord>().get(geometry_);
514  const CTPPSGeometry* geom = geometry_.product();
516  const DetGeomDesc* det = geom->getSensor(detid);
517  horizontalShiftOfDiamond_ = det->translation().x() - det->params().at(0);
518 
519  // Rough alignement of pixel detector for diamond thomography
521  if (iRun.run() > 300000) { //Pixel installed
522  det = geom->getSensor(pixid);
524  }
525 }
Translation translation() const
Definition: DetGeomDesc.h:66
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
RunNumber_t run() const
Definition: RunBase.h:40
Event setup record containing the real (actual) geometry information.
static const int CTPPS_PIXEL_STATION_ID
static const int CTPPS_DIAMOND_STATION_ID
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
std::vector< std::pair< edm::EventRange, int > > runParameters_
Geometrical description of a sensor.
Definition: DetGeomDesc.h:35
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:33
static const int CTPPS_FAR_RP_ID
T get() const
Definition: EventSetup.h:71
std::vector< double > params() const
Definition: DetGeomDesc.h:68
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
static const int CTPPS_DIAMOND_RP_ID
T const * product() const
Definition: ESHandle.h:86
void CTPPSDiamondDQMSource::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprotected

Definition at line 1206 of file CTPPSDiamondDQMSource.cc.

References DEFINE_FWK_MODULE.

1206 {}
std::shared_ptr< dds::Cache > CTPPSDiamondDQMSource::globalBeginLuminosityBlock ( const edm::LuminosityBlock ,
const edm::EventSetup  
) const
overrideprotected

Definition at line 551 of file CTPPSDiamondDQMSource.cc.

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

552  {
553  auto d = std::make_shared<dds::Cache>();
554  d->hitDistribution2dMap.reserve(potPlots_.size());
555  for (auto& plot : potPlots_)
556  d->hitDistribution2dMap[plot.first] =
557  std::unique_ptr<TH2F>(static_cast<TH2F*>(plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
558  return d;
559 }
std::unordered_map< unsigned int, PotPlots > potPlots_
void CTPPSDiamondDQMSource::globalEndLuminosityBlock ( const edm::LuminosityBlock iLumi,
const edm::EventSetup  
)
overrideprotected

Definition at line 1135 of file CTPPSDiamondDQMSource.cc.

References CTPPSDetId::arm(), CTPPSDiamondDetId::channel(), channelPlots_, PostProcessor_cff::efficiency, edm::LuminosityBlock::index(), CTPPSDiamondDetId::plane(), planePlots_, plotFactory::plot, potPlots_, CTPPSDetId::rp(), year_2016_postTS2_cff::rpId, SEC_PER_LUMI_SECTION, CTPPSDiamondDetId::setPlane(), and pileupDistInMC::total.

1135  {
1136  auto lumiCache = luminosityBlockCache(iLumi.index());
1137  for (auto& plot : potPlots_) {
1138  *(plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[plot.first]);
1139  }
1140  for (auto& plot : channelPlots_) {
1141  auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[plot.first];
1142  if (hitsCounterPerLumisection != 0) {
1143  plot.second.hit_rate->Fill((double)hitsCounterPerLumisection / SEC_PER_LUMI_SECTION);
1144  }
1145 
1146  double HundredOverHitCounter = .0;
1147  if (plot.second.HitCounter != 0)
1148  HundredOverHitCounter = 100. / plot.second.HitCounter;
1149  plot.second.HPTDCErrorFlags->setBinContent(16, HundredOverHitCounter * plot.second.MHCounter);
1150  plot.second.leadingWithoutTrailing->setBinContent(1, HundredOverHitCounter * plot.second.LeadingOnlyCounter);
1151  plot.second.leadingWithoutTrailing->setBinContent(2, HundredOverHitCounter * plot.second.TrailingOnlyCounter);
1152  plot.second.leadingWithoutTrailing->setBinContent(3, HundredOverHitCounter * plot.second.CompleteCounter);
1153  }
1154 
1155  for (auto& plot : potPlots_) {
1156  double HundredOverHitCounterPot = 0.;
1157  if (plot.second.HitCounter != 0)
1158  HundredOverHitCounterPot = 100. / plot.second.HitCounter;
1159  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(
1160  1, HundredOverHitCounterPot * plot.second.LeadingOnlyCounter);
1161  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(
1162  2, HundredOverHitCounterPot * plot.second.TrailingOnlyCounter);
1163  plot.second.leadingWithoutTrailingCumulativePot->setBinContent(
1164  3, HundredOverHitCounterPot * plot.second.CompleteCounter);
1165 
1166  plot.second.MHComprensive->Reset();
1167  CTPPSDiamondDetId rpId(plot.first);
1168  for (auto& chPlot : channelPlots_) {
1169  CTPPSDiamondDetId chId(chPlot.first);
1170  if (chId.arm() == rpId.arm() && chId.rp() == rpId.rp()) {
1171  plot.second.MHComprensive->Fill(chId.plane(), chId.channel(), chPlot.second.HPTDCErrorFlags->getBinContent(16));
1172  }
1173  }
1174  }
1175 
1176  // Efficiencies of single channels
1177  for (auto& plot : potPlots_) {
1178  plot.second.EfficiencyOfChannelsInPot->Reset();
1179  for (auto& element : plot.second.effTriplecountingChMap) {
1180  if (plot.second.effDoublecountingChMap[element.first] > 0) {
1181  int plane = element.first / 100;
1182  int channel = element.first % 100;
1183  double counted = element.second;
1184  double total = plot.second.effDoublecountingChMap[element.first];
1185  double efficiency = counted / total;
1186  // double error = std::sqrt( efficiency * ( 1 - efficiency ) / total );
1187 
1188  plot.second.EfficiencyOfChannelsInPot->Fill(plane, channel, 100 * efficiency);
1189  }
1190  }
1191  }
1192 
1193  // Efficeincy wrt pixels //TODO
1194  for (auto& plot : planePlots_) {
1195  TH2F* hitHistoTmp = plot.second.EfficiencyWRTPixelsInPlane->getTH2F();
1196 
1197  CTPPSDiamondDetId detId_pot(plot.first);
1198  detId_pot.setPlane(0);
1199 
1200  hitHistoTmp->Divide(&(plot.second.pixelTracksMapWithDiamonds), &(potPlots_[detId_pot].pixelTracksMap));
1201  }
1202 }
LuminosityBlockIndex index() const
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
std::unordered_map< unsigned int, PotPlots > potPlots_
static const double SEC_PER_LUMI_SECTION
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::unordered_map< unsigned int, PlanePlots > planePlots_

Member Data Documentation

int CTPPSDiamondDQMSource::centralOOT_
private

Definition at line 110 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CHANNEL_OF_VFAT_CLOCK = 30
staticprivate

Definition at line 84 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 201 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_CHANNELS = 12
staticprivate

Definition at line 95 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_NUM_OF_PLANES = 4
staticprivate

Definition at line 94 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_RP_ID = 6
staticprivate

Definition at line 90 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_DIAMOND_STATION_ID = 1
staticprivate

Definition at line 89 of file CTPPSDiamondDQMSource.cc.

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

const int CTPPSDiamondDQMSource::CTPPS_FAR_RP_ID = 3
staticprivate

Definition at line 93 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_45 = 583
staticprivate

Definition at line 96 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_FED_ID_56 = 582
staticprivate

Definition at line 97 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const int CTPPSDiamondDQMSource::CTPPS_NEAR_RP_ID = 2
staticprivate

Definition at line 92 of file CTPPSDiamondDQMSource.cc.

const int CTPPSDiamondDQMSource::CTPPS_NUM_OF_ARMS = 2
staticprivate

Definition at line 88 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

const int CTPPSDiamondDQMSource::CTPPS_PIXEL_STATION_ID = 2
staticprivate

Definition at line 91 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::DISPLAY_RESOLUTION_FOR_HITS_MM = 0.1
staticprivate

Definition at line 85 of file CTPPSDiamondDQMSource.cc.

int CTPPSDiamondDQMSource::EC_difference_45_
private

Definition at line 163 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

int CTPPSDiamondDQMSource::EC_difference_56_
private

Definition at line 163 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

bool CTPPSDiamondDQMSource::excludeMultipleHits_
private

Definition at line 106 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

GlobalPlots CTPPSDiamondDQMSource::globalPlot_
private

Definition at line 119 of file CTPPSDiamondDQMSource.cc.

Referenced by bookHistograms().

double CTPPSDiamondDQMSource::horizontalShiftBwDiamondPixels_
private

Definition at line 107 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

double CTPPSDiamondDQMSource::horizontalShiftOfDiamond_
private

Definition at line 108 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::HPTDC_BIN_WIDTH_NS = 25. / 1024
staticprivate

Definition at line 87 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

const double CTPPSDiamondDQMSource::INV_DISPLAY_RESOLUTION_FOR_HITS_MM = 1. / DISPLAY_RESOLUTION_FOR_HITS_MM
staticprivate
std::unordered_map<unsigned int, PlanePlots> CTPPSDiamondDQMSource::planePlots_
private

Definition at line 180 of file CTPPSDiamondDQMSource.cc.

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

std::unordered_map<unsigned int, PotPlots> CTPPSDiamondDQMSource::potPlots_
private
std::vector<std::pair<edm::EventRange, int> > CTPPSDiamondDQMSource::runParameters_
private

Definition at line 109 of file CTPPSDiamondDQMSource.cc.

Referenced by CTPPSDiamondDQMSource(), and dqmBeginRun().

const double CTPPSDiamondDQMSource::SEC_PER_LUMI_SECTION = 23.31
staticprivate

Definition at line 83 of file CTPPSDiamondDQMSource.cc.

Referenced by globalEndLuminosityBlock().

edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondRecHit> > CTPPSDiamondDQMSource::tokenDiamondHit_
private

Definition at line 102 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondLocalTrack> > CTPPSDiamondDQMSource::tokenDiamondTrack_
private

Definition at line 103 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondDigi> > CTPPSDiamondDQMSource::tokenDigi_
private

Definition at line 101 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

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

Definition at line 104 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelLocalTrack> > CTPPSDiamondDQMSource::tokenPixelTrack_
private

Definition at line 100 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

edm::EDGetTokenT<edm::DetSetVector<TotemVFATStatus> > CTPPSDiamondDQMSource::tokenStatus_
private

Definition at line 99 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().

unsigned int CTPPSDiamondDQMSource::verbosity_
private

Definition at line 111 of file CTPPSDiamondDQMSource.cc.

Referenced by analyze().