39 setConfig(ps,
"DTLocalTriggerLut");
40 baseFolderTM =
"DT/03-LocalTrigger-TM/";
41 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",
true)){
67 for (; iTr != trEnd; ++iTr){
69 for (; iHw != hwEnd; ++iHw){
72 for (
int wh=-2; wh<=2; ++wh){
73 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
74 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
75 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
76 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
79 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigSlope");
80 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigIntercept");
81 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigCorr");
82 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigSlope");
83 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigIntercept");
84 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigCorr");
92 for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){
94 for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
97 for (
int wh=-2; wh<=2; ++wh){
99 bookWheelHistos(ibooker,wh,
"PhiLutSummary");
100 bookWheelHistos(ibooker,wh,
"PhibLutSummary");
103 bookCmsHistos(ibooker,
"PhiLutSummary");
104 bookCmsHistos(ibooker,
"PhibLutSummary");
119 if (!bookingdone) Bookings(ibooker,igetter);
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<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
127 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
128 for (; chIt != chEnd; ++chIt) {
130 int wh = chId.
wheel();
131 int sect = chId.sector();
132 int stat = chId.station();
138 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
140 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>10) {
143 if( whME[wh].
find(fullName(
"PhiTkvsTrigCorr")) == whME[wh].end() ){
145 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigSlope");
146 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigIntercept");
147 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigCorr");
150 TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX();
155 TF1 ffPhi(
"mypol1",
"pol1");
156 PhitkvsPhitrigProf->Fit(&ffPhi,
"CQO");
157 phiInt = ffPhi.GetParameter(0);
158 phiSlope = ffPhi.GetParameter(1);
159 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
161 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhitkvsPhitrig for Wheel " << wh
162 <<
" Sector " << sect <<
" Station " <<
stat;
165 std::map<std::string,MonitorElement*> &innerME = whME[wh];
166 fillWhPlot(innerME.find(fullName(
"PhiTkvsTrigSlope"))->second,sect,
stat,phiSlope-1);
167 fillWhPlot(innerME.find(fullName(
"PhiTkvsTrigIntercept"))->second,sect,
stat,phiInt);
168 fillWhPlot(innerME.find(fullName(
"PhiTkvsTrigCorr"))->second,sect,
stat,phiCorr,
false);
173 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
175 if (stat != 3 && TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>10) {
178 if( whME[wh].
find(fullName(
"PhibTkvsTrigCorr")) == whME[wh].end() ){
179 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigSlope");
180 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigIntercept");
181 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigCorr");
184 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
186 double phibSlope = 0;
189 TF1 ffPhib(
"ffPhib",
"pol1");
190 PhibtkvsPhibtrigProf->Fit(&ffPhib,
"CQO");
191 phibInt = ffPhib.GetParameter(0);
192 phibSlope = ffPhib.GetParameter(1);
193 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
195 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh
196 <<
" Sector " << sect <<
" Station " <<
stat;
199 std::map<std::string,MonitorElement*> &innerME = whME[wh];
200 fillWhPlot(innerME.find(fullName(
"PhibTkvsTrigSlope"))->second,sect,
stat,phibSlope-1);
201 fillWhPlot(innerME.find(fullName(
"PhibTkvsTrigIntercept"))->second,sect,
stat,phibInt);
202 fillWhPlot(innerME.find(fullName(
"PhibTkvsTrigCorr"))->second,sect,
stat,phibCorr,
false);
210 TH1F * PhiResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhiResidual",
"Segment", chId)));
213 if (PhiResidual && PhiResidual->GetEffectiveEntries()>10) {
216 if( whME[wh].
find(fullName(
"PhiResidualMean")) == whME[wh].end() ){
217 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
218 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
221 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
225 TF1 ffPhi(
"ffPhi",
"gaus");
226 PhiResidual->Fit(&ffPhi,
"CQO",
"",peak-5,peak+5);
227 phiMean = ffPhi.GetParameter(1);
228 phiRMS = ffPhi.GetParameter(2);
231 <<
" Sector " << sect <<
" Station " <<
stat;
234 std::map<std::string,MonitorElement*> &innerME = whME[wh];
235 fillWhPlot(innerME.find(fullName(
"PhiResidualMean"))->second,sect,
stat,phiMean);
236 fillWhPlot(innerME.find(fullName(
"PhiResidualRMS"))->second,sect,
stat,phiRMS);
238 phiSummary = performLutTest(phiMean,phiRMS,thresholdPhiMean,thresholdPhiRMS);
241 fillWhPlot(whME[wh].
find(fullName(
"PhiLutSummary"))->
second,sect,stat,phiSummary);
244 TH1F * PhibResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhibResidual",
"Segment", chId)));
245 int phibSummary = stat==3 ? 0 : 1;
247 if (stat != 3 && PhibResidual && PhibResidual->GetEffectiveEntries()>10) {
250 if( whME[wh].
find(fullName(
"PhibResidualMean")) == whME[wh].end() ){
251 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
252 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
255 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
259 TF1 ffPhib(
"ffPhib",
"gaus");
260 PhibResidual->Fit(&ffPhib,
"CQO",
"",peak-5,peak+5);
261 phibMean = ffPhib.GetParameter(1);
262 phibRMS = ffPhib.GetParameter(2);
265 <<
" Sector " << sect <<
" Station " <<
stat;
268 std::map<std::string,MonitorElement*> &innerME = whME[wh];
269 fillWhPlot(innerME.find(fullName(
"PhibResidualMean"))->second,sect,
stat,phibMean);
270 fillWhPlot(innerME.find(fullName(
"PhibResidualRMS"))->second,sect,
stat,phibRMS);
272 phibSummary = performLutTest(phibMean,phibRMS,thresholdPhibMean,thresholdPhibRMS);
275 fillWhPlot(whME[wh].
find(fullName(
"PhibLutSummary"))->
second,sect,stat,phibSummary);
282 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
284 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
286 for (
int wh=-2; wh<=2; ++wh){
287 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
289 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(fullName(
"PhiLutSummary"))->second);
290 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(fullName(
"PhibLutSummary"))->second);
291 for (
int sect=1; sect<=12; ++sect){
297 switch (static_cast<int>(phiWhSummary->GetBinContent(sect,
stat))) {
304 switch (static_cast<int>(phibWhSummary->GetBinContent(sect,
stat))) {
312 if (phiNoData == 4) phiErr = 5;
313 if (phibNoData == 3) phibErr = 5;
314 cmsME.find(fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+wheelArrayShift,phiErr);
315 cmsME.find(fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+wheelArrayShift,phibErr);
325 bool meanErr = fabs(mean)>thresholdMean;
326 bool rmsErr = RMS>thresholdRMS;
328 return (meanErr || rmsErr) ? 2+(meanErr!=rmsErr) : 0 ;
335 int scsect = sect==13 ? 4 : 10;
336 if ( (fabs(value)>fabs(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)
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)
MonitorElement * get(std::string const &path)
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
~DTLocalTriggerLutTest() override
Destructor.
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
double getBinContent(int binx) const
get content of bin (1-D)
void beginRun(const edm::Run &r, const edm::EventSetup &c) override
BeginRun.
DTLocalTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
int wheel() const
Return the wheel number.