34 setConfig(ps,
"DTLocalTriggerLut");
35 baseFolderTM =
"DT/03-LocalTrigger-TM/";
48 vector<string>::const_iterator iTr = trigSources.begin();
49 vector<string>::const_iterator trEnd = trigSources.end();
50 vector<string>::const_iterator iHw =
hwSources.begin();
51 vector<string>::const_iterator hwEnd =
hwSources.end();
54 if (
parameters.getUntrackedParameter<
bool>(
"staticBooking",
true)) {
55 for (; iTr != trEnd; ++iTr) {
57 for (; iHw != hwEnd; ++iHw) {
60 for (
int wh = -2; wh <= 2; ++wh) {
61 bookWheelHistos(ibooker, wh,
"PhiResidualMean");
62 bookWheelHistos(ibooker, wh,
"PhiResidualRMS");
63 bookWheelHistos(ibooker, wh,
"PhibResidualMean");
64 bookWheelHistos(ibooker, wh,
"PhibResidualRMS");
66 bookWheelHistos(ibooker, wh,
"PhiTkvsTrigSlope");
67 bookWheelHistos(ibooker, wh,
"PhiTkvsTrigIntercept");
68 bookWheelHistos(ibooker, wh,
"PhiTkvsTrigCorr");
69 bookWheelHistos(ibooker, wh,
"PhibTkvsTrigSlope");
70 bookWheelHistos(ibooker, wh,
"PhibTkvsTrigIntercept");
71 bookWheelHistos(ibooker, wh,
"PhibTkvsTrigCorr");
79 for (iTr = trigSources.begin(); iTr != trEnd; ++iTr) {
84 for (
int wh = -2; wh <= 2; ++wh) {
85 bookWheelHistos(ibooker, wh,
"PhiLutSummary");
86 bookWheelHistos(ibooker, wh,
"PhibLutSummary");
89 bookCmsHistos(ibooker,
"PhiLutSummary");
90 bookCmsHistos(ibooker,
"PhibLutSummary");
103 Bookings(ibooker, igetter);
106 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
108 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw) {
110 vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
111 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
112 for (; chIt != chEnd; ++chIt) {
114 int wh = chId.
wheel();
115 int sect = chId.sector();
116 int stat = chId.station();
121 TH2F* TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
123 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries() > 10) {
125 if (whME[wh].
find(
fullName(
"PhiTkvsTrigCorr")) == whME[wh].end()) {
126 bookWheelHistos(ibooker, wh,
"PhiTkvsTrigSlope");
127 bookWheelHistos(ibooker, wh,
"PhiTkvsTrigIntercept");
128 bookWheelHistos(ibooker, wh,
"PhiTkvsTrigCorr");
131 TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX();
136 TF1 ffPhi(
"mypol1",
"pol1");
137 PhitkvsPhitrigProf->Fit(&ffPhi,
"CQO");
138 phiInt = ffPhi.GetParameter(0);
139 phiSlope = ffPhi.GetParameter(1);
140 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
143 <<
" Sector " << sect <<
" Station " <<
stat;
146 std::map<std::string, MonitorElement*>& innerME = whME[wh];
147 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigSlope"))->second, sect,
stat, phiSlope - 1);
148 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigIntercept"))->second, sect,
stat, phiInt);
149 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigCorr"))->second, sect,
stat, phiCorr,
false);
153 TH2F* TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
155 if (stat != 3 && TrackPhibtkvsPhibtrig &&
156 TrackPhibtkvsPhibtrig->GetEntries() > 10) {
159 if (whME[wh].
find(
fullName(
"PhibTkvsTrigCorr")) == whME[wh].end()) {
160 bookWheelHistos(ibooker, wh,
"PhibTkvsTrigSlope");
161 bookWheelHistos(ibooker, wh,
"PhibTkvsTrigIntercept");
162 bookWheelHistos(ibooker, wh,
"PhibTkvsTrigCorr");
165 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
167 double phibSlope = 0;
170 TF1 ffPhib(
"ffPhib",
"pol1");
171 PhibtkvsPhibtrigProf->Fit(&ffPhib,
"CQO");
172 phibInt = ffPhib.GetParameter(0);
173 phibSlope = ffPhib.GetParameter(1);
174 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
177 <<
" Sector " << sect <<
" Station " <<
stat;
180 std::map<std::string, MonitorElement*>& innerME = whME[wh];
181 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigSlope"))->second, sect,
stat, phibSlope - 1);
182 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigIntercept"))->second, sect,
stat, phibInt);
183 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigCorr"))->second, sect,
stat, phibCorr,
false);
189 TH1F* PhiResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhiResidual",
"Segment", chId)));
192 if (PhiResidual && PhiResidual->GetEffectiveEntries() > 10) {
194 if (whME[wh].
find(
fullName(
"PhiResidualMean")) == whME[wh].end()) {
195 bookWheelHistos(ibooker, wh,
"PhiResidualMean");
196 bookWheelHistos(ibooker, wh,
"PhiResidualRMS");
199 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
203 TF1 ffPhi(
"ffPhi",
"gaus");
204 PhiResidual->Fit(&ffPhi,
"CQO",
"", peak - 5, peak + 5);
205 phiMean = ffPhi.GetParameter(1);
206 phiRMS = ffPhi.GetParameter(2);
209 <<
" Sector " << sect <<
" Station " <<
stat;
212 std::map<std::string, MonitorElement*>& innerME = whME[wh];
213 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second, sect,
stat, phiMean);
214 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second, sect,
stat, phiRMS);
216 phiSummary = performLutTest(phiMean, phiRMS, thresholdPhiMean, thresholdPhiRMS);
221 TH1F* PhibResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhibResidual",
"Segment", chId)));
222 int phibSummary = stat == 3 ? 0 : 1;
224 if (stat != 3 && PhibResidual &&
225 PhibResidual->GetEffectiveEntries() > 10) {
228 if (whME[wh].
find(
fullName(
"PhibResidualMean")) == whME[wh].end()) {
229 bookWheelHistos(ibooker, wh,
"PhibResidualMean");
230 bookWheelHistos(ibooker, wh,
"PhibResidualRMS");
233 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
237 TF1 ffPhib(
"ffPhib",
"gaus");
238 PhibResidual->Fit(&ffPhib,
"CQO",
"", peak - 5, peak + 5);
239 phibMean = ffPhib.GetParameter(1);
240 phibRMS = ffPhib.GetParameter(2);
243 <<
" Sector " << sect <<
" Station " <<
stat;
246 std::map<std::string, MonitorElement*>& innerME = whME[wh];
247 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second, sect,
stat, phibMean);
248 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second, sect,
stat, phibRMS);
250 phibSummary = performLutTest(phibMean, phibRMS, thresholdPhibMean, thresholdPhibRMS);
252 fillWhPlot(whME[wh].
find(
fullName(
"PhibLutSummary"))->
second, sect, stat, phibSummary);
258 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
260 for (vector<string>::const_iterator iHw =
hwSources.begin(); iHw !=
hwSources.end(); ++iHw) {
262 for (
int wh = -2; wh <= 2; ++wh) {
263 std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
265 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
266 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
267 for (
int sect = 1; sect <= 12; ++sect) {
273 switch (static_cast<int>(phiWhSummary->GetBinContent(sect,
stat))) {
281 switch (static_cast<int>(phibWhSummary->GetBinContent(sect,
stat))) {
294 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phiErr);
295 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phibErr);
303 bool meanErr = fabs(mean) > thresholdMean;
304 bool rmsErr = RMS > thresholdRMS;
306 return (meanErr || rmsErr) ? 2 + (meanErr != rmsErr) : 0;
311 int scsect = sect == 13 ? 4 : 10;
312 if ((fabs(value) > fabs(plot->
getBinContent(scsect, stat))) == lessIsBest) {
T getUntrackedParameter(std::string const &, T const &) const
int performLutTest(double mean, double RMS, double thresholdMean, double thresholdRMS)
Perform Lut Test logical operations.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void runClientDiagnostic(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
Run client analysis.
void fillWhPlot(MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
Fill summary plots managing double MB4 chambers.
U second(std::pair< T, U > const &p)
virtual double getBinContent(int binx) const
get content of bin (1-D)
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
~DTLocalTriggerLutTest() override
Destructor.
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
DTLocalTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
MonitorElement * get(std::string const &path)
int wheel() const
Return the wheel number.