CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CTPPSRandomDQMSource Class Reference
Inheritance diagram for CTPPSRandomDQMSource:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 CTPPSRandomDQMSource (const edm::ParameterSet &ps)
 
 ~CTPPSRandomDQMSource () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

int getRPindex (int arm, int station, int rp) const
 

Private Attributes

const std::string folderName_ = "PPSRANDOM/RandomPixel"
 
MonitorElementh2HitsVsBXRandoms_ [kRPotsTotalNumber_]
 
MonitorElementhBX_
 
const int kIndexNotValid = 0
 
int RPindexValid_ [kRPotsTotalNumber_]
 
int rpStatus_ [kStationIDMAX_][kRPotsIDMAX_]
 
unsigned int rpStatusWord_ = 0x8008
 
int stationStatus_ [kStationIDMAX_]
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > const tokenDigi_
 

Static Private Attributes

static constexpr int kFirstRPn_ = 3
 
static constexpr int kLastRPn_ = 4
 
static constexpr int kNArms_ = 2
 
static constexpr int kNplaneMAX_ = 6
 
static constexpr int kNRPotsMAX_ = 6
 
static constexpr int kNStationMAX_ = 3
 
static constexpr int kRPotsIDMAX_ = 8
 
static constexpr int kRPotsTotalNumber_ = kNArms_ * kNStationMAX_ * kNRPotsMAX_
 
static constexpr int kStationIDMAX_ = 4
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 28 of file CTPPSRandomDQMSource.cc.

Constructor & Destructor Documentation

◆ CTPPSRandomDQMSource()

CTPPSRandomDQMSource::CTPPSRandomDQMSource ( const edm::ParameterSet ps)

Definition at line 75 of file CTPPSRandomDQMSource.cc.

References kNRPotsMAX_, kNStationMAX_, kRPotsIDMAX_, kStationIDMAX_, RPindexValid_, rpStatus_, rpStatusWord_, and stationStatus_.

77  folderName_(ps.getUntrackedParameter<std::string>("folderName", "PPSRANDOM/RandomPixel")),
78  rpStatusWord_(ps.getUntrackedParameter<unsigned int>("RPStatusWord", 0x8008)) {
79  for (int stn = 0; stn < kStationIDMAX_; stn++) {
80  stationStatus_[stn] = 0;
81  for (int rp = 0; rp < kRPotsIDMAX_; rp++)
82  rpStatus_[stn][rp] = 0;
83  }
84 
85  unsigned int rpSts = rpStatusWord_ << 1;
86  for (int stn = 0; stn < kNStationMAX_; stn++) {
87  int stns = 0;
88  for (int rp = 0; rp < kNRPotsMAX_; rp++) {
89  rpSts = (rpSts >> 1);
90  rpStatus_[stn][rp] = rpSts & 1;
91  if (rpStatus_[stn][rp] > 0)
92  stns = 1;
93  }
94  stationStatus_[stn] = stns;
95  }
96 
97  for (int index = 0; index < 2 * 3 * kNRPotsMAX_; index++)
98  RPindexValid_[index] = 0;
99 }
int rpStatus_[kStationIDMAX_][kRPotsIDMAX_]
static constexpr int kNStationMAX_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
int RPindexValid_[kRPotsTotalNumber_]
static constexpr int kRPotsIDMAX_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > const tokenDigi_
static constexpr int kStationIDMAX_
T getUntrackedParameter(std::string const &, T const &) const
static constexpr int kNRPotsMAX_
int stationStatus_[kStationIDMAX_]
const std::string folderName_

◆ ~CTPPSRandomDQMSource()

CTPPSRandomDQMSource::~CTPPSRandomDQMSource ( )
overridedefault

Member Function Documentation

◆ analyze()

void CTPPSRandomDQMSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 158 of file CTPPSRandomDQMSource.cc.

References protons_cff::arm, dqm::impl::MonitorElement::Fill(), getRPindex(), h2HitsVsBXRandoms_, hBX_, kNplaneMAX_, kNRPotsMAX_, kNStationMAX_, AlCaHLTBitMon_ParallelJobs::p, DetId::rawId(), RPindexValid_, rpStatus_, stationStatus_, and tokenDigi_.

