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
 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 (const std::string &iProcessName, std::vector< const char * > &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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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_
 
MonitorElementlumisecId_
 
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_
 
MonitorElementrunId_
 
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
 
- 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:97
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: L1TRPCTPG.h:92
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:99
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:96
bool verbose_
Definition: L1TRPCTPG.h:93
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:98
tuple cout
Definition: gather_cfg.py:121
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 86 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_.

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

45  {
46  //
47  //lumisecId_->Fill(l.id().luminosityBlock());
48 }
void L1TRPCTPG::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 51 of file L1TRPCTPG.cc.

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

52 {
53 
54  nev_ = 0;
55 
56  ibooker.setCurrentFolder("L1T/L1TRPCTPG");
57  runId_=ibooker.bookInt("iRun");
58  lumisecId_=ibooker.bookInt("iLumi");
59 
60  rpctpgbx = ibooker.book1D("RPCTPG_bx",
61  "RPC digis bx - all events", 9, -4.5, 4.5 ) ;
62 
63  rpctpgndigi[1] = ibooker.book1D("RPCTPG_ndigi",
64  "RPCTPG nDigi bx 0", 100, -0.5, 99.5 ) ;
65  rpctpgndigi[2] = ibooker.book1D("RPCTPG_ndigi_+1",
66  "RPCTPG nDigi bx +1", 100, -0.5, 99.5 ) ;
67  rpctpgndigi[0] = ibooker.book1D("RPCTPG_ndigi_-1",
68  "RPCTPG nDigi bx -1", 100, -0.5, 99.5 ) ;
69 
70 
71 
72  m_digiBxRPCBar = ibooker.book1D("RPCDigiRPCBmu_noDTmu_bx",
73  "RPC digis bx - RPC, !DT", 9, -4.5, 4.5 ) ;
74 
75  m_digiBxRPCEnd = ibooker.book1D("RPCDigiRPCEmu_noCSCmu_bx",
76  "RPC digis bx - RPC, !CSC", 9, -4.5, 4.5 ) ;
77 
78  m_digiBxDT = ibooker.book1D("RPCDigiDTmu_noRPCBmu_bx",
79  "RPC digis bx - !RPC, DT", 9, -4.5, 4.5 ) ;
80 
81  m_digiBxCSC = ibooker.book1D("RPCDigiCSCmu_noRPCEmu_bx",
82  "RPC digis bx - !RPC, CSC", 9, -4.5, 4.5 ) ;
83 }
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
MonitorElement * m_digiBxCSC
Definition: L1TRPCTPG.h:85
int nev_
Definition: L1TRPCTPG.h:91
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * runId_
Definition: L1TRPCTPG.h:86
MonitorElement * rpctpgndigi[3]
Definition: L1TRPCTPG.h:80
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * m_digiBxRPCBar
Definition: L1TRPCTPG.h:82
MonitorElement * m_digiBxRPCEnd
Definition: L1TRPCTPG.h:83
MonitorElement * lumisecId_
Definition: L1TRPCTPG.h:87
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  //runId_->Fill(r.id().run());
43 }

Member Data Documentation

std::ofstream L1TRPCTPG::logFile_
private

Definition at line 95 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::lumisecId_
private

Definition at line 87 of file L1TRPCTPG.h.

Referenced by bookHistograms().

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 94 of file L1TRPCTPG.h.

int L1TRPCTPG::nev_
private

Definition at line 91 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

std::string L1TRPCTPG::outputFile_
private

Definition at line 92 of file L1TRPCTPG.h.

Referenced by L1TRPCTPG().

edm::InputTag L1TRPCTPG::rpctfSource_
private

Definition at line 98 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 99 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 89 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 96 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 97 of file L1TRPCTPG.h.

Referenced by analyze().

MonitorElement* L1TRPCTPG::runId_
private

Definition at line 86 of file L1TRPCTPG.h.

Referenced by bookHistograms().

bool L1TRPCTPG::verbose_
private

Definition at line 93 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().