CMS 3D CMS Logo

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

Data Format. More...

#include <L1TRPCTPG.h>

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

Public Member Functions

 L1TRPCTPG (const edm::ParameterSet &ps)
 
 ~L1TRPCTPG () 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
 
 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 &e, const edm::EventSetup &c) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

std::ofstream logFile_
 
MonitorElementm_digiBxCSC
 
MonitorElementm_digiBxDT
 
MonitorElementm_digiBxRPCBar
 
MonitorElementm_digiBxRPCEnd
 
bool monitorDaemon_
 
int nev_
 
std::string outputFile_
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordrpcgeomToken_
 
edm::InputTag rpctfSource_
 
edm::EDGetTokenT< L1MuGMTReadoutCollectionrpctfSource_token_
 
MonitorElementrpctpgbx
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > rpctpgmeCollection
 
MonitorElementrpctpgndigi [3]
 
edm::InputTag rpctpgSource_
 
edm::EDGetTokenT< RPCDigiCollectionrpctpgSource_token_
 
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

Data Format.

Geometry

Definition at line 55 of file L1TRPCTPG.h.

Constructor & Destructor Documentation

◆ L1TRPCTPG()

L1TRPCTPG::L1TRPCTPG ( const edm::ParameterSet ps)

Definition at line 13 of file L1TRPCTPG.cc.

References gather_cfg::cout, deDxTools::esConsumes(), edm::ParameterSet::getUntrackedParameter(), outputFile_, rpcgeomToken_, and verbose_.

14  : rpctpgSource_(ps.getParameter<InputTag>("rpctpgSource")),
15  rpctpgSource_token_(consumes<RPCDigiCollection>(ps.getParameter<InputTag>("rpctpgSource"))),
16  rpctfSource_(ps.getParameter<InputTag>("rpctfSource")),
17  rpctfSource_token_(consumes<L1MuGMTReadoutCollection>(ps.getParameter<InputTag>("rpctfSource"))) {
18  // verbosity switch
19  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
20 
21  if (verbose_)
22  cout << "L1TRPCTPG: constructor...." << endl;
23 
24  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
25  if (!outputFile_.empty()) {
26  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
27  }
28 
29  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
30  if (disable) {
31  outputFile_ = "";
32  }
34 }
edm::EDGetTokenT< RPCDigiCollection > rpctpgSource_token_
Definition: L1TRPCTPG.h:89
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcgeomToken_
Definition: L1TRPCTPG.h:92
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: L1TRPCTPG.h:84
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:91
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:88
bool verbose_
Definition: L1TRPCTPG.h:85
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:90

◆ ~L1TRPCTPG()

L1TRPCTPG::~L1TRPCTPG ( )
override

Definition at line 36 of file L1TRPCTPG.cc.

36 {}

Member Function Documentation

◆ analyze()

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

RPC Geometry

DIGI

Reimplemented from DQMEDAnalyzer.

Definition at line 62 of file L1TRPCTPG.cc.

References nano_mu_digi_cff::bx, HltBtagPostValidation_cff::c, gather_cfg::cout, MillePedeFileConverter_cfg::e, dqm::impl::MonitorElement::Fill(), L1MuGMTReadoutCollection::getRecords(), edm::HandleBase::isValid(), edm::InputTag::label(), m_digiBxCSC, m_digiBxDT, m_digiBxRPCBar, m_digiBxRPCEnd, nev_, edm::Handle< T >::product(), rpcgeomToken_, rpctfSource_, rpctfSource_token_, rpctpgbx, rpctpgndigi, rpctpgSource_, rpctpgSource_token_, edm::second(), and verbose_.

