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:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 L1TRPCTPG (const edm::ParameterSet &ps)
 
 ~L1TRPCTPG () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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
 

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_
 

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_.empty() ) {
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:94
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFile_
Definition: L1TRPCTPG.h:89
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_token_
Definition: L1TRPCTPG.h:96
edm::InputTag rpctpgSource_
Definition: L1TRPCTPG.h:93
bool verbose_
Definition: L1TRPCTPG.h:90
edm::InputTag rpctfSource_
Definition: L1TRPCTPG.h:95
L1TRPCTPG::~L1TRPCTPG ( )
override

Definition at line 36 of file L1TRPCTPG.cc.

37 {
38 }

Member Function Documentation

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

RPC Geometry

DIGI

Definition at line 79 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_.

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

Definition at line 46 of file L1TRPCTPG.cc.

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

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

Definition at line 40 of file L1TRPCTPG.cc.

40  {
41  //
42 }

Member Data Documentation

std::ofstream L1TRPCTPG::logFile_
private

Definition at line 92 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::m_digiBxCSC
private

Definition at line 84 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxDT
private

Definition at line 83 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxRPCBar
private

Definition at line 81 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* L1TRPCTPG::m_digiBxRPCEnd
private

Definition at line 82 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

bool L1TRPCTPG::monitorDaemon_
private

Definition at line 91 of file L1TRPCTPG.h.

int L1TRPCTPG::nev_
private

Definition at line 88 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

std::string L1TRPCTPG::outputFile_
private

Definition at line 89 of file L1TRPCTPG.h.

Referenced by L1TRPCTPG().

edm::InputTag L1TRPCTPG::rpctfSource_
private

Definition at line 95 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 96 of file L1TRPCTPG.h.

Referenced by analyze().

MonitorElement* L1TRPCTPG::rpctpgbx
private

Definition at line 80 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

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

Definition at line 86 of file L1TRPCTPG.h.

MonitorElement* L1TRPCTPG::rpctpgndigi[3]
private

Definition at line 79 of file L1TRPCTPG.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag L1TRPCTPG::rpctpgSource_
private

Definition at line 93 of file L1TRPCTPG.h.

Referenced by analyze().

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

Definition at line 94 of file L1TRPCTPG.h.

Referenced by analyze().

bool L1TRPCTPG::verbose_
private

Definition at line 90 of file L1TRPCTPG.h.

Referenced by analyze(), and L1TRPCTPG().