test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes
TotemRPDQMSource Class Reference
Inheritance diagram for TotemRPDQMSource:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  ArmPlots
 plots related to one arm More...
 
struct  DiagonalPlots
 plots related to one (anti)diagonal More...
 
struct  GlobalPlots
 plots related to the whole system More...
 
struct  PlanePlots
 plots related to one RP plane More...
 
struct  PotPlots
 plots related to one RP More...
 
struct  StationPlots
 plots related to one station More...
 

Public Member Functions

 TotemRPDQMSource (const edm::ParameterSet &ps)
 
virtual ~TotemRPDQMSource ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

std::map< unsigned int, ArmPlotsarmPlots
 
std::map< unsigned int,
DiagonalPlots
diagonalPlots
 
GlobalPlots globalPlots
 
std::map< unsigned int,
PlanePlots
planePlots
 
std::map< unsigned int, PotPlotspotPlots
 
std::map< unsigned int,
StationPlots
stationPlots
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemRPCluster > > 
tokenCluster
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemRPDigi > > 
tokenDigi
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemRPLocalTrack > > 
tokenLocalTrack
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemRPRecHit > > 
tokenRecHit
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemVFATStatus > > 
tokenStatus
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemRPUVPattern > > 
tokenUVPattern
 
unsigned int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 39 of file TotemRPDQMSource.cc.

Constructor & Destructor Documentation

TotemRPDQMSource::TotemRPDQMSource ( const edm::ParameterSet ps)

Definition at line 323 of file TotemRPDQMSource.cc.

References edm::ParameterSet::getParameter(), tokenCluster, tokenDigi, tokenLocalTrack, tokenRecHit, tokenStatus, and tokenUVPattern.

