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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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)
 

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 edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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)
 

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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Data Format.

Geometry

Definition at line 56 of file L1TRPCTPG.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file L1TRPCTPG.cc.

References gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), outputFile_, 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  }
33 }
T getParameter(std::string const &) const
edm::EDGetTokenT< RPCDigiCollection > rpctpgSource_token_
Definition: L1TRPCTPG.h:90
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: L1TRPCTPG.h:85
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:92
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:89
bool verbose_
Definition: L1TRPCTPG.h:86
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:91
L1TRPCTPG::~L1TRPCTPG ( )
override

Definition at line 35 of file L1TRPCTPG.cc.

35 {}

Member Function Documentation

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

RPC Geometry

DIGI

Definition at line 61 of file L1TRPCTPG.cc.

References l1GtPatternGenerator_cfi::bx, gather_cfg::cout, dqm::impl::MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), 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_.

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) {
153  m_digiBxRPCBar->Fill(bx);
154  }
155 
156  if (nRPCTrackEndcap == 0 && nCSCTrack != 0) {
157  m_digiBxCSC->Fill(bx);
158  } else if (nRPCTrackEndcap != 0 && nCSCTrack == 0) {
159  m_digiBxRPCEnd->Fill(bx);
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:90
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:80
void Fill(long long x)
U second(std::pair< T, U > const &p)
int nev_
Definition: L1TRPCTPG.h:84
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:75
T const * product() const
Definition: Handle.h:69
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:92
std::vector< RPCDigi >::const_iterator const_iterator
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:89
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:77
bool verbose_
Definition: L1TRPCTPG.h:86
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:78
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
T get() const
Definition: EventSetup.h:73
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:91
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:76
bool isValid() const
Definition: ESHandle.h:44
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:79
void L1TRPCTPG::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 41 of file L1TRPCTPG.cc.

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

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 }
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:80
int nev_
Definition: L1TRPCTPG.h:84
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:75
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:77
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:78
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:76
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:79
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

std::ofstream L1TRPCTPG::logFile_
private

Definition at line 88 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::m_digiBxCSC
private

Definition at line 80 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxDT
private

Definition at line 79 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxRPCBar
private

Definition at line 77 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxRPCEnd
private

Definition at line 78 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

bool L1TRPCTPG::monitorDaemon_
private

Definition at line 87 of file L1TRPCTPG.h.

int L1TRPCTPG::nev_
private

Definition at line 84 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

std::string L1TRPCTPG::outputFile_
private

Definition at line 85 of file L1TRPCTPG.h.

Referenced by L1TRPCTPG().

edm::InputTag L1TRPCTPG::rpctfSource_
private

Definition at line 91 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 92 of file L1TRPCTPG.h.

Referenced by analyze().

MonitorElement* L1TRPCTPG::rpctpgbx
private

Definition at line 76 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 82 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::rpctpgndigi[3]
private

Definition at line 75 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag L1TRPCTPG::rpctpgSource_
private

Definition at line 89 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 90 of file L1TRPCTPG.h.

Referenced by analyze().

bool L1TRPCTPG::verbose_
private

Definition at line 86 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().