39 setConfig(ps,
"DTTriggerLut");
40 baseFolderTM =
"DT/03-LocalTrigger-TM/";
41 baseFolderDDU =
"DT/04-LocalTrigger-DDU/";
63 vector<string>::const_iterator iTr = trigSources.begin();
64 vector<string>::const_iterator trEnd = trigSources.end();
65 vector<string>::const_iterator iHw = hwSources.begin();
66 vector<string>::const_iterator hwEnd = hwSources.end();
69 if(
parameters.getUntrackedParameter<
bool>(
"staticBooking")){
71 for (; iTr != trEnd; ++iTr){
73 for (; iHw != hwEnd; ++iHw){
76 for (
int wh=-2; wh<=2; ++wh){
77 if (detailedAnalysis){
78 bookWheelHistos(ibooker,wh,
"PhiResidualPercentage");
79 bookWheelHistos(ibooker,wh,
"PhibResidualPercentage");
82 bookWheelHistos(ibooker,wh,
"PhiLutSummary",
"Summaries");
83 bookWheelHistos(ibooker,wh,
"PhibLutSummary",
"Summaries");
85 if (detailedAnalysis){
86 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
87 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
88 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
89 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
90 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhi");
91 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhib");
92 bookWheelHistos(ibooker,wh,
"DoublePeakFlagPhib");
97 bookCmsHistos(ibooker,
"TrigLutSummary",
"",
true);
98 bookCmsHistos(ibooker,
"PhiLutSummary");
99 bookCmsHistos(ibooker,
"PhibLutSummary");
100 if (detailedAnalysis){
102 bookCmsHistos1d(ibooker,
"PhiPercentageSummary");
103 bookCmsHistos1d(ibooker,
"PhibPercentageSummary");
119 if (!bookingdone) Bookings(ibooker,igetter);
122 if (detailedAnalysis){
123 cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Reset();
124 cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Reset();
128 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
130 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
132 vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
133 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
134 for (; chIt != chEnd; ++chIt) {
137 int wh = chId.
wheel();
138 int sect = chId.sector();
139 int stat = chId.station();
141 std::map<std::string,MonitorElement*> &innerME = whME[wh];
144 TH1F * PhiResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhiResidual",
"Segment", chId)));
146 if (PhiResidual && PhiResidual->GetEntries()>10) {
148 if( innerME.find(
fullName(
"PhiResidualPercentage")) == innerME.end() ){
149 bookWheelHistos(ibooker,wh,
"PhiResidualPercentage");
152 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
153 float center = (PhiResidual->GetNbinsX())/2.;
154 float perc = (PhiResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhiResidual->Integral());
155 fillWhPlot(innerME.find(
fullName(
"PhiResidualPercentage"))->second,sect,stat,perc,
false);
156 phiSummary = performLutTest(perc,thresholdWarnPhi,thresholdErrPhi);
157 if (detailedAnalysis) cmsME.find(
fullName(
"PhiPercentageSummary"))->second->Fill(perc);
161 fillWhPlot(innerME.find(
fullName(
"PhiLutSummary"))->second,sect,stat,phiSummary);
163 if (detailedAnalysis){
165 if ((phiSummary==0)||(phiSummary==3)){
167 if( innerME.find(
fullName(
"PhiResidualMean")) == innerME.end() ){
168 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
169 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
172 float center = (PhiResidual->GetNbinsX())/2.;
173 float rangeBin = validRange/(PhiResidual->GetBinWidth(1));
174 PhiResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
175 float max = PhiResidual->GetMaximumBin();
176 float maxBin = PhiResidual->GetXaxis()->FindBin(max);
177 float nBinMax = 0.5/(PhiResidual->GetBinWidth(1));
178 PhiResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
179 float Mean = PhiResidual->GetMean();
180 float rms = PhiResidual->GetRMS();
182 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,
Mean);
183 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,
rms);
187 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
189 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>100) {
190 float corr = TrackPhitkvsPhitrig->GetCorrelationFactor();
191 if( innerME.find(
fullName(
"CorrelationFactorPhi")) == innerME.end() ){
192 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhi");
194 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhi"))->second,sect,stat,
corr,
false);
201 TH1F * PhibResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhibResidual",
"Segment", chId)));
202 int phibSummary = stat==3 ? -1 : 1;
204 if (stat != 3 && PhibResidual && PhibResidual->GetEntries()>10) {
206 if( innerME.find(
fullName(
"PhibResidualPercentage")) == innerME.end() ){
207 bookWheelHistos(ibooker,wh,
"PhibResidualPercentage");
210 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
211 float center = (PhibResidual->GetNbinsX())/2.;
212 float perc = (PhibResidual->Integral(floor(center-rangeBin),ceil(center+rangeBin)))/(PhibResidual->Integral());
214 fillWhPlot(innerME.find(
fullName(
"PhibResidualPercentage"))->second,sect,stat,perc,
false);
215 phibSummary = performLutTest(perc,thresholdWarnPhiB,thresholdErrPhiB);
216 if (detailedAnalysis) cmsME.find(
fullName(
"PhibPercentageSummary"))->second->Fill(perc);
220 fillWhPlot(innerME.find(
fullName(
"PhibLutSummary"))->second,sect,stat,phibSummary);
222 if (detailedAnalysis){
224 if ((phibSummary==0)||(phibSummary==3)){
226 if( innerME.find(
fullName(
"PhibResidualMean")) == innerME.end() ){
227 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
228 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
231 float center = (PhibResidual->GetNbinsX())/2.;
232 float rangeBin = validRange/(PhibResidual->GetBinWidth(1));
233 PhibResidual->GetXaxis()->SetRange(floor(center-rangeBin),ceil(center+rangeBin));
234 float max = PhibResidual->GetMaximumBin();
235 float maxBin = PhibResidual->GetXaxis()->FindBin(max);
236 float nBinMax = 0.5/(PhibResidual->GetBinWidth(1));
237 PhibResidual->GetXaxis()->SetRange(floor(maxBin-nBinMax),ceil(maxBin+nBinMax));
238 float Mean = PhibResidual->GetMean();
239 float rms = PhibResidual->GetRMS();
241 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,
Mean);
242 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,
rms);
245 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
246 if (TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>100) {
248 float corr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
249 if( innerME.find(
fullName(
"CorrelationFactorPhib")) == innerME.end() ){
250 bookWheelHistos(ibooker,wh,
"CorrelationFactorPhib");
253 fillWhPlot(innerME.find(
fullName(
"CorrelationFactorPhib"))->second,sect,stat,
corr,
false);
263 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
265 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
267 for (
int wh=-2; wh<=2; ++wh){
269 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
271 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
272 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
274 for (
int sect=1; sect<=12; ++sect){
276 int phiSectorTotal = 0;
277 int phibSectorTotal = 0;
284 for (
int stat=1; stat<=4; ++stat){
285 if (phiWhSummary->GetBinContent(sect,stat)==2){
289 if (phiWhSummary->GetBinContent(sect,stat)==1)
291 if (phibWhSummary->GetBinContent(sect,stat)==2) {
295 if (phibWhSummary->GetBinContent(sect,stat)==1)
299 phiStatus=phiSectorTotal;
303 phibStatus=phibSectorTotal;
307 cmsME.find(
"TrigLutSummary")->second->setBinContent(sect,wh+3,glbStatus);
308 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiStatus);
309 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibStatus);
319 bool isInWarn = perc<thresholdWarn;
320 bool isInErr = perc<thresholdErr;
322 int result= isInErr ? 2 : isInWarn ? 3 : 0;
330 string basedir = topFolder(
true);
332 basedir += folder +
"/" ;
337 LogTrace(
category()) <<
"[" << testName <<
"Test]: booking " << basedir << hName;
348 int scsect = sect==13 ? 4 : 10;
349 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)
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.
MonitorElement * book1D(Args &&...args)
void setCurrentFolder(const std::string &fullpath)
double getBinContent(int binx) const
get content of bin (1-D)
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
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.
tuple folder
Histograms Source for live online DQM in P5
EventID const & max(EventID const &lh, EventID const &rh)