158  {
159  auto const pixDigi = event.getHandle(tokenDigi_);
160 
161  if (!pixDigi.isValid())
162  return;
163 
164  hBX_->Fill(event.bunchCrossing());
165 
166  for (int arm = 0; arm < 2; arm++) {
167  for (int stn = 0; stn < kNStationMAX_; stn++) {
168  if (!stationStatus_[stn])
169  continue;
170  for (int rp = 0; rp < kNRPotsMAX_; rp++) {
171  if (!rpStatus_[stn][rp])
172  continue;
173  int index = getRPindex(arm, stn, rp);
174  if (RPindexValid_[index] == 0)
175  continue;
176 
177  for (int p = 0; p < kNplaneMAX_; p++) {
178  CTPPSPixelDetId planeId(arm, stn, rp, p);
179  auto pix_d = pixDigi->find(planeId.rawId());
180  if (pix_d != pixDigi->end()) {
181  int n_digis = pix_d->size();
182  h2HitsVsBXRandoms_[index]->Fill(event.bunchCrossing(), p, n_digis);
183  }
184  }
185  } // end for (int rp=0; rp<kNRPotsMAX_; rp++) {
186  } // end for (int stn = 0; stn < kNStationMAX_; stn++) {
187  } // end for (int arm=0; arm<2; arm++) {
188 }
int rpStatus_[kStationIDMAX_][kRPotsIDMAX_]
static constexpr int kNStationMAX_
int RPindexValid_[kRPotsTotalNumber_]
static constexpr int kNplaneMAX_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > const tokenDigi_
void Fill(long long x)
static constexpr int kNRPotsMAX_
int getRPindex(int arm, int station, int rp) const
MonitorElement * h2HitsVsBXRandoms_[kRPotsTotalNumber_]
int stationStatus_[kStationIDMAX_]
Definition: event.py:1

◆ bookHistograms()

void CTPPSRandomDQMSource::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 103 of file CTPPSRandomDQMSource.cc.

References protons_cff::arm, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), folderName_, getRPindex(), dqm::impl::MonitorElement::getTH2F(), h2HitsVsBXRandoms_, hBX_, kFirstRPn_, kLastRPn_, kNArms_, kNplaneMAX_, kNStationMAX_, CTPPSDetId::nFull, CTPPSDetId::nShort, RPindexValid_, CTPPSDetId::sdTrackingPixel, dqm::implementation::NavigatorBase::setCurrentFolder(), stationStatus_, and AlCaHLTBitMon_QueryRunRegistry::string.

