23 m_lastUsedBxInBxdiff(0),
24 output_dir_ (ps.getUntrackedParameter<
string>(
"output_dir") )
33 if(
verbose_)
cout <<
"L1TRPCTF: constructor...." << endl;
37 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
58 ostringstream oDir; oDir<<
output_dir_ <<
"/CrateSynchroHistograms/";
60 for(
unsigned int i = 0;
i < 12;
i++) {
62 ostringstream
o; o<<
"RPCTF_crate_"<<
i<<
"_synchro";
64 for (
int bx = -2; bx < 3; ++bx){
65 ostringstream
b; b<<
"BX="<<bx;
74 "RPCTF eta value bx=0", 33, -16.5, 16.5 ) ;
76 "RPCTF eta value bx>0", 33, -16.5, 16.5 ) ;
78 "RPCTF eta value bx<0", 33, -16.5, 16.5 ) ;
81 "RPCTF phi value bx=0", 144, -0.5, 143.5) ;
83 "RPCTF phi value bx>0", 144, -0.5, 143.5 ) ;
85 "RPCTF phi value bx<0", 144, -0.5, 143.5 ) ;
90 "RPCTF pt value bx=0", 160, -0.5, 159.5 );
92 "RPCTF pt value bx>0", 160, -0.5, 159.5 );
94 "RPCTF pt value bx<0", 160, -0.5, 159.5 );
98 "RPCTF charge value bx=0", 3, -1.5, 1.5 ) ;
100 "RPCTF charge value bx>0", 3, -1.5, 1.5 ) ;
102 "RPCTF charge value bx<01", 3, -1.5, 1.5 ) ;
105 "RPCTF quality bx=0", 6, -0.5, 5.5 ) ;
107 "RPCTF quality bx>0", 6, -0.5, 5.5 ) ;
109 "RPCTF quality bx<0", 6, -0.5, 5.5 ) ;
112 "RPCTF number of tracks - barrel, bx=0", 5, -0.5, 4.5 ) ;
114 "RPCTF number of tracks - barrel, bx>0", 5, -0.5, 4.5 ) ;
116 "RPCTF number of tracks - barrel, bx<0", 5, -0.5, 4.5 ) ;
121 "RPCTF number of tracks - endcap, bx=0", 5, -0.5, 4.5 ) ;
123 "RPCTF number of tracks - endcap, bx>0", 5, -0.5, 4.5 ) ;
125 "RPCTF number of tracks - endcap, bx<0", 5, -0.5, 4.5 ) ;
132 "RPCTF quality vs eta, bx=0",
136 "RPCTF quality vs eta, bx>0",
140 "RPCTF quality vs eta, bx<0",
147 "RPCTF occupancy(eta,phi), bx=0",
151 "RPCTF occupancy(eta,phi), bx>0",
155 "RPCTF occupancy(eta,phi), bx<0",
160 "RPCTF bx distribiution", 7, -3.5, 3.5 );
163 for (
int l = 0;
l<3; ++
l){
173 for (
int i = 0;
i < 12 ; ++
i ){
176 int lBin = int((30./360)*
i*144)+1;
177 std::stringstream
ss;
179 for (
int l = 0;
l<3; ++
l){
199 for (
int i = -16;
i < 17 ; ++
i ){
200 std::stringstream
ss;
202 for (
int l = 0;
l<3; ++
l){
212 "RPCTrigger - bx difference", 12000, -.5, 11999.5);
225 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection";
231 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
232 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
234 std::vector<int> nrpctftrack_b(3,0);
235 std::vector<int> nrpctftrack_e(3,0);
237 vector<L1TRPCTF::BxDelays> all_bxdelays;
240 for( RRItr = gmt_records.begin() ;
241 RRItr != gmt_records.end() ;
245 if (
verbose_)
cout <<
"Readout Record " << RRItr->getBxInEvent() << endl;
247 vector<vector<L1MuRegionalCand> > brlAndFwdCands;
248 brlAndFwdCands.push_back(RRItr->getBrlRPCCands());
249 brlAndFwdCands.push_back(RRItr->getFwdRPCCands());
252 vector<vector<L1MuRegionalCand> >::iterator RPCTFCands = brlAndFwdCands.begin();
253 for(; RPCTFCands!= brlAndFwdCands.end(); ++RPCTFCands)
256 for( vector<L1MuRegionalCand>::const_iterator
257 ECItr = RPCTFCands->begin() ;
258 ECItr != RPCTFCands->end() ;
263 if (ECItr->bx() > 0) bxindex = 2;
264 if (ECItr->bx() < 0) bxindex = 0;
266 if (!ECItr->empty()) {
269 if (beIndex == 0) ++nrpctftrack_b[bxindex];
270 if (beIndex == 1) ++nrpctftrack_e[bxindex];
272 if (
verbose_)
cout <<
"RPCTFCand bx " << ECItr->bx() << endl;
274 int tower = ECItr->eta_packed();
276 tower = - ( (~tower & 63) + 1);
282 if (
verbose_)
cout <<
"\tRPCTFCand eta value " << ECItr->etaValue() << endl;
285 if (
verbose_)
cout <<
"\tRPCTFCand phi value " << ECItr->phiValue() << endl;
288 if (
verbose_)
cout <<
"\tRPCTFCand pt value " << ECItr->ptValue()<< endl;
291 if (
verbose_)
cout <<
"\tRPCTFCand charge value " << ECItr->chargeValue() << endl;
294 if (
verbose_)
cout <<
"\tRPCTFCand quality " << ECItr->quality() << endl;
301 bx_del.
bx = ECItr->bx();
302 bx_del.
eta_t = tower;
303 bx_del.
phi_p = ECItr->phi_packed();
304 all_bxdelays.push_back(bx_del);
312 for (
int bxI = 0; bxI < 3; ++bxI){
318 for(
unsigned int i = 0;
i < all_bxdelays.size();
i++) {
320 int sector= ((all_bxdelays[
i].phi_p+ 142)%144)/12;
321 if (sector>11 || sector < 0)
continue;
322 int eta_tower = all_bxdelays[
i].eta_t;
323 for(
unsigned int j = 0;
j < all_bxdelays.size();
j++) {
325 int sector2= ((all_bxdelays[
j].phi_p + 142)%144)/12;
327 int distance_cut = 1;
328 int distance = ((sector+12)-sector2)%12;
329 distance =
min(distance, 11-distance);
330 if(distance<distance_cut)
continue;
332 int bxDiff = all_bxdelays[
i].bx-all_bxdelays[
j].bx;
346 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
std::set< unsigned long long int > m_globBX
void endLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c) override
MonitorElement * rpctfcratesynchro[12]
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * rpctfchargevalue[3]
MonitorElement * rpctfetavalue[3]
MonitorElement * rpctfptvalue[3]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
virtual void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
MonitorElement * rpctfquality[3]
MonitorElement * rpctfphivalue[3]
MonitorElement * book1D(Args &&...args)
MonitorElement * m_bxDiff
MonitorElement * m_muonsEtaPhi[3]
MonitorElement * m_qualVsEta[3]
L1TRPCTF(const edm::ParameterSet &ps)
void setCurrentFolder(const std::string &fullpath)
T const * product() const
MonitorElement * book2D(Args &&...args)
long long int m_lastUsedBxInBxdiff
MonitorElement * rpctfntrack_e[3]
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * rpctfntrack_b[3]
virtual void beginLuminosityBlock(const edm::LuminosityBlock &l, const edm::EventSetup &c) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_