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 322 of file TotemRPDQMSource.cc.

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

322  :
323  verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0))
324 {
325  tokenStatus = consumes<DetSetVector<TotemVFATStatus>>(ps.getParameter<edm::InputTag>("tagStatus"));
326 
327  tokenDigi = consumes< DetSetVector<TotemRPDigi> >(ps.getParameter<edm::InputTag>("tagDigi"));
328  tokenCluster = consumes< edm::DetSetVector<TotemRPCluster> >(ps.getParameter<edm::InputTag>("tagCluster"));
329  tokenRecHit = consumes< edm::DetSetVector<TotemRPRecHit> >(ps.getParameter<edm::InputTag>("tagRecHit"));
330  tokenUVPattern = consumes< DetSetVector<TotemRPUVPattern> >(ps.getParameter<edm::InputTag>("tagUVPattern"));
331  tokenLocalTrack = consumes< DetSetVector<TotemRPLocalTrack> >(ps.getParameter<edm::InputTag>("tagLocalTrack"));
332  //tokenMultiTrackColl = consumes< RPMulFittedTrackCollection >(ps.getParameter<edm::InputTag>("tagMultiTrackColl"));
333 }
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 337 of file TotemRPDQMSource.cc.

338 {
339 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

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

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

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

Implements DQMEDAnalyzer.

Definition at line 349 of file TotemRPDQMSource.cc.

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

350 {
351  ibooker.cd();
352  ibooker.setCurrentFolder("CTPPS");
353 
354  // global plots
355  globalPlots.Init(ibooker);
356 
357  // temporarily disabled
358  /*
359  // initialize diagonals
360  diagonalPlots[1] = DiagonalPlots(ibooker, 1); // 45 bot - 56 top
361  diagonalPlots[2] = DiagonalPlots(ibooker, 2); // 45 top - 45 bot
362 
363  // initialize anti-diagonals
364  diagonalPlots[0] = DiagonalPlots(ibooker, 0); // 45 bot - 56 bot
365  diagonalPlots[3] = DiagonalPlots(ibooker, 3); // 45 top - 56 top
366  */
367 
368  // loop over arms
369  for (unsigned int arm = 0; arm < 2; arm++)
370  {
371  armPlots[arm] = ArmPlots(ibooker, arm);
372 
373  // loop over stations
374  for (unsigned int st = 0; st < 3; st += 2)
375  {
376  unsigned int stId = 10*arm + st;
377 
378  stationPlots[stId] = StationPlots(ibooker, stId);
379 
380  // loop over RPs
381  for (unsigned int rp = 0; rp < 6; ++rp)
382  {
383  unsigned int rpId = 10*stId + rp;
384 
385  potPlots[rpId] = PotPlots(ibooker, rpId);
386 
387  // loop over planes
388  for (unsigned int pl = 0; pl < 10; ++pl)
389  {
390  unsigned int plId = 10*rpId + pl;
391  planePlots[plId] = PlanePlots(ibooker, plId);
392  }
393  }
394  }
395  }
396 }
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 343 of file TotemRPDQMSource.cc.

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

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 961 of file TotemRPDQMSource.cc.

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

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 967 of file TotemRPDQMSource.cc.

968 {
969 }

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