39 setConfig(ps,
"DTLocalTriggerLut");
40 baseFolderDCC =
"DT/03-LocalTrigger-DCC/";
41 baseFolderDDU =
"DT/04-LocalTrigger-DDU/";
61 if (bookingdone)
return;
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",
true)){
70 for (; iTr != trEnd; ++iTr){
72 for (; iHw != hwEnd; ++iHw){
75 for (
int wh=-2; wh<=2; ++wh){
76 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
77 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
78 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
79 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
82 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigSlope");
83 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigIntercept");
84 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigCorr");
85 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigSlope");
86 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigIntercept");
87 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigCorr");
95 for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){
97 for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
100 for (
int wh=-2; wh<=2; ++wh){
102 bookWheelHistos(ibooker,wh,
"PhiLutSummary");
103 bookWheelHistos(ibooker,wh,
"PhibLutSummary");
106 bookCmsHistos(ibooker,
"PhiLutSummary");
107 bookCmsHistos(ibooker,
"PhibLutSummary");
123 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
125 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
127 vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
128 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
129 for (; chIt != chEnd; ++chIt) {
131 int wh = chId.
wheel();
132 int sect = chId.sector();
133 int stat = chId.station();
139 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
141 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>10) {
144 if( whME[wh].
find(
fullName(
"PhiTkvsTrigCorr")) == whME[wh].end() ){
146 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigSlope");
147 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigIntercept");
148 bookWheelHistos(ibooker,wh,
"PhiTkvsTrigCorr");
151 TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX();
156 TF1 ffPhi(
"mypol1",
"pol1");
157 PhitkvsPhitrigProf->Fit(&ffPhi,
"CQO");
158 phiInt = ffPhi.GetParameter(0);
159 phiSlope = ffPhi.GetParameter(1);
160 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
162 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhitkvsPhitrig for Wheel " << wh
163 <<
" Sector " << sect <<
" Station " << stat;
166 std::map<std::string,MonitorElement*> &innerME = whME[wh];
167 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigSlope"))->second,sect,stat,phiSlope-1);
168 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigIntercept"))->second,sect,stat,phiInt);
169 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigCorr"))->second,sect,stat,phiCorr,
false);
174 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.
get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
176 if (stat != 3 && TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>10) {
179 if( whME[wh].
find(
fullName(
"PhibTkvsTrigCorr")) == whME[wh].end() ){
180 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigSlope");
181 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigIntercept");
182 bookWheelHistos(ibooker,wh,
"PhibTkvsTrigCorr");
185 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
187 double phibSlope = 0;
190 TF1 ffPhib(
"ffPhib",
"pol1");
191 PhibtkvsPhibtrigProf->Fit(&ffPhib,
"CQO");
192 phibInt = ffPhib.GetParameter(0);
193 phibSlope = ffPhib.GetParameter(1);
194 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
196 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh
197 <<
" Sector " << sect <<
" Station " << stat;
200 std::map<std::string,MonitorElement*> &innerME = whME[wh];
201 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigSlope"))->second,sect,stat,phibSlope-1);
202 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigIntercept"))->second,sect,stat,phibInt);
203 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigCorr"))->second,sect,stat,phibCorr,
false);
211 TH1F * PhiResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhiResidual",
"Segment", chId)));
214 if (PhiResidual && PhiResidual->GetEffectiveEntries()>10) {
217 if( whME[wh].
find(
fullName(
"PhiResidualMean")) == whME[wh].end() ){
218 bookWheelHistos(ibooker,wh,
"PhiResidualMean");
219 bookWheelHistos(ibooker,wh,
"PhiResidualRMS");
222 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
226 TF1 ffPhi(
"ffPhi",
"gaus");
227 PhiResidual->Fit(&ffPhi,
"CQO",
"",peak-5,peak+5);
228 phiMean = ffPhi.GetParameter(1);
229 phiRMS = ffPhi.GetParameter(2);
232 <<
" Sector " << sect <<
" Station " << stat;
235 std::map<std::string,MonitorElement*> &innerME = whME[wh];
236 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,phiMean);
237 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,phiRMS);
239 phiSummary = performLutTest(phiMean,phiRMS,thresholdPhiMean,thresholdPhiRMS);
245 TH1F * PhibResidual = getHisto<TH1F>(igetter.
get(getMEName(
"PhibResidual",
"Segment", chId)));
246 int phibSummary = stat==3 ? 0 : 1;
248 if (stat != 3 && PhibResidual && PhibResidual->GetEffectiveEntries()>10) {
251 if( whME[wh].
find(
fullName(
"PhibResidualMean")) == whME[wh].end() ){
252 bookWheelHistos(ibooker,wh,
"PhibResidualMean");
253 bookWheelHistos(ibooker,wh,
"PhibResidualRMS");
256 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
260 TF1 ffPhib(
"ffPhib",
"gaus");
261 PhibResidual->Fit(&ffPhib,
"CQO",
"",peak-5,peak+5);
262 phibMean = ffPhib.GetParameter(1);
263 phibRMS = ffPhib.GetParameter(2);
266 <<
" Sector " << sect <<
" Station " << stat;
269 std::map<std::string,MonitorElement*> &innerME = whME[wh];
270 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,phibMean);
271 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,phibRMS);
273 phibSummary = performLutTest(phibMean,phibRMS,thresholdPhibMean,thresholdPhibRMS);
283 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
285 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
287 for (
int wh=-2; wh<=2; ++wh){
288 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
290 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
291 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
292 for (
int sect=1; sect<=12; ++sect){
297 for (
int stat=1; stat<=4; ++stat){
298 switch (static_cast<int>(phiWhSummary->GetBinContent(sect,stat))) {
305 switch (static_cast<int>(phibWhSummary->GetBinContent(sect,stat))) {
313 if (phiNoData == 4) phiErr = 5;
314 if (phibNoData == 3) phibErr = 5;
315 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiErr);
316 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibErr);
326 bool meanErr = fabs(mean)>thresholdMean;
327 bool rmsErr = RMS>thresholdRMS;
329 return (meanErr || rmsErr) ? 2+(meanErr!=rmsErr) : 0 ;
336 int scsect = sect==13 ? 4 : 10;
337 if ( (fabs(value)>fabs(plot->
getBinContent(scsect,stat)))==lessIsBest) {
void runClientDiagnostic(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Run client analysis.
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Perform client diagnostic in online.
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * get(const std::string &path)
void beginRun(const edm::Run &r, const edm::EventSetup &c)
BeginRun.
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
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 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)
double getBinContent(int binx) const
get content of bin (1-D)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &)
DTLocalTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
int wheel() const
Return the wheel number.
virtual ~DTLocalTriggerLutTest()
Destructor.