22 : rpctfSource_( ps.getParameter<
InputTag >(
"rpctfSource") ),
26 m_lastUsedBxInBxdiff(0),
27 output_dir_ (ps.getUntrackedParameter<string>(
"output_dir") )
36 if(
verbose_)
cout <<
"L1TRPCTF: constructor...." << endl;
48 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
88 ostringstream oDir; oDir<<
output_dir_ <<
"/CrateSynchroHistograms/";
90 for(
unsigned int i = 0;
i < 12;
i++) {
92 ostringstream
o; o<<
"RPCTF_crate_"<<
i<<
"_synchro";
94 for (
int bx = -2; bx < 3; ++bx){
95 ostringstream
b; b<<
"BX="<<bx;
104 "RPCTF eta value bx=0", 33, -16.5, 16.5 ) ;
106 "RPCTF eta value bx>0", 33, -16.5, 16.5 ) ;
108 "RPCTF eta value bx<0", 33, -16.5, 16.5 ) ;
111 "RPCTF phi value bx=0", 144, -0.5, 143.5) ;
113 "RPCTF phi value bx>0", 144, -0.5, 143.5 ) ;
115 "RPCTF phi value bx<0", 144, -0.5, 143.5 ) ;
120 "RPCTF pt value bx=0", 160, -0.5, 159.5 );
122 "RPCTF pt value bx>0", 160, -0.5, 159.5 );
124 "RPCTF pt value bx<0", 160, -0.5, 159.5 );
128 "RPCTF charge value bx=0", 3, -1.5, 1.5 ) ;
130 "RPCTF charge value bx>0", 3, -1.5, 1.5 ) ;
132 "RPCTF charge value bx<01", 3, -1.5, 1.5 ) ;
135 "RPCTF quality bx=0", 6, -0.5, 5.5 ) ;
137 "RPCTF quality bx>0", 6, -0.5, 5.5 ) ;
139 "RPCTF quality bx<0", 6, -0.5, 5.5 ) ;
142 "RPCTF number of tracks - barrel, bx=0", 5, -0.5, 4.5 ) ;
144 "RPCTF number of tracks - barrel, bx>0", 5, -0.5, 4.5 ) ;
146 "RPCTF number of tracks - barrel, bx<0", 5, -0.5, 4.5 ) ;
151 "RPCTF number of tracks - endcap, bx=0", 5, -0.5, 4.5 ) ;
153 "RPCTF number of tracks - endcap, bx>0", 5, -0.5, 4.5 ) ;
155 "RPCTF number of tracks - endcap, bx<0", 5, -0.5, 4.5 ) ;
162 "RPCTF quality vs eta, bx=0",
166 "RPCTF quality vs eta, bx>0",
170 "RPCTF quality vs eta, bx<0",
177 "RPCTF occupancy(eta,phi), bx=0",
181 "RPCTF occupancy(eta,phi), bx>0",
185 "RPCTF occupancy(eta,phi), bx<0",
190 "RPCTF bx distribiution", 7, -3.5, 3.5 );
193 for (
int l = 0;
l<3; ++
l){
203 for (
int i = 0;
i < 12 ; ++
i ){
206 int lBin = int((30./360)*
i*144)+1;
207 std::stringstream ss;
209 for (
int l = 0;
l<3; ++
l){
229 for (
int i = -16;
i < 17 ; ++
i ){
230 std::stringstream ss;
232 for (
int l = 0;
l<3; ++
l){
242 "RPCTrigger - bx difference", 12000, -.5, 11999.5);
270 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
287 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection with label "
294 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
295 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
297 std::vector<int> nrpctftrack_b(3,0);
298 std::vector<int> nrpctftrack_e(3,0);
300 vector<L1TRPCTF::BxDelays> all_bxdelays;
303 for( RRItr = gmt_records.begin() ;
304 RRItr != gmt_records.end() ;
308 if (
verbose_)
cout <<
"Readout Record " << RRItr->getBxInEvent() << endl;
310 vector<vector<L1MuRegionalCand> > brlAndFwdCands;
311 brlAndFwdCands.push_back(RRItr->getBrlRPCCands());
312 brlAndFwdCands.push_back(RRItr->getFwdRPCCands());
315 vector<vector<L1MuRegionalCand> >::iterator RPCTFCands = brlAndFwdCands.begin();
316 for(; RPCTFCands!= brlAndFwdCands.end(); ++RPCTFCands)
319 for( vector<L1MuRegionalCand>::const_iterator
320 ECItr = RPCTFCands->begin() ;
321 ECItr != RPCTFCands->end() ;
326 if (ECItr->bx() > 0) bxindex = 2;
327 if (ECItr->bx() < 0) bxindex = 0;
329 if (!ECItr->empty()) {
332 if (beIndex == 0) ++nrpctftrack_b[bxindex];
333 if (beIndex == 1) ++nrpctftrack_e[bxindex];
335 if (
verbose_)
cout <<
"RPCTFCand bx " << ECItr->bx() << endl;
337 int tower = ECItr->eta_packed();
339 tower = - ( (~tower & 63) + 1);
345 if (
verbose_)
cout <<
"\tRPCTFCand eta value " << ECItr->etaValue() << endl;
348 if (
verbose_)
cout <<
"\tRPCTFCand phi value " << ECItr->phiValue() << endl;
351 if (
verbose_)
cout <<
"\tRPCTFCand pt value " << ECItr->ptValue()<< endl;
354 if (
verbose_)
cout <<
"\tRPCTFCand charge value " << ECItr->chargeValue() << endl;
357 if (
verbose_)
cout <<
"\tRPCTFCand quality " << ECItr->quality() << endl;
364 bx_del.
bx = ECItr->bx();
365 bx_del.
eta_t = tower;
366 bx_del.
phi_p = ECItr->phi_packed();
367 all_bxdelays.push_back(bx_del);
375 for (
int bxI = 0; bxI < 3; ++bxI){
381 for(
unsigned int i = 0;
i < all_bxdelays.size();
i++) {
383 int sector= ((all_bxdelays[
i].phi_p+ 142)%144)/12;
384 if (sector>11 || sector < 0)
continue;
385 int eta_tower = all_bxdelays[
i].eta_t;
386 for(
unsigned int j = 0;
j < all_bxdelays.size();
j++) {
388 int sector2= ((all_bxdelays[
j].phi_p + 142)%144)/12;
390 int distance_cut = 1;
391 int distance = ((sector+12)-sector2)%12;
392 distance =
min(distance, 11-distance);
393 if(distance<distance_cut)
continue;
395 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]
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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 endRun(const edm::Run &r, const edm::EventSetup &c)
void setVerbose(unsigned level)
MonitorElement * m_bxDiff
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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]
edm::InputTag rpctfSource_
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)