37 setConfig(ps,
"DTTriggerEfficiency");
38 baseFolderTM =
"DT/03-LocalTrigger-TM/";
53 Bookings(ibooker, igetter);
56 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
58 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw) {
61 if (globalEffDistr.find(
fullName(
"TrigEffPhi")) == globalEffDistr.end()) {
65 for (
int wh = -2; wh <= 2; ++wh) {
66 TH2F* TrigEffDenum = getHisto<TH2F>(igetter.
get(getMEName(
"TrigEffDenum",
"Task", wh)));
67 TH2F* TrigEffNum = getHisto<TH2F>(igetter.
get(getMEName(
"TrigEffNum",
"Task", wh)));
68 TH2F* TrigEffCorrNum = getHisto<TH2F>(igetter.
get(getMEName(
"TrigEffCorrNum",
"Task", wh)));
70 if (TrigEffDenum && TrigEffNum && TrigEffCorrNum && TrigEffDenum->GetEntries() > 1) {
71 if (whME[wh].
find(
fullName(
"TrigEffPhi")) == whME[wh].end()) {
72 bookWheelHistos(ibooker, wh,
"TrigEffPhi",
"");
73 bookWheelHistos(ibooker, wh,
"TrigEffCorrPhi",
"");
85 makeEfficiencyME(TrigEffNum, TrigEffDenum, Eff2DWh_TrigEffPhi, Eff1DWh_TrigEffPhi, Eff1DAll_TrigEffPhi);
87 TrigEffCorrNum, TrigEffDenum, Eff2DWh_TrigEffCorrPhi, Eff1DWh_TrigEffCorrPhi, Eff1DAll_TrigEffCorrPhi);
92 for (
int sect = 1; sect <= 12; ++sect) {
94 uint32_t indexCh = chId.
rawId();
98 TH2F* TrackPosvsAngle = getHisto<TH2F>(igetter.
get(getMEName(
"TrackPosvsAngle",
"Segment", chId)));
99 TH2F* TrackPosvsAngleAnyQual =
100 getHisto<TH2F>(igetter.
get(getMEName(
"TrackPosvsAngleAnyQual",
"Segment", chId)));
101 TH2F* TrackPosvsAngleCorr =
102 getHisto<TH2F>(igetter.
get(getMEName(
"TrackPosvsAngleCorr",
"Segment", chId)));
104 if (TrackPosvsAngle && TrackPosvsAngleAnyQual && TrackPosvsAngleCorr &&
105 TrackPosvsAngle->GetEntries() > 1) {
106 if (chambME[indexCh].
find(
fullName(
"TrigEffAnglePhi")) == chambME[indexCh].end()) {
107 bookChambHistos(ibooker, chId,
"TrigEffPosvsAnglePhi",
"Segment");
108 bookChambHistos(ibooker, chId,
"TrigEffPosvsAngleCorrPhi",
"Segment");
111 std::map<std::string, MonitorElement*>* innerME = &(chambME[indexCh]);
113 TrackPosvsAngleAnyQual, TrackPosvsAngle, innerME->find(
fullName(
"TrigEffPosvsAnglePhi"))->second);
115 TrackPosvsAngleCorr, TrackPosvsAngle, innerME->find(
fullName(
"TrigEffPosvsAngleCorrPhi"))->second);
135 for (
int binx = 1; binx <=
nbinsx; ++binx) {
136 for (
int biny = 1; biny <=
nbinsy; ++biny) {
138 float bineff =
efficiency->GetBinContent(binx, biny);
140 result1DWh->
Fill(bineff);
141 result1D->
Fill(bineff);
161 for (
int binx = 1; binx <=
nbinsx; ++binx) {
162 for (
int biny = 1; biny <=
nbinsy; ++biny) {
164 float bineff =
efficiency->GetBinContent(binx, biny);
200 string hname = fullTag +
"_All";
202 globalEffDistr[fullTag] = ibooker.
book1D(hname.c_str(), hname.c_str(), 51, 0., 1.02);
210 if (hTag.find(
"Summary") != string::npos) {
213 basedir = topFolder() +
"Wheel" + wh.str() +
"/";
222 string hname = fullTag +
"_W" + wh.str();
224 string hnameAll = fullTag +
"_All_W" + wh.str();
228 (EffDistrPerWh[
wheel])[fullTag] = ibooker.
book1D(hnameAll.c_str(), hnameAll.c_str(), 51, 0., 1.02);
230 if (hTag.find(
"Phi") != string::npos || hTag.find(
"Summary") != string::npos) {
234 me->setBinLabel(1,
"MB1", 2);
235 me->setBinLabel(2,
"MB2", 2);
236 me->setBinLabel(3,
"MB3", 2);
237 me->setBinLabel(4,
"MB4", 2);
238 me->setAxisTitle(
"Sector", 1);
244 if (hTag.find(
"Theta") != string::npos) {
248 me->setBinLabel(1,
"MB1", 2);
249 me->setBinLabel(2,
"MB2", 2);
250 me->setBinLabel(3,
"MB3", 2);
251 me->setAxisTitle(
"Sector", 1);
278 uint32_t indexChId = chambId.
rawId();
281 trigGeomUtils->phiRange(chambId,
min,
max,
nbins, 20);
282 if (htype.find(
"TrigEffPosvsAnglePhi") == 0) {
283 chambME[indexChId][fullType] = ibooker.
book2D(
284 HistoName.c_str(),
"Trigger efficiency (any qual.) position vs angle (Phi)", 12, -30., 30.,
nbins,
min,
max);
287 if (htype.find(
"TrigEffPosvsAngleCorrPhi") == 0) {
288 chambME[indexChId][fullType] = ibooker.
book2D(
289 HistoName.c_str(),
"Trigger efficiency (correlated) pos vs angle (Phi)", 12, -30., 30.,
nbins,
min,
max);
295 vector<string>::const_iterator iTr = trigSources.begin();
296 vector<string>::const_iterator trEnd = trigSources.end();
297 vector<string>::const_iterator iHw =
hwSources.begin();
298 vector<string>::const_iterator hwEnd =
hwSources.end();
301 if (
parameters.getUntrackedParameter<
bool>(
"staticBooking",
true)) {
302 for (; iTr != trEnd; ++iTr) {
304 for (; iHw != hwEnd; ++iHw) {
310 for (
int wh = -2; wh <= 2; ++wh) {
312 for (
int sect = 1; sect <= 12; ++sect) {
316 bookChambHistos(ibooker, chId,
"TrigEffPosvsAnglePhi",
"Segment");
317 bookChambHistos(ibooker, chId,
"TrigEffPosvsAngleCorrPhi",
"Segment");
322 bookWheelHistos(ibooker, wh,
"TrigEffPhi",
"");
323 bookWheelHistos(ibooker, wh,
"TrigEffCorrPhi",
"");
void makeEfficiencyME(TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
Compute 1D/2D efficiency plots.
int station() const
Return the station number.
virtual void setCurrentFolder(std::string const &fullpath)
DTTriggerEfficiencyTest(const edm::ParameterSet &ps)
Constructor.
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
Book the new MEs (for each wheel)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
T getUntrackedParameter(std::string const &, T const &) const
U second(std::pair< T, U > const &p)
virtual TH2F * getTH2F() const
void bookChambHistos(DQMStore::IBooker &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
Book the new MEs (for each chamber)
std::string getMEName(std::string histoTag, std::string folder, int wh)
Get the ME name (by wheel)
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &) override
DQM Client Diagnostic.
EventID const & min(EventID const &lh, EventID const &rh)
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
constexpr uint32_t rawId() const
get the raw id
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
virtual MonitorElement * get(std::string const &fullpath) const
~DTTriggerEfficiencyTest() override
Destructor.
int wheel() const
Return the wheel number.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
void bookHistos(DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
Book the new MEs (global)
EventID const & max(EventID const &lh, EventID const &rh)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)