#include <DQM/DTMonitorClient/src/DTLocalTriggerLutTest.h>
Public Member Functions | |
DTLocalTriggerLutTest (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~DTLocalTriggerLutTest () |
Destructor. | |
Protected Member Functions | |
void | beginJob (const edm::EventSetup &c) |
Begin Job. | |
void | runClientDiagnostic () |
Run client analysis. |
Definition at line 20 of file DTLocalTriggerLutTest.h.
DTLocalTriggerLutTest::DTLocalTriggerLutTest | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 36 of file DTLocalTriggerLutTest.cc.
References DTLocalTriggerBaseTest::baseFolder, and DTLocalTriggerBaseTest::setConfig().
00036 { 00037 00038 setConfig(ps,"DTLocalTriggerLut"); 00039 baseFolder = "DT/03-LocalTrigger/"; 00040 00041 }
DTLocalTriggerLutTest::~DTLocalTriggerLutTest | ( | ) | [virtual] |
void DTLocalTriggerLutTest::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
Begin Job.
Reimplemented from DTLocalTriggerBaseTest.
Definition at line 49 of file DTLocalTriggerLutTest.cc.
References DTLocalTriggerBaseTest::beginJob(), DTLocalTriggerBaseTest::bookCmsHistos(), DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), edm::ParameterSet::getUntrackedParameter(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, DTLocalTriggerBaseTest::parameters, DTLocalTriggerBaseTest::trigSource, and DTLocalTriggerBaseTest::trigSources.
00049 { 00050 00051 DTLocalTriggerBaseTest::beginJob(c); 00052 00053 00054 vector<string>::const_iterator iTr = trigSources.begin(); 00055 vector<string>::const_iterator trEnd = trigSources.end(); 00056 vector<string>::const_iterator iHw = hwSources.begin(); 00057 vector<string>::const_iterator hwEnd = hwSources.end(); 00058 00059 00060 //Booking 00061 if(parameters.getUntrackedParameter<bool>("staticBooking", true)){ 00062 for (; iTr != trEnd; ++iTr){ 00063 trigSource = (*iTr); 00064 for (; iHw != hwEnd; ++iHw){ 00065 hwSource = (*iHw); 00066 // Loop over the TriggerUnits 00067 for (int wh=-2; wh<=2; ++wh){ 00068 for (int sect=1; sect<=12; ++sect){ 00069 bookSectorHistos(wh,sect,"","PhiTkvsTrigSlope"); 00070 bookSectorHistos(wh,sect,"","PhiTkvsTrigIntercept"); 00071 bookSectorHistos(wh,sect,"","PhiTkvsTrigCorr"); 00072 bookSectorHistos(wh,sect,"","PhibTkvsTrigSlope"); 00073 bookSectorHistos(wh,sect,"","PhibTkvsTrigIntercept"); 00074 bookSectorHistos(wh,sect,"","PhibTkvsTrigCorr"); 00075 } 00076 bookWheelHistos(wh,"","PhiResidualMean"); 00077 bookWheelHistos(wh,"","PhiResidualRMS"); 00078 bookWheelHistos(wh,"","PhibResidualMean"); 00079 bookWheelHistos(wh,"","PhibResidualRMS"); 00080 bookWheelHistos(wh,"","PhiTkvsTrigSlope"); 00081 bookWheelHistos(wh,"","PhiTkvsTrigIntercept"); 00082 bookWheelHistos(wh,"","PhiTkvsTrigCorr"); 00083 bookWheelHistos(wh,"","PhibTkvsTrigSlope"); 00084 bookWheelHistos(wh,"","PhibTkvsTrigIntercept"); 00085 bookWheelHistos(wh,"","PhibTkvsTrigCorr"); 00086 } 00087 } 00088 } 00089 } 00090 00091 // Summary test histo booking (only static) 00092 for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){ 00093 trigSource = (*iTr); 00094 for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){ 00095 hwSource = (*iHw); 00096 // Loop over the TriggerUnits 00097 for (int wh=-2; wh<=2; ++wh){ 00098 bookWheelHistos(wh,"","PhiSlopeSummary"); 00099 bookWheelHistos(wh,"","PhibSlopeSummary"); 00100 } 00101 bookCmsHistos("PhiSlopeSummary"); 00102 bookCmsHistos("PhibSlopeSummary"); 00103 } 00104 } 00105 00106 }
void DTLocalTriggerLutTest::runClientDiagnostic | ( | ) | [protected, virtual] |
Run client analysis.
Implements DTLocalTriggerBaseTest.
Definition at line 109 of file DTLocalTriggerLutTest.cc.
References DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), DTLocalTriggerBaseTest::category(), DTLocalTriggerBaseTest::cmsME, DTLocalTriggerBaseTest::dbe, end, err, find(), DTLocalTriggerBaseTest::fullName(), DQMStore::get(), QReport::getBadChannels(), MonitorElement::getEntries(), DTLocalTriggerBaseTest::getMEName(), MonitorElement::getQReport(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, i, DTLocalTriggerBaseTest::secME, DTLocalTriggerBaseTest::testName, DTLocalTriggerBaseTest::trigSource, DTLocalTriggerBaseTest::trigSources, muonGeometry::wheel, and DTLocalTriggerBaseTest::whME.
00109 { 00110 00111 // Loop over Trig & Hw sources 00112 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){ 00113 trigSource = (*iTr); 00114 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){ 00115 hwSource = (*iHw); 00116 // Loop over the TriggerUnits 00117 for (int stat=1; stat<=4; ++stat){ 00118 for (int wh=-2; wh<=2; ++wh){ 00119 for (int sect=1; sect<=12; ++sect){ 00120 DTChamberId chId(wh,stat,sect); 00121 int sector_id = (wh+3)+(sect-1)*5; 00122 00123 // Perform Correlation Plots analysis (DCC + segment Phi) 00124 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(dbe->get(getMEName("PhitkvsPhitrig","Segment", chId))); 00125 00126 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>10) { 00127 00128 // Fill client histos 00129 if( secME[sector_id].find(fullName("PhiTkvsTrigCorr")) == secME[sector_id].end() ){ 00130 bookSectorHistos(wh,sect,"","PhiTkvsTrigSlope"); 00131 bookSectorHistos(wh,sect,"","PhiTkvsTrigIntercept"); 00132 bookSectorHistos(wh,sect,"","PhiTkvsTrigCorr"); 00133 } 00134 if( whME[wh].find(fullName("PhiTkvsTrigCorr")) == whME[wh].end() ){ 00135 bookWheelHistos(wh,"","PhiTkvsTrigSlope"); 00136 bookWheelHistos(wh,"","PhiTkvsTrigIntercept"); 00137 bookWheelHistos(wh,"","PhiTkvsTrigCorr"); 00138 } 00139 00140 TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX(); 00141 double phiInt = 0; 00142 double phiSlope = 0; 00143 double phiCorr = 0; 00144 try { 00145 PhitkvsPhitrigProf->Fit("pol1","CQO"); 00146 TF1 *ffPhi= PhitkvsPhitrigProf->GetFunction("pol1"); 00147 if (ffPhi) { 00148 phiInt = ffPhi->GetParameter(0); 00149 phiSlope = ffPhi->GetParameter(1); 00150 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor(); 00151 } 00152 } catch (...) { 00153 edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhitkvsPhitrig for Wheel " << wh 00154 <<" Sector " << sect << " Station " << stat; 00155 } 00156 std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]); 00157 innerME->find(fullName("PhiTkvsTrigSlope"))->second->setBinContent(stat,phiSlope); 00158 innerME->find(fullName("PhiTkvsTrigIntercept"))->second->setBinContent(stat,phiInt); 00159 innerME->find(fullName("PhiTkvsTrigCorr"))->second->setBinContent(stat,phiCorr); 00160 00161 innerME = &(whME[wh]); 00162 innerME->find(fullName("PhiTkvsTrigSlope"))->second->setBinContent(sect,stat,phiSlope); 00163 innerME->find(fullName("PhiTkvsTrigIntercept"))->second->setBinContent(sect,stat,phiInt); 00164 innerME->find(fullName("PhiTkvsTrigCorr"))->second->setBinContent(sect,stat,phiCorr); 00165 00166 } 00167 00168 // Perform Correlation Plots analysis (DCC + segment Phib) 00169 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(dbe->get(getMEName("PhibtkvsPhibtrig","Segment", chId))); 00170 00171 if (stat != 3 && TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>10) {// station 3 has no meaningful MB3 phi bending information 00172 00173 // Fill client histos 00174 if( secME[sector_id].find(fullName("PhibTkvsTrigCorr")) == secME[sector_id].end() ){ 00175 bookSectorHistos(wh,sect,"","PhibTkvsTrigSlope"); 00176 bookSectorHistos(wh,sect,"","PhibTkvsTrigIntercept"); 00177 bookSectorHistos(wh,sect,"","PhibTkvsTrigCorr"); 00178 } 00179 if( whME[wh].find(fullName("PhibTkvsTrigCorr")) == whME[wh].end() ){ 00180 bookWheelHistos(wh,"","PhibTkvsTrigSlope"); 00181 bookWheelHistos(wh,"","PhibTkvsTrigIntercept"); 00182 bookWheelHistos(wh,"","PhibTkvsTrigCorr"); 00183 } 00184 00185 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX(); 00186 double phibInt = 0; 00187 double phibSlope = 0; 00188 double phibCorr = 0; 00189 try { 00190 PhibtkvsPhibtrigProf->Fit("pol1","CQO"); 00191 TF1 *ffPhib= PhibtkvsPhibtrigProf->GetFunction("pol1"); 00192 if (ffPhib) { 00193 phibInt = ffPhib->GetParameter(0); 00194 phibSlope = ffPhib->GetParameter(1); 00195 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor(); 00196 } 00197 } catch (...) { 00198 edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh 00199 <<" Sector " << sect << " Station " << stat; 00200 } 00201 00202 std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]); 00203 innerME->find(fullName("PhibTkvsTrigSlope"))->second->setBinContent(stat,phibSlope); 00204 innerME->find(fullName("PhibTkvsTrigIntercept"))->second->setBinContent(stat,phibInt); 00205 innerME->find(fullName("PhibTkvsTrigCorr"))->second->setBinContent(stat,phibCorr); 00206 00207 innerME = &(whME[wh]); 00208 innerME->find(fullName("PhibTkvsTrigSlope"))->second->setBinContent(sect,stat,phibSlope); 00209 innerME->find(fullName("PhibTkvsTrigIntercept"))->second->setBinContent(sect,stat,phibInt); 00210 innerME->find(fullName("PhibTkvsTrigCorr"))->second->setBinContent(sect,stat,phibCorr); 00211 00212 } 00213 00214 // Make Phi Residual Summary 00215 TH1F * PhiResidual = getHisto<TH1F>(dbe->get(getMEName("PhiResidual","Segment", chId))); 00216 00217 if (PhiResidual && PhiResidual->GetEffectiveEntries()>10) {// station 3 has no meaningful MB3 phi bending information 00218 00219 // Fill client histos 00220 if( whME[wh].find(fullName("PhiResidualMean")) == whME[wh].end() ){ 00221 bookWheelHistos(wh,"","PhiResidualMean"); 00222 bookWheelHistos(wh,"","PhiResidualRMS"); 00223 } 00224 00225 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin()); 00226 double phiMean = 0; 00227 double phiRMS = 0; 00228 try { 00229 PhiResidual->Fit("gaus","CQO","",peak-5,peak+5); 00230 TF1 *ffPhi = PhiResidual->GetFunction("gaus"); 00231 if ( ffPhi ) { 00232 phiMean = ffPhi->GetParameter(1); 00233 phiRMS = ffPhi->GetParameter(2); 00234 } 00235 } catch (...) { 00236 edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhiResidual for Wheel " << wh 00237 <<" Sector " << sect << " Station " << stat; 00238 } 00239 00240 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]); 00241 innerME->find(fullName("PhiResidualMean"))->second->setBinContent(sect,stat,phiMean); 00242 innerME->find(fullName("PhiResidualRMS"))->second->setBinContent(sect,stat,phiRMS); 00243 00244 } 00245 00246 // Make Phib Residual Summary 00247 TH1F * PhibResidual = getHisto<TH1F>(dbe->get(getMEName("PhibResidual","Segment", chId))); 00248 00249 if (stat != 3 && PhibResidual && PhibResidual->GetEffectiveEntries()>10) {// station 3 has no meaningful MB3 phi bending information 00250 00251 // Fill client histos 00252 if( whME[wh].find(fullName("PhibResidualMean")) == whME[wh].end() ){ 00253 bookWheelHistos(wh,"","PhibResidualMean"); 00254 bookWheelHistos(wh,"","PhibResidualRMS"); 00255 } 00256 00257 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin()); 00258 double phibMean = 0; 00259 double phibRMS = 0; 00260 try { 00261 PhibResidual->Fit("gaus","CQO","",peak-5,peak+5); 00262 TF1 *ffPhib = PhibResidual->GetFunction("gaus"); 00263 if ( ffPhib ) { 00264 phibMean = ffPhib->GetParameter(1); 00265 phibRMS = ffPhib->GetParameter(2); 00266 } 00267 } catch (...) { 00268 edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhibResidual for Wheel " << wh 00269 <<" Sector " << sect << " Station " << stat; 00270 } 00271 00272 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]); 00273 innerME->find(fullName("PhibResidualMean"))->second->setBinContent(sect,stat,phibMean); 00274 innerME->find(fullName("PhibResidualRMS"))->second->setBinContent(sect,stat,phibRMS); 00275 00276 } 00277 00278 } 00279 } 00280 } 00281 } 00282 } 00283 00284 // Summary Plots 00285 map<int,map<string,MonitorElement*> >::const_iterator imapIt = secME.begin(); 00286 map<int,map<string,MonitorElement*> >::const_iterator mapEnd = secME.end(); 00287 00288 for(; imapIt != mapEnd; ++imapIt){ 00289 int sector = ((*imapIt).first-1)/5 + 1; 00290 int wheel = ((*imapIt).first-1)%5 - 2; 00291 00292 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){ 00293 trigSource = (*iTr); 00294 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){ 00295 hwSource = (*iHw); 00296 00297 MonitorElement *testME = (*imapIt).second.find(fullName("PhiTkvsTrigSlope"))->second; 00298 bool hasEntries = testME->getEntries()>=1; 00299 const QReport *testQReport = testME->getQReport("TrigPhiSlopeInRange"); 00300 00301 if (testQReport) { 00302 int err = testQReport->getBadChannels().size(); 00303 if (err<0 || err>4) err=4; 00304 cmsME.find(fullName("PhiSlopeSummary"))->second->setBinContent(sector,wheel+3,err); 00305 vector<dqm::me_util::Channel> badChannels = testQReport->getBadChannels(); 00306 int cherr[4]; 00307 for (int i=0;i<4;++i) 00308 cherr[i] = hasEntries ? 0 : 1; 00309 if (hasEntries) { 00310 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); 00311 channel != badChannels.end(); channel++) { 00312 cherr[(*channel).getBin()-1] = 2 ; 00313 } 00314 } 00315 for (int i=0;i<4;++i) 00316 whME.find(wheel)->second.find(fullName("PhiSlopeSummary"))->second->setBinContent(sector,i+1,cherr[i]); 00317 } 00318 00319 testME = (*imapIt).second.find(fullName("PhibTkvsTrigSlope"))->second; 00320 hasEntries = testME->getEntries()>=1; 00321 testQReport = testME->getQReport("TrigPhibSlopeInRange"); 00322 00323 if (testQReport) { 00324 int err = testQReport->getBadChannels().size(); 00325 if (err<0 || err>4) err=4; 00326 vector<dqm::me_util::Channel> badChannels = testQReport->getBadChannels(); 00327 int cherr[4]; 00328 for (int i=0;i<4;++i) 00329 cherr[i] = hasEntries ? 0 : 1; 00330 if (hasEntries) { 00331 for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); 00332 channel != badChannels.end(); channel++) { 00333 cherr[(*channel).getBin()-1] = 2 ; 00334 if ((*channel).getBin()==3) err-=1; 00335 } 00336 } 00337 cherr[2] = 1; //MB3 has no meaningful phib info! 00338 cmsME.find(fullName("PhibSlopeSummary"))->second->setBinContent(sector,wheel+3,err); 00339 for (int i=0;i<4;++i) 00340 whME.find(wheel)->second.find(fullName("PhibSlopeSummary"))->second->setBinContent(sector,i+1,cherr[i]); 00341 } 00342 } 00343 } 00344 } 00345 }