103  {
104  ibooker.cd();
105  ibooker.setCurrentFolder(folderName_);
106 
107  hBX_ = ibooker.book1D("events per BX", "ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
108 
109  for (int arm = 0; arm < kNArms_; arm++) {
111  std::string sd;
112  ID.armName(sd, CTPPSDetId::nShort);
113  sd = folderName_ + "/sector " + sd;
114 
115  ibooker.setCurrentFolder(sd);
116 
117  for (int stn = 0; stn < kNStationMAX_; stn++) {
118  if (stationStatus_[stn] == 0)
119  continue;
120  ID.setStation(stn);
121  std::string stnd;
122  CTPPSDetId(ID.stationId()).stationName(stnd, CTPPSDetId::nShort);
123  stnd = sd + "/station " + stnd;
124 
125  ibooker.setCurrentFolder(stnd);
126 
127  for (int rp = kFirstRPn_; rp < kLastRPn_; rp++) { // only installed pixel pots
128  ID.setRP(rp);
129  std::string rpd, rpTitle;
130  CTPPSDetId(ID.rpId()).rpName(rpTitle, CTPPSDetId::nFull);
131  CTPPSDetId(ID.rpId()).rpName(rpd, CTPPSDetId::nShort);
132  rpd = stnd + "/" + rpd;
133 
134  ibooker.setCurrentFolder(rpd);
135 
136  int indexP = getRPindex(arm, stn, rp);
137  RPindexValid_[indexP] = 1;
138 
139  h2HitsVsBXRandoms_[indexP] = ibooker.book2D("Digi per plane per BX - random triggers",
140  rpTitle + ";Event.BX;Plane",
141  4002,
142  -1.5,
143  4000. + 0.5,
144  kNplaneMAX_,
145  0,
146  kNplaneMAX_);
147  h2HitsVsBXRandoms_[indexP]->getTH2F()->SetOption("colz");
148 
149  } // end for(int rp=0; rp<kNRPotsMAX_;...
150  } // end of for(int stn=0; stn<
151  } // end of for(int arm=0; arm<2;...
152 
153  return;
154 }
static constexpr int kNStationMAX_
static constexpr int kFirstRPn_
static constexpr int kLastRPn_
int RPindexValid_[kRPotsTotalNumber_]
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
static constexpr int kNplaneMAX_
uint32_t ID
Definition: Definitions.h:24
int getRPindex(int arm, int station, int rp) const
static constexpr int kNArms_
MonitorElement * h2HitsVsBXRandoms_[kRPotsTotalNumber_]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
int stationStatus_[kStationIDMAX_]
const std::string folderName_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ fillDescriptions()

void CTPPSRandomDQMSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 192 of file CTPPSRandomDQMSource.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_2022v15_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

192  {
194  desc.add<edm::InputTag>("tagRPixDigi", edm::InputTag("ctppsPixelDigisAlCaRecoProducer", ""));
195  desc.addUntracked<std::string>("folderName", "PPSRANDOM/RandomPixel");
196  desc.addUntracked<unsigned int>("RPStatusWord", 0x8008);
197  descriptions.add("ctppsRandomDQMSource", desc);
198 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getRPindex()

int CTPPSRandomDQMSource::getRPindex ( int  arm,
int  station,
int  rp 
) const
inlineprivate

Definition at line 63 of file CTPPSRandomDQMSource.cc.

References protons_cff::arm, kIndexNotValid, kNRPotsMAX_, kNStationMAX_, and relativeConstraints::station.

Referenced by analyze(), and bookHistograms().

63  {
64  if (arm < 0 || station < 0 || rp < 0)
65  return (kIndexNotValid);
66  if (arm > 1 || station >= kNStationMAX_ || rp >= kNRPotsMAX_)
67  return (kIndexNotValid);
68  int rc = (arm * kNStationMAX_ + station) * kNRPotsMAX_ + rp;
69  return (rc);
70  }
static constexpr int kNStationMAX_
static constexpr int kNRPotsMAX_

Member Data Documentation

◆ folderName_

const std::string CTPPSRandomDQMSource::folderName_ = "PPSRANDOM/RandomPixel"
private

Definition at line 49 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ h2HitsVsBXRandoms_

MonitorElement* CTPPSRandomDQMSource::h2HitsVsBXRandoms_[kRPotsTotalNumber_]
private

Definition at line 61 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hBX_

MonitorElement* CTPPSRandomDQMSource::hBX_
private

Definition at line 56 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ kFirstRPn_

constexpr int CTPPSRandomDQMSource::kFirstRPn_ = 3
staticprivate

Definition at line 45 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ kIndexNotValid

const int CTPPSRandomDQMSource::kIndexNotValid = 0
private

Definition at line 54 of file CTPPSRandomDQMSource.cc.

Referenced by getRPindex().

◆ kLastRPn_

constexpr int CTPPSRandomDQMSource::kLastRPn_ = 4
staticprivate

Definition at line 45 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ kNArms_

constexpr int CTPPSRandomDQMSource::kNArms_ = 2
staticprivate

Definition at line 41 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ kNplaneMAX_

constexpr int CTPPSRandomDQMSource::kNplaneMAX_ = 6
staticprivate

Definition at line 44 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ kNRPotsMAX_

constexpr int CTPPSRandomDQMSource::kNRPotsMAX_ = 6
staticprivate

Definition at line 43 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), CTPPSRandomDQMSource(), and getRPindex().

◆ kNStationMAX_

constexpr int CTPPSRandomDQMSource::kNStationMAX_ = 3
staticprivate

Definition at line 42 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), bookHistograms(), CTPPSRandomDQMSource(), and getRPindex().

◆ kRPotsIDMAX_

constexpr int CTPPSRandomDQMSource::kRPotsIDMAX_ = 8
staticprivate

Definition at line 47 of file CTPPSRandomDQMSource.cc.

Referenced by CTPPSRandomDQMSource().

◆ kRPotsTotalNumber_

constexpr int CTPPSRandomDQMSource::kRPotsTotalNumber_ = kNArms_ * kNStationMAX_ * kNRPotsMAX_
staticprivate

Definition at line 58 of file CTPPSRandomDQMSource.cc.

◆ kStationIDMAX_

constexpr int CTPPSRandomDQMSource::kStationIDMAX_ = 4
staticprivate

Definition at line 46 of file CTPPSRandomDQMSource.cc.

Referenced by CTPPSRandomDQMSource().

◆ RPindexValid_

int CTPPSRandomDQMSource::RPindexValid_[kRPotsTotalNumber_]
private

Definition at line 60 of file CTPPSRandomDQMSource.cc.

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

◆ rpStatus_

int CTPPSRandomDQMSource::rpStatus_[kStationIDMAX_][kRPotsIDMAX_]
private

Definition at line 52 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and CTPPSRandomDQMSource().

◆ rpStatusWord_

unsigned int CTPPSRandomDQMSource::rpStatusWord_ = 0x8008
private

Definition at line 51 of file CTPPSRandomDQMSource.cc.

Referenced by CTPPSRandomDQMSource().

◆ stationStatus_

int CTPPSRandomDQMSource::stationStatus_[kStationIDMAX_]
private

Definition at line 53 of file CTPPSRandomDQMSource.cc.

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

◆ tokenDigi_

edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelDigi> > const CTPPSRandomDQMSource::tokenDigi_
private

Definition at line 39 of file CTPPSRandomDQMSource.cc.

Referenced by analyze().