36 setConfig(ps,
"DTLocalTriggerLut");
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",
true)){
65 for (; iTr != trEnd; ++iTr){
67 for (; iHw != hwEnd; ++iHw){
70 for (
int wh=-2; wh<=2; ++wh){
71 bookWheelHistos(wh,
"PhiResidualMean");
72 bookWheelHistos(wh,
"PhiResidualRMS");
73 bookWheelHistos(wh,
"PhibResidualMean");
74 bookWheelHistos(wh,
"PhibResidualRMS");
76 bookWheelHistos(wh,
"PhiTkvsTrigSlope");
77 bookWheelHistos(wh,
"PhiTkvsTrigIntercept");
78 bookWheelHistos(wh,
"PhiTkvsTrigCorr");
79 bookWheelHistos(wh,
"PhibTkvsTrigSlope");
80 bookWheelHistos(wh,
"PhibTkvsTrigIntercept");
81 bookWheelHistos(wh,
"PhibTkvsTrigCorr");
89 for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){
91 for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
94 for (
int wh=-2; wh<=2; ++wh){
95 bookWheelHistos(wh,
"PhiLutSummary");
96 bookWheelHistos(wh,
"PhibLutSummary");
98 bookCmsHistos(
"PhiLutSummary");
99 bookCmsHistos(
"PhibLutSummary");
116 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
118 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
120 vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
121 vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
122 for (; chIt != chEnd; ++chIt) {
124 int wh = chId.
wheel();
125 int sect = chId.sector();
126 int stat = chId.station();
131 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(dbe->get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
133 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>10) {
136 if( whME[wh].
find(
fullName(
"PhiTkvsTrigCorr")) == whME[wh].end() ){
137 bookWheelHistos(wh,
"PhiTkvsTrigSlope");
138 bookWheelHistos(wh,
"PhiTkvsTrigIntercept");
139 bookWheelHistos(wh,
"PhiTkvsTrigCorr");
142 TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX();
147 TF1 ffPhi(
"mypol1",
"pol1");
148 PhitkvsPhitrigProf->Fit(&ffPhi,
"CQO");
149 phiInt = ffPhi.GetParameter(0);
150 phiSlope = ffPhi.GetParameter(1);
151 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
153 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhitkvsPhitrig for Wheel " << wh
154 <<
" Sector " << sect <<
" Station " << stat;
157 std::map<std::string,MonitorElement*> &innerME = whME[wh];
158 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigSlope"))->second,sect,stat,phiSlope-1);
159 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigIntercept"))->second,sect,stat,phiInt);
160 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigCorr"))->second,sect,stat,phiCorr,
false);
165 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(dbe->get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
167 if (stat != 3 && TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>10) {
170 if( whME[wh].
find(
fullName(
"PhibTkvsTrigCorr")) == whME[wh].end() ){
171 bookWheelHistos(wh,
"PhibTkvsTrigSlope");
172 bookWheelHistos(wh,
"PhibTkvsTrigIntercept");
173 bookWheelHistos(wh,
"PhibTkvsTrigCorr");
176 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
178 double phibSlope = 0;
181 TF1 ffPhib(
"ffPhib",
"pol1");
182 PhibtkvsPhibtrigProf->Fit(&ffPhib,
"CQO");
183 phibInt = ffPhib.GetParameter(0);
184 phibSlope = ffPhib.GetParameter(1);
185 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
187 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh
188 <<
" Sector " << sect <<
" Station " << stat;
191 std::map<std::string,MonitorElement*> &innerME = whME[wh];
192 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigSlope"))->second,sect,stat,phibSlope-1);
193 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigIntercept"))->second,sect,stat,phibInt);
194 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigCorr"))->second,sect,stat,phibCorr,
false);
201 TH1F * PhiResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhiResidual",
"Segment", chId)));
204 if (PhiResidual && PhiResidual->GetEffectiveEntries()>10) {
207 if( whME[wh].
find(
fullName(
"PhiResidualMean")) == whME[wh].end() ){
208 bookWheelHistos(wh,
"PhiResidualMean");
209 bookWheelHistos(wh,
"PhiResidualRMS");
212 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
216 TF1 ffPhi(
"ffPhi",
"gaus");
217 PhiResidual->Fit(&ffPhi,
"CQO",
"",peak-5,peak+5);
218 phiMean = ffPhi.GetParameter(1);
219 phiRMS = ffPhi.GetParameter(2);
222 <<
" Sector " << sect <<
" Station " << stat;
225 std::map<std::string,MonitorElement*> &innerME = whME[wh];
226 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,phiMean);
227 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,phiRMS);
229 phiSummary = performLutTest(phiMean,phiRMS,thresholdPhiMean,thresholdPhiRMS);
235 TH1F * PhibResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhibResidual",
"Segment", chId)));
236 int phibSummary = stat==3 ? 0 : 1;
238 if (stat != 3 && PhibResidual && PhibResidual->GetEffectiveEntries()>10) {
241 if( whME[wh].
find(
fullName(
"PhibResidualMean")) == whME[wh].end() ){
242 bookWheelHistos(wh,
"PhibResidualMean");
243 bookWheelHistos(wh,
"PhibResidualRMS");
246 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
250 TF1 ffPhib(
"ffPhib",
"gaus");
251 PhibResidual->Fit(&ffPhib,
"CQO",
"",peak-5,peak+5);
252 phibMean = ffPhib.GetParameter(1);
253 phibRMS = ffPhib.GetParameter(2);
256 <<
" Sector " << sect <<
" Station " << stat;
259 std::map<std::string,MonitorElement*> &innerME = whME[wh];
260 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,phibMean);
261 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,phibRMS);
263 phibSummary = performLutTest(phibMean,phibRMS,thresholdPhibMean,thresholdPhibRMS);
273 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
275 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
277 for (
int wh=-2; wh<=2; ++wh){
278 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
280 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
281 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
282 for (
int sect=1; sect<=12; ++sect){
287 for (
int stat=1; stat<=4; ++stat){
288 switch (static_cast<int>(phiWhSummary->GetBinContent(sect,stat))) {
295 switch (static_cast<int>(phibWhSummary->GetBinContent(sect,stat))) {
303 if (phiNoData == 4) phiErr = 5;
304 if (phibNoData == 3) phibErr = 5;
305 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiErr);
306 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibErr);
316 bool meanErr = fabs(mean)>thresholdMean;
317 bool rmsErr = RMS>thresholdRMS;
319 return (meanErr || rmsErr) ? 2+(meanErr!=rmsErr) : 0 ;
326 int scsect = sect==13 ? 4 : 10;
327 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)
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)
void runClientDiagnostic()
Run client analysis.
double getBinContent(int binx) const
get content of bin (1-D)
DTLocalTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
int wheel() const
Return the wheel number.
virtual ~DTLocalTriggerLutTest()
Destructor.