39 setConfig(ps,
"DTTriggerLut");
40 baseFolderDCC =
"DT/03-LocalTrigger-DCC/";
41 baseFolderDDU =
"DT/04-LocalTrigger-DDU/";
61 if (bookingdone)
return;
64 vector<string>::const_iterator iTr = trigSources.begin();
65 vector<string>::const_iterator trEnd = trigSources.end();
66 vector<string>::const_iterator iHw = hwSources.begin();
67 vector<string>::const_iterator hwEnd = hwSources.end();
70 if(
parameters.getUntrackedParameter<
bool>(
"staticBooking")){
72 for (; iTr != trEnd; ++iTr){
74 for (; iHw != hwEnd; ++iHw){
77 for (
int wh=-2; wh<=2; ++wh){
78 if (detailedAnalysis){
79 bookWheelHistos(ibooker,wh,
"PhiResidualPercentage");
80 bookWheelHistos(ibooker,wh,
"PhibResidualPercentage");
83 bookWheelHistos(ibooker,wh,
"PhiLutSummary",
"Summaries");
84 bookWheelHistos(ibooker,wh,
"PhibLutSummary",
"Summaries");
86 if (detailedAnalysis){
87 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
88 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
89 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
90 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
91 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhi");
92 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhib");
93 bookWheelHistos(ibooker,wh,
"DoublePeakFlagPhib");
98 bookCmsHistos(ibooker,
"TrigLutSummary",
"",
true);
99 bookCmsHistos(ibooker,
"PhiLutSummary");
100 bookCmsHistos(ibooker,
"PhibLutSummary");
101 if (detailedAnalysis){
103 bookCmsHistos1d(ibooker,
"PhiPercentageSummary");
104 bookCmsHistos1d(ibooker,
"PhibPercentageSummary");
121 if (detailedAnalysis){
122 cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Reset();
123 cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Reset();
127 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
129 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
131 vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
132 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
133 for (; chIt != chEnd; ++chIt) {
136 int wh = chId.
wheel();
137 int sect = chId.sector();
138 int stat = chId.station();
140 std::map<std::string,MonitorElement*> &innerME = whME[wh];
143 TH1F * PhiResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhiResidual",
"Segment", chId)));
145 if (PhiResidual && PhiResidual->GetEntries()>10) {
147 if( innerME.find(
fullName(
"PhiResidualPercentage")) == innerME.end() ){
148 bookWheelHistos(ibooker,wh,
"PhiResidualPercentage");
151 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
152 float center = (PhiResidual->GetNbinsX())/2.;
153 float perc = (PhiResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhiResidual->Integral());
154 fillWhPlot(innerME.find(
fullName(
"PhiResidualPercentage"))->second,sect,stat,perc,
false);
155 phiSummary = performLutTest(perc,thresholdWarnPhi,thresholdErrPhi);
156 if (detailedAnalysis) cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Fill(perc);
160 fillWhPlot(innerME.find(
fullName(
"PhiLutSummary"))->second,sect,stat,phiSummary);
162 if (detailedAnalysis){
164 if ((phiSummary==0)||(phiSummary==3)){
166 if( innerME.find(
fullName(
"PhiResidualMean")) == innerME.end() ){
167 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
168 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
171 float center = (PhiResidual->GetNbinsX())/2.;
172 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
173 PhiResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
174 float max = PhiResidual->GetMaximumBin();
175 float maxBin = PhiResidual->GetXaxis()->FindBin(max);
176 float nBinMax = 0.5/(PhiResidual->GetBinWidth(1));
177 PhiResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
178 float Mean = PhiResidual->GetMean();
179 float rms = PhiResidual->GetRMS();
181 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,
Mean);
182 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,
rms);
186 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
188 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>100) {
189 float corr = TrackPhitkvsPhitrig->GetCorrelationFactor();
190 if( innerME.find(
fullName(
"CorrelationFactorPhi")) == innerME.end() ){
191 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhi");
193 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhi"))->second,sect,stat,
corr,
false);
200 TH1F * PhibResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhibResidual",
"Segment", chId)));
201 int phibSummary = stat==3 ? -1 : 1;
203 if (stat != 3 && PhibResidual && PhibResidual->GetEntries()>10) {
205 if( innerME.find(
fullName(
"PhibResidualPercentage")) == innerME.end() ){
206 bookWheelHistos(ibooker,wh,
"PhibResidualPercentage");
209 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
210 float center = (PhibResidual->GetNbinsX())/2.;
211 float perc = (PhibResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhibResidual->Integral());
213 fillWhPlot(innerME.find(
fullName(
"PhibResidualPercentage"))->second,sect,stat,perc,
false);
214 phibSummary = performLutTest(perc,thresholdWarnPhiB,thresholdErrPhiB);
215 if (detailedAnalysis) cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Fill(perc);
219 fillWhPlot(innerME.find(
fullName(
"PhibLutSummary"))->second,sect,stat,phibSummary);
221 if (detailedAnalysis){
223 if ((phibSummary==0)||(phibSummary==3)){
225 if( innerME.find(
fullName(
"PhibResidualMean")) == innerME.end() ){
226 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
227 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
230 float center = (PhibResidual->GetNbinsX())/2.;
231 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
232 PhibResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
233 float max = PhibResidual->GetMaximumBin();
234 float maxBin = PhibResidual->GetXaxis()->FindBin(max);
235 float nBinMax = 0.5/(PhibResidual->GetBinWidth(1));
236 PhibResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
237 float Mean = PhibResidual->GetMean();
238 float rms = PhibResidual->GetRMS();
240 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,
Mean);
241 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,
rms);
244 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
245 if (TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>100) {
247 float corr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
248 if( innerME.find(
fullName(
"CorrelationFactorPhib")) == innerME.end() ){
249 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhib");
252 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhib"))->second,sect,stat,
corr,
false);
262 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
264 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
266 for (
int wh=-2; wh<=2; ++wh){
268 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
270 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
271 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
273 for (
int sect=1; sect<=12; ++sect){
275 int phiSectorTotal = 0;
276 int phibSectorTotal = 0;
283 for (
int stat=1; stat<=4; ++stat){
284 if (phiWhSummary->GetBinContent(sect,stat)==2){
288 if (phiWhSummary->GetBinContent(sect,stat)==1)
290 if (phibWhSummary->GetBinContent(sect,stat)==2) {
294 if (phibWhSummary->GetBinContent(sect,stat)==1)
298 phiStatus=phiSectorTotal;
302 phibStatus=phibSectorTotal;
306 cmsME.find(
"TrigLutSummary")->second->setBinContent(sect,wh+3,glbStatus);
307 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiStatus);
308 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibStatus);
318 bool isInWarn = perc<thresholdWarn;
319 bool isInErr = perc<thresholdErr;
321 int result= isInErr ? 2 : isInWarn ? 3 : 0;
329 string basedir = topFolder(
true);
331 basedir += folder +
"/" ;
336 LogTrace(
category()) <<
"[" << testName <<
"Test]: booking " << basedir << hName;
347 int scsect = sect==13 ? 4 : 10;
348 if ((value>plot->
getBinContent(scsect,stat)) == lessIsBest) {
void runClientDiagnostic(DQMStore::IBooker &, DQMStore::IGetter &)
Run client analysis.
T getUntrackedParameter(std::string const &, T const &) const
void bookCmsHistos1d(DQMStore::IBooker &, std::string hTag, std::string folder="")
void setBinContent(int binx, double content)
set content of bin (1-D)
DTTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
MonitorElement * get(const std::string &path)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
virtual ~DTTriggerLutTest()
Destructor.
int performLutTest(double perc, double threshold1, double threshold2)
Perform Lut Test logical operations.
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
void fillWhPlot(MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
Fill summary plots managing double MB4 chambers.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Perform client diagnostic in online.
MonitorElement * book1D(Args &&...args)
void setCurrentFolder(const std::string &fullpath)
double getBinContent(int binx) const
get content of bin (1-D)
int wheel() const
Return the wheel number.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
EventID const & max(EventID const &lh, EventID const &rh)