CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
LumiMonitor Class Reference
Inheritance diagram for LumiMonitor:
DQMGlobalEDAnalyzer< Histograms > edm::global::EDAnalyzer< edm::RunCache< Histograms >, Args... > edm::global::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 LumiMonitor (const edm::ParameterSet &)
 
 ~LumiMonitor () override=default
 
- Public Member Functions inherited from edm::global::EDAnalyzer< edm::RunCache< Histograms >, Args... >
 EDAnalyzer ()=default
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillHistoLSPSetDescription (edm::ParameterSetDescription &pset)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 
- Static Public Member Functions inherited from edm::global::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void bookHistograms (DQMStore::ConcurrentBooker &, edm::Run const &, edm::EventSetup const &, Histograms &) const override
 
void dqmAnalyze (edm::Event const &, edm::EventSetup const &, Histograms const &) const override
 

Static Private Member Functions

static MEbinning getHistoLSPSet (const edm::ParameterSet &pset)
 
static MEbinning getHistoPSet (const edm::ParameterSet &pset)
 

Private Attributes

bool doPixelLumi_
 
std::string folderName_
 
MEbinning ls_binning_
 
MEbinning lumi_binning_
 
float lumi_factor_per_bx_
 
edm::EDGetTokenT< LumiScalersCollectionlumiScalersToken_
 
edm::EDGetTokenT< LumiSummarylumiSummaryToken_
 
int minNumberOfPixelsPerCluster_
 
float minPixelClusterCharge_
 
MEbinning pixelCluster_binning_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
 
MEbinning pixellumi_binning_
 
MEbinning pu_binning_
 
bool useBPixLayer1_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Detailed Description

Definition at line 45 of file LumiMonitor.cc.

Constructor & Destructor Documentation

LumiMonitor::LumiMonitor ( const edm::ParameterSet config)

Definition at line 88 of file LumiMonitor.cc.

References doPixelLumi_, GetLumi::FREQ_ORBIT, getHistoPSet(), edm::ParameterSet::getParameter(), lumi_factor_per_bx_, pixellumi_binning_, GetLumi::rXSEC_PIXEL_CLUSTER, GetLumi::SECONDS_PER_LS, useBPixLayer1_, and GetLumi::XSEC_PIXEL_CLUSTER.

88  :
89  folderName_ ( config.getParameter<std::string>("FolderName") )
90  , lumiScalersToken_ ( consumes<LumiScalersCollection>(config.getParameter<edm::InputTag>("scalers") ) )
94  , doPixelLumi_ ( config.getParameter<bool>("doPixelLumi") )
96  , useBPixLayer1_ ( doPixelLumi_ ? config.getParameter<bool> ("useBPixLayer1") : false )
97  , minNumberOfPixelsPerCluster_ ( doPixelLumi_ ? config.getParameter<int> ("minNumberOfPixelsPerCluster") : -1 )
98  , minPixelClusterCharge_ ( doPixelLumi_ ? config.getParameter<double> ("minPixelClusterCharge") : -1. )
99  , pixelCluster_binning_ ( doPixelLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("pixelClusterPSet")) : MEbinning {} )
100  , pixellumi_binning_ ( doPixelLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("pixellumiPSet")) : MEbinning {} )
101 {
102  if(useBPixLayer1_) {
104  } else {
106  }
107 }
T getParameter(std::string const &) const
bool useBPixLayer1_
Definition: LumiMonitor.cc:70
static MEbinning getHistoPSet(const edm::ParameterSet &pset)
Definition: LumiMonitor.cc:109
MEbinning pu_binning_
Definition: LumiMonitor.cc:65
float minPixelClusterCharge_
Definition: LumiMonitor.cc:72
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
Definition: LumiMonitor.cc:69
static double XSEC_PIXEL_CLUSTER
Definition: GetLumi.h:41
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::string folderName_
Definition: LumiMonitor.cc:61
edm::EDGetTokenT< LumiScalersCollection > lumiScalersToken_
Definition: LumiMonitor.cc:63
MEbinning pixellumi_binning_
Definition: LumiMonitor.cc:74
static MEbinning getHistoLSPSet(const edm::ParameterSet &pset)
Definition: LumiMonitor.cc:118
static double rXSEC_PIXEL_CLUSTER
Definition: GetLumi.h:45
bool doPixelLumi_
Definition: LumiMonitor.cc:68
MEbinning pixelCluster_binning_
Definition: LumiMonitor.cc:73
float lumi_factor_per_bx_
Definition: LumiMonitor.cc:79
int minNumberOfPixelsPerCluster_
Definition: LumiMonitor.cc:71
MEbinning lumi_binning_
Definition: LumiMonitor.cc:64
static double FREQ_ORBIT
Definition: GetLumi.h:32
MEbinning ls_binning_
Definition: LumiMonitor.cc:66
static double SECONDS_PER_LS
Definition: GetLumi.h:33
LumiMonitor::~LumiMonitor ( )
overridedefault

