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 33 of file CTPPSRandomDQMSource.cc.

Constructor & Destructor Documentation

◆ CTPPSRandomDQMSource()

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

Definition at line 80 of file CTPPSRandomDQMSource.cc.

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

82  folderName_(ps.getUntrackedParameter<std::string>("folderName", "PPSRANDOM/RandomPixel")),
83  rpStatusWord_(ps.getUntrackedParameter<unsigned int>("RPStatusWord", 0x8008)) {
84  for (int stn = 0; stn < kStationIDMAX_; stn++) {
85  stationStatus_[stn] = 0;
86  for (int rp = 0; rp < kRPotsIDMAX_; rp++)
87  rpStatus_[stn][rp] = 0;
88  }
89 
90  unsigned int rpSts = rpStatusWord_ << 1;
91  for (int stn = 0; stn < kNStationMAX_; stn++) {
92  int stns = 0;
93  for (int rp = 0; rp < kNRPotsMAX_; rp++) {
94  rpSts = (rpSts >> 1);
95  rpStatus_[stn][rp] = rpSts & 1;
96  if (rpStatus_[stn][rp] > 0)
97  stns = 1;
98  }
99  stationStatus_[stn] = stns;
100  }
101 
102  for (int index = 0; index < 2 * 3 * kNRPotsMAX_; index++)
103  RPindexValid_[index] = 0;
104 }
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 163 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_.

163  {
164  auto const pixDigi = event.getHandle(tokenDigi_);
165 
166  if (!pixDigi.isValid())
167  return;
168 
169  hBX_->Fill(event.bunchCrossing());
170 
171  for (int arm = 0; arm < 2; arm++) {
172  for (int stn = 0; stn < kNStationMAX_; stn++) {
173  if (!stationStatus_[stn])
174  continue;
175  for (int rp = 0; rp < kNRPotsMAX_; rp++) {
176  if (!rpStatus_[stn][rp])
177  continue;
178  int index = getRPindex(arm, stn, rp);
179  if (RPindexValid_[index] == 0)
180  continue;
181 
182  for (int p = 0; p < kNplaneMAX_; p++) {
183  CTPPSPixelDetId planeId(arm, stn, rp, p);
184  auto pix_d = pixDigi->find(planeId.rawId());
185  if (pix_d != pixDigi->end()) {
186  int n_digis = pix_d->size();
187  h2HitsVsBXRandoms_[index]->Fill(event.bunchCrossing(), p, n_digis);
188  }
189  }
190  } // end for (int rp=0; rp<kNRPotsMAX_; rp++) {
191  } // end for (int stn = 0; stn < kNStationMAX_; stn++) {
192  } // end for (int arm=0; arm<2; arm++) {
193 }
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 108 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.

108  {
109  ibooker.cd();
110  ibooker.setCurrentFolder(folderName_);
111 
112  hBX_ = ibooker.book1D("events per BX", "ctpps_pixel;Event.BX", 4002, -1.5, 4000. + 0.5);
113 
114  for (int arm = 0; arm < kNArms_; arm++) {
116  std::string sd;
117  ID.armName(sd, CTPPSDetId::nShort);
118  sd = folderName_ + "/sector " + sd;
119 
120  ibooker.setCurrentFolder(sd);
121 
122  for (int stn = 0; stn < kNStationMAX_; stn++) {
123  if (stationStatus_[stn] == 0)
124  continue;
125  ID.setStation(stn);
126  std::string stnd;
127  CTPPSDetId(ID.stationId()).stationName(stnd, CTPPSDetId::nShort);
128  stnd = sd + "/station " + stnd;
129 
130  ibooker.setCurrentFolder(stnd);
131 
132  for (int rp = kFirstRPn_; rp < kLastRPn_; rp++) { // only installed pixel pots
133  ID.setRP(rp);
134  std::string rpd, rpTitle;
135  CTPPSDetId(ID.rpId()).rpName(rpTitle, CTPPSDetId::nFull);
136  CTPPSDetId(ID.rpId()).rpName(rpd, CTPPSDetId::nShort);
137  rpd = stnd + "/" + rpd;
138 
139  ibooker.setCurrentFolder(rpd);
140 
141  int indexP = getRPindex(arm, stn, rp);
142  RPindexValid_[indexP] = 1;
143 
144  h2HitsVsBXRandoms_[indexP] = ibooker.book2D("Digi per plane per BX - random triggers",
145  rpTitle + ";Event.BX;Plane",
146  4002,
147  -1.5,
148  4000. + 0.5,
149  kNplaneMAX_,
150  0,
151  kNplaneMAX_);
152  h2HitsVsBXRandoms_[indexP]->getTH2F()->SetOption("colz");
153 
154  } // end for(int rp=0; rp<kNRPotsMAX_;...
155  } // end of for(int stn=0; stn<
156  } // end of for(int arm=0; arm<2;...
157 
158  return;
159 }
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 197 of file CTPPSRandomDQMSource.cc.

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

