38 setConfig(ps,
"DTLocalTriggerLut");
39 baseFolderDCC =
"DT/03-LocalTrigger-DCC/";
40 baseFolderDDU =
"DT/04-LocalTrigger-DDU/";
60 vector<string>::const_iterator iTr = trigSources.begin();
61 vector<string>::const_iterator trEnd = trigSources.end();
62 vector<string>::const_iterator iHw = hwSources.begin();
63 vector<string>::const_iterator hwEnd = hwSources.end();
66 if(
parameters.getUntrackedParameter<
bool>(
"staticBooking",
true)){
67 for (; iTr != trEnd; ++iTr){
69 for (; iHw != hwEnd; ++iHw){
72 for (
int wh=-2; wh<=2; ++wh){
73 bookWheelHistos(wh,
"PhiResidualMean");
74 bookWheelHistos(wh,
"PhiResidualRMS");
75 bookWheelHistos(wh,
"PhibResidualMean");
76 bookWheelHistos(wh,
"PhibResidualRMS");
78 bookWheelHistos(wh,
"PhiTkvsTrigSlope");
79 bookWheelHistos(wh,
"PhiTkvsTrigIntercept");
80 bookWheelHistos(wh,
"PhiTkvsTrigCorr");
81 bookWheelHistos(wh,
"PhibTkvsTrigSlope");
82 bookWheelHistos(wh,
"PhibTkvsTrigIntercept");
83 bookWheelHistos(wh,
"PhibTkvsTrigCorr");
91 for (iTr = trigSources.begin(); iTr != trEnd; ++iTr){
93 for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
96 for (
int wh=-2; wh<=2; ++wh){
97 bookWheelHistos(wh,
"PhiLutSummary");
98 bookWheelHistos(wh,
"PhibLutSummary");
100 bookCmsHistos(
"PhiLutSummary");
101 bookCmsHistos(
"PhibLutSummary");
118 for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
120 for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
122 vector<DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
123 vector<DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
124 for (; chIt != chEnd; ++chIt) {
126 int wh = chId.
wheel();
127 int sect = chId.sector();
128 int stat = chId.station();
133 TH2F * TrackPhitkvsPhitrig = getHisto<TH2F>(dbe->get(getMEName(
"PhitkvsPhitrig",
"Segment", chId)));
135 if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries()>10) {
138 if( whME[wh].
find(
fullName(
"PhiTkvsTrigCorr")) == whME[wh].end() ){
139 bookWheelHistos(wh,
"PhiTkvsTrigSlope");
140 bookWheelHistos(wh,
"PhiTkvsTrigIntercept");
141 bookWheelHistos(wh,
"PhiTkvsTrigCorr");
144 TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX();
149 PhitkvsPhitrigProf->Fit(
"pol1",
"CQO");
150 TF1 *ffPhi= PhitkvsPhitrigProf->GetFunction(
"pol1");
152 phiInt = ffPhi->GetParameter(0);
153 phiSlope = ffPhi->GetParameter(1);
154 phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
157 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhitkvsPhitrig for Wheel " << wh
158 <<
" Sector " << sect <<
" Station " << stat;
161 std::map<std::string,MonitorElement*> &innerME = whME[wh];
162 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigSlope"))->second,sect,stat,phiSlope-1);
163 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigIntercept"))->second,sect,stat,phiInt);
164 fillWhPlot(innerME.find(
fullName(
"PhiTkvsTrigCorr"))->second,sect,stat,phiCorr,
false);
169 TH2F * TrackPhibtkvsPhibtrig = getHisto<TH2F>(dbe->get(getMEName(
"PhibtkvsPhibtrig",
"Segment", chId)));
171 if (stat != 3 && TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries()>10) {
174 if( whME[wh].
find(
fullName(
"PhibTkvsTrigCorr")) == whME[wh].end() ){
175 bookWheelHistos(wh,
"PhibTkvsTrigSlope");
176 bookWheelHistos(wh,
"PhibTkvsTrigIntercept");
177 bookWheelHistos(wh,
"PhibTkvsTrigCorr");
180 TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
182 double phibSlope = 0;
185 PhibtkvsPhibtrigProf->Fit(
"pol1",
"CQO");
186 TF1 *ffPhib= PhibtkvsPhibtrigProf->GetFunction(
"pol1");
188 phibInt = ffPhib->GetParameter(0);
189 phibSlope = ffPhib->GetParameter(1);
190 phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
193 edm::LogError(
category()) <<
"[" << testName <<
"Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh
194 <<
" Sector " << sect <<
" Station " << stat;
197 std::map<std::string,MonitorElement*> &innerME = whME[wh];
198 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigSlope"))->second,sect,stat,phibSlope-1);
199 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigIntercept"))->second,sect,stat,phibInt);
200 fillWhPlot(innerME.find(
fullName(
"PhibTkvsTrigCorr"))->second,sect,stat,phibCorr,
false);
207 TH1F * PhiResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhiResidual",
"Segment", chId)));
210 if (PhiResidual && PhiResidual->GetEffectiveEntries()>10) {
213 if( whME[wh].
find(
fullName(
"PhiResidualMean")) == whME[wh].end() ){
214 bookWheelHistos(wh,
"PhiResidualMean");
215 bookWheelHistos(wh,
"PhiResidualRMS");
218 double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
222 PhiResidual->Fit(
"gaus",
"CQO",
"",peak-5,peak+5);
223 TF1 *ffPhi = PhiResidual->GetFunction(
"gaus");
225 phiMean = ffPhi->GetParameter(1);
226 phiRMS = ffPhi->GetParameter(2);
230 <<
" Sector " << sect <<
" Station " << stat;
233 std::map<std::string,MonitorElement*> &innerME = whME[wh];
234 fillWhPlot(innerME.find(
fullName(
"PhiResidualMean"))->second,sect,stat,phiMean);
235 fillWhPlot(innerME.find(
fullName(
"PhiResidualRMS"))->second,sect,stat,phiRMS);
237 phiSummary = performLutTest(phiMean,phiRMS,thresholdPhiMean,thresholdPhiRMS);
243 TH1F * PhibResidual = getHisto<TH1F>(dbe->get(getMEName(
"PhibResidual",
"Segment", chId)));
244 int phibSummary = stat==3 ? 0 : 1;
246 if (stat != 3 && PhibResidual && PhibResidual->GetEffectiveEntries()>10) {
249 if( whME[wh].
find(
fullName(
"PhibResidualMean")) == whME[wh].end() ){
250 bookWheelHistos(wh,
"PhibResidualMean");
251 bookWheelHistos(wh,
"PhibResidualRMS");
254 double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
258 PhibResidual->Fit(
"gaus",
"CQO",
"",peak-5,peak+5);
259 TF1 *ffPhib = PhibResidual->GetFunction(
"gaus");
261 phibMean = ffPhib->GetParameter(1);
262 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) {
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)
static const std::string category("Muon|RecoMuon|L3MuonCandidateProducerFromMuons")
DTLocalTriggerLutTest(const edm::ParameterSet &ps)
Constructor.
int wheel() const
Return the wheel number.
virtual ~DTLocalTriggerLutTest()
Destructor.