323  :
324  verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0))
325 {
326  tokenStatus = consumes<DetSetVector<TotemVFATStatus>>(ps.getParameter<edm::InputTag>("tagStatus"));
327 
328  tokenDigi = consumes< DetSetVector<TotemRPDigi> >(ps.getParameter<edm::InputTag>("tagDigi"));
329  tokenCluster = consumes< edm::DetSetVector<TotemRPCluster> >(ps.getParameter<edm::InputTag>("tagCluster"));
330  tokenRecHit = consumes< edm::DetSetVector<TotemRPRecHit> >(ps.getParameter<edm::InputTag>("tagRecHit"));
331  tokenUVPattern = consumes< DetSetVector<TotemRPUVPattern> >(ps.getParameter<edm::InputTag>("tagUVPattern"));
332  tokenLocalTrack = consumes< DetSetVector<TotemRPLocalTrack> >(ps.getParameter<edm::InputTag>("tagLocalTrack"));
333  //tokenMultiTrackColl = consumes< RPMulFittedTrackCollection >(ps.getParameter<edm::InputTag>("tagMultiTrackColl"));
334 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > tokenRecHit
unsigned int verbosity
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPattern
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus
TotemRPDQMSource::~TotemRPDQMSource ( )
virtual

Definition at line 338 of file TotemRPDQMSource.cc.

339 {
340 }

Member Function Documentation

void TotemRPDQMSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 408 of file TotemRPDQMSource.cc.

References armPlots, edm::DetSet< T >::begin(), edm::EventBase::bunchCrossing(), python.rootplot.argparse::category, TotemRPDetId::decToRawId(), TotemRPDQMSource::GlobalPlots::events_per_bx, TotemRPDQMSource::GlobalPlots::events_per_bx_short, MonitorElement::Fill(), geometry, edm::EventSetup::get(), globalPlots, h, TotemRPDQMSource::PotPlots::h_planes_fit_u, TotemRPDQMSource::PotPlots::h_planes_fit_v, TotemRPDQMSource::ArmPlots::h_trackCorr, TotemRPDQMSource::GlobalPlots::h_trackCorr_hor, TotemRPDQMSource::ArmPlots::h_trackCorr_overlap, TotemRPDQMSource::PotPlots::hit_plane_hist, TotemRPDetId::isStripsCoordinateUDirection(), edm::HandleBase::isValid(), match(), AlCaHLTBitMon_ParallelJobs::p, patterns, TotemRPDQMSource::PotPlots::patterns_u, TotemRPDQMSource::PotPlots::patterns_v, planePlots, RecoTauValidation_cfi::plots, potPlots, createTree::pp, TotemRPUVPattern::projU, TotemRPUVPattern::projV, TotemRPDetId::rawToDecId(), TotemRPDetId::rpOfDet(), alignCSCRings::s, mps_update::status, tokenCluster, tokenDigi, tokenLocalTrack, tokenRecHit, tokenStatus, tokenUVPattern, TotemRPDQMSource::PotPlots::track_u_profile, TotemRPDQMSource::PotPlots::track_v_profile, TotemRPDQMSource::PotPlots::trackHitsCumulativeHist, testEve_cfg::tracks, findQualityFiles::v, verbosity, x, and y.

409 {
410  // get event setup data
412  eventSetup.get<VeryForwardRealGeometryRecord>().get(geometry);
413 
414  // get event data
416  event.getByToken(tokenStatus, status);
417 
419  event.getByToken(tokenDigi, digi);
420 
422  event.getByToken(tokenCluster, digCluster);
423 
425  event.getByToken(tokenRecHit, hits);
426 
428  event.getByToken(tokenUVPattern, patterns);
429 
431  event.getByToken(tokenLocalTrack, tracks);
432 
433  //Handle< RPMulFittedTrackCollection > multiTracks;
434  //event.getByToken(tokenMultiTrackColl, multiTracks);
435 
436  // check validity
437  bool valid = true;
438  valid &= status.isValid();
439  valid &= digi.isValid();
440  valid &= digCluster.isValid();
441  valid &= hits.isValid();
442  valid &= patterns.isValid();
443  valid &= tracks.isValid();
444  //valid &= multiTracks.isValid();
445 
446  if (!valid)
447  {
448  if (verbosity)
449  {
450  LogProblem("TotemRPDQMSource") <<
451  "ERROR in TotemDQMModuleRP::analyze > some of the required inputs are not valid. Skipping this event.\n"
452  << " status.isValid = " << status.isValid() << "\n"
453  << " digi.isValid = " << digi.isValid() << "\n"
454  << " digCluster.isValid = " << digCluster.isValid() << "\n"
455  << " hits.isValid = " << hits.isValid() << "\n"
456  << " patterns.isValid = " << patterns.isValid() << "\n"
457  << " tracks.isValid = " << tracks.isValid();
458  //<< " multiTracks.isValid = %i\n", multiTracks.isValid()
459  }
460 
461  return;
462  }
463 
464  //------------------------------
465  // Global Plots
466 
467  globalPlots.events_per_bx->Fill(event.bunchCrossing());
468  globalPlots.events_per_bx_short->Fill(event.bunchCrossing());
469 
470  for (auto &ds1 : *tracks)
471  {
472  for (auto &tr1 : ds1)
473  {
474  if (! tr1.isValid())
475  continue;
476 
477  unsigned int rpId1 = ds1.detId();
478  unsigned int arm1 = rpId1 / 100;
479  unsigned int stNum1 = (rpId1 / 10) % 10;
480  unsigned int rpNum1 = rpId1 % 10;
481  if (stNum1 != 0 || (rpNum1 != 2 && rpNum1 != 3))
482  continue;
483  unsigned int idx1 = arm1*2 + rpNum1-2;
484 
485  for (auto &ds2 : *tracks)
486  {
487  for (auto &tr2 : ds2)
488  {
489  if (! tr2.isValid())
490  continue;
491 
492  unsigned int rpId2 = ds2.detId();
493  unsigned int arm2 = rpId2 / 100;
494  unsigned int stNum2 = (rpId2 / 10) % 10;
495  unsigned int rpNum2 = rpId2 % 10;
496  if (stNum2 != 0 || (rpNum2 != 2 && rpNum2 != 3))
497  continue;
498  unsigned int idx2 = arm2*2 + rpNum2-2;
499 
500  globalPlots.h_trackCorr_hor->Fill(idx1, idx2);
501  }
502  }
503  }
504  }
505 
506  //------------------------------
507  // Status Plots
508 
509  for (auto &ds : *status)
510  {
511  unsigned int decId = TotemRPDetId::rawToDecId(ds.detId());
512  unsigned int rpId = decId / 10;
513  unsigned int plNum = decId % 10;
514 
515  auto &plots = potPlots[rpId];
516 
517  for (auto &s : ds)
518  {
519  if (s.isMissing())
520  {
521  plots.vfat_problem->Fill(plNum, s.getChipPosition());
522  plots.vfat_missing->Fill(plNum, s.getChipPosition());
523  }
524 
525  if (s.isECProgressError() || s.isBCProgressError())
526  {
527  plots.vfat_problem->Fill(plNum, s.getChipPosition());
528  plots.vfat_ec_bc_error->Fill(plNum, s.getChipPosition());
529  }
530 
531  if (s.isIDMismatch() || s.isFootprintError() || s.isCRCError())
532  {
533  plots.vfat_problem->Fill(plNum, s.getChipPosition());
534  plots.vfat_corruption->Fill(plNum, s.getChipPosition());
535  }
536  }
537  }
538 
539  //------------------------------
540  // Plane Plots
541 
542  // digi profile cumulative
543  for (DetSetVector<TotemRPDigi>::const_iterator it = digi->begin(); it != digi->end(); ++it)
544  {
545  unsigned int DetId = TotemRPDetId::rawToDecId(it->detId());
546  for (DetSet<TotemRPDigi>::const_iterator dit = it->begin(); dit != it->end(); ++dit)
547  {
548  planePlots[DetId].digi_profile_cumulative->Fill(dit->getStripNumber());
549  }
550  }
551 
552  // cluster profile cumulative
553  for (DetSetVector<TotemRPCluster>::const_iterator it = digCluster->begin(); it != digCluster->end(); it++)
554  {
555  unsigned int DetId = TotemRPDetId::rawToDecId(it->detId());
556  for (DetSet<TotemRPCluster>::const_iterator dit = it->begin(); dit != it->end(); ++dit)
557  {
558  planePlots[DetId].cluster_profile_cumulative->Fill(dit->getCenterStripPosition());
559  }
560  }
561 
562  // hit multiplicity
563  for (DetSetVector<TotemRPCluster>::const_iterator it = digCluster->begin(); it != digCluster->end(); it++)
564  {
565  unsigned int DetId = TotemRPDetId::rawToDecId(it->detId());
566  planePlots[DetId].hit_multiplicity->Fill(it->size());
567  }
568 
569  // cluster size
570  for (DetSetVector<TotemRPCluster>::const_iterator it = digCluster->begin(); it != digCluster->end(); it++)
571  {
572  unsigned int DetId = TotemRPDetId::rawToDecId(it->detId());
573  for (DetSet<TotemRPCluster>::const_iterator dit = it->begin(); dit != it->end(); ++dit)
574  planePlots[DetId].cluster_size->Fill(dit->getNumberOfStrips());
575  }
576 
577  // plane efficiency plots
578  for (auto &ds : *tracks)
579  {
580  unsigned int rpId = ds.detId();
581 
582  for (auto &ft : ds)
583  {
584  if (!ft.isValid())
585  continue;
586 
587  double rp_z = geometry->GetRPGlobalTranslation(rpId).z();
588 
589  for (unsigned int plNum = 0; plNum < 10; ++plNum)
590  {
591  unsigned int plDecId = rpId*10 + plNum;
592  unsigned int plRawId = TotemRPDetId::decToRawId(plDecId);
593 
594  double ft_z = ft.getZ0();
595  double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
596  double ft_y = ft.getY0() + ft.getTy() * (ft_z - rp_z);
597 
598  double ft_v = geometry->GlobalToLocal(plRawId, CLHEP::Hep3Vector(ft_x, ft_y, ft_z)).y();
599 
600  bool hasMatchingHit = false;
601  const auto &hit_ds_it = hits->find(plRawId);
602  if (hit_ds_it != hits->end())
603  {
604  for (const auto &h : *hit_ds_it)
605  {
606  bool match = (fabs(ft_v - h.getPosition()) < 2.*0.066);
607  if (match)
608  {
609  hasMatchingHit = true;
610  break;
611  }
612  }
613  }
614 
615  auto &pp = planePlots[plDecId];
616 
617  pp.efficiency_den->Fill(ft_v);
618  if (hasMatchingHit)
619  pp.efficiency_num->Fill(ft_v);
620  }
621  }
622  }
623 
624 
625  //------------------------------
626  // Roman Pots Plots
627 
628  // determine active planes (from RecHits and VFATStatus)
629  map<unsigned int, set<unsigned int> > planes;
630  map<unsigned int, set<unsigned int> > planes_u;
631  map<unsigned int, set<unsigned int> > planes_v;
632  for (const auto &ds : *hits)
633  {
634  if (ds.empty())
635  continue;
636 
637  unsigned int DetId = TotemRPDetId::rawToDecId(ds.detId());
638  unsigned int RPId = TotemRPDetId::rpOfDet(DetId);
639  unsigned int planeNum = DetId % 10;
640  planes[RPId].insert(planeNum);
642  planes_u[RPId].insert(planeNum);
643  else
644  planes_v[RPId].insert(planeNum);
645  }
646 
647  for (const auto &ds : *status)
648  {
649  bool activity = false;
650  for (const auto &s : ds)
651  {
652  if (s.isNumberOfClustersSpecified() && s.getNumberOfClusters() > 0)
653  {
654  activity = true;
655  break;
656  }
657  }
658 
659  if (!activity)
660  continue;
661 
662  unsigned int DetId = TotemRPDetId::rawToDecId(ds.detId());
663  unsigned int RPId = TotemRPDetId::rpOfDet(DetId);
664  unsigned int planeNum = DetId % 10;
665  planes[RPId].insert(planeNum);
667  planes_u[RPId].insert(planeNum);
668  else
669  planes_v[RPId].insert(planeNum);
670  }
671 
672  // plane activity histogram
673  for (std::map<unsigned int, PotPlots>::iterator it = potPlots.begin(); it != potPlots.end(); it++)
674  {
675  it->second.activity->Fill(planes[it->first].size());
676  it->second.activity_u->Fill(planes_u[it->first].size());
677  it->second.activity_v->Fill(planes_v[it->first].size());
678 
679  if (planes[it->first].size() >= 6)
680  {
681  it->second.activity_per_bx->Fill(event.bunchCrossing());
682  it->second.activity_per_bx_short->Fill(event.bunchCrossing());
683  }
684  }
685 
686  for (DetSetVector<TotemRPCluster>::const_iterator it = digCluster->begin(); it != digCluster->end(); it++)
687  {
688  unsigned int DetId = TotemRPDetId::rawToDecId(it->detId());
689  unsigned int RPId = TotemRPDetId::rpOfDet(DetId);
690  unsigned int planeNum = DetId % 10;
691  PotPlots &pp = potPlots[RPId];
692  for (DetSet<TotemRPCluster>::const_iterator dit = it->begin(); dit != it->end(); ++dit)
693  pp.hit_plane_hist->Fill(planeNum, dit->getCenterStripPosition());
694  }
695 
696  // recognized pattern histograms
697  for (auto &ds : *patterns)
698  {
699  unsigned int rpId = ds.detId();
700  PotPlots &pp = potPlots[rpId];
701 
702  // count U and V patterns
703  unsigned int u = 0, v = 0;
704  for (auto &p : ds)
705  {
706  if (! p.getFittable())
707  continue;
708 
709  if (p.getProjection() == TotemRPUVPattern::projU)
710  u++;
711 
712  if (p.getProjection() == TotemRPUVPattern::projV)
713  v++;
714  }
715 
716  pp.patterns_u->Fill(u);
717  pp.patterns_v->Fill(v);
718  }
719 
720  // event-category histogram
721  for (auto &it : potPlots)
722  {
723  const unsigned int &id = it.first;
724  auto &pp = it.second;
725 
726  // process hit data for this plot
727  unsigned int pl_u = planes_u[id].size();
728  unsigned int pl_v = planes_v[id].size();
729 
730  // process pattern data for this pot
731  const auto &rp_pat_it = patterns->find(id);
732 
733  unsigned int pat_u = 0, pat_v = 0;
734  if (rp_pat_it != patterns->end())
735  {
736  for (auto &p : *rp_pat_it)
737  {
738  if (! p.getFittable())
739  continue;
740 
741  if (p.getProjection() == TotemRPUVPattern::projU)
742  pat_u++;
743 
744  if (p.getProjection() == TotemRPUVPattern::projV)
745  pat_v++;
746  }
747  }
748 
749  // determine category
750  signed int category = -1;
751 
752  if (pl_u == 0 && pl_v == 0) category = 0; // empty
753 
754  if (category == -1 && pat_u + pat_v <= 1)
755  {
756  if (pl_u + pl_v < 6)
757  category = 1; // insuff
758  else
759  category = 4; // shower
760  }
761 
762  if (pat_u == 1 && pat_v == 1) category = 2; // 1-track
763 
764  if (category == -1) category = 3; // multi-track
765 
766  pp.event_category->Fill(category);
767  }
768 
769  // RP track-fit plots
770  for (auto &ds : *tracks)
771  {
772  unsigned int RPId = ds.detId();
773  PotPlots &pp = potPlots[RPId];
774 
775  for (auto &ft : ds)
776  {
777  if (!ft.isValid())
778  continue;
779 
780  // number of planes contributing to (valid) fits
781  unsigned int n_pl_in_fit_u = 0, n_pl_in_fit_v = 0;
782  for (auto &hds : ft.getHits())
783  {
784  unsigned int rawId = hds.detId();
785  unsigned int decId = TotemRPDetId::rawToDecId(rawId);
787 
788  for (auto &h : hds)
789  {
790  h.getPosition(); // just to keep compiler silent
791  if (uProj)
792  n_pl_in_fit_u++;
793  else
794  n_pl_in_fit_v++;
795  }
796  }
797 
798  pp.h_planes_fit_u->Fill(n_pl_in_fit_u);
799  pp.h_planes_fit_v->Fill(n_pl_in_fit_v);
800 
801  // mean position of U and V planes
802  double rp_x = ( geometry->GetDetector(TotemRPDetId::decToRawId(RPId*10 + 0))->translation().x() +
803  geometry->GetDetector(TotemRPDetId::decToRawId(RPId*10 + 1))->translation().x() ) / 2.;
804  double rp_y = ( geometry->GetDetector(TotemRPDetId::decToRawId(RPId*10 + 0))->translation().y() +
805  geometry->GetDetector(TotemRPDetId::decToRawId(RPId*10 + 1))->translation().y() ) / 2.;
806 
807  // mean read-out direction of U and V planes
808  CLHEP::Hep3Vector rod_U = geometry->LocalToGlobalDirection(TotemRPDetId::decToRawId(RPId*10 + 1), CLHEP::Hep3Vector(0., 1., 0.));
809  CLHEP::Hep3Vector rod_V = geometry->LocalToGlobalDirection(TotemRPDetId::decToRawId(RPId*10 + 0), CLHEP::Hep3Vector(0., 1., 0.));
810 
811  double x = ft.getX0() - rp_x;
812  double y = ft.getY0() - rp_y;
813 
814  pp.trackHitsCumulativeHist->Fill(x, y);
815 
816  double U = x * rod_U.x() + y * rod_U.y();
817  double V = x * rod_V.x() + y * rod_V.y();
818 
819  pp.track_u_profile->Fill(U);
820  pp.track_v_profile->Fill(V);
821  }
822  }
823 
824  //------------------------------
825  // Station Plots
826 
827 
828  //------------------------------
829  // Arm Plots
830  {
831  map<unsigned int, unsigned int> mTop, mHor, mBot;
832 
833  for (auto p : armPlots)
834  {
835  mTop[p.first] = 0;
836  mHor[p.first] = 0;
837  mBot[p.first] = 0;
838  }
839 
840  for (auto &ds : *tracks)
841  {
842  unsigned int rpId = ds.detId();
843  unsigned int armNum = rpId / 100;
844  unsigned int rpNum = rpId % 10;
845 
846  for (auto &tr : ds)
847  {
848  if (! tr.isValid())
849  continue;
850 
851  if (rpNum == 0 || rpNum == 4)
852  mTop[armNum]++;
853  if (rpNum == 2 || rpNum == 3)
854  mHor[armNum]++;
855  if (rpNum == 1 || rpNum == 5)
856  mBot[armNum]++;
857  }
858  }
859 
860  for (auto &p : armPlots)
861  {
862  p.second.h_numRPWithTrack_top->Fill(mTop[p.first]);
863  p.second.h_numRPWithTrack_hor->Fill(mHor[p.first]);
864  p.second.h_numRPWithTrack_bot->Fill(mBot[p.first]);
865  }
866 
867  // track RP correlation
868  for (auto &ds1 : *tracks)
869  {
870  for (auto &tr1 : ds1)
871  {
872  if (! tr1.isValid())
873  continue;
874 
875  unsigned int rpId1 = ds1.detId();
876  unsigned int arm1 = rpId1 / 100;
877  unsigned int stNum1 = (rpId1 / 10) % 10;
878  unsigned int rpNum1 = rpId1 % 10;
879  unsigned int idx1 = stNum1/2 * 7 + rpNum1;
880  bool hor1 = (rpNum1 == 2 || rpNum1 == 3);
881 
882  ArmPlots &ap = armPlots[arm1];
883 
884  for (auto &ds2 : *tracks)
885  {
886  for (auto &tr2 : ds2)
887  {
888  if (! tr2.isValid())
889  continue;
890 
891  unsigned int rpId2 = ds2.detId();
892  unsigned int arm2 = rpId2 / 100;
893  unsigned int stNum2 = (rpId2 / 10) % 10;
894  unsigned int rpNum2 = rpId2 % 10;
895  unsigned int idx2 = stNum2/2 * 7 + rpNum2;
896  bool hor2 = (rpNum2 == 2 || rpNum2 == 3);
897 
898  if (arm1 != arm2)
899  continue;
900 
901  ap.h_trackCorr->Fill(idx1, idx2);
902 
903  if (hor1 != hor2)
904  ap.h_trackCorr_overlap->Fill(idx1, idx2);
905  }
906  }
907  }
908  }
909  }
910 
911  //------------------------------
912  // RP-system plots
913  // TODO: this code needs
914  // * generalization for more than two RPs per arm
915  // * updating for tracks as DetSetVector
916  /*
917  for (auto &dp : diagonalPlots)
918  {
919  unsigned int id = dp.first;
920  bool top45 = id & 2;
921  bool top56 = id & 1;
922 
923  unsigned int id_45_n = (top45) ? 20 : 21;
924  unsigned int id_45_f = (top45) ? 24 : 25;
925  unsigned int id_56_n = (top56) ? 120 : 121;
926  unsigned int id_56_f = (top56) ? 124 : 125;
927 
928  bool h_45_n = (tracks->find(id_45_n) != tracks->end() && tracks->find(id_45_n)->second.IsValid());
929  bool h_45_f = (tracks->find(id_45_f) != tracks->end() && tracks->find(id_45_f)->second.IsValid());
930  bool h_56_n = (tracks->find(id_56_n) != tracks->end() && tracks->find(id_56_n)->second.IsValid());
931  bool h_56_f = (tracks->find(id_56_f) != tracks->end() && tracks->find(id_56_f)->second.IsValid());
932 
933  if (! (h_45_n && h_45_f && h_56_n && h_56_f) )
934  continue;
935 
936  double x_45_n = tracks->find(id_45_n)->second.X0(), y_45_n = tracks->find(id_45_n)->second.Y0();
937  double x_45_f = tracks->find(id_45_f)->second.X0(), y_45_f = tracks->find(id_45_f)->second.Y0();
938  double x_56_n = tracks->find(id_56_n)->second.X0(), y_56_n = tracks->find(id_56_n)->second.Y0();
939  double x_56_f = tracks->find(id_56_f)->second.X0(), y_56_f = tracks->find(id_56_f)->second.Y0();
940 
941  double dx_45 = x_45_f - x_45_n;
942  double dy_45 = y_45_f - y_45_n;
943  double dx_56 = x_56_f - x_56_n;
944  double dy_56 = y_56_f - y_56_n;
945 
946  DiagonalPlots &pl = dp.second;
947 
948  pl.h_lrc_x_d->Fill(dx_45, dx_56);
949  pl.h_lrc_y_d->Fill(dy_45, dy_56);
950 
951  pl.h_lrc_x_n->Fill(x_45_n, x_56_n);
952  pl.h_lrc_y_n->Fill(y_45_n, y_56_n);
953 
954  pl.h_lrc_x_f->Fill(x_45_f, x_56_f);
955  pl.h_lrc_y_f->Fill(y_45_f, y_56_f);
956  }
957  */
958 }
GlobalPlots globalPlots
PhiMemoryImage patterns[9]
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static unsigned int rpOfDet(unsigned int i)
returns ID of RP for given detector ID &#39;&#39;i&#39;&#39;
Definition: TotemRPDetId.h:141
tuple pp
Definition: createTree.py:15
std::map< unsigned int, ArmPlots > armPlots
static unsigned int rawToDecId(unsigned int raw)
fast conversion Raw to Decimal ID
Definition: TotemRPDetId.h:120
bool isStripsCoordinateUDirection() const
Definition: TotemRPDetId.h:95
edm::EDGetTokenT< edm::DetSetVector< TotemRPDigi > > tokenDigi
Event setup record containing the real (actual) geometry information.
void Fill(long long x)
std::map< unsigned int, PlanePlots > planePlots
edm::EDGetTokenT< edm::DetSetVector< TotemRPRecHit > > tokenRecHit
unsigned int verbosity
edm::EDGetTokenT< edm::DetSetVector< TotemRPUVPattern > > tokenUVPattern
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:75
MonitorElement * events_per_bx_short
iterator begin()
Definition: DetSet.h:59
edm::EDGetTokenT< edm::DetSetVector< TotemRPCluster > > tokenCluster
Definition: DetId.h:18
tuple tracks
Definition: testEve_cfg.py:39
ESHandle< TrackerGeometry > geometry
std::map< unsigned int, PotPlots > potPlots
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack
static unsigned int decToRawId(unsigned int dec)
fast conversion Decimal to Raw ID
Definition: TotemRPDetId.h:129
edm::EDGetTokenT< edm::DetSetVector< TotemVFATStatus > > tokenStatus
tuple status
Definition: mps_update.py:57
void TotemRPDQMSource::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 401 of file TotemRPDQMSource.cc.

403 {
404 }
void TotemRPDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 350 of file TotemRPDQMSource.cc.

References armPlots, DQMStore::IBooker::cd(), globalPlots, TotemRPDQMSource::GlobalPlots::Init(), planePlots, potPlots, DQMStore::IBooker::setCurrentFolder(), and stationPlots.

351 {
352  ibooker.cd();
353  ibooker.setCurrentFolder("CTPPS");
354 
355  // global plots
356  globalPlots.Init(ibooker);
357 
358  // temporarily disabled
359  /*
360  // initialize diagonals
361  diagonalPlots[1] = DiagonalPlots(ibooker, 1); // 45 bot - 56 top
362  diagonalPlots[2] = DiagonalPlots(ibooker, 2); // 45 top - 45 bot
363 
364  // initialize anti-diagonals
365  diagonalPlots[0] = DiagonalPlots(ibooker, 0); // 45 bot - 56 bot
366  diagonalPlots[3] = DiagonalPlots(ibooker, 3); // 45 top - 56 top
367  */
368 
369  // loop over arms
370  for (unsigned int arm = 0; arm < 2; arm++)
371  {
372  armPlots[arm] = ArmPlots(ibooker, arm);
373 
374  // loop over stations
375  for (unsigned int st = 0; st < 3; st += 2)
376  {
377  unsigned int stId = 10*arm + st;
378 
379  stationPlots[stId] = StationPlots(ibooker, stId);
380 
381  // loop over RPs
382  for (unsigned int rp = 0; rp < 6; ++rp)
383  {
384  unsigned int rpId = 10*stId + rp;
385 
386  potPlots[rpId] = PotPlots(ibooker, rpId);
387 
388  // loop over planes
389  for (unsigned int pl = 0; pl < 10; ++pl)
390  {
391  unsigned int plId = 10*rpId + pl;
392  planePlots[plId] = PlanePlots(ibooker, plId);
393  }
394  }
395  }
396  }
397 }
GlobalPlots globalPlots
void Init(DQMStore::IBooker &ibooker)
void cd(void)
Definition: DQMStore.cc:268
std::map< unsigned int, ArmPlots > armPlots
std::map< unsigned int, PlanePlots > planePlots
std::map< unsigned int, StationPlots > stationPlots
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
std::map< unsigned int, PotPlots > potPlots
void TotemRPDQMSource::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 344 of file TotemRPDQMSource.cc.

345 {
346 }
void TotemRPDQMSource::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 962 of file TotemRPDQMSource.cc.

963 {
964 }
void TotemRPDQMSource::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 968 of file TotemRPDQMSource.cc.

969 {
970 }

Member Data Documentation

std::map<unsigned int, ArmPlots> TotemRPDQMSource::armPlots
private

Definition at line 103 of file TotemRPDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::map<unsigned int, DiagonalPlots> TotemRPDQMSource::diagonalPlots
private

Definition at line 88 of file TotemRPDQMSource.cc.

GlobalPlots TotemRPDQMSource::globalPlots
private

Definition at line 73 of file TotemRPDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::map<unsigned int, PlanePlots> TotemRPDQMSource::planePlots
private

Definition at line 147 of file TotemRPDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::map<unsigned int, PotPlots> TotemRPDQMSource::potPlots
private

Definition at line 132 of file TotemRPDQMSource.cc.

Referenced by analyze(), and bookHistograms().

std::map<unsigned int, StationPlots> TotemRPDQMSource::stationPlots
private

Definition at line 112 of file TotemRPDQMSource.cc.

Referenced by bookHistograms().

edm::EDGetTokenT< edm::DetSetVector<TotemRPCluster> > TotemRPDQMSource::tokenCluster
private

Definition at line 58 of file TotemRPDQMSource.cc.

Referenced by analyze(), and TotemRPDQMSource().

edm::EDGetTokenT< edm::DetSetVector<TotemRPDigi> > TotemRPDQMSource::tokenDigi
private

Definition at line 57 of file TotemRPDQMSource.cc.

Referenced by analyze(), and TotemRPDQMSource().

edm::EDGetTokenT< edm::DetSetVector<TotemRPLocalTrack> > TotemRPDQMSource::tokenLocalTrack
private

Definition at line 61 of file TotemRPDQMSource.cc.

Referenced by analyze(), and TotemRPDQMSource().

edm::EDGetTokenT< edm::DetSetVector<TotemRPRecHit> > TotemRPDQMSource::tokenRecHit
private

Definition at line 59 of file TotemRPDQMSource.cc.

Referenced by analyze(), and TotemRPDQMSource().

edm::EDGetTokenT< edm::DetSetVector<TotemVFATStatus> > TotemRPDQMSource::tokenStatus
private

Definition at line 56 of file TotemRPDQMSource.cc.

Referenced by analyze(), and TotemRPDQMSource().

edm::EDGetTokenT< edm::DetSetVector<TotemRPUVPattern> > TotemRPDQMSource::tokenUVPattern
private

Definition at line 60 of file TotemRPDQMSource.cc.

Referenced by analyze(), and TotemRPDQMSource().

unsigned int TotemRPDQMSource::verbosity
private

Definition at line 54 of file TotemRPDQMSource.cc.

Referenced by analyze().