23 m_lastUsedBxInBxdiff(0),
24 output_dir_(ps.getUntrackedParameter<
string>(
"output_dir"))
33 cout <<
"L1TRPCTF: constructor...." << endl;
45 for (
unsigned int i = 0;
i < 12;
i++) {
47 o <<
"RPCTF_crate_" <<
i <<
"_synchro";
49 for (
int bx = -2;
bx < 3; ++
bx) {
58 rpctfetavalue[1] = ibooker.
book1D(
"RPCTF_eta_value_bx0",
"RPCTF eta value bx=0", 33, -16.5, 16.5);
59 rpctfetavalue[2] = ibooker.
book1D(
"RPCTF_eta_value_bx+",
"RPCTF eta value bx>0", 33, -16.5, 16.5);
60 rpctfetavalue[0] = ibooker.
book1D(
"RPCTF_eta_value_bx-",
"RPCTF eta value bx<0", 33, -16.5, 16.5);
62 rpctfphivalue[1] = ibooker.
book1D(
"RPCTF_phi_value_bx0",
"RPCTF phi value bx=0", 144, -0.5, 143.5);
63 rpctfphivalue[2] = ibooker.
book1D(
"RPCTF_phi_value_bx+",
"RPCTF phi value bx>0", 144, -0.5, 143.5);
64 rpctfphivalue[0] = ibooker.
book1D(
"RPCTF_phi_value_bx-",
"RPCTF phi value bx<0", 144, -0.5, 143.5);
66 rpctfptvalue[1] = ibooker.
book1D(
"RPCTF_pt_value_bx0",
"RPCTF pt value bx=0", 160, -0.5, 159.5);
67 rpctfptvalue[2] = ibooker.
book1D(
"RPCTF_pt_value_bx+",
"RPCTF pt value bx>0", 160, -0.5, 159.5);
68 rpctfptvalue[0] = ibooker.
book1D(
"RPCTF_pt_value_bx-",
"RPCTF pt value bx<0", 160, -0.5, 159.5);
75 rpctfquality[2] = ibooker.
book1D(
"RPCTF_quality_bx+",
"RPCTF quality bx>0", 6, -0.5, 5.5);
76 rpctfquality[0] = ibooker.
book1D(
"RPCTF_quality_bx-",
"RPCTF quality bx<0", 6, -0.5, 5.5);
78 rpctfntrack_b[1] = ibooker.
book1D(
"RPCTF_ntrack_brl_bx0",
"RPCTF number of tracks - barrel, bx=0", 5, -0.5, 4.5);
79 rpctfntrack_b[2] = ibooker.
book1D(
"RPCTF_ntrack_brl_bx+",
"RPCTF number of tracks - barrel, bx>0", 5, -0.5, 4.5);
80 rpctfntrack_b[0] = ibooker.
book1D(
"RPCTF_ntrack_brl_bx-",
"RPCTF number of tracks - barrel, bx<0", 5, -0.5, 4.5);
82 rpctfntrack_e[1] = ibooker.
book1D(
"RPCTF_ntrack_fwd_bx0",
"RPCTF number of tracks - endcap, bx=0", 5, -0.5, 4.5);
83 rpctfntrack_e[2] = ibooker.
book1D(
"RPCTF_ntrack_fwd_bx+",
"RPCTF number of tracks - endcap, bx>0", 5, -0.5, 4.5);
84 rpctfntrack_e[0] = ibooker.
book1D(
"RPCTF_ntrack_fwd_bx-",
"RPCTF number of tracks - endcap, bx<0", 5, -0.5, 4.5);
87 "RPCTF quality vs eta, bx=0",
95 "RPCTF quality vs eta, bx>0",
103 "RPCTF quality vs eta, bx<0",
112 ibooker.
book2D(
"RPCTF_muons_eta_phi_bx0",
"RPCTF occupancy(eta,phi), bx=0", 33, -16.5, 16.5, 144, -0.5, 143.5);
114 ibooker.
book2D(
"RPCTF_muons_eta_phi_bx+",
"RPCTF occupancy(eta,phi), bx>0", 33, -16.5, 16.5, 144, -0.5, 143.5);
116 ibooker.
book2D(
"RPCTF_muons_eta_phi_bx-",
"RPCTF occupancy(eta,phi), bx<0", 33, -16.5, 16.5, 144, -0.5, 143.5);
118 rpctfbx = ibooker.
book1D(
"RPCTF_bx",
"RPCTF bx distribiution", 7, -3.5, 3.5);
121 for (
int l = 0;
l < 3; ++
l) {
131 for (
int i = 0;
i < 12; ++
i) {
134 int lBin =
int((30. / 360) *
i * 144) + 1;
135 std::stringstream
ss;
136 ss <<
"phi=" << lPhi;
137 for (
int l = 0;
l < 3; ++
l) {
156 for (
int i = -16;
i < 17; ++
i) {
157 std::stringstream
ss;
159 for (
int l = 0;
l < 3; ++
l) {
166 m_bxDiff = ibooker.
book1D(
"RPCTF_bx_diff",
"RPCTrigger - bx difference", 12000, -.5, 11999.5);
172 cout <<
"L1TRPCTF: analyze...." << endl;
178 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection";
183 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
184 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
186 std::vector<int> nrpctftrack_b(3, 0);
187 std::vector<int> nrpctftrack_e(3, 0);
189 vector<L1TRPCTF::BxDelays> all_bxdelays;
191 for (RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++) {
193 cout <<
"Readout Record " << RRItr->getBxInEvent() << endl;
195 vector<vector<L1MuRegionalCand> > brlAndFwdCands;
196 brlAndFwdCands.push_back(RRItr->getBrlRPCCands());
197 brlAndFwdCands.push_back(RRItr->getFwdRPCCands());
200 vector<vector<L1MuRegionalCand> >::iterator RPCTFCands = brlAndFwdCands.begin();
201 for (; RPCTFCands != brlAndFwdCands.end(); ++RPCTFCands) {
202 for (vector<L1MuRegionalCand>::const_iterator ECItr = RPCTFCands->begin(); ECItr != RPCTFCands->end(); ++ECItr) {
209 if (!ECItr->empty()) {
211 ++nrpctftrack_b[bxindex];
213 ++nrpctftrack_e[bxindex];
216 cout <<
"RPCTFCand bx " << ECItr->bx() << endl;
218 int tower = ECItr->eta_packed();
227 cout <<
"\tRPCTFCand eta value " << ECItr->etaValue() << endl;
231 cout <<
"\tRPCTFCand phi value " << ECItr->phiValue() << endl;
235 cout <<
"\tRPCTFCand pt value " << ECItr->ptValue() << endl;
239 cout <<
"\tRPCTFCand charge value " << ECItr->chargeValue() << endl;
243 cout <<
"\tRPCTFCand quality " << ECItr->quality() << endl;
249 bx_del.
bx = ECItr->bx();
251 bx_del.
phi_p = ECItr->phi_packed();
252 all_bxdelays.push_back(bx_del);
260 for (
int bxI = 0; bxI < 3; ++bxI) {
265 for (
unsigned int i = 0;
i < all_bxdelays.size();
i++) {
266 int sector = ((all_bxdelays[
i].phi_p + 142) % 144) / 12;
269 int eta_tower = all_bxdelays[
i].eta_t;
270 for (
unsigned int j = 0;
j < all_bxdelays.size();
j++) {
273 int sector2 = ((all_bxdelays[
j].phi_p + 142) % 144) / 12;
275 int distance_cut = 1;
281 int bxDiff = all_bxdelays[
i].bx - all_bxdelays[
j].bx;
294 cout <<
"L1TRPCTF: end job...." << endl;
295 LogInfo(
"EndJob") <<
"analyzed " <<
nev_ <<
" events";
std::set< unsigned long long int > m_globBX
MonitorElement * rpctfcratesynchro[12]
MonitorElement * rpctfchargevalue[3]
MonitorElement * rpctfetavalue[3]
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * rpctfptvalue[3]
T const * product() const
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &, const edm::EventSetup &) override
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * rpctfquality[3]
MonitorElement * rpctfphivalue[3]
MonitorElement * m_bxDiff
virtual 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)
MonitorElement * m_muonsEtaPhi[3]
MonitorElement * m_qualVsEta[3]
Log< level::Info, false > LogInfo
L1TRPCTF(const edm::ParameterSet &ps)
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
long long int m_lastUsedBxInBxdiff
MonitorElement * rpctfntrack_e[3]
MonitorElement * rpctfntrack_b[3]
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
edm::EDGetTokenT< L1MuGMTReadoutCollection > rpctfSource_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)