CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
L1TdeGEMTPG Class Reference

#include <L1TdeGEMTPG.h>

Inheritance diagram for L1TdeGEMTPG:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 L1TdeGEMTPG (const edm::ParameterSet &ps)
 
 ~L1TdeGEMTPG () override
 
- 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
 

Protected Member Functions

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

Private Attributes

std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
 
std::vector< std::string > chambers_
 
std::vector< double > clusterMaxBin_
 
std::vector< double > clusterMinBin_
 
std::vector< unsigned > clusterNBin_
 
std::vector< std::string > clusterVars_
 
edm::EDGetTokenT< GEMPadDigiClusterCollectiondata_token_
 
std::vector< std::string > dataEmul_
 
edm::EDGetTokenT< GEMPadDigiClusterCollectionemul_token_
 
std::string monitorDir_
 
bool useDataClustersOnlyInBX0_
 
bool verbose_
 

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
 
- 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 Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 13 of file L1TdeGEMTPG.h.

Constructor & Destructor Documentation

◆ L1TdeGEMTPG()

L1TdeGEMTPG::L1TdeGEMTPG ( const edm::ParameterSet ps)

Definition at line 5 of file L1TdeGEMTPG.cc.

6  : data_token_(consumes<GEMPadDigiClusterCollection>(ps.getParameter<edm::InputTag>("data"))),
7  emul_token_(consumes<GEMPadDigiClusterCollection>(ps.getParameter<edm::InputTag>("emul"))),
8  monitorDir_(ps.getParameter<std::string>("monitorDir")),
9  verbose_(ps.getParameter<bool>("verbose")),
10 
11  chambers_(ps.getParameter<std::vector<std::string>>("chambers")),
12  dataEmul_(ps.getParameter<std::vector<std::string>>("dataEmul")),
13 
14  // variables
15  clusterVars_(ps.getParameter<std::vector<std::string>>("clusterVars")),
16 
17  // binning
18  clusterNBin_(ps.getParameter<std::vector<unsigned>>("clusterNBin")),
19  clusterMinBin_(ps.getParameter<std::vector<double>>("clusterMinBin")),
20  clusterMaxBin_(ps.getParameter<std::vector<double>>("clusterMaxBin")),
21  useDataClustersOnlyInBX0_(ps.getParameter<bool>("useDataClustersOnlyInBX0")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< unsigned > clusterNBin_
Definition: L1TdeGEMTPG.h:32
std::vector< std::string > chambers_
Definition: L1TdeGEMTPG.h:28
std::vector< std::string > dataEmul_
Definition: L1TdeGEMTPG.h:29
std::vector< double > clusterMinBin_
Definition: L1TdeGEMTPG.h:33
bool useDataClustersOnlyInBX0_
Definition: L1TdeGEMTPG.h:36
std::string monitorDir_
Definition: L1TdeGEMTPG.h:25
std::vector< std::string > clusterVars_
Definition: L1TdeGEMTPG.h:31
bool verbose_
Definition: L1TdeGEMTPG.h:26
std::vector< double > clusterMaxBin_
Definition: L1TdeGEMTPG.h:34
edm::EDGetTokenT< GEMPadDigiClusterCollection > emul_token_
Definition: L1TdeGEMTPG.h:24
edm::EDGetTokenT< GEMPadDigiClusterCollection > data_token_
Definition: L1TdeGEMTPG.h:23

◆ ~L1TdeGEMTPG()

L1TdeGEMTPG::~L1TdeGEMTPG ( )
override

Definition at line 23 of file L1TdeGEMTPG.cc.

23 {}

Member Function Documentation

◆ analyze()

void L1TdeGEMTPG::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 46 of file L1TdeGEMTPG.cc.

References chamberHistos, data_token_, MillePedeFileConverter_cfg::e, emul_token_, FastTimerService_cff::range, relativeConstraints::station, useDataClustersOnlyInBX0_, and verbose_.

46  {
47  if (verbose_)
48  edm::LogInfo("L1TdeGEMTPG") << "L1TdeGEMTPG: analyzing collections" << std::endl;
49 
50  // handles
53  e.getByToken(data_token_, dataClusters);
54  e.getByToken(emul_token_, emulClusters);
55 
56  for (auto it = dataClusters->begin(); it != dataClusters->end(); it++) {
57  auto range = dataClusters->get((*it).first);
58  const int type = ((*it).first).station() - 1;
59  for (auto cluster = range.first; cluster != range.second; cluster++) {
60  if (cluster->isValid()) {
61  // ignore data clusters in BX's other than BX0
62  if (useDataClustersOnlyInBX0_ and cluster->bx() != 0)
63  continue;
64 
65  chamberHistos[type]["cluster_size_data"]->Fill(cluster->pads().size());
66  chamberHistos[type]["cluster_pad_data"]->Fill(cluster->pads().front());
67  chamberHistos[type]["cluster_bx_data"]->Fill(cluster->bx());
68  }
69  }
70  }
71 
72  for (auto it = emulClusters->begin(); it != emulClusters->end(); it++) {
73  auto range = emulClusters->get((*it).first);
74  const int type = ((*it).first).station() - 1;
75  for (auto cluster = range.first; cluster != range.second; cluster++) {
76  if (cluster->isValid()) {
77  chamberHistos[type]["cluster_size_emul"]->Fill(cluster->pads().size());
78  chamberHistos[type]["cluster_pad_emul"]->Fill(cluster->pads().front());
79  chamberHistos[type]["cluster_bx_emul"]->Fill(cluster->bx());
80  }
81  }
82  }
83 }
bool useDataClustersOnlyInBX0_
Definition: L1TdeGEMTPG.h:36
bool verbose_
Definition: L1TdeGEMTPG.h:26
Log< level::Info, false > LogInfo
edm::EDGetTokenT< GEMPadDigiClusterCollection > emul_token_
Definition: L1TdeGEMTPG.h:24
edm::EDGetTokenT< GEMPadDigiClusterCollection > data_token_
Definition: L1TdeGEMTPG.h:23
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
Definition: L1TdeGEMTPG.h:40

◆ bookHistograms()

void L1TdeGEMTPG::bookHistograms ( DQMStore::IBooker iBooker,
const edm::Run ,
const edm::EventSetup  
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 25 of file L1TdeGEMTPG.cc.

References dqm::implementation::IBooker::book1D(), chamberHistos, chambers_, clusterMaxBin_, clusterMinBin_, clusterNBin_, clusterVars_, dataEmul_, B2GTnPMonitor_cfi::histTitle, crabWrapper::key, monitorDir_, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

25  {
27 
28  // chamber type
29  for (unsigned iType = 0; iType < chambers_.size(); iType++) {
30  // data vs emulator
31  for (unsigned iData = 0; iData < dataEmul_.size(); iData++) {
32  // cluster variable
33  for (unsigned iVar = 0; iVar < clusterVars_.size(); iVar++) {
34  const std::string key("cluster_" + clusterVars_[iVar] + "_" + dataEmul_[iData]);
35  const std::string histName(key + "_" + chambers_[iType]);
36  const std::string histTitle(chambers_[iType] + " Cluster " + clusterVars_[iVar] + " (" + dataEmul_[iData] +
37  ")");
38  chamberHistos[iType][key] =
39  iBooker.book1D(histName, histTitle, clusterNBin_[iVar], clusterMinBin_[iVar], clusterMaxBin_[iVar]);
40  chamberHistos[iType][key]->getTH1()->SetMinimum(0);
41  }
42  }
43  }
44 }
std::vector< unsigned > clusterNBin_
Definition: L1TdeGEMTPG.h:32
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::vector< std::string > chambers_
Definition: L1TdeGEMTPG.h:28
std::vector< std::string > dataEmul_
Definition: L1TdeGEMTPG.h:29
std::vector< double > clusterMinBin_
Definition: L1TdeGEMTPG.h:33
std::string monitorDir_
Definition: L1TdeGEMTPG.h:25
std::vector< std::string > clusterVars_
Definition: L1TdeGEMTPG.h:31
std::vector< double > clusterMaxBin_
Definition: L1TdeGEMTPG.h:34
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
Definition: L1TdeGEMTPG.h:40

Member Data Documentation

◆ chamberHistos

std::map<uint32_t, std::map<std::string, MonitorElement*> > L1TdeGEMTPG::chamberHistos
private

Definition at line 40 of file L1TdeGEMTPG.h.

Referenced by analyze(), and bookHistograms().

◆ chambers_

std::vector<std::string> L1TdeGEMTPG::chambers_
private

Definition at line 28 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ clusterMaxBin_

std::vector<double> L1TdeGEMTPG::clusterMaxBin_
private

Definition at line 34 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ clusterMinBin_

std::vector<double> L1TdeGEMTPG::clusterMinBin_
private

Definition at line 33 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ clusterNBin_

std::vector<unsigned> L1TdeGEMTPG::clusterNBin_
private

Definition at line 32 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ clusterVars_

std::vector<std::string> L1TdeGEMTPG::clusterVars_
private

Definition at line 31 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ data_token_

edm::EDGetTokenT<GEMPadDigiClusterCollection> L1TdeGEMTPG::data_token_
private

Definition at line 23 of file L1TdeGEMTPG.h.

Referenced by analyze().

◆ dataEmul_

std::vector<std::string> L1TdeGEMTPG::dataEmul_
private

Definition at line 29 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ emul_token_

edm::EDGetTokenT<GEMPadDigiClusterCollection> L1TdeGEMTPG::emul_token_
private

Definition at line 24 of file L1TdeGEMTPG.h.

Referenced by analyze().

◆ monitorDir_

std::string L1TdeGEMTPG::monitorDir_
private

Definition at line 25 of file L1TdeGEMTPG.h.

Referenced by bookHistograms().

◆ useDataClustersOnlyInBX0_

bool L1TdeGEMTPG::useDataClustersOnlyInBX0_
private

Definition at line 36 of file L1TdeGEMTPG.h.

Referenced by analyze().

◆ verbose_

bool L1TdeGEMTPG::verbose_
private

Definition at line 26 of file L1TdeGEMTPG.h.

Referenced by analyze().