CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TRPCTPG (const edm::ParameterSet &ps)
 
virtual ~L1TRPCTPG ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- 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 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
< L1MuGMTReadoutCollection
rpctfSource_token_
 
MonitorElementrpctpgbx
 
std::map< uint32_t, std::map
< std::string, MonitorElement * > > 
rpctpgmeCollection
 
MonitorElementrpctpgndigi [3]
 
edm::InputTag rpctpgSource_
 
edm::EDGetTokenT
< RPCDigiCollection
rpctpgSource_token_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Data Format.

Geometry

Definition at line 58 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 {
19 
20  // verbosity switch
21  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
22 
23  if(verbose_) cout << "L1TRPCTPG: constructor...." << endl;
24 
25  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
26  if ( outputFile_.size() != 0 ) {
27  cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
28  }
29 
30  bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
31  if(disable){
32  outputFile_="";
33  }
34 }
T getParameter(std::string const &) const
edm::EDGetTokenT< RPCDigiCollection > rpctpgSource_token_
Definition: L1TRPCTPG.h:95
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: L1TRPCTPG.h:90
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:97
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:94
bool verbose_
Definition: L1TRPCTPG.h:91
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:96
tuple cout
Definition: gather_cfg.py:145
L1TRPCTPG::~L1TRPCTPG ( )
virtual

Definition at line 36 of file L1TRPCTPG.cc.

37 {
38 }

Member Function Documentation

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

RPC Geometry

DIGI

Implements edm::stream::EDAnalyzerBase.

Definition at line 82 of file L1TRPCTPG.cc.

References gather_cfg::cout, 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_.

