23 m_lastUsedBxInBxdiff(0),
24 output_dir_ (ps.getUntrackedParameter<
string>(
"output_dir") )
33 if(
verbose_)
cout <<
"L1TRPCTF: constructor...." << endl;
45 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
85 ostringstream oDir; oDir<<
output_dir_ <<
"/CrateSynchroHistograms/";
87 for(
unsigned int i = 0;
i < 12;
i++) {
89 ostringstream
o; o<<
"RPCTF_crate_"<<
i<<
"_synchro";
91 for (
int bx = -2; bx < 3; ++bx){
92 ostringstream
b; b<<
"BX="<<bx;
101 "RPCTF eta value bx=0", 33, -16.5, 16.5 ) ;
103 "RPCTF eta value bx>0", 33, -16.5, 16.5 ) ;
105 "RPCTF eta value bx<0", 33, -16.5, 16.5 ) ;
108 "RPCTF phi value bx=0", 144, -0.5, 143.5) ;
110 "RPCTF phi value bx>0", 144, -0.5, 143.5 ) ;
112 "RPCTF phi value bx<0", 144, -0.5, 143.5 ) ;
117 "RPCTF pt value bx=0", 160, -0.5, 159.5 );
119 "RPCTF pt value bx>0", 160, -0.5, 159.5 );
121 "RPCTF pt value bx<0", 160, -0.5, 159.5 );
125 "RPCTF charge value bx=0", 3, -1.5, 1.5 ) ;
127 "RPCTF charge value bx>0", 3, -1.5, 1.5 ) ;
129 "RPCTF charge value bx<01", 3, -1.5, 1.5 ) ;
132 "RPCTF quality bx=0", 6, -0.5, 5.5 ) ;
134 "RPCTF quality bx>0", 6, -0.5, 5.5 ) ;
136 "RPCTF quality bx<0", 6, -0.5, 5.5 ) ;
139 "RPCTF number of tracks - barrel, bx=0", 5, -0.5, 4.5 ) ;
141 "RPCTF number of tracks - barrel, bx>0", 5, -0.5, 4.5 ) ;
143 "RPCTF number of tracks - barrel, bx<0", 5, -0.5, 4.5 ) ;
148 "RPCTF number of tracks - endcap, bx=0", 5, -0.5, 4.5 ) ;
150 "RPCTF number of tracks - endcap, bx>0", 5, -0.5, 4.5 ) ;
152 "RPCTF number of tracks - endcap, bx<0", 5, -0.5, 4.5 ) ;
159 "RPCTF quality vs eta, bx=0",
163 "RPCTF quality vs eta, bx>0",
167 "RPCTF quality vs eta, bx<0",
174 "RPCTF occupancy(eta,phi), bx=0",
178 "RPCTF occupancy(eta,phi), bx>0",
182 "RPCTF occupancy(eta,phi), bx<0",
187 "RPCTF bx distribiution", 7, -3.5, 3.5 );
190 for (
int l = 0;
l<3; ++
l){
200 for (
int i = 0;
i < 12 ; ++
i ){
203 int lBin = int((30./360)*
i*144)+1;
204 std::stringstream ss;
206 for (
int l = 0;
l<3; ++
l){
226 for (
int i = -16;
i < 17 ; ++
i ){
227 std::stringstream ss;
229 for (
int l = 0;
l<3; ++
l){
239 "RPCTrigger - bx difference", 12000, -.5, 11999.5);
267 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
284 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection";
290 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
291 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
293 std::vector<int> nrpctftrack_b(3,0);
294 std::vector<int> nrpctftrack_e(3,0);
296 vector<L1TRPCTF::BxDelays> all_bxdelays;
299 for( RRItr = gmt_records.begin() ;
300 RRItr != gmt_records.end() ;
304 if (
verbose_)
cout <<
"Readout Record " << RRItr->getBxInEvent() << endl;
306 vector<vector<L1MuRegionalCand> > brlAndFwdCands;
307 brlAndFwdCands.push_back(RRItr->getBrlRPCCands());
308 brlAndFwdCands.push_back(RRItr->getFwdRPCCands());
311 vector<vector<L1MuRegionalCand> >::iterator RPCTFCands = brlAndFwdCands.begin();
312 for(; RPCTFCands!= brlAndFwdCands.end(); ++RPCTFCands)
315 for( vector<L1MuRegionalCand>::const_iterator
316 ECItr = RPCTFCands->begin() ;
317 ECItr != RPCTFCands->end() ;
322 if (ECItr->bx() > 0) bxindex = 2;
323 if (ECItr->bx() < 0) bxindex = 0;
325 if (!ECItr->empty()) {
328 if (beIndex == 0) ++nrpctftrack_b[bxindex];
329 if (beIndex == 1) ++nrpctftrack_e[bxindex];
331 if (
verbose_)
cout <<
"RPCTFCand bx " << ECItr->bx() << endl;
333 int tower = ECItr->eta_packed();
335 tower = - ( (~tower & 63) + 1);
341 if (
verbose_)
cout <<
"\tRPCTFCand eta value " << ECItr->etaValue() << endl;
344 if (
verbose_)
cout <<
"\tRPCTFCand phi value " << ECItr->phiValue() << endl;
347 if (
verbose_)
cout <<
"\tRPCTFCand pt value " << ECItr->ptValue()<< endl;
350 if (
verbose_)
cout <<
"\tRPCTFCand charge value " << ECItr->chargeValue() << endl;
353 if (
verbose_)
cout <<
"\tRPCTFCand quality " << ECItr->quality() << endl;
360 bx_del.
bx = ECItr->bx();
361 bx_del.
eta_t = tower;
362 bx_del.
phi_p = ECItr->phi_packed();
363 all_bxdelays.push_back(bx_del);
371 for (
int bxI = 0; bxI < 3; ++bxI){
377 for(
unsigned int i = 0;
i < all_bxdelays.size();
i++) {
379 int sector= ((all_bxdelays[
i].phi_p+ 142)%144)/12;
380 if (sector>11 || sector < 0)
continue;
381 int eta_tower = all_bxdelays[
i].eta_t;
382 for(
unsigned int j = 0;
j < all_bxdelays.size();
j++) {
384 int sector2= ((all_bxdelays[
j].phi_p + 142)%144)/12;
386 int distance_cut = 1;
387 int distance = ((sector+12)-sector2)%12;
388 distance =
min(distance, 11-distance);
389 if(distance<distance_cut)
continue;
391 int bxDiff = all_bxdelays[
i].bx-all_bxdelays[
j].bx;
std::set< unsigned long long int > m_globBX
MonitorElement * rpctfcratesynchro[12]
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * rpctfchargevalue[3]
MonitorElement * rpctfetavalue[3]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void rmdir(const std::string &fullpath)
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)
void analyze(const edm::Event &e, const edm::EventSetup &c)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
MonitorElement * rpctfquality[3]
MonitorElement * rpctfphivalue[3]
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
void endRun(const edm::Run &r, const edm::EventSetup &c)
void setVerbose(unsigned level)
MonitorElement * m_bxDiff
MonitorElement * m_muonsEtaPhi[3]
MonitorElement * m_qualVsEta[3]
L1TRPCTF(const edm::ParameterSet &ps)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
long long int m_lastUsedBxInBxdiff
T const * product() const
MonitorElement * rpctfntrack_e[3]
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * rpctfntrack_b[3]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_