62  {
63  nev_++;
64  if (verbose_)
65  cout << "L1TRPCTPG: analyze...." << endl;
66 
68  const auto& rpcGeo = c.getHandle(rpcgeomToken_);
69  if (!rpcGeo.isValid()) {
70  edm::LogInfo("DataNotFound") << "can't find RPCGeometry" << endl;
71  return;
72  }
73  // char layerLabel[328];
74  // char meId [328];
75 
78  e.getByToken(rpctpgSource_token_, rpcdigis);
79 
80  if (!rpcdigis.isValid()) {
81  edm::LogInfo("DataNotFound") << "can't find RPCDigiCollection with label " << rpctpgSource_ << endl;
82  return;
83  }
84 
85  // Calculate the number of DT and CSC cands present
87  e.getByToken(rpctfSource_token_, pCollection);
88 
89  if (!pCollection.isValid()) {
90  edm::LogInfo("DataNotFound") << "can't find L1MuGMTReadoutCollection with label " << rpctfSource_.label();
91  return;
92  }
93 
94  L1MuGMTReadoutCollection const* gmtrc = pCollection.product();
95  vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
96  vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
97 
98  int nRPCTrackBarrel, nRPCTrackEndcap, nDTTrack, nCSCTrack;
99  nRPCTrackBarrel = 0;
100  nRPCTrackEndcap = 0;
101  nDTTrack = 0;
102  nCSCTrack = 0;
103 
104  for (RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++) {
105  // DTs
106  vector<L1MuRegionalCand> DTCands = RRItr->getDTBXCands();
107  for (vector<L1MuRegionalCand>::const_iterator ECItr = DTCands.begin(); ECItr != DTCands.end(); ++ECItr) {
108  if (!ECItr->empty()) {
109  ++nDTTrack;
110  }
111  }
112  // CSCs
113  vector<L1MuRegionalCand> CSCCands = RRItr->getCSCCands();
114  for (vector<L1MuRegionalCand>::const_iterator ECItr = CSCCands.begin(); ECItr != CSCCands.end(); ++ECItr) {
115  if (!ECItr->empty()) {
116  ++nCSCTrack;
117  }
118  }
119 
120  //RPC barrel
121  vector<L1MuRegionalCand> RPCBCands = RRItr->getBrlRPCCands();
122  for (vector<L1MuRegionalCand>::const_iterator ECItr = RPCBCands.begin(); ECItr != RPCBCands.end(); ++ECItr) {
123  if (!ECItr->empty()) {
124  ++nRPCTrackBarrel;
125  }
126  }
127 
128  //RPC endcap
129  vector<L1MuRegionalCand> RPCECands = RRItr->getFwdRPCCands();
130  for (vector<L1MuRegionalCand>::const_iterator ECItr = RPCECands.begin(); ECItr != RPCECands.end(); ++ECItr) {
131  if (!ECItr->empty()) {
132  ++nRPCTrackEndcap;
133  }
134  }
135  }
136 
137  int numberofDigi[3] = {0, 0, 0};
138 
140  for (collectionItr = rpcdigis->begin(); collectionItr != rpcdigis->end(); ++collectionItr) {
142  for (digiItr = ((*collectionItr).second).first; digiItr != ((*collectionItr).second).second; ++digiItr) {
143  // strips is a list of hit strips (regardless of bx) for this roll
144  // int strip= (*digiItr).strip();
145  // strips.push_back(strip);
146  int bx = (*digiItr).bx();
147  rpctpgbx->Fill(bx);
148  //
149 
150  if (nRPCTrackBarrel == 0 && nDTTrack != 0) {
151  m_digiBxDT->Fill(bx);
152  } else if (nRPCTrackBarrel != 0 && nDTTrack == 0) {
154  }
155 
156  if (nRPCTrackEndcap == 0 && nCSCTrack != 0) {
157  m_digiBxCSC->Fill(bx);
158  } else if (nRPCTrackEndcap != 0 && nCSCTrack == 0) {
160  }
161 
162  if (bx == -1) {
163  numberofDigi[0]++;
164  }
165  if (bx == 0) {
166  // sprintf(meId,"Occupancy_%s",detUnitLabel);
167  // meMap[meId]->Fill(strip);
168  numberofDigi[1]++;
169  }
170  if (bx == 2) {
171  numberofDigi[2]++;
172  }
173 
174  // sprintf(meId,"BXN_%s",detUnitLabel);
175  // meMap[meId]->Fill(bx);
176  // sprintf(meId,"BXN_vs_strip_%s",detUnitLabel);
177  // meMap[meId]->Fill(strip,bx);
178  }
179  }
180 
181  rpctpgndigi[0]->Fill(numberofDigi[0]);
182  rpctpgndigi[1]->Fill(numberofDigi[1]);
183  rpctpgndigi[2]->Fill(numberofDigi[2]);
184 
185  if (verbose_)
186  cout << "L1TRPCTPG: end job...." << endl;
187  LogInfo("EndJob") << "analyzed " << nev_ << " events";
188 }
edm::EDGetTokenT< RPCDigiCollection > rpctpgSource_token_
Definition: L1TRPCTPG.h:89
T const * product() const
Definition: Handle.h:70
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:79
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcgeomToken_
Definition: L1TRPCTPG.h:92
void Fill(long long x)
U second(std::pair< T, U > const &p)
int nev_
Definition: L1TRPCTPG.h:83
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:74
Log< level::Info, false > LogInfo
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:91
std::vector< RPCDigi >::const_iterator const_iterator
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:88
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:76
bool verbose_
Definition: L1TRPCTPG.h:85
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:77
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:90
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:75
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:78

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 42 of file L1TRPCTPG.cc.