Member Function Documentation

void LumiMonitor::bookHistograms ( DQMStore::ConcurrentBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup,
Histograms histograms 
) const
overrideprivatevirtual

Implements DQMGlobalEDAnalyzer< Histograms >.

Definition at line 127 of file LumiMonitor.cc.

References DQMStore::ConcurrentBooker::book1D(), DQMStore::ConcurrentBooker::bookProfile(), doPixelLumi_, folderName_, ls_binning_, lumi_binning_, pixelCluster_binning_, pixellumi_binning_, pu_binning_, and DQMStore::IBooker::setCurrentFolder().

128 {
130 
131  if (doPixelLumi_) {
132  histograms.numberOfPixelClustersVsLS = booker.book1D(
133  "numberOfPixelClustersVsLS",
134  "number of pixel clusters vs LS",
135  ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax);
136  histograms.numberOfPixelClustersVsLS.setAxisTitle("LS", 1);
137  histograms.numberOfPixelClustersVsLS.setAxisTitle("number of pixel clusters", 2);
138 
139  histograms.numberOfPixelClustersVsLumi = booker.bookProfile(
140  "numberOfPixelClustersVsLumi",
141  "number of pixel clusters vs scal lumi",
142  lumi_binning_.nbins, lumi_binning_.xmin, lumi_binning_.xmax,
144  histograms.numberOfPixelClustersVsLumi.setAxisTitle("scal inst lumi E30 [Hz cm^{-2}]", 1);
145  histograms.numberOfPixelClustersVsLumi.setAxisTitle("number of pixel clusters", 2);
146 
147  histograms.pixelLumiVsLS = booker.bookProfile(
148  "pixelLumiVsLS",
149  "pixel-lumi vs LS",
150  ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax,
152  histograms.pixelLumiVsLS.setAxisTitle("LS", 1);
153  histograms.pixelLumiVsLS.setAxisTitle("pixel-based inst lumi E30 [Hz cm^{-2}]", 2);
154 
155  histograms.pixelLumiVsLumi = booker.bookProfile(
156  "pixelLumiVsLumi",
157  "pixel-lumi vs scal lumi",
158  lumi_binning_.nbins, lumi_binning_.xmin, lumi_binning_.xmax,
159  pixellumi_binning_.xmin, lumi_binning_.xmax);
160  histograms.pixelLumiVsLumi.setAxisTitle("scal inst lumi E30 [Hz cm^{-2}]", 1);
161  histograms.pixelLumiVsLumi.setAxisTitle("pixel-based inst lumi E30 [Hz cm^{-2}]", 2);
162  }
163 
164  histograms.lumiVsLS = booker.bookProfile(
165  "lumiVsLS",
166  "scal lumi vs LS",
167  ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax,
168  lumi_binning_.xmin, lumi_binning_.xmax);
169  histograms.lumiVsLS.setAxisTitle("LS", 1);
170  histograms.lumiVsLS.setAxisTitle("scal inst lumi E30 [Hz cm^{-2}]", 2);
171 
172  histograms.puVsLS = booker.bookProfile(
173  "puVsLS",
174  "scal PU vs LS",
175  ls_binning_.nbins, ls_binning_.xmin, ls_binning_.xmax,
176  pu_binning_.xmin, pu_binning_.xmax);
177  histograms.puVsLS.setAxisTitle("LS", 1);
178  histograms.puVsLS.setAxisTitle("scal PU", 2);
179 
180 }
ConcurrentMonitorElement bookProfile(Args &&...args)
Definition: DQMStore.h:167
MEbinning pu_binning_
Definition: LumiMonitor.cc:65
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::string folderName_
Definition: LumiMonitor.cc:61
MEbinning pixellumi_binning_
Definition: LumiMonitor.cc:74
ConcurrentMonitorElement book1D(Args &&...args)
Definition: DQMStore.h:160
bool doPixelLumi_
Definition: LumiMonitor.cc:68
MEbinning pixelCluster_binning_
Definition: LumiMonitor.cc:73
MEbinning lumi_binning_
Definition: LumiMonitor.cc:64
MEbinning ls_binning_
Definition: LumiMonitor.cc:66
void LumiMonitor::dqmAnalyze ( edm::Event const &  event,
edm::EventSetup const &  setup,
Histograms const &  histograms 
) const
overrideprivate

Definition at line 182 of file LumiMonitor.cc.

References GetLumi::CM2_TO_NANOBARN, doPixelLumi_, edm::HandleBase::isValid(), eostools::ls(), lumi_factor_per_bx_, lumiScalersToken_, minNumberOfPixelsPerCluster_, minPixelClusterCharge_, PixelSubdetector::PixelBarrel, HiRegitMuonDetachedTripletStep_cff::pixelClusters, pixelClustersToken_, GeneralSetup::setup(), and DetId::subdetId().

183 {
184  int ls = event.id().luminosityBlock();
185 
186  float scal_lumi = -1.;
187  float scal_pu = -1.;
189  event.getByToken(lumiScalersToken_, lumiScalers);
190  if (lumiScalers.isValid() and not lumiScalers->empty()) {
191  auto scalit = lumiScalers->begin();
192  scal_lumi = scalit->instantLumi();
193  scal_pu = scalit->pileup();
194  } else {
195  scal_lumi = -1.;
196  scal_pu = -1.;
197  }
198  histograms.lumiVsLS.fill(ls, scal_lumi);
199  histograms.puVsLS.fill(ls, scal_pu);
200 
201  if (doPixelLumi_) {
202  size_t pixel_clusters = 0;
203  float pixel_lumi = -1.;
205  event.getByToken(pixelClustersToken_, pixelClusters);
206  if (pixelClusters.isValid()) {
207  auto const& tTopo = edm::get<TrackerTopology, TrackerTopologyRcd>(setup);
208 
209  // Count the number of clusters with at least a minimum
210  // number of pixels per cluster and at least a minimum charge.
211  size_t tot = 0;
212  for (auto pixCluDet = pixelClusters->begin(); pixCluDet != pixelClusters->end(); ++pixCluDet) {
213 
214  DetId detid = pixCluDet->detId();
215  size_t subdetid = detid.subdetId();
216  if (subdetid == (int) PixelSubdetector::PixelBarrel) {
217  if (tTopo.layer(detid)==1) {
218  continue;
219  }
220  }
221 
222  for (auto pixClu = pixCluDet->begin(); pixClu != pixCluDet->end(); ++pixClu) {
223  ++tot;
224  if ((pixClu->size() >= minNumberOfPixelsPerCluster_) and
225  (pixClu->charge() >= minPixelClusterCharge_ )) {
226  ++pixel_clusters;
227  }
228  }
229  }
230  pixel_lumi = lumi_factor_per_bx_ * pixel_clusters / GetLumi::CM2_TO_NANOBARN ; // ?!?!
231  } else {
232  pixel_lumi = -1.;
233  }
234 
235  histograms.numberOfPixelClustersVsLS.fill(ls, pixel_clusters);
236  histograms.numberOfPixelClustersVsLumi.fill(scal_lumi, pixel_clusters);
237  histograms.pixelLumiVsLS.fill(ls, pixel_lumi);
238  histograms.pixelLumiVsLumi.fill(scal_lumi, pixel_lumi);
239  }
240 
241 }
float minPixelClusterCharge_
Definition: LumiMonitor.cc:72
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
Definition: LumiMonitor.cc:69
edm::EDGetTokenT< LumiScalersCollection > lumiScalersToken_
Definition: LumiMonitor.cc:63
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
static double CM2_TO_NANOBARN
Definition: GetLumi.h:47
bool isValid() const
Definition: HandleBase.h:74
Definition: DetId.h:18
def ls(path, rec=False)
Definition: eostools.py:349
bool doPixelLumi_
Definition: LumiMonitor.cc:68
float lumi_factor_per_bx_
Definition: LumiMonitor.cc:79
int minNumberOfPixelsPerCluster_
Definition: LumiMonitor.cc:71
void LumiMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 255 of file LumiMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, funct::false, fillHistoLSPSetDescription(), fillHistoPSetDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

256 {
258  desc.add<edm::InputTag>( "pixelClusters", edm::InputTag("hltSiPixelClusters") );
259  desc.add<edm::InputTag>( "scalers", edm::InputTag("hltScalersRawToDigi"));
260  desc.add<std::string> ( "FolderName", "HLT/LumiMonitoring" );
261  desc.add<bool> ( "doPixelLumi", false );
262  desc.add<bool> ( "useBPixLayer1", false );
263  desc.add<int> ( "minNumberOfPixelsPerCluster", 2 ); // from DQM/PixelLumi/python/PixelLumiDQM_cfi.py
264  desc.add<double> ( "minPixelClusterCharge", 15000. );
265 
267  edm::ParameterSetDescription pixelClusterPSet;
268  LumiMonitor::fillHistoPSetDescription(pixelClusterPSet);
269  histoPSet.add("pixelClusterPSet", pixelClusterPSet);
270 
272  fillHistoPSetDescription(lumiPSet);
273  histoPSet.add<edm::ParameterSetDescription>("lumiPSet", lumiPSet);
274 
276  fillHistoPSetDescription(puPSet);
277  histoPSet.add<edm::ParameterSetDescription>("puPSet", puPSet);
278 
279  edm::ParameterSetDescription pixellumiPSet;
280  fillHistoPSetDescription(pixellumiPSet);
281  histoPSet.add<edm::ParameterSetDescription>("pixellumiPSet", pixellumiPSet);
282 
285  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
286 
287  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
288 
289  descriptions.add("lumiMonitor", desc);
290 }
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
Definition: LumiMonitor.cc:250
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
Definition: LumiMonitor.cc:243
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void LumiMonitor::fillHistoLSPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 250 of file LumiMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

251 {
252  pset.add<int> ( "nbins", 2500);
253 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void LumiMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 243 of file LumiMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

244 {
245  pset.add<int> ( "nbins");
246  pset.add<double>( "xmin" );
247  pset.add<double>( "xmax" );
248 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MEbinning LumiMonitor::getHistoLSPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 118 of file LumiMonitor.cc.

References edm::ParameterSet::getParameter().

119 {
120  return MEbinning{
121  pset.getParameter<int32_t>("nbins"),
122  -0.5,
123  pset.getParameter<int32_t>("nbins") - 0.5
124  };
125 }
T getParameter(std::string const &) const
MEbinning LumiMonitor::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 109 of file LumiMonitor.cc.

References edm::ParameterSet::getParameter().

Referenced by LumiMonitor().

110 {
111  return MEbinning{
112  pset.getParameter<int32_t>("nbins"),
113  pset.getParameter<double>("xmin"),
114  pset.getParameter<double>("xmax"),
115  };
116 }
T getParameter(std::string const &) const

Member Data Documentation

bool LumiMonitor::doPixelLumi_
private

Definition at line 68 of file LumiMonitor.cc.

Referenced by bookHistograms(), dqmAnalyze(), and LumiMonitor().

std::string LumiMonitor::folderName_
private

Definition at line 61 of file LumiMonitor.cc.

Referenced by bookHistograms().

MEbinning LumiMonitor::ls_binning_
private

Definition at line 66 of file LumiMonitor.cc.

Referenced by bookHistograms().

MEbinning LumiMonitor::lumi_binning_
private

Definition at line 64 of file LumiMonitor.cc.

Referenced by bookHistograms().

float LumiMonitor::lumi_factor_per_bx_
private

Definition at line 79 of file LumiMonitor.cc.

Referenced by dqmAnalyze(), and LumiMonitor().

edm::EDGetTokenT<LumiScalersCollection> LumiMonitor::lumiScalersToken_
private

Definition at line 63 of file LumiMonitor.cc.

Referenced by dqmAnalyze().

edm::EDGetTokenT<LumiSummary> LumiMonitor::lumiSummaryToken_
private

Definition at line 76 of file LumiMonitor.cc.

int LumiMonitor::minNumberOfPixelsPerCluster_
private

Definition at line 71 of file LumiMonitor.cc.

Referenced by dqmAnalyze().

float LumiMonitor::minPixelClusterCharge_
private

Definition at line 72 of file LumiMonitor.cc.

Referenced by dqmAnalyze().

MEbinning LumiMonitor::pixelCluster_binning_
private

Definition at line 73 of file LumiMonitor.cc.

Referenced by bookHistograms().

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > LumiMonitor::pixelClustersToken_
private

Definition at line 69 of file LumiMonitor.cc.

Referenced by dqmAnalyze().

MEbinning LumiMonitor::pixellumi_binning_
private

Definition at line 74 of file LumiMonitor.cc.

Referenced by bookHistograms(), and LumiMonitor().

MEbinning LumiMonitor::pu_binning_
private

Definition at line 65 of file LumiMonitor.cc.

Referenced by bookHistograms().

bool LumiMonitor::useBPixLayer1_
private

Definition at line 70 of file LumiMonitor.cc.

Referenced by LumiMonitor().