00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "DQM/DTMonitorClient/src/DTLocalTriggerTPTest.h"
00012
00013
00014 #include "FWCore/Framework/interface/EventSetup.h"
00015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00016 #include "DQMServices/Core/interface/MonitorElement.h"
00017 #include "DQMServices/Core/interface/DQMStore.h"
00018
00019
00020 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00021 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00022
00023
00024 #include "TF1.h"
00025 #include "TProfile.h"
00026
00027
00028
00029 #include <iostream>
00030 #include <sstream>
00031
00032 using namespace edm;
00033 using namespace std;
00034
00035
00036 DTLocalTriggerTPTest::DTLocalTriggerTPTest(const edm::ParameterSet& ps){
00037
00038 setConfig(ps,"DTLocalTriggerTP");
00039 baseFolder = "DT/11-LocalTriggerTP/";
00040
00041
00042 }
00043
00044
00045 DTLocalTriggerTPTest::~DTLocalTriggerTPTest(){
00046
00047 }
00048
00049 void DTLocalTriggerTPTest::beginJob(const edm::EventSetup& c){
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
00061 if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
00062 for (; iTr != trEnd; ++iTr){
00063 trigSource = (*iTr);
00064 for (; iHw != hwEnd; ++iHw){
00065 hwSource = (*iHw);
00066
00067 for (int wh=-2; wh<=2; ++wh){
00068 bookWheelHistos(wh,"","CorrectBXPhi");
00069 bookWheelHistos(wh,"","ResidualBXPhi");
00070 }
00071 }
00072 }
00073 }
00074
00075 }
00076
00077 void DTLocalTriggerTPTest::runClientDiagnostic() {
00078
00079
00080 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
00081 trigSource = (*iTr);
00082 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
00083 hwSource = (*iHw);
00084
00085 for (int stat=1; stat<=4; ++stat){
00086 for (int wh=-2; wh<=2; ++wh){
00087 for (int sect=1; sect<=12; ++sect){
00088 DTChamberId chId(wh,stat,sect);
00089
00090
00091
00092
00093
00094 TH2F * BXvsQual = getHisto<TH2F>(dbe->get(getMEName("BXvsQual","LocalTriggerPhi", chId)));
00095 if ( BXvsQual ) {
00096
00097 if (BXvsQual->GetEntries()>1) {
00098
00099 TH1D* BX = BXvsQual->ProjectionY();
00100 int BXOK_bin = BX->GetMaximumBin();
00101 double BXMean = BX->GetMean();
00102 double BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
00103 delete BX;
00104
00105 if( whME[wh].find(fullName("CorrectBXPhi")) == whME[wh].end() ){
00106 bookWheelHistos(wh,"","ResidualBXPhi");
00107 bookWheelHistos(wh,"","CorrectBXPhi");
00108 }
00109
00110 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
00111 innerME->find(fullName("CorrectBXPhi"))->second->setBinContent(sect,stat,BX_OK+0.00001);
00112 innerME->find(fullName("ResidualBXPhi"))->second->setBinContent(sect,stat,round(25.*(BXMean-BX_OK))+0.00001);
00113 }
00114
00115 }
00116 }
00117 }
00118 }
00119 }
00120 }
00121
00122 }
00123