References dqm::implementation::IBooker::book1D(), m_digiBxCSC, m_digiBxDT, m_digiBxRPCBar, m_digiBxRPCEnd, nev_, rpctpgbx, rpctpgndigi, and dqm::implementation::NavigatorBase::setCurrentFolder().

42  {
43  nev_ = 0;
44 
45  ibooker.setCurrentFolder("L1T/L1TRPCTPG");
46 
47  rpctpgbx = ibooker.book1D("RPCTPG_bx", "RPC digis bx - all events", 9, -4.5, 4.5);
48 
49  rpctpgndigi[1] = ibooker.book1D("RPCTPG_ndigi", "RPCTPG nDigi bx 0", 100, -0.5, 99.5);
50  rpctpgndigi[2] = ibooker.book1D("RPCTPG_ndigi_+1", "RPCTPG nDigi bx +1", 100, -0.5, 99.5);
51  rpctpgndigi[0] = ibooker.book1D("RPCTPG_ndigi_-1", "RPCTPG nDigi bx -1", 100, -0.5, 99.5);
52 
53  m_digiBxRPCBar = ibooker.book1D("RPCDigiRPCBmu_noDTmu_bx", "RPC digis bx - RPC, !DT", 9, -4.5, 4.5);
54 
55  m_digiBxRPCEnd = ibooker.book1D("RPCDigiRPCEmu_noCSCmu_bx", "RPC digis bx - RPC, !CSC", 9, -4.5, 4.5);
56 
57  m_digiBxDT = ibooker.book1D("RPCDigiDTmu_noRPCBmu_bx", "RPC digis bx - !RPC, DT", 9, -4.5, 4.5);
58 
59  m_digiBxCSC = ibooker.book1D("RPCDigiCSCmu_noRPCEmu_bx", "RPC digis bx - !RPC, CSC", 9, -4.5, 4.5);
60 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:79
int nev_
Definition: L1TRPCTPG.h:83
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:74
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:76
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:77
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:75
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:78

◆ dqmBeginRun()

void L1TRPCTPG::dqmBeginRun ( edm::Run const &  r,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 38 of file L1TRPCTPG.cc.

38  {
39  //
40 }

Member Data Documentation

◆ logFile_

std::ofstream L1TRPCTPG::logFile_
private

Definition at line 87 of file L1TRPCTPG.h.

◆ m_digiBxCSC

MonitorElement* L1TRPCTPG::m_digiBxCSC
private

Definition at line 79 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ m_digiBxDT

MonitorElement* L1TRPCTPG::m_digiBxDT
private

Definition at line 78 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ m_digiBxRPCBar

MonitorElement* L1TRPCTPG::m_digiBxRPCBar
private

Definition at line 76 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ m_digiBxRPCEnd

MonitorElement* L1TRPCTPG::m_digiBxRPCEnd
private

Definition at line 77 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ monitorDaemon_

bool L1TRPCTPG::monitorDaemon_
private

Definition at line 86 of file L1TRPCTPG.h.

◆ nev_

int L1TRPCTPG::nev_
private

Definition at line 83 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ outputFile_

std::string L1TRPCTPG::outputFile_
private

Definition at line 84 of file L1TRPCTPG.h.

Referenced by L1TRPCTPG().

◆ rpcgeomToken_

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> L1TRPCTPG::rpcgeomToken_
private

Definition at line 92 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().

◆ rpctfSource_

edm::InputTag L1TRPCTPG::rpctfSource_
private

Definition at line 90 of file L1TRPCTPG.h.

Referenced by analyze().

◆ rpctfSource_token_

edm::EDGetTokenT<L1MuGMTReadoutCollection> L1TRPCTPG::rpctfSource_token_
private

Definition at line 91 of file L1TRPCTPG.h.

Referenced by analyze().

◆ rpctpgbx

MonitorElement* L1TRPCTPG::rpctpgbx
private

Definition at line 75 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ rpctpgmeCollection

std::map<uint32_t, std::map<std::string, MonitorElement*> > L1TRPCTPG::rpctpgmeCollection
private

Definition at line 81 of file L1TRPCTPG.h.

◆ rpctpgndigi

MonitorElement* L1TRPCTPG::rpctpgndigi[3]
private

Definition at line 74 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ rpctpgSource_

edm::InputTag L1TRPCTPG::rpctpgSource_
private

Definition at line 88 of file L1TRPCTPG.h.

Referenced by analyze().

◆ rpctpgSource_token_

edm::EDGetTokenT<RPCDigiCollection> L1TRPCTPG::rpctpgSource_token_
private

Definition at line 89 of file L1TRPCTPG.h.

Referenced by analyze().

◆ verbose_

bool L1TRPCTPG::verbose_
private

Definition at line 85 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().