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 PhitkvsPhitrigProf->Fit(
"pol1",
"CQO");
148 TF1 *ffPhi= PhitkvsPhitrigProf->GetFunction(
"pol1");
150 phiInt = ffPhi->GetParameter(0);
151 phiSlope = ffPhi->GetParameter(1);
152 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
155 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhitkvsPhitrig for Wheel " << wh
156 <<
" Sector " << sect <<
" Station " << stat;
159 std::map<std::string,MonitorElement*> &innerME = whME[wh];
160 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigSlope"))->second,sect,stat,phiSlope-1);
161 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigIntercept"))->second,sect,stat,phiInt);
162 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigCorr"))->second,sect,stat,phiCorr,
false);
167 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(dbe->get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
169 if (stat != 3 && TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>10) {
172 if( whME[wh].
find(
fullName(
"PhibTkvsTrigCorr")) == whME[wh].end() ){
173 bookWheelHistos(wh,
"PhibTkvsTrigSlope");
174 bookWheelHistos(wh,
"PhibTkvsTrigIntercept");
175 bookWheelHistos(wh,
"PhibTkvsTrigCorr");
178 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
180 double phibSlope = 0;
183 PhibtkvsPhibtrigProf->Fit(
"pol1",
"CQO");
184 TF1 *ffPhib= PhibtkvsPhibtrigProf->GetFunction(
"pol1");
186 phibInt = ffPhib->GetParameter(0);
187 phibSlope = ffPhib->GetParameter(1);
188 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
191 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh
192 <<
" Sector " << sect <<
" Station " << stat;
195 std::map<std::string,MonitorElement*> &innerME = whME[wh];
196 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigSlope"))->second,sect,stat,phibSlope-1);
197 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigIntercept"))->second,sect,stat,phibInt);
198 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigCorr"))->second,sect,stat,phibCorr,
false);
205 TH1F * PhiResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhiResidual",
"Segment", chId)));
208 if (PhiResidual && PhiResidual->GetEffectiveEntries()>10) {
211 if( whME[wh].
find(
fullName(
"PhiResidualMean")) == whME[wh].end() ){
212 bookWheelHistos(wh,
"PhiResidualMean");
213 bookWheelHistos(wh,
"PhiResidualRMS");
216 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
220 PhiResidual->Fit(
"gaus",
"CQO",
"",peak-5,peak+5);
221 TF1 *ffPhi = PhiResidual->GetFunction(
"gaus");
223 phiMean = ffPhi->GetParameter(1);
224 phiRMS = ffPhi->GetParameter(2);
228 <<
" Sector " << sect <<
" Station " << stat;
231 std::map<std::string,MonitorElement*> &innerME = whME[wh];
232 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,phiMean);
233 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,phiRMS);
235 phiSummary = performLutTest(phiMean,phiRMS,thresholdPhiMean,thresholdPhiRMS);
241 TH1F * PhibResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhibResidual",
"Segment", chId)));
242 int phibSummary = stat==3 ? 0 : 1;
244 if (stat != 3 && PhibResidual && PhibResidual->GetEffectiveEntries()>10) {
247 if( whME[wh].
find(
fullName(
"PhibResidualMean")) == whME[wh].end() ){
248 bookWheelHistos(wh,
"PhibResidualMean");
249 bookWheelHistos(wh,
"PhibResidualRMS");
252 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
256 PhibResidual->Fit(
"gaus",
"CQO",
"",peak-5,peak+5);
257 TF1 *ffPhib = PhibResidual->GetFunction(
"gaus");
259 phibMean = ffPhib->GetParameter(1);
260 phibRMS = ffPhib->GetParameter(2);
264 <<
" Sector " << sect <<
" Station " << stat;
267 std::map<std::string,MonitorElement*> &innerME = whME[wh];
268 fillWhPlot(innerME.find(
fullName(
"PhibResidualMean"))->second,sect,stat,phibMean);
269 fillWhPlot(innerME.find(
fullName(
"PhibResidualRMS"))->second,sect,stat,phibRMS);
271 phibSummary = performLutTest(phibMean,phibRMS,thresholdPhibMean,thresholdPhibRMS);
281 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
283 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
285 for (
int wh=-2; wh<=2; ++wh){
286 std::map<std::string,MonitorElement*> *innerME = &(whME[wh]);
288 TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhiLutSummary"))->second);
289 TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(
fullName(
"PhibLutSummary"))->second);
290 for (
int sect=1; sect<=12; ++sect){
295 for (
int stat=1; stat<=4; ++stat){
296 switch (static_cast<int>(phiWhSummary->GetBinContent(sect,stat))) {
303 switch (static_cast<int>(phibWhSummary->GetBinContent(sect,stat))) {
311 if (phiNoData == 4) phiErr = 5;
312 if (phibNoData == 3) phibErr = 5;
313 cmsME.find(
fullName(
"PhiLutSummary"))->second->setBinContent(sect,wh+3,phiErr);
314 cmsME.find(
fullName(
"PhibLutSummary"))->second->setBinContent(sect,wh+3,phibErr);
324 bool meanErr = fabs(mean)>thresholdMean;
325 bool rmsErr = RMS>thresholdRMS;
327 return (meanErr || rmsErr) ? 2+(meanErr!=rmsErr) : 0 ;
334 int scsect = sect==13 ? 4 : 10;
335 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.