83 {
84  nev_++;
85  if(verbose_) cout << "L1TRPCTPG: analyze...." << endl;
86 
87 
90  c.get<MuonGeometryRecord>().get(rpcGeo);
91  if (!rpcGeo.isValid()) {
92  edm::LogInfo("DataNotFound") << "can't find RPCGeometry" << endl;
93  return;
94  }
95 // char layerLabel[328];
96 // char meId [328];
97 
98 
101  e.getByToken(rpctpgSource_token_,rpcdigis);
102 
103  if (!rpcdigis.isValid()) {
104  edm::LogInfo("DataNotFound") << "can't find RPCDigiCollection with label "<< rpctpgSource_ << endl;
105  return;
106  }
107 
108  // Calculate the number of DT and CSC cands present
110  e.getByToken(rpctfSource_token_,pCollection);
111 
112  if (!pCollection.isValid()) {
113  edm::LogInfo("DataNotFound") << "can't find L1MuGMTReadoutCollection with label "
114  << rpctfSource_.label() ;
115  return;
116  }
117 
118  L1MuGMTReadoutCollection const* gmtrc = pCollection.product();
119  vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
120  vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
121 
122  int nRPCTrackBarrel, nRPCTrackEndcap , nDTTrack, nCSCTrack;
123  nRPCTrackBarrel = 0;
124  nRPCTrackEndcap = 0;
125  nDTTrack = 0;
126  nCSCTrack = 0;
127 
128  for( RRItr = gmt_records.begin() ;
129  RRItr != gmt_records.end() ;
130  RRItr++ )
131  {
132  // DTs
133  vector<L1MuRegionalCand> DTCands = RRItr->getDTBXCands();
134  for( vector<L1MuRegionalCand>::const_iterator
135  ECItr = DTCands.begin() ;
136  ECItr != DTCands.end() ;
137  ++ECItr )
138  {
139  if (!ECItr->empty()) { ++nDTTrack; }
140  }
141  // CSCs
142  vector<L1MuRegionalCand> CSCCands = RRItr->getCSCCands();
143  for( vector<L1MuRegionalCand>::const_iterator
144  ECItr = CSCCands.begin() ;
145  ECItr != CSCCands.end() ;
146  ++ECItr )
147  {
148  if (!ECItr->empty()) { ++nCSCTrack; }
149  }
150 
151  //RPC barrel
152  vector<L1MuRegionalCand> RPCBCands = RRItr->getBrlRPCCands();
153  for( vector<L1MuRegionalCand>::const_iterator
154  ECItr = RPCBCands.begin() ;
155  ECItr != RPCBCands.end() ;
156  ++ECItr )
157  {
158  if (!ECItr->empty()) { ++nRPCTrackBarrel; }
159  }
160 
161  //RPC endcap
162  vector<L1MuRegionalCand> RPCECands = RRItr->getFwdRPCCands();
163  for( vector<L1MuRegionalCand>::const_iterator
164  ECItr = RPCECands.begin() ;
165  ECItr != RPCECands.end() ;
166  ++ECItr )
167  {
168  if (!ECItr->empty()) { ++nRPCTrackEndcap; }
169  }
170  }
171 
172  int numberofDigi[3] = {0,0,0};
173 
174 
176  for(collectionItr=rpcdigis->begin(); collectionItr!=rpcdigis->end(); ++collectionItr){
177 
179  for (digiItr = ((*collectionItr ).second).first;
180  digiItr!=((*collectionItr).second).second; ++digiItr){
181 
182  // strips is a list of hit strips (regardless of bx) for this roll
183 // int strip= (*digiItr).strip();
184 // strips.push_back(strip);
185  int bx=(*digiItr).bx();
186  rpctpgbx->Fill(bx);
187  //
188 
189  if ( nRPCTrackBarrel == 0 && nDTTrack != 0) {
190  m_digiBxDT->Fill(bx);
191  } else if ( nRPCTrackBarrel != 0 && nDTTrack == 0) {
192  m_digiBxRPCBar->Fill(bx);
193  }
194 
195  if ( nRPCTrackEndcap == 0 && nCSCTrack != 0) {
196  m_digiBxCSC->Fill(bx);
197  } else if ( nRPCTrackEndcap != 0 && nCSCTrack == 0) {
198  m_digiBxRPCEnd->Fill(bx);
199  }
200 
201 
202 
203 
204 
205  if (bx == -1)
206  {
207  numberofDigi[0]++;
208  }
209  if (bx == 0)
210  {
211 // sprintf(meId,"Occupancy_%s",detUnitLabel);
212 // meMap[meId]->Fill(strip);
213  numberofDigi[1]++;
214  }
215  if (bx == 2)
216  {
217  numberofDigi[2]++;
218  }
219 
220 // sprintf(meId,"BXN_%s",detUnitLabel);
221 // meMap[meId]->Fill(bx);
222 // sprintf(meId,"BXN_vs_strip_%s",detUnitLabel);
223 // meMap[meId]->Fill(strip,bx);
224 
225  }
226  }
227 
228  rpctpgndigi[0]->Fill(numberofDigi[0]);
229  rpctpgndigi[1]->Fill(numberofDigi[1]);
230  rpctpgndigi[2]->Fill(numberofDigi[2]);
231 
232 
233  if(verbose_) cout << "L1TRPCTPG: end job...." << endl;
234  LogInfo("EndJob") << "analyzed " << nev_ << " events";
235 }
edm::EDGetTokenT< RPCDigiCollection > rpctpgSource_token_
Definition: L1TRPCTPG.h:95
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:85
void Fill(long long x)
U second(std::pair< T, U > const &p)
int nev_
Definition: L1TRPCTPG.h:89
bool isValid() const
Definition: HandleBase.h:75
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:80
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:97
std::vector< RPCDigi >::const_iterator const_iterator
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:94
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:82
bool verbose_
Definition: L1TRPCTPG.h:91
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:83
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:96
tuple cout
Definition: gather_cfg.py:145
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:81
bool isValid() const
Definition: ESHandle.h:47
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:84
void L1TRPCTPG::beginLuminosityBlock ( edm::LuminosityBlock const &  l,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 44 of file L1TRPCTPG.cc.

44  {
45  //
46 }
void L1TRPCTPG::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 49 of file L1TRPCTPG.cc.

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

50 {
51 
52  nev_ = 0;
53 
54  ibooker.setCurrentFolder("L1T/L1TRPCTPG");
55 
56  rpctpgbx = ibooker.book1D("RPCTPG_bx",
57  "RPC digis bx - all events", 9, -4.5, 4.5 ) ;
58 
59  rpctpgndigi[1] = ibooker.book1D("RPCTPG_ndigi",
60  "RPCTPG nDigi bx 0", 100, -0.5, 99.5 ) ;
61  rpctpgndigi[2] = ibooker.book1D("RPCTPG_ndigi_+1",
62  "RPCTPG nDigi bx +1", 100, -0.5, 99.5 ) ;
63  rpctpgndigi[0] = ibooker.book1D("RPCTPG_ndigi_-1",
64  "RPCTPG nDigi bx -1", 100, -0.5, 99.5 ) ;
65 
66 
67 
68  m_digiBxRPCBar = ibooker.book1D("RPCDigiRPCBmu_noDTmu_bx",
69  "RPC digis bx - RPC, !DT", 9, -4.5, 4.5 ) ;
70 
71  m_digiBxRPCEnd = ibooker.book1D("RPCDigiRPCEmu_noCSCmu_bx",
72  "RPC digis bx - RPC, !CSC", 9, -4.5, 4.5 ) ;
73 
74  m_digiBxDT = ibooker.book1D("RPCDigiDTmu_noRPCBmu_bx",
75  "RPC digis bx - !RPC, DT", 9, -4.5, 4.5 ) ;
76 
77  m_digiBxCSC = ibooker.book1D("RPCDigiCSCmu_noRPCEmu_bx",
78  "RPC digis bx - !RPC, CSC", 9, -4.5, 4.5 ) ;
79 }
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:85
int nev_
Definition: L1TRPCTPG.h:89
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:80
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:82
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:83
MonitorElement * rpctpgbx
Definition: L1TRPCTPG.h:81
MonitorElement * m_digiBxDT
Definition: L1TRPCTPG.h:84
void L1TRPCTPG::dqmBeginRun ( edm::Run const &  r,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 40 of file L1TRPCTPG.cc.

40  {
41  //
42 }

Member Data Documentation

std::ofstream L1TRPCTPG::logFile_
private

Definition at line 93 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::m_digiBxCSC
private

Definition at line 85 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxDT
private

Definition at line 84 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxRPCBar
private

Definition at line 82 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxRPCEnd
private

Definition at line 83 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

bool L1TRPCTPG::monitorDaemon_
private

Definition at line 92 of file L1TRPCTPG.h.

int L1TRPCTPG::nev_
private

Definition at line 89 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

std::string L1TRPCTPG::outputFile_
private

Definition at line 90 of file L1TRPCTPG.h.

Referenced by L1TRPCTPG().

edm::InputTag L1TRPCTPG::rpctfSource_
private

Definition at line 96 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 97 of file L1TRPCTPG.h.

Referenced by analyze().

MonitorElement* L1TRPCTPG::rpctpgbx
private

Definition at line 81 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 87 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::rpctpgndigi[3]
private

Definition at line 80 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag L1TRPCTPG::rpctpgSource_
private

Definition at line 94 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 95 of file L1TRPCTPG.h.

Referenced by analyze().

bool L1TRPCTPG::verbose_
private

Definition at line 91 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().