36 setConfig(ps,
"DTTriggerLut");
37 baseFolderDCC =
"DT/03-LocalTrigger-DCC/";
38 baseFolderDDU =
"DT/04-LocalTrigger-DDU/";
58 vector<string>::const_iterator iTr = trigSources.begin();
59 vector<string>::const_iterator trEnd = trigSources.end();
60 vector<string>::const_iterator iHw = hwSources.begin();
61 vector<string>::const_iterator hwEnd = hwSources.end();
64 if(
parameters.getUntrackedParameter<
bool>(
"staticBooking")){
66 for (; iTr != trEnd; ++iTr){
68 for (; iHw != hwEnd; ++iHw){
71 for (
int wh=-2; wh<=2; ++wh){
72 if (detailedAnalysis){
73 bookWheelHistos(wh,
"PhiResidualPercentage");
74 bookWheelHistos(wh,
"PhibResidualPercentage");
77 bookWheelHistos(wh,
"PhiLutSummary",
"Summaries");
78 bookWheelHistos(wh,
"PhibLutSummary",
"Summaries");
80 if (detailedAnalysis){
81 bookWheelHistos(wh,
"PhiResidualMean");
82 bookWheelHistos(wh,
"PhiResidualRMS");
83 bookWheelHistos(wh,
"PhibResidualMean");
84 bookWheelHistos(wh,
"PhibResidualRMS");
85 bookWheelHistos(wh,
"CorrelationFactorPhi");
86 bookWheelHistos(wh,
"CorrelationFactorPhib");
87 bookWheelHistos(wh,
"DoublePeakFlagPhib");
92 bookCmsHistos(
"TrigLutSummary",
"",
true);
93 bookCmsHistos(
"PhiLutSummary");
94 bookCmsHistos(
"PhibLutSummary");
95 if (detailedAnalysis){
96 bookCmsHistos1d(
"PhiPercentageSummary");
97 bookCmsHistos1d(
"PhibPercentageSummary");
116 if (detailedAnalysis){
117 cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Reset();
118 cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Reset();
122 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
124 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
126 vector<DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
127 vector<DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
128 for (; chIt != chEnd; ++chIt) {
131 int wh = chId.
wheel();
132 int sect = chId.sector();
133 int stat = chId.station();
135 std::map<std::string,MonitorElement*> &innerME = whME[wh];
138 TH1F * PhiResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhiResidual",
"Segment", chId)));
140 if (PhiResidual && PhiResidual->GetEntries()>10) {
142 if( innerME.find(
fullName(
"PhiResidualPercentage")) == innerME.end() ){
143 bookWheelHistos(wh,
"PhiResidualPercentage");
146 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
147 float center = (PhiResidual->GetNbinsX())/2.;
148 float perc = (PhiResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhiResidual->Integral());
149 fillWhPlot(innerME.find(
fullName(
"PhiResidualPercentage"))->second,sect,stat,perc,
false);
150 phiSummary = performLutTest(perc,thresholdWarnPhi,thresholdErrPhi);
151 if (detailedAnalysis) cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Fill(perc);
155 fillWhPlot(innerME.find(
fullName(
"PhiLutSummary"))->second,sect,stat,phiSummary);
157 if (detailedAnalysis){
178 if ((phiSummary==0)||(phiSummary==3)){
180 if( innerME.find(
fullName(
"PhiResidualMean")) == innerME.end() ){
181 bookWheelHistos(wh,
"PhiResidualMean");
182 bookWheelHistos(wh,
"PhiResidualRMS");
185 float center = (PhiResidual->GetNbinsX())/2.;
186 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
187 PhiResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
188 float max = PhiResidual->GetMaximumBin();
189 float maxBin = PhiResidual->GetXaxis()->FindBin(max);
190 float nBinMax = 0.5/(PhiResidual->GetBinWidth(1));
191 PhiResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
192 float Mean = PhiResidual->GetMean();
193 float rms = PhiResidual->GetRMS();
195 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,
Mean);
196 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,
rms);
200 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(dbe->get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
202 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>100) {
203 float corr = TrackPhitkvsPhitrig->GetCorrelationFactor();
204 if( innerME.find(
fullName(
"CorrelationFactorPhi")) == innerME.end() ){
205 bookWheelHistos(wh,
"CorrelationFactorPhi");
207 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhi"))->second,sect,stat,
corr,
false);
214 TH1F * PhibResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhibResidual",
"Segment", chId)));
215 int phibSummary = stat==3 ? -1 : 1;
217 if (stat != 3 && PhibResidual && PhibResidual->GetEntries()>10) {
219 if( innerME.find(
fullName(
"PhibResidualPercentage")) == innerME.end() ){
220 bookWheelHistos(wh,
"PhibResidualPercentage");
223 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
224 float center = (PhibResidual->GetNbinsX())/2.;
225 float perc = (PhibResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhibResidual->Integral());
227 fillWhPlot(innerME.find(
fullName(
"PhibResidualPercentage"))->second,sect,stat,perc,
false);
228 phibSummary = performLutTest(perc,thresholdWarnPhiB,thresholdErrPhiB);
229 if (detailedAnalysis) cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Fill(perc);
233 fillWhPlot(innerME.find(
fullName(
"PhibLutSummary"))->second,sect,stat,phibSummary);
235 if (detailedAnalysis){
255 if ((phibSummary==0)||(phibSummary==3)){
257 if( innerME.find(
fullName(
"PhibResidualMean")) == innerME.end() ){
258 bookWheelHistos(wh,
"PhibResidualMean");
259 bookWheelHistos(wh,
"PhibResidualRMS");
262 float center = (PhibResidual->GetNbinsX())/2.;
263 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
264 PhibResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
265 float max = PhibResidual->GetMaximumBin();
266 float maxBin = PhibResidual->GetXaxis()->FindBin(max);
267 float nBinMax = 0.5/(PhibResidual->GetBinWidth(1));
268 PhibResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
269 float Mean = PhibResidual->GetMean();
270 float rms = PhibResidual->GetRMS();
272 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,
Mean);
273 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,
rms);
276 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(dbe->get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
277 if (TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>100) {
279 float corr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
280 if( innerME.find(
fullName(
"CorrelationFactorPhib")) == innerME.end() ){
281 bookWheelHistos(wh,
"CorrelationFactorPhib");
284 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhib"))->second,sect,stat,
corr,
false);
294 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
296 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
298 for (
int wh=-2; wh<=2; ++wh){
300 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
302 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
303 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
305 for (
int sect=1; sect<=12; ++sect){
307 int phiSectorTotal = 0;
308 int phibSectorTotal = 0;
315 for (
int stat=1; stat<=4; ++stat){
316 if (phiWhSummary->GetBinContent(sect,stat)==2){
320 if (phiWhSummary->GetBinContent(sect,stat)==1)
322 if (phibWhSummary->GetBinContent(sect,stat)==2) {
326 if (phibWhSummary->GetBinContent(sect,stat)==1)
330 phiStatus=phiSectorTotal;
334 phibStatus=phibSectorTotal;
338 cmsME.find(
"TrigLutSummary")->second->setBinContent(sect,wh+3,glbStatus);
339 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiStatus);
340 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibStatus);
350 bool isInWarn = perc<thresholdWarn;
351 bool isInErr = perc<thresholdErr;
353 int result= isInErr ? 2 : isInWarn ? 3 : 0;
361 string basedir = topFolder(
true);
363 basedir += folder +
"/" ;
365 dbe->setCurrentFolder(basedir);
368 LogTrace(
category()) <<
"[" << testName <<
"Test]: booking " << basedir << hName;
371 MonitorElement* me = dbe->book1D(hName.c_str(),hName.c_str(),101,-0.005,1.005);
380 int scsect = sect==13 ? 4 : 10;
381 if ((value>plot->
getBinContent(scsect,stat)) == lessIsBest) {
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
void bookCmsHistos1d(std::string hTag, std::string folder="")
DTTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
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 runClientDiagnostic()
Run client analysis.
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)