197  {
199  desc.add<edm::InputTag>("tagRPixDigi", edm::InputTag("ctppsPixelDigisAlCaRecoProducer"));
200  desc.addUntracked<std::string>("folderName", "PPSRANDOM/RandomPixel");
201  desc.addUntracked<unsigned int>("RPStatusWord", 0x8008);
202  descriptions.add("ctppsRandomDQMSource", desc);
203 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getRPindex()

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

Definition at line 68 of file CTPPSRandomDQMSource.cc.

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

Referenced by analyze(), and bookHistograms().

68  {
69  if (arm < 0 || station < 0 || rp < 0)
70  return (kIndexNotValid);
71  if (arm > 1 || station >= kNStationMAX_ || rp >= kNRPotsMAX_)
72  return (kIndexNotValid);
73  int rc = (arm * kNStationMAX_ + station) * kNRPotsMAX_ + rp;
74  return (rc);
75  }
static constexpr int kNStationMAX_
static constexpr int kNRPotsMAX_

Member Data Documentation

◆ folderName_

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

Definition at line 54 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ h2HitsVsBXRandoms_

MonitorElement* CTPPSRandomDQMSource::h2HitsVsBXRandoms_[kRPotsTotalNumber_]
private

Definition at line 66 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ hBX_

MonitorElement* CTPPSRandomDQMSource::hBX_
private

Definition at line 61 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ kFirstRPn_

constexpr int CTPPSRandomDQMSource::kFirstRPn_ = 3
staticprivate

Definition at line 50 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ kIndexNotValid

const int CTPPSRandomDQMSource::kIndexNotValid = 0
private

Definition at line 59 of file CTPPSRandomDQMSource.cc.

Referenced by getRPindex().

◆ kLastRPn_

constexpr int CTPPSRandomDQMSource::kLastRPn_ = 4
staticprivate

Definition at line 50 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ kNArms_

constexpr int CTPPSRandomDQMSource::kNArms_ = 2
staticprivate

Definition at line 46 of file CTPPSRandomDQMSource.cc.

Referenced by bookHistograms().

◆ kNplaneMAX_

constexpr int CTPPSRandomDQMSource::kNplaneMAX_ = 6
staticprivate

Definition at line 49 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and bookHistograms().

◆ kNRPotsMAX_

constexpr int CTPPSRandomDQMSource::kNRPotsMAX_ = 6
staticprivate

Definition at line 48 of file CTPPSRandomDQMSource.cc.

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

◆ kNStationMAX_

constexpr int CTPPSRandomDQMSource::kNStationMAX_ = 3
staticprivate

Definition at line 47 of file CTPPSRandomDQMSource.cc.

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

◆ kRPotsIDMAX_

constexpr int CTPPSRandomDQMSource::kRPotsIDMAX_ = 8
staticprivate

Definition at line 52 of file CTPPSRandomDQMSource.cc.

Referenced by CTPPSRandomDQMSource().

◆ kRPotsTotalNumber_

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

Definition at line 63 of file CTPPSRandomDQMSource.cc.

◆ kStationIDMAX_

constexpr int CTPPSRandomDQMSource::kStationIDMAX_ = 4
staticprivate

Definition at line 51 of file CTPPSRandomDQMSource.cc.

Referenced by CTPPSRandomDQMSource().

◆ RPindexValid_

int CTPPSRandomDQMSource::RPindexValid_[kRPotsTotalNumber_]
private

Definition at line 65 of file CTPPSRandomDQMSource.cc.

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

◆ rpStatus_

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

Definition at line 57 of file CTPPSRandomDQMSource.cc.

Referenced by analyze(), and CTPPSRandomDQMSource().

◆ rpStatusWord_

unsigned int CTPPSRandomDQMSource::rpStatusWord_ = 0x8008
private

Definition at line 56 of file CTPPSRandomDQMSource.cc.

Referenced by CTPPSRandomDQMSource().

◆ stationStatus_

int CTPPSRandomDQMSource::stationStatus_[kStationIDMAX_]
private

Definition at line 58 of file CTPPSRandomDQMSource.cc.

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

◆ tokenDigi_

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

Definition at line 44 of file CTPPSRandomDQMSource.cc.

Referenced by analyze().