38 setConfig(ps,
"DTTriggerLut");
39 baseFolderDCC =
"DT/03-LocalTrigger-DCC/";
40 baseFolderDDU =
"DT/04-LocalTrigger-DDU/";
60 vector<string>::const_iterator iTr = trigSources.begin();
61 vector<string>::const_iterator trEnd = trigSources.end();
62 vector<string>::const_iterator iHw = hwSources.begin();
63 vector<string>::const_iterator hwEnd = hwSources.end();
66 if(
parameters.getUntrackedParameter<
bool>(
"staticBooking")){
68 for (; iTr != trEnd; ++iTr){
70 for (; iHw != hwEnd; ++iHw){
73 for (
int wh=-2; wh<=2; ++wh){
74 if (detailedAnalysis){
75 bookWheelHistos(wh,
"PhiResidualPercentage");
76 bookWheelHistos(wh,
"PhibResidualPercentage");
79 bookWheelHistos(wh,
"PhiLutSummary",
"Summaries");
80 bookWheelHistos(wh,
"PhibLutSummary",
"Summaries");
82 if (detailedAnalysis){
83 bookWheelHistos(wh,
"PhiResidualMean");
84 bookWheelHistos(wh,
"PhiResidualRMS");
85 bookWheelHistos(wh,
"PhibResidualMean");
86 bookWheelHistos(wh,
"PhibResidualRMS");
87 bookWheelHistos(wh,
"CorrelationFactorPhi");
88 bookWheelHistos(wh,
"CorrelationFactorPhib");
89 bookWheelHistos(wh,
"DoublePeakFlagPhib");
94 bookCmsHistos(
"TrigLutSummary",
"",
true);
95 bookCmsHistos(
"PhiLutSummary");
96 bookCmsHistos(
"PhibLutSummary");
97 if (detailedAnalysis){
98 bookCmsHistos1d(
"PhiPercentageSummary");
99 bookCmsHistos1d(
"PhibPercentageSummary");
118 if (detailedAnalysis){
119 cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Reset();
120 cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Reset();
124 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
126 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
128 vector<DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
129 vector<DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
130 for (; chIt != chEnd; ++chIt) {
133 int wh = chId.
wheel();
134 int sect = chId.sector();
135 int stat = chId.station();
137 std::map<std::string,MonitorElement*> &innerME = whME[wh];
140 TH1F * PhiResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhiResidual",
"Segment", chId)));
142 if (PhiResidual && PhiResidual->GetEntries()>10) {
144 if( innerME.find(
fullName(
"PhiResidualPercentage")) == innerME.end() ){
145 bookWheelHistos(wh,
"PhiResidualPercentage");
148 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
149 float center = (PhiResidual->GetNbinsX())/2.;
150 float perc = (PhiResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhiResidual->Integral());
151 fillWhPlot(innerME.find(
fullName(
"PhiResidualPercentage"))->second,sect,stat,perc,
false);
152 phiSummary = performLutTest(perc,thresholdWarnPhi,thresholdErrPhi);
153 if (detailedAnalysis) cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Fill(perc);
157 fillWhPlot(innerME.find(
fullName(
"PhiLutSummary"))->second,sect,stat,phiSummary);
159 if (detailedAnalysis){
180 if ((phiSummary==0)||(phiSummary==3)){
182 if( innerME.find(
fullName(
"PhiResidualMean")) == innerME.end() ){
183 bookWheelHistos(wh,
"PhiResidualMean");
184 bookWheelHistos(wh,
"PhiResidualRMS");
187 float center = (PhiResidual->GetNbinsX())/2.;
188 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
189 PhiResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
190 float max = PhiResidual->GetMaximumBin();
191 float maxBin = PhiResidual->GetXaxis()->FindBin(max);
192 float nBinMax = 0.5/(PhiResidual->GetBinWidth(1));
193 PhiResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
194 float Mean = PhiResidual->GetMean();
195 float rms = PhiResidual->GetRMS();
197 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,
Mean);
198 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,
rms);
202 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(dbe->get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
204 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>100) {
205 float corr = TrackPhitkvsPhitrig->GetCorrelationFactor();
206 if( innerME.find(
fullName(
"CorrelationFactorPhi")) == innerME.end() ){
207 bookWheelHistos(wh,
"CorrelationFactorPhi");
209 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhi"))->second,sect,stat,
corr,
false);
216 TH1F * PhibResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhibResidual",
"Segment", chId)));
217 int phibSummary = stat==3 ? -1 : 1;
219 if (stat != 3 && PhibResidual && PhibResidual->GetEntries()>10) {
221 if( innerME.find(
fullName(
"PhibResidualPercentage")) == innerME.end() ){
222 bookWheelHistos(wh,
"PhibResidualPercentage");
225 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
226 float center = (PhibResidual->GetNbinsX())/2.;
227 float perc = (PhibResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhibResidual->Integral());
229 fillWhPlot(innerME.find(
fullName(
"PhibResidualPercentage"))->second,sect,stat,perc,
false);
230 phibSummary = performLutTest(perc,thresholdWarnPhiB,thresholdErrPhiB);
231 if (detailedAnalysis) cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Fill(perc);
235 fillWhPlot(innerME.find(
fullName(
"PhibLutSummary"))->second,sect,stat,phibSummary);
237 if (detailedAnalysis){
257 if ((phibSummary==0)||(phibSummary==3)){
259 if( innerME.find(
fullName(
"PhibResidualMean")) == innerME.end() ){
260 bookWheelHistos(wh,
"PhibResidualMean");
261 bookWheelHistos(wh,
"PhibResidualRMS");
264 float center = (PhibResidual->GetNbinsX())/2.;
265 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
266 PhibResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
267 float max = PhibResidual->GetMaximumBin();
268 float maxBin = PhibResidual->GetXaxis()->FindBin(max);
269 float nBinMax = 0.5/(PhibResidual->GetBinWidth(1));
270 PhibResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
271 float Mean = PhibResidual->GetMean();
272 float rms = PhibResidual->GetRMS();
274 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,
Mean);
275 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,
rms);
278 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(dbe->get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
279 if (TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>100) {
281 float corr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
282 if( innerME.find(
fullName(
"CorrelationFactorPhib")) == innerME.end() ){
283 bookWheelHistos(wh,
"CorrelationFactorPhib");
286 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhib"))->second,sect,stat,
corr,
false);
296 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
298 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
300 for (
int wh=-2; wh<=2; ++wh){
302 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
304 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
305 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
307 for (
int sect=1; sect<=12; ++sect){
309 int phiSectorTotal = 0;
310 int phibSectorTotal = 0;
317 for (
int stat=1; stat<=4; ++stat){
318 if (phiWhSummary->GetBinContent(sect,stat)==2){
322 if (phiWhSummary->GetBinContent(sect,stat)==1)
324 if (phibWhSummary->GetBinContent(sect,stat)==2) {
328 if (phibWhSummary->GetBinContent(sect,stat)==1)
332 phiStatus=phiSectorTotal;
336 phibStatus=phibSectorTotal;
340 cmsME.find(
"TrigLutSummary")->second->setBinContent(sect,wh+3,glbStatus);
341 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiStatus);
342 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibStatus);
352 bool isInWarn = perc<thresholdWarn;
353 bool isInErr = perc<thresholdErr;
355 int result= isInErr ? 2 : isInWarn ? 3 : 0;
363 string basedir = topFolder(
true);
365 basedir += folder +
"/" ;
367 dbe->setCurrentFolder(basedir);
370 LogTrace(
category()) <<
"[" << testName <<
"Test]: booking " << basedir << hName;
373 MonitorElement* me = dbe->book1D(hName.c_str(),hName.c_str(),101,-0.005,1.005);
382 int scsect = sect==13 ? 4 : 10;
383 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)