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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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::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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 56 of file L1TRPCTPG.h.

Constructor & Destructor Documentation

◆ L1TRPCTPG()

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

Definition at line 13 of file L1TRPCTPG.cc.

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  }
33 }

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

◆ ~L1TRPCTPG()

L1TRPCTPG::~L1TRPCTPG ( )
override

Definition at line 35 of file L1TRPCTPG.cc.

35 {}

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 61 of file L1TRPCTPG.cc.

61  {
62  nev_++;
63  if (verbose_)
64  cout << "L1TRPCTPG: analyze...." << endl;
65 
68  c.get<MuonGeometryRecord>().get(rpcGeo);
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 }

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

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 41 of file L1TRPCTPG.cc.

41  {
42  nev_ = 0;
43 
44  ibooker.setCurrentFolder("L1T/L1TRPCTPG");
45 
46  rpctpgbx = ibooker.book1D("RPCTPG_bx", "RPC digis bx - all events", 9, -4.5, 4.5);
47 
48  rpctpgndigi[1] = ibooker.book1D("RPCTPG_ndigi", "RPCTPG nDigi bx 0", 100, -0.5, 99.5);
49  rpctpgndigi[2] = ibooker.book1D("RPCTPG_ndigi_+1", "RPCTPG nDigi bx +1", 100, -0.5, 99.5);
50  rpctpgndigi[0] = ibooker.book1D("RPCTPG_ndigi_-1", "RPCTPG nDigi bx -1", 100, -0.5, 99.5);
51 
52  m_digiBxRPCBar = ibooker.book1D("RPCDigiRPCBmu_noDTmu_bx", "RPC digis bx - RPC, !DT", 9, -4.5, 4.5);
53 
54  m_digiBxRPCEnd = ibooker.book1D("RPCDigiRPCEmu_noCSCmu_bx", "RPC digis bx - RPC, !CSC", 9, -4.5, 4.5);
55 
56  m_digiBxDT = ibooker.book1D("RPCDigiDTmu_noRPCBmu_bx", "RPC digis bx - !RPC, DT", 9, -4.5, 4.5);
57 
58  m_digiBxCSC = ibooker.book1D("RPCDigiCSCmu_noRPCEmu_bx", "RPC digis bx - !RPC, CSC", 9, -4.5, 4.5);
59 }

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

◆ dqmBeginRun()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 37 of file L1TRPCTPG.cc.

37  {
38  //
39 }

Member Data Documentation

◆ logFile_

std::ofstream L1TRPCTPG::logFile_
private

Definition at line 88 of file L1TRPCTPG.h.

◆ m_digiBxCSC

MonitorElement* L1TRPCTPG::m_digiBxCSC
private

Definition at line 80 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ m_digiBxDT

MonitorElement* L1TRPCTPG::m_digiBxDT
private

Definition at line 79 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ m_digiBxRPCBar

MonitorElement* L1TRPCTPG::m_digiBxRPCBar
private

Definition at line 77 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ m_digiBxRPCEnd

MonitorElement* L1TRPCTPG::m_digiBxRPCEnd
private

Definition at line 78 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ monitorDaemon_

bool L1TRPCTPG::monitorDaemon_
private

Definition at line 87 of file L1TRPCTPG.h.

◆ nev_

int L1TRPCTPG::nev_
private

Definition at line 84 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ outputFile_

std::string L1TRPCTPG::outputFile_
private

Definition at line 85 of file L1TRPCTPG.h.

Referenced by L1TRPCTPG().

◆ rpctfSource_

edm::InputTag L1TRPCTPG::rpctfSource_
private

Definition at line 91 of file L1TRPCTPG.h.

Referenced by analyze().

◆ rpctfSource_token_

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

Definition at line 92 of file L1TRPCTPG.h.

Referenced by analyze().

◆ rpctpgbx

MonitorElement* L1TRPCTPG::rpctpgbx
private

Definition at line 76 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 82 of file L1TRPCTPG.h.

◆ rpctpgndigi

MonitorElement* L1TRPCTPG::rpctpgndigi[3]
private

Definition at line 75 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

◆ rpctpgSource_

edm::InputTag L1TRPCTPG::rpctpgSource_
private

Definition at line 89 of file L1TRPCTPG.h.

Referenced by analyze().

◆ rpctpgSource_token_

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

Definition at line 90 of file L1TRPCTPG.h.

Referenced by analyze().

◆ verbose_

bool L1TRPCTPG::verbose_
private

Definition at line 86 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().

L1TRPCTPG::rpctpgSource_token_
edm::EDGetTokenT< RPCDigiCollection > rpctpgSource_token_
Definition: L1TRPCTPG.h:90
L1TRPCTPG::outputFile_
std::string outputFile_
Definition: L1TRPCTPG.h:85
L1TRPCTPG::rpctpgbx
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:76
L1TRPCTPG::m_digiBxCSC
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:80
edm::Handle::product
T const * product() const
Definition: Handle.h:70
gather_cfg.cout
cout
Definition: gather_cfg.py:144
L1TRPCTPG::verbose_
bool verbose_
Definition: L1TRPCTPG.h:86
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
L1TRPCTPG::m_digiBxDT
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:79
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< RPCDigiCollection >
MuonDigiCollection< RPCDetId, RPCDigi >::const_iterator
std::vector< RPCDigi >::const_iterator const_iterator
Definition: MuonDigiCollection.h:94
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
L1TRPCTPG::m_digiBxRPCBar
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:77
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ESHandle< RPCGeometry >
L1MuGMTReadoutCollection::getRecords
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
Definition: L1MuGMTReadoutCollection.h:52
L1TRPCTPG::rpctpgndigi
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:75
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
L1MuGMTReadoutCollection
Definition: L1MuGMTReadoutCollection.h:39
L1TRPCTPG::nev_
int nev_
Definition: L1TRPCTPG.h:84
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
L1TRPCTPG::rpctfSource_
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:91
L1TRPCTPG::rpctfSource_token_
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:92
L1TRPCTPG::rpctpgSource_
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:89
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DigiContainerIterator
Definition: MuonDigiCollection.h:30
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
L1TRPCTPG::m_digiBxRPCEnd
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:78
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37