CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
MuonTestSummary Class Reference

#include <MuonTestSummary.h>

Inheritance diagram for MuonTestSummary:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 MuonTestSummary (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~MuonTestSummary ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 Histograms initialisation. More...
 
void doEnergyTests (std::string nameHisto, std::string muonType, int bin)
 
void doKinematicsTests (std::string muonType, int bin)
 test operations More...
 
void doMultiplicityTests ()
 
void doMuonIDTests ()
 
void doResidualsTests (std::string type, std::string parameter, int bin)
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 Diagnostic. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
void GaussFit (std::string type, std::string parameter, MonitorElement *Histo, float &mean, float &mean_err, float &sigma, float &sigma_err)
 
void ResidualCheck (std::string muType, const std::vector< std::string > &resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

double chi2Fraction
 
double chi2Spread
 
MonitorElementchi2TestSummaryMap
 
DQMStoredbe
 
MonitorElementenergySummaryMap
 
double etaExpected
 
double expMultiplicityGlb_max
 
double expMultiplicityGlb_min
 
double expMultiplicitySta_max
 
double expMultiplicitySta_min
 
double expMultiplicityTk_max
 
double expMultiplicityTk_min
 
double expPeakEcalS9_max
 
double expPeakEcalS9_min
 
double expPeakHadS9_max
 
double expPeakHadS9_min
 
MonitorElementkinematicsSummaryMap
 
MonitorElementKolmogorovTestSummaryMap
 
double matchesFractionCsc_max
 
double matchesFractionCsc_min
 
double matchesFractionDt_max
 
double matchesFractionDt_min
 
std::string metname
 
MonitorElementmultiplicitySummaryMap
 
MonitorElementmuonIdSummaryMap
 
double numMatchedExpected_max
 
double numMatchedExpected_min
 
double phiExpected
 
double pullEtaSpread
 
double pullOneOvPSpread
 
double pullPhiSpread
 
double resChargeLimit_glbSta
 
double resChargeLimit_tkGlb
 
double resChargeLimit_tkSta
 
double resEtaSpread_glbSta
 
double resEtaSpread_tkGlb
 
MonitorElementresidualsSummaryMap
 
double resOneOvPSpread_glbSta
 
double resOneOvPSpread_tkGlb
 
double resPhiSpread_glbSta
 
double resPhiSpread_tkGlb
 
double resSegmTrack_mean_max
 
double resSegmTrack_mean_min
 
double resSegmTrack_rms_max
 
double resSegmTrack_rms_min
 
double sigmaResSegmTrackExp
 
MonitorElementsummaryCertification
 
MonitorElementsummaryCertificationMap
 
MonitorElementsummaryReport
 
MonitorElementsummaryReportMap
 
std::vector< MonitorElement * > theCertificationContents
 
std::vector< MonitorElement * > theSummaryContents
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 34 of file MuonTestSummary.h.

Constructor & Destructor Documentation

MuonTestSummary::MuonTestSummary ( const edm::ParameterSet ps)

Constructor.

Definition at line 30 of file MuonTestSummary.cc.

References edm::ParameterSet::getParameter(), and cppFunctionSkipper::operator.

30  {
31 
33 
34  // parameter initialization for kinematics test
35  etaExpected = ps.getParameter<double>("etaExpected");
36  phiExpected = ps.getParameter<double>("phiExpected");
37  chi2Fraction = ps.getParameter<double>("chi2Fraction");
38  chi2Spread = ps.getParameter<double>("chi2Spread");
39  resEtaSpread_tkGlb = ps.getParameter<double>("resEtaSpread_tkGlb");
40  resEtaSpread_glbSta = ps.getParameter<double>("resEtaSpread_glbSta");
41  resPhiSpread_tkGlb = ps.getParameter<double>("resPhiSpread_tkGlb");
42  resPhiSpread_glbSta = ps.getParameter<double>("resPhiSpread_glbSta");
43  resOneOvPSpread_tkGlb = ps.getParameter<double>("resOneOvPSpread_tkGlb");
44  resOneOvPSpread_glbSta = ps.getParameter<double>("resOneOvPSpread_glbSta");
45  pullEtaSpread = ps.getParameter<double>("pullEtaSpread");
46  pullPhiSpread = ps.getParameter<double>("pullPhiSpread");
47  pullOneOvPSpread = ps.getParameter<double>("pullOneOvPSpread");
48  resChargeLimit_tkGlb = ps.getParameter<double>("resChargeLimit_tkGlb");
49  resChargeLimit_glbSta = ps.getParameter<double>("resChargeLimit_glbSta");
50  resChargeLimit_tkSta = ps.getParameter<double>("resChargeLimit_tkSta");
51  numMatchedExpected_min = ps.getParameter<double>("numMatchedExpected_min");
52  numMatchedExpected_max = ps.getParameter<double>("numMatchedExpected_max");
53  matchesFractionDt_min = ps.getParameter<double>("matchesFractionDt_min");
54  matchesFractionDt_max = ps.getParameter<double>("matchesFractionDt_max");
55  matchesFractionCsc_min = ps.getParameter<double>("matchesFractionCsc_min");
56  matchesFractionCsc_max = ps.getParameter<double>("matchesFractionCsc_max");
57  resSegmTrack_rms_min = ps.getParameter<double>("resSegmTrack_rms_min");
58  resSegmTrack_rms_max = ps.getParameter<double>("resSegmTrack_rms_max");
59  resSegmTrack_mean_min = ps.getParameter<double>("resSegmTrack_mean_min");
60  resSegmTrack_mean_max = ps.getParameter<double>("resSegmTrack_mean_max");
61  expPeakEcalS9_min = ps.getParameter<double>("expPeakEcalS9_min");
62  expPeakEcalS9_max = ps.getParameter<double>("expPeakEcalS9_max");
63  expPeakHadS9_min = ps.getParameter<double>("expPeakHadS9_min");
64  expPeakHadS9_max = ps.getParameter<double>("expPeakHadS9_max");
65  expMultiplicityGlb_max = ps.getParameter<double>("expMultiplicityGlb_max");
66  expMultiplicityTk_max = ps.getParameter<double>("expMultiplicityTk_max");
67  expMultiplicitySta_max = ps.getParameter<double>("expMultiplicitySta_max");
68  expMultiplicityGlb_min = ps.getParameter<double>("expMultiplicityGlb_min");
69  expMultiplicityTk_min = ps.getParameter<double>("expMultiplicityTk_min");
70  expMultiplicitySta_min = ps.getParameter<double>("expMultiplicitySta_min");
71 
72 }
T getParameter(std::string const &) const
double matchesFractionCsc_max
double expMultiplicityTk_max
double resSegmTrack_rms_min
double resSegmTrack_rms_max
double expMultiplicityGlb_min
double resSegmTrack_mean_min
double resSegmTrack_mean_max
double resPhiSpread_tkGlb
double matchesFractionDt_max
double matchesFractionCsc_min
double resEtaSpread_glbSta
double resPhiSpread_glbSta
double resOneOvPSpread_glbSta
double resOneOvPSpread_tkGlb
double resEtaSpread_tkGlb
double resChargeLimit_glbSta
double numMatchedExpected_min
double expMultiplicityGlb_max
double expMultiplicityTk_min
double numMatchedExpected_max
double resChargeLimit_tkGlb
double resChargeLimit_tkSta
double expMultiplicitySta_min
double expMultiplicitySta_max
double matchesFractionDt_min
MuonTestSummary::~MuonTestSummary ( )
virtual

Destructor.

Definition at line 74 of file MuonTestSummary.cc.

74 {}

Member Function Documentation

void MuonTestSummary::analyze ( const edm::Event e,
const edm::EventSetup c 
)
inlineprotectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 50 of file MuonTestSummary.h.

50 {}
void MuonTestSummary::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file MuonTestSummary.cc.

References LogTrace, and metname.

76  {
77 
78  metname = "muonTestSummary";
79  LogTrace(metname)<<"[MuonTestSummary] beginJob: Histo booking";
80 
81  // book the summary histos
82  dbe->setCurrentFolder("Muons/TestSummary");
83 
84  // kinematics test report
85  kinematicsSummaryMap = dbe->book2D("kinematicsSummaryMap","Kinematics test summary",5,1,6,3,1,4);
86  kinematicsSummaryMap->setAxisTitle("track monitored",1);
88  kinematicsSummaryMap->setBinLabel(2,"TKfromGLB",1);
89  kinematicsSummaryMap->setBinLabel(3,"STAfromGLB",1);
92  kinematicsSummaryMap->setAxisTitle("parameter tested",2);
93  kinematicsSummaryMap->setBinLabel(1,"#chi^{2}",2);
94  kinematicsSummaryMap->setBinLabel(2,"#eta",2);
95  kinematicsSummaryMap->setBinLabel(3,"#phi",2);
96 
97  //chi2 kinematics quality test report
98  chi2TestSummaryMap = dbe->book2D("chi2TestSummaryMap","#chi2 quality test summary",5,1,6,5,1,6);
99  chi2TestSummaryMap->setAxisTitle("track monitored",1);
100  chi2TestSummaryMap->setBinLabel(1,"GLB",1);
101  chi2TestSummaryMap->setBinLabel(2,"TKfromGLB",1);
102  chi2TestSummaryMap->setBinLabel(3,"STAfromGLB",1);
103  chi2TestSummaryMap->setBinLabel(4,"TK",1);
104  chi2TestSummaryMap->setBinLabel(5,"STA",1);
105  chi2TestSummaryMap->setAxisTitle("parameter tested",2);
106  chi2TestSummaryMap->setBinLabel(1,"#chi^{2}",2);
107  chi2TestSummaryMap->setBinLabel(2,"#eta",2);
108  chi2TestSummaryMap->setBinLabel(3,"#phi",2);
109  chi2TestSummaryMap->setBinLabel(4,"#pt",2);
110  chi2TestSummaryMap->setBinLabel(5,"#q",2);
111 
112 //Kolmogorov kinematics quality test report
113  KolmogorovTestSummaryMap = dbe->book2D("KolmogorovTestSummaryMap","Kolmogorov quality test summary",5,1,6,5,1,6);
114  KolmogorovTestSummaryMap->setAxisTitle("track monitored",1);
116  KolmogorovTestSummaryMap->setBinLabel(2,"TKfromGLB",1);
117  KolmogorovTestSummaryMap->setBinLabel(3,"STAfromGLB",1);
120  KolmogorovTestSummaryMap->setAxisTitle("parameter tested",2);
121  KolmogorovTestSummaryMap->setBinLabel(1,"#chi^{2}",2);
126 
127 
128  // residuals test report
129  residualsSummaryMap = dbe->book2D("residualsSummaryMap","Residuals test summary",4,1,5,4,1,5);
130  residualsSummaryMap->setAxisTitle("residuals",1);
131  residualsSummaryMap->setBinLabel(1,"TK-GLB",1);
132  residualsSummaryMap->setBinLabel(2,"GLB-STA",1);
133  residualsSummaryMap->setBinLabel(3,"TK-STA",1);
134  residualsSummaryMap->setBinLabel(4,"TK-STA Pull",1);
135  residualsSummaryMap->setAxisTitle("parameter tested",2);
136  residualsSummaryMap->setBinLabel(1,"#eta",2);
137  residualsSummaryMap->setBinLabel(2,"#phi",2);
138  residualsSummaryMap->setBinLabel(3,"1/p",2);
140 
141  // muonId test report
142  muonIdSummaryMap = dbe->book2D("muonIdSummaryMap","muonId test summary",4,1,5, 5,1,6);
143  muonIdSummaryMap->setAxisTitle("muons",1);
144  muonIdSummaryMap->setBinLabel(1,"GLB DT",1);
145  muonIdSummaryMap->setBinLabel(2,"GLB CSC",1);
146  muonIdSummaryMap->setBinLabel(3,"TK DT",1);
147  muonIdSummaryMap->setBinLabel(4,"TK CSC",1);
148  muonIdSummaryMap->setAxisTitle("tests",2);
149  muonIdSummaryMap->setBinLabel(1,"#assSeg",2);
150  muonIdSummaryMap->setBinLabel(2,"x mean",2);
151  muonIdSummaryMap->setBinLabel(3,"x rms",2);
152  muonIdSummaryMap->setBinLabel(4,"y mean",2);
153  muonIdSummaryMap->setBinLabel(5,"y rms",2);
154 
155  // energy test report
156  energySummaryMap = dbe->book2D("energySummaryMap","Energy deposits test summary",3,1,4,3,1,4);
157  energySummaryMap->setAxisTitle("muons",1);
158  energySummaryMap->setBinLabel(1,"GLB",1);
159  energySummaryMap->setBinLabel(2,"TK",1);
160  energySummaryMap->setBinLabel(3,"STA",1);
161  energySummaryMap->setAxisTitle("calorimeter tested",2);
162  energySummaryMap->setBinLabel(1,"ECAL",2);
163  energySummaryMap->setBinLabel(2,"HAD",2);
164  energySummaryMap->setBinLabel(3,"H0",2);
165 
166  // multiplicity tests report
167  multiplicitySummaryMap = dbe->book1D("multiplicitySummaryMap","muon multiplicity test summary",3,1,4);
172 
173 
174  // summary test report
175  dbe->setCurrentFolder("Muons/EventInfo");
176  summaryReport = dbe->bookFloat("reportSummary");
177 
178  summaryReportMap = dbe->book2D("reportSummaryMap","Muon Report Summary Map",3,1,4,7,1,8);
179  summaryReportMap->setAxisTitle("muons",1);
180  summaryReportMap->setBinLabel(1,"GLB",1);
181  summaryReportMap->setBinLabel(2,"TK",1);
182  summaryReportMap->setBinLabel(3,"STA",1);
183  summaryReportMap->setAxisTitle("test",2);
184  summaryReportMap->setBinLabel(1,"#chi^{2}/Df",2);
185  summaryReportMap->setBinLabel(2,"#eta",2);
186  summaryReportMap->setBinLabel(3,"#phi",2);
187  summaryReportMap->setBinLabel(4,"residuals",2);
188  summaryReportMap->setBinLabel(5,"muonId",2);
189  summaryReportMap->setBinLabel(6,"energyDeposits",2);
190  summaryReportMap->setBinLabel(7,"multiplicity",2);
191 
192  dbe->setCurrentFolder("Muons/EventInfo/reportSummaryContents");
193  theSummaryContents.push_back(dbe->bookFloat("kinematics_GLB"));
194  theSummaryContents.push_back(dbe->bookFloat("muonId_GLB"));
195  theSummaryContents.push_back(dbe->bookFloat("residuals_GLB"));
196  theSummaryContents.push_back(dbe->bookFloat("GLB"));
197  theSummaryContents.push_back(dbe->bookFloat("kinematics_TK"));
198  theSummaryContents.push_back(dbe->bookFloat("muonId_TK"));
199  theSummaryContents.push_back(dbe->bookFloat("residuals_TK"));
200  theSummaryContents.push_back(dbe->bookFloat("TK"));
201  theSummaryContents.push_back(dbe->bookFloat("kinematics_STA"));
202  theSummaryContents.push_back(dbe->bookFloat("residuals_STA"));
203  theSummaryContents.push_back(dbe->bookFloat("STA"));
204  theSummaryContents.push_back(dbe->bookFloat("energyDeposits"));
205  theSummaryContents.push_back(dbe->bookFloat("multiplicity"));
206 
207  // certification report
208  dbe->setCurrentFolder("Muons/EventInfo");
209  summaryCertification = dbe->bookFloat("CertificationSummary");
211 
212  summaryCertificationMap = dbe->book2D("CertificationSummaryMap","Muon Certification Summary Map",9,1,10,7,1,8);
214  summaryCertificationMap->setBinLabel(1,"GLB_Tot",1);
215  summaryCertificationMap->setBinLabel(2,"TK_Tot",1);
216  summaryCertificationMap->setBinLabel(3,"STA_tot",1);
217  summaryCertificationMap->setBinLabel(4,"GLB_B",1);
219  summaryCertificationMap->setBinLabel(6,"STA_B",1);
220  summaryCertificationMap->setBinLabel(7,"GLB_EC",1);
221  summaryCertificationMap->setBinLabel(8,"TK_EC",1);
222  summaryCertificationMap->setBinLabel(9,"STA_EC",1);
224  summaryCertificationMap->setBinLabel(1,"#chi^{2}/Df",2);
227  summaryCertificationMap->setBinLabel(4,"residuals",2);
228  summaryCertificationMap->setBinLabel(5,"muonId",2);
229  summaryCertificationMap->setBinLabel(6,"energyDeposits",2);
230  summaryCertificationMap->setBinLabel(7,"multiplicity",2);
231 
232  dbe->setCurrentFolder("Muons/EventInfo/CertificationContents");
233  theCertificationContents.push_back(dbe->bookFloat("GLB_Tot"));
234  theCertificationContents.push_back(dbe->bookFloat("STA_Tot"));
235  theCertificationContents.push_back(dbe->bookFloat("TK_Tot"));
236  theCertificationContents.push_back(dbe->bookFloat("GLB_B"));
237  theCertificationContents.push_back(dbe->bookFloat("STA_B"));
238  theCertificationContents.push_back(dbe->bookFloat("TK_B"));
239  theCertificationContents.push_back(dbe->bookFloat("GLB_EC"));
240  theCertificationContents.push_back(dbe->bookFloat("STA_EC"));
241  theCertificationContents.push_back(dbe->bookFloat("TK_EC"));
242 
243 
244  for (unsigned int icert=0;icert <theCertificationContents.size();icert++){
245  theCertificationContents[icert]->Fill(-1);
246  }
247 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
MonitorElement * KolmogorovTestSummaryMap
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * multiplicitySummaryMap
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:659
void Fill(long long x)
std::string metname
MonitorElement * kinematicsSummaryMap
MonitorElement * muonIdSummaryMap
MonitorElement * summaryCertification
std::vector< MonitorElement * > theSummaryContents
#define LogTrace(id)
std::vector< MonitorElement * > theCertificationContents
MonitorElement * energySummaryMap
MonitorElement * summaryReport
MonitorElement * summaryCertificationMap
MonitorElement * summaryReportMap
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:850
MonitorElement * chi2TestSummaryMap
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * residualsSummaryMap
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void MuonTestSummary::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 296 of file MuonTestSummary.cc.

296  {
297  // LogTrace(metname)<<"[MuonTestSummary]: beginLuminosityBlock";
298 }
void MuonTestSummary::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Histograms initialisation.

Reimplemented from edm::EDAnalyzer.

Definition at line 250 of file MuonTestSummary.cc.

References LogTrace, metname, and cuy::yBin.

250  {
251 
252  LogTrace(metname)<<"[MuonTestSummary]: beginRun";
253 
254  // initialisation of histo bins
255  for(int xBin=1; xBin<=5; xBin++){
256  for(int yBin=1; yBin<=3; yBin++){
257  kinematicsSummaryMap->Fill(xBin,yBin,1);
258  }
259  for(int yBin=1; yBin<=5; yBin++){
260  chi2TestSummaryMap->Fill(xBin,yBin,1);
262  }
263  }
264  for(int xBin=1; xBin<=residualsSummaryMap->getNbinsX(); xBin++){
265  for(int yBin=1; yBin<=residualsSummaryMap->getNbinsY(); yBin++){
266  residualsSummaryMap->Fill(xBin,yBin,1);
267  }
268  }
269  residualsSummaryMap->setBinContent(4, 4, 1); //not used for now
270 
271  for(int xBin=1; xBin<=muonIdSummaryMap->getNbinsX(); xBin++){
272  for(int yBin=1; yBin<=muonIdSummaryMap->getNbinsY(); yBin++){
273  muonIdSummaryMap->Fill(xBin,yBin,1);
274  }
275  }
276  for(int xBin=1; xBin<=3; xBin++){
277  for(int yBin=1; yBin<=3; yBin++){
278  energySummaryMap->Fill(xBin,yBin,1);
279  }
280  }
281  for(int xBin=1; xBin<=3; xBin++){
282  multiplicitySummaryMap->Fill(xBin,1);
283  }
284  for(int xBin=1; xBin<=3; xBin++){
285  for(int yBin=1; yBin<=7; yBin++){
286  summaryReportMap->Fill(xBin,yBin,1);
287  }
288  }
289  for(int xBin=1; xBin<=9; xBin++){
290  for(int yBin=1; yBin<=7; yBin++){
292  }
293  }
294 }
void setBinContent(int binx, double content)
set content of bin (1-D)
tuple yBin
Definition: cuy.py:891
MonitorElement * KolmogorovTestSummaryMap
MonitorElement * multiplicitySummaryMap
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
std::string metname
MonitorElement * kinematicsSummaryMap
MonitorElement * muonIdSummaryMap
#define LogTrace(id)
MonitorElement * energySummaryMap
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * summaryCertificationMap
MonitorElement * summaryReportMap
MonitorElement * chi2TestSummaryMap
MonitorElement * residualsSummaryMap
void MuonTestSummary::doEnergyTests ( std::string  nameHisto,
std::string  muonType,
int  bin 
)
protected

Definition at line 1197 of file MuonTestSummary.cc.

References MonitorElement::getEntries(), MonitorElement::getTH1F(), langaupro(), LogTrace, metname, and getHLTPrescaleColumns::path.

1197  {
1198 
1199  // num matches test
1200  string path = "Muons/MuonEnergyDepositAnalyzer/"+histname+muonType;
1201  MonitorElement * energyHisto = dbe->get(path);
1202  Double_t hPeak=-1, hFWHM=-1;
1203  if(energyHisto){
1204  TH1F * energyHisto_root = energyHisto->getTH1F();
1205 
1206  // Setting fit range and start values
1207  Double_t fitRange[2];
1208  Double_t startValues[4], parlimitslo[4], parlimitshi[4], fitPar[4], fitParErr[4];
1209 
1210  if (energyHisto->getEntries()>20){
1211  if(histname=="ecalS9PointingMuDepositedEnergy_"){
1212  fitRange[0]=0.04;
1213  fitRange[1]=3.0;
1214 
1215  startValues[0]=0.036; startValues[1]=0.193; startValues[2]=110.0; startValues[3]=0.06;
1216  parlimitslo[0]=0.0; parlimitslo[1]=0.; parlimitslo[2]=1.0; parlimitslo[3]=0.;
1217  parlimitshi[0]=0.05; parlimitshi[1]=0.5; parlimitshi[2]=80000.0; parlimitshi[3]=0.1;
1218 
1219  Double_t chisqr;
1220  Int_t ndf;
1221  TF1 *fit = langaufit(energyHisto_root,fitRange,startValues,parlimitslo,parlimitshi,fitPar,fitParErr,&chisqr,&ndf);
1222  if(fit){
1223  langaupro(fitPar,hPeak,hFWHM);
1224  LogTrace(metname)<<"hPeak from langau fit: "<<hPeak<<" for: "<<histname+muonType<<endl;
1225  LogTrace(metname)<<"hFWHM from langau fit: "<<hFWHM<<" for: "<<histname+muonType<<endl;
1226  }
1227  }
1228 
1229  if(histname=="hadS9PointingMuDepositedEnergy_"){
1230  fitRange[0]=0.0;
1231  fitRange[1]=7.0;
1232 
1233  startValues[0]=2.0; startValues[1]=2.4; startValues[2]=110.0; startValues[3]=4.0;
1234  parlimitslo[0]=0.0; parlimitslo[1]=0.; parlimitslo[2]=1.0; parlimitslo[3]=0.;
1235  parlimitshi[0]=4.0; parlimitshi[1]=4.0; parlimitshi[2]=80000.0; parlimitshi[3]=8.0;
1236 
1237  Double_t chisqr;
1238  Int_t ndf;
1239  TF1 *fit = langaufit(energyHisto_root,fitRange,startValues,parlimitslo,parlimitshi,fitPar,fitParErr,&chisqr,&ndf);
1240  if(fit){
1241  langaupro(fitPar,hPeak,hFWHM);
1242  LogTrace(metname)<<"hPeak from langau fit: "<<hPeak<<" for: "<<histname+muonType<<endl;
1243  LogTrace(metname)<<"hFWHM from langau fit: "<<hFWHM<<" for: "<<histname+muonType<<endl;
1244  }
1245  }
1246  }
1247  else{
1248  LogTrace(metname) << "[MuonTestSummary]: Test of Energy for "<< histname+muonType << " not performed because # entries < 20 ";
1249  }
1250  }
1251 
1252  if(histname=="ecalS9PointingMuDepositedEnergy_" && hPeak>expPeakEcalS9_min && hPeak<expPeakEcalS9_max)
1254  if(histname=="ecalS9PointingMuDepositedEnergy_" && (hPeak!=-1) &&!(hPeak>expPeakEcalS9_min && hPeak<expPeakEcalS9_max))
1256 
1257  if(histname=="hadS9PointingMuDepositedEnergy_" && hPeak>expPeakHadS9_min && hPeak<expPeakHadS9_max)
1259  if(histname=="hadS9PointingMuDepositedEnergy_" && (hPeak!=-1) && !(hPeak>expPeakHadS9_min && hPeak<expPeakHadS9_max))
1261 
1262  //missing test on ho distributions
1263 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double getEntries(void) const
get # of entries
std::string metname
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define LogTrace(id)
int32_t langaupro(double *params, double &maxx, double &FWHM)
Definition: fitUtilities.h:120
MonitorElement * energySummaryMap
TH1F * getTH1F(void) const
void MuonTestSummary::doKinematicsTests ( std::string  muonType,
int  bin 
)
protected

test operations

Definition at line 523 of file MuonTestSummary.cc.

References QReport::getMessage(), MonitorElement::getQReport(), QReport::getQTresult(), QReport::getStatus(), MonitorElement::getTH1F(), LogTrace, metname, getHLTPrescaleColumns::path, mathSSE::sqrt(), and AlCaHLTBitMon_QueryRunRegistry::string.

523  {
524 
525 
526  // chi2 test
527  string path = "Muons/MuonRecoAnalyzer/" + muonType + "chi2OverDf";
528  MonitorElement * chi2Histo = dbe->get(path);
529 
530  if(chi2Histo){
531  TH1F * chi2Histo_root = chi2Histo->getTH1F();
532  if(chi2Histo_root->GetEntries()>20){
533 
534  //Standard QT based on fraction of events below and above a cut
535  LogTrace(metname)<<"chi2 kin test based on fraction for "<<muonType<<endl;
536  int maxBin = chi2Histo_root->GetMaximumBin();
537  if(chi2Histo_root->Integral(maxBin+1,chi2Histo_root->GetNbinsX())!=0){
538  double fraction = double(chi2Histo_root->Integral(1,maxBin))/double(chi2Histo_root->Integral(maxBin+1,chi2Histo_root->GetNbinsX()));
539  LogTrace(metname)<<"chi2 fraction for "<<muonType<<" : "<<fraction<< " must be within "<< chi2Fraction-chi2Spread<<","<<chi2Fraction+chi2Spread<<endl;
540  if(fraction>(chi2Fraction-chi2Spread) && fraction<(chi2Fraction+chi2Spread))
542  else
544  }
545 
546  //QT based on comp wrt reference based on chi2
547  LogTrace(metname)<<"chi2 kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
548  const QReport * myQReport = chi2Histo->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
549  if(myQReport) {
550  LogTrace(metname) << "Chi2Report exists!!";
551  float qtresult = myQReport->getQTresult(); // get QT result value
552  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
553  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
554  LogTrace(metname) << "qtresult " <<qtresult << " qtstatus "<<qtstatus<<endl;
555  chi2TestSummaryMap->setBinContent(bin,1,qtresult);
556  }
557  //QT based on comp wrt reference based on kolmogorov test
558  LogTrace(metname)<<"chi2 kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
559  const QReport * myQReportKolmo = chi2Histo->getQReport("Mu_Comp2RefKolmogorov");
560  if(myQReportKolmo) {
561  LogTrace(metname) << "Chi2Report Kolmogorov exists!!";
562  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
563  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
564  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
565  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
567  }
568 
569  }
570  else{
571  LogTrace(metname) << "[MuonTestSummary]: Test of Chi2 Kin not performed for "<< muonType << " because # entries < 20 ";
572  }
573  }
574 
575 
576 
577  // pseudorapidity test
578  path = "Muons/MuonRecoAnalyzer/" + muonType + "eta";
579  MonitorElement * etaHisto = dbe->get(path);
580 
581  if(etaHisto){
582  TH1F * etaHisto_root = etaHisto->getTH1F();
583  if (etaHisto_root ->GetEntries()>20){
584 
585  //Standard QT based on fraction of events below and above a cut
586  LogTrace(metname)<<"eta kin test based on fraction for "<<muonType<<endl;
587  double binSize = (etaHisto_root->GetXaxis()->GetXmax()-etaHisto_root->GetXaxis()->GetXmin())/etaHisto_root->GetNbinsX();
588  int binZero = int((0-etaHisto_root->GetXaxis()->GetXmin())/binSize);
589  if(etaHisto_root->Integral(1,binZero-1)!=0 && etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX())!=0){
590  double symmetryFactor =
591  double(etaHisto_root->Integral(1,binZero-1)) / double(etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX()));
592  double errSymmetryFactor =
593  symmetryFactor*sqrt(1.0/double(etaHisto_root->Integral(1,binZero-1)) + 1.0/double(etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX())));
594  LogTrace(metname)<<"eta symmetryFactor for "<<muonType<<" : "<<symmetryFactor<< " (expected :" <<etaExpected <<")"<<endl;
595  LogTrace(metname)<<"eta errSymmetryFactor for "<<muonType<<" : "<<errSymmetryFactor<<endl;
596  double tParameter;
597  if((symmetryFactor-etaExpected)>0) tParameter=double(symmetryFactor-etaExpected)/errSymmetryFactor;
598  else tParameter=double(-symmetryFactor+etaExpected)/errSymmetryFactor;
599  LogTrace(metname)<<"eta tParameter for "<<muonType<<" : "<<tParameter<<" (expected < 1.95)" <<endl;
600  if (tParameter<1.95) //2sigma rejection
602  else
604  }
605 
606  //QT based on comp wrt reference based on chi2
607  LogTrace(metname)<<"eta kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
608  const QReport * myQReport = etaHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
609  if(myQReport) {
610  LogTrace(metname) << "EtaReport exists!!";
611  float qtresult = myQReport->getQTresult(); // get QT result value
612  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
613  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
614  LogTrace(metname) << "qtresult " <<qtresult << " qtstatus "<<qtstatus<<endl;
615  chi2TestSummaryMap->setBinContent(bin,2,qtresult);
616  }
617 
618  //QT based on comp wrt reference based on kolmogorov test
619  LogTrace(metname)<<"eta kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
620  const QReport * myQReportKolmo = etaHisto->getQReport("Mu_Comp2RefKolmogorov");
621  if(myQReportKolmo) {
622  LogTrace(metname) << "EtaReport Kolmogorov exists!!";
623  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
624  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
625  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
626  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
628  }
629 
630  }
631  else{
632  LogTrace(metname) << "[MuonTestSummary]: Test of Eta Kin not performed for "<< muonType << " because # entries < 20 ";
633  }
634  }
635 
636 
637 
638  // phi test
639  path = "Muons/MuonRecoAnalyzer/" + muonType + "phi";
640  MonitorElement * phiHisto = dbe->get(path);
641 
642  if(phiHisto ){
643  TH1F * phiHisto_root = phiHisto->getTH1F();
644  if(phiHisto_root ->GetEntries()>20){
645 
646  //Standard QT based on fraction of events below and above a cut
647  LogTrace(metname)<<"phi kin test based on fraction for "<<muonType<<endl;
648  double binSize = (phiHisto_root->GetXaxis()->GetXmax()-phiHisto_root->GetXaxis()->GetXmin())/phiHisto_root->GetNbinsX();
649  int binZero = int((0-phiHisto_root->GetXaxis()->GetXmin())/binSize);
650  if(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())!=0 && phiHisto_root->Integral(1,binZero)!=0){
651  double symmetryFactor =
652  double(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())) / double(phiHisto_root->Integral(1,binZero));
653  double errSymmetryFactor =
654  symmetryFactor*sqrt(1.0/double(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())) + 1.0/double(phiHisto_root->Integral(1,binZero)));
655  LogTrace(metname)<<"phi symmetryFactor for "<<muonType<<" : "<<symmetryFactor<< "(phi expected :" <<phiExpected <<")"<<endl;
656  LogTrace(metname)<<"phi errSymmetryFactor for "<<muonType<<" : "<<errSymmetryFactor<<endl;
657  double tParameter;
658  if((symmetryFactor-phiExpected)>0) tParameter=double(symmetryFactor-phiExpected)/errSymmetryFactor;
659  else tParameter=double(-symmetryFactor+phiExpected)/errSymmetryFactor;
660  LogTrace(metname)<<"phi tParameter for "<<muonType<<" : "<<tParameter<<" (expected < 1.95)" <<endl;
661  if (tParameter<1.95) //2sigma rejection
663  else
665  }
666 
667  //QT based on comp wrt reference based on chi2
668  LogTrace(metname)<<"phi kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
669  const QReport * myQReport = phiHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
670  if(myQReport) {
671  LogTrace(metname) << "PhiReport exists!!";
672  float qtresult = myQReport->getQTresult(); // get QT result value
673  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
674  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
675  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
676  chi2TestSummaryMap->setBinContent(bin,3,qtresult);
677  }
678 
679  //QT based on comp wrt reference based on kolmogorov test
680  LogTrace(metname)<<"phi kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
681  const QReport * myQReportKolmo = phiHisto->getQReport("Mu_Comp2RefKolmogorov");
682  if(myQReportKolmo) {
683  LogTrace(metname) << "PhiReport Kolmogorov exists!!";
684  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
685  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
686  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
687  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
689  }
690 
691  }
692  else{
693  LogTrace(metname) << "[MuonTestSummary]: Test of Phi Kin not performed for "<< muonType << " because # entries < 20 ";
694  }
695  }
696 
697  // pt test
698  path = "Muons/MuonRecoAnalyzer/" + muonType + "pt";
699  MonitorElement * ptHisto = dbe->get(path);
700 
701  if(ptHisto ){
702  TH1F * ptHisto_root = ptHisto->getTH1F();
703  if(ptHisto_root ->GetEntries()>20){
704 
705  //QT based on comp wrt reference based on chi2
706  LogTrace(metname)<<"pt kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
707  const QReport * myQReport = ptHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
708  if(myQReport) {
709  LogTrace(metname) << "PtReport exists!!";
710  float qtresult = myQReport->getQTresult(); // get QT result value
711  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
712  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
713  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
714  chi2TestSummaryMap->setBinContent(bin,4,qtresult);
715  }
716 
717  //QT based on comp wrt reference based on kolmogorov test
718  LogTrace(metname)<<"pt kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
719  const QReport * myQReportKolmo = ptHisto->getQReport("Mu_Comp2RefKolmogorov");
720  if(myQReportKolmo) {
721  LogTrace(metname) << "PtReport Kolmogorov exists!!";
722  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
723  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
724  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
725  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
727  }
728  }
729  else{
730  LogTrace(metname) << "[MuonTestSummary]: Test of Pt Kin not performed for "<< muonType << " because # entries < 20 ";
731  }
732  }
733 
734  // q test
735  path = "Muons/MuonRecoAnalyzer/" + muonType + "q";
736  MonitorElement * qHisto = dbe->get(path);
737 
738  if(ptHisto ){
739  TH1F * qHisto_root = qHisto->getTH1F();
740  if(qHisto_root ->GetEntries()>20){
741 
742  //QT based on comp wrt reference based on chi2
743  LogTrace(metname)<<"q kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
744  const QReport * myQReport = qHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
745  if(myQReport) {
746  LogTrace(metname) << "qReport exists!!";
747  float qtresult = myQReport->getQTresult(); // get QT result value
748  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
749  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
750  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
751  chi2TestSummaryMap->setBinContent(bin,5,qtresult);
752  }
753 
754  //QT based on comp wrt reference based on kolmogorov test
755  LogTrace(metname)<<"q kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
756  const QReport * myQReportKolmo = qHisto->getQReport("Mu_Comp2RefKolmogorov");
757  if(myQReportKolmo) {
758  LogTrace(metname) << "qReport Kolmogorov exists!!";
759  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
760  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
761  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
762  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
764  }
765  }
766  else{
767  LogTrace(metname) << "[MuonTestSummary]: Test of q Kin not performed for "<< muonType << " because # entries < 20 ";
768  }
769  }
770 
771 }
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to &lt;qtname&gt; (null pointer if QReport does not exist)
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * KolmogorovTestSummaryMap
const std::string & getMessage(void) const
get message attached to test
Definition: QReport.h:24
std::string metname
MonitorElement * kinematicsSummaryMap
T sqrt(T t)
Definition: SSEVec.h:48
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
Definition: QReport.h:16
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define LogTrace(id)
TH1F * getTH1F(void) const
float getQTresult(void) const
get test result i.e. prob value
Definition: QReport.h:20
MonitorElement * chi2TestSummaryMap
void MuonTestSummary::doMultiplicityTests ( )
protected

Definition at line 1266 of file MuonTestSummary.cc.

References MonitorElement::getBinContent(), MonitorElement::getEntries(), LogTrace, and metname.

1266  {
1267 
1268  MonitorElement* multiplicityHisto = dbe->get("Muons/MuonRecoAnalyzer/muReco");
1269 
1270  if(multiplicityHisto){
1271  if(multiplicityHisto->getEntries()>20){
1272  double multiplicity_GLB = double(multiplicityHisto->getBinContent(1)+multiplicityHisto->getBinContent(2))/double(multiplicityHisto->getEntries());
1273  LogTrace(metname)<<"multiplicity_GLB: "<<multiplicity_GLB<< " ExpMultiplicityGlb_min " <<expMultiplicityGlb_min <<" ExpMultiplicityGlb_max " <<expMultiplicityGlb_max<<endl;
1274  double multiplicity_TK = double(multiplicityHisto->getBinContent(3)+multiplicityHisto->getBinContent(4))/double(multiplicityHisto->getEntries());
1275  LogTrace(metname)<<"multiplicity_TK: "<<multiplicity_TK<< " ExpMultiplicityTk_min " <<expMultiplicityTk_min <<" ExpMultiplicityTk_max " <<expMultiplicityTk_max<<endl;
1276  double multiplicity_STA = double(multiplicityHisto->getBinContent(3)+multiplicityHisto->getBinContent(5))/double(multiplicityHisto->getEntries());
1277  LogTrace(metname)<<"multiplicity_STA: "<<multiplicity_STA<< " ExpMultiplicitySta_min " <<expMultiplicitySta_min <<" ExpMultiplicitySta_max " <<expMultiplicitySta_max<<endl;
1278 
1279  if(multiplicity_GLB>expMultiplicityGlb_min && multiplicity_GLB<expMultiplicityGlb_max)
1281  else
1283 
1284  if(multiplicity_TK>expMultiplicityTk_min && multiplicity_TK<expMultiplicityTk_max)
1286  else
1288 
1289  if(multiplicity_STA>expMultiplicitySta_min && multiplicity_STA<expMultiplicitySta_max)
1291  else
1293  }
1294  else{
1295  LogTrace(metname) << "[MuonTestSummary]: Test of Multiplicity not performed because # entries < 20 ";
1296  }
1297  }
1298 
1299 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double expMultiplicityTk_max
double expMultiplicityGlb_min
MonitorElement * multiplicitySummaryMap
double getEntries(void) const
get # of entries
std::string metname
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define LogTrace(id)
double expMultiplicityGlb_max
double expMultiplicityTk_min
double getBinContent(int binx) const
get content of bin (1-D)
double expMultiplicitySta_min
double expMultiplicitySta_max
void MuonTestSummary::doMuonIDTests ( )
protected

Definition at line 928 of file MuonTestSummary.cc.

References MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getTH1F(), i, LogTrace, metname, getHLTPrescaleColumns::path, and ResidualCheck().

928  {
929 
930  vector<string> muType;
931  muType.push_back("GlobalMuons");
932  muType.push_back("TrackerMuons");
933 
934  for(int i=0; i<=1; i++){
935 
936  // num matches test
937  string path = "Muons/MuonIdDQM/" + muType[i] + "/hNumMatches";
938  MonitorElement * matchesHisto = dbe->get(path);
939 
940  if(matchesHisto){
941  TH1F * matchesHisto_root = matchesHisto->getTH1F();
942  if(matchesHisto_root->GetMaximumBin() >= numMatchedExpected_min && matchesHisto_root->GetMaximumBin() <= numMatchedExpected_max)
944  else
946  }
947 
948 
949  // num of 0 associated segments
950  double numOneSegm_dt = 0;
951  int numHistos_dt=0;
952  int numHistos_csc=0;
953  MonitorElement * DT1Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT1NumSegments");
954  if(DT1Histo)
955  {numHistos_dt++;
956  if(DT1Histo->getEntries()!=0) numOneSegm_dt+=double(DT1Histo->getBinContent(2))/double(DT1Histo->getEntries());}
957  MonitorElement * DT2Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT2NumSegments");
958  if(DT2Histo)
959  {numHistos_dt++;
960  if(DT2Histo->getEntries()!=0) numOneSegm_dt+=double(DT2Histo->getBinContent(2))/double(DT2Histo->getEntries());}
961  MonitorElement * DT3Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT3NumSegments");
962  if(DT3Histo)
963  {numHistos_dt++;
964  if(DT3Histo->getEntries()!=0) numOneSegm_dt+=double(DT3Histo->getBinContent(2))/double(DT3Histo->getEntries());}
965  MonitorElement * DT4Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hDT4NumSegments");
966  if(DT4Histo)
967  {numHistos_dt++;
968  if(DT4Histo->getEntries()!=0) numOneSegm_dt+=double(DT4Histo->getBinContent(2))/double(DT4Histo->getEntries());}
969  double fraction_dt=0;
970  if(numOneSegm_dt!=0){
971  fraction_dt = numOneSegm_dt/double(numHistos_dt);
972  LogTrace(metname)<<"fraction_dt: "<<fraction_dt<<" for "<<muType[i]<<endl;
973  }
974 
975  double numOneSegm_csc = 0;
976  MonitorElement * CSC1Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC1NumSegments");
977  if(CSC1Histo)
978  {numHistos_csc++;
979  if(CSC1Histo->getEntries()!=0) numOneSegm_csc+=double(CSC1Histo->getBinContent(2))/double(CSC1Histo->getEntries());}
980  MonitorElement * CSC2Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC2NumSegments");
981  if(CSC2Histo)
982  {numHistos_csc++;
983  if(CSC2Histo->getEntries()!=0) numOneSegm_csc+=double(CSC2Histo->getBinContent(2))/double(CSC2Histo->getEntries());}
984  MonitorElement * CSC3Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC3NumSegments");
985  if(CSC3Histo)
986  {numHistos_csc++;
987  if(CSC3Histo->getEntries()!=0) numOneSegm_csc+=double(CSC3Histo->getBinContent(2))/double(CSC3Histo->getEntries());}
988  MonitorElement * CSC4Histo = dbe->get("Muons/MuonIdDQM/" + muType[i] + "/hCSC4NumSegments");
989  if(CSC4Histo)
990  {numHistos_csc++;
991  if(CSC4Histo->getEntries()!=0) numOneSegm_csc+=double(CSC4Histo->getBinContent(2))/double(CSC4Histo->getEntries());}
992  double fraction_csc=0;
993  if(numOneSegm_csc!=0){
994  fraction_csc = numOneSegm_csc/double(numHistos_csc);
995  LogTrace(metname)<<"fraction_csc: "<<fraction_csc<<" for "<<muType[i]<<endl;
996  }
997 
998 
999 
1000  //--GH modified
1001 
1002  if(fraction_dt>matchesFractionDt_min && fraction_dt<matchesFractionDt_max)
1003  muonIdSummaryMap->setBinContent(2*i+1,1,1);
1004  else
1005  muonIdSummaryMap->setBinContent(2*i+1,1,0);
1006 
1007  if(fraction_csc>matchesFractionCsc_min && fraction_csc<matchesFractionCsc_max)
1008  muonIdSummaryMap->setBinContent(2*i+2,1,1);
1009  else
1010  muonIdSummaryMap->setBinContent(2*i+2,1,0);
1011 
1012 
1013 
1014  //--GH modified
1015 
1016  // residuals test
1017  vector<string> DTXresHistos, DTYresHistos, CSCXresHistos, CSCYresHistos;
1018  DTXresHistos.push_back("hDT1Pullx");
1019  DTXresHistos.push_back("hDT2Pullx");
1020  DTXresHistos.push_back("hDT3Pullx");
1021  DTXresHistos.push_back("hDT4Pullx");
1022 
1023  DTYresHistos.push_back("hDT1Pully");
1024  DTYresHistos.push_back("hDT2Pully");
1025  DTYresHistos.push_back("hDT3Pully");
1026 
1027  CSCXresHistos.push_back("hCSC1Pullx");
1028  CSCXresHistos.push_back("hCSC2Pullx");
1029  CSCXresHistos.push_back("hCSC3Pullx");
1030  CSCXresHistos.push_back("hCSC4Pullx");
1031 
1032  CSCYresHistos.push_back("hCSC1Pully");
1033  CSCYresHistos.push_back("hCSC2Pully");
1034  CSCYresHistos.push_back("hCSC3Pully");
1035  CSCYresHistos.push_back("hCSC4Pully");
1036 
1037  int numPlot_dtX, numPlot_dtY, numPlot_cscX, numPlot_cscY;
1038  double dtSigmaX, dtSigmaY, cscSigmaX, cscSigmaY;
1039  double dtSigmaX_err, dtSigmaY_err, cscSigmaX_err, cscSigmaY_err;
1040  double dtMeanX, dtMeanY, cscMeanX, cscMeanY;
1041  double dtMeanX_err, dtMeanY_err, cscMeanX_err, cscMeanY_err;
1042  MuonTestSummary::ResidualCheck(muType[i], DTXresHistos, numPlot_dtX, dtMeanX, dtMeanX_err, dtSigmaX, dtSigmaX_err);
1043  MuonTestSummary::ResidualCheck(muType[i], DTYresHistos, numPlot_dtY, dtMeanY, dtMeanY_err, dtSigmaY, dtSigmaY_err);
1044  MuonTestSummary::ResidualCheck(muType[i], CSCXresHistos, numPlot_cscX, cscMeanX, cscMeanX_err, cscSigmaX, cscSigmaX_err);
1045  MuonTestSummary::ResidualCheck(muType[i], CSCYresHistos, numPlot_cscY, cscMeanY, cscMeanY_err, cscSigmaY, cscSigmaY_err);
1046 
1047 
1048  LogTrace(metname)<<"DT mean must be between: "<<resSegmTrack_mean_min <<" and "<<resSegmTrack_mean_max<<endl;
1049  LogTrace(metname)<<"DT rms must be between: "<<resSegmTrack_rms_min <<" and "<<resSegmTrack_rms_max<<endl;
1050  LogTrace(metname)<<"DT X residual "<< muType[i]<<" mean: " << dtMeanX<<" +- "<< dtMeanX_err
1051  <<", sigma: "<< dtSigmaX <<" +- "<<dtSigmaX_err<< endl;
1052  LogTrace(metname)<<"DT Y residual "<< muType[i]<<" mean: " << dtMeanY<<" +- "<< dtMeanY_err
1053  <<", sigma: "<< dtSigmaY <<" +- "<<dtSigmaY_err<< endl;
1054  LogTrace(metname)<<"CSC X residual "<< muType[i]<<" mean: " << cscMeanX<<" +- "<< cscMeanX_err
1055  <<", sigma: "<< cscSigmaX <<" +- "<<cscSigmaX_err<< endl;
1056  LogTrace(metname)<<"CSC Y residual "<< muType[i]<<" mean: " << cscMeanY<<" +- "<< cscMeanY_err
1057  <<", sigma: "<< cscSigmaY <<" +- "<<cscSigmaY_err<< endl;
1058 
1059 
1060  //require the mean and rms to be within nsig sigma of preferred range;
1061  const int nsig=2;
1062  if(numPlot_dtX > 0 ) {
1063  if( dtMeanX + nsig*dtMeanX_err>resSegmTrack_mean_min &&
1064  dtMeanX - nsig*dtMeanX_err<resSegmTrack_mean_max)
1065  muonIdSummaryMap->setBinContent(2*i+1,2,1);
1066  else
1067  muonIdSummaryMap->setBinContent(2*i+1,2,0);
1068 
1069  if( dtSigmaX + nsig*dtSigmaX_err>resSegmTrack_rms_min &&
1070  dtSigmaX - nsig*dtSigmaX_err<resSegmTrack_rms_max)
1071  muonIdSummaryMap->setBinContent(2*i+1,3,1);
1072  else
1073  muonIdSummaryMap->setBinContent(2*i+1,3,0);
1074  }
1075  if(numPlot_dtY > 0 ){
1076  if( dtMeanY + nsig*dtMeanY_err>resSegmTrack_mean_min &&
1077  dtMeanY - nsig*dtMeanY_err<resSegmTrack_mean_max)
1078  muonIdSummaryMap->setBinContent(2*i+1,4,1);
1079  else
1080  muonIdSummaryMap->setBinContent(2*i+1,4,0);
1081 
1082  if( dtSigmaY + nsig*dtSigmaY_err>resSegmTrack_rms_min &&
1083  dtSigmaY - nsig*dtSigmaX_err<resSegmTrack_rms_max)
1084  muonIdSummaryMap->setBinContent(2*i+1,5,1);
1085  else
1086  muonIdSummaryMap->setBinContent(2*i+1,5,0);
1087  }
1088 
1089 
1090  if(numPlot_cscX > 0 ) {
1091  if( cscMeanX + nsig*cscMeanX_err>resSegmTrack_mean_min &&
1092  cscMeanX - nsig*cscMeanX_err<resSegmTrack_mean_max)
1093  muonIdSummaryMap->setBinContent(2*i+2,2,1);
1094  else
1095  muonIdSummaryMap->setBinContent(2*i+2,2,0);
1096 
1097  if( cscSigmaX + nsig*cscSigmaX_err>resSegmTrack_rms_min &&
1098  cscSigmaX - nsig*cscSigmaX_err<resSegmTrack_rms_max)
1099  muonIdSummaryMap->setBinContent(2*i+2,3,1);
1100  else
1101  muonIdSummaryMap->setBinContent(2*i+2,3,0);
1102  }
1103  if(numPlot_cscY > 0 ){
1104  if( cscMeanY + nsig*cscMeanY_err>resSegmTrack_mean_min &&
1105  cscMeanY - nsig*cscMeanY_err<resSegmTrack_mean_max)
1106  muonIdSummaryMap->setBinContent(2*i+2,4,1);
1107  else
1108  muonIdSummaryMap->setBinContent(2*i+2,4,0);
1109 
1110  if( cscSigmaY + nsig*cscSigmaY_err>resSegmTrack_rms_min &&
1111  cscSigmaY - nsig*cscSigmaY_err<resSegmTrack_rms_max)
1112  muonIdSummaryMap->setBinContent(2*i+2,5,1);
1113  else
1114  muonIdSummaryMap->setBinContent(2*i+2,5,0);
1115  }
1116 
1117  //---- end of modification
1118 
1119 
1120  }
1121 
1122 }
int i
Definition: DBlmapReader.cc:9
double matchesFractionCsc_max
void setBinContent(int binx, double content)
set content of bin (1-D)
double resSegmTrack_rms_min
double resSegmTrack_rms_max
double resSegmTrack_mean_min
double getEntries(void) const
get # of entries
double resSegmTrack_mean_max
std::string metname
double matchesFractionDt_max
MonitorElement * muonIdSummaryMap
double matchesFractionCsc_min
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define LogTrace(id)
double numMatchedExpected_min
TH1F * getTH1F(void) const
double numMatchedExpected_max
double getBinContent(int binx) const
get content of bin (1-D)
void ResidualCheck(std::string muType, const std::vector< std::string > &resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err)
double matchesFractionDt_min
void MuonTestSummary::doResidualsTests ( std::string  type,
std::string  parameter,
int  bin 
)
protected

Definition at line 822 of file MuonTestSummary.cc.

References MonitorElement::getBinContent(), LogTrace, timingPdfMaker::mean, metname, and getHLTPrescaleColumns::path.

822  {
823 
824  // residuals test
825  if(type!="GlbMuon"){
826  string path = "Muons/MuonRecoAnalyzer/Res_" + type + "_" + parameter;
827  MonitorElement * residualsHisto = dbe->get(path);
828 
829  float mean = -1;
830  float mean_err = -1;
831  float sigma = -1;
832  float sigma_err = -1;
833 
834  if(residualsHisto){
835 
836  LogTrace(metname) << "[MuonTestSummary]: Starting Gaussian fit for Test of Res_"<<type<<"_"<<parameter<< endl;
837  GaussFit( type, parameter, residualsHisto, mean, mean_err, sigma, sigma_err);
838 
839  if(sigma!=-1 && parameter=="eta" && type=="TkGlb"){
840  if(sigma-sigma_err<resEtaSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 1, 1);
842  }
843  if(sigma!=-1 && parameter=="eta" && (type=="GlbSta" || type=="TkSta")) {
844  if(sigma-sigma_err<resEtaSpread_glbSta) residualsSummaryMap->setBinContent(bin, 1, 1);
846  }
847  if(sigma!=-1 && parameter=="phi" && type=="TkGlb"){
848  if(sigma-sigma_err<resPhiSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 2, 1);
850  }
851  if(sigma!=-1 && parameter=="phi" && (type=="GlbSta" || type=="TkSta")){
852  if(sigma-sigma_err<resPhiSpread_glbSta) residualsSummaryMap->setBinContent(bin, 2, 1);
853  else residualsSummaryMap->setBinContent(bin, 2, 0);
854  }
855  if(sigma!=-1 && parameter=="oneOverp" && type=="TkGlb"){
856  if(sigma-sigma_err<resOneOvPSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 3, 1);
858  }
859  if(sigma!=-1 && parameter=="oneOverp" && (type=="GlbSta" || type=="TkSta")) {
860  if(sigma-sigma_err<resOneOvPSpread_glbSta) residualsSummaryMap->setBinContent(bin, 3, 1);
862  }
863  }
864 
865 
866 
867  //--GH modified
868  if(type=="TkSta"){
869  //look at the pull:
870  string path = "Muons/MuonRecoAnalyzer/Pull_" + type + "_" + parameter;
871  MonitorElement * pullHisto = dbe->get(path);
872 
873  if(pullHisto){
874 
875  LogTrace(metname) << "[MuonTestSummary]: Starting Gaussian fit for Test of Pull_"<<type<<"_"<<parameter<< endl;
876  GaussFit( type, parameter, pullHisto, mean, mean_err, sigma, sigma_err);
877 
878  if(sigma!=-1 && parameter=="eta" ){
879  if(sigma-sigma_err<pullEtaSpread) residualsSummaryMap->setBinContent(4, 1, 1);
880  else residualsSummaryMap->setBinContent(4, 1, 0);
881  }
882  if(sigma!=-1 && parameter=="phi"){
883  if(sigma-sigma_err<pullPhiSpread) residualsSummaryMap->setBinContent(4, 2, 1);
884  else residualsSummaryMap->setBinContent(4, 2, 0);
885  }
886  if(sigma!=-1 && parameter=="oneOverp"){
887  if(sigma-sigma_err<pullOneOvPSpread) residualsSummaryMap->setBinContent(4, 3, 1);
888  else residualsSummaryMap->setBinContent(4, 3, 0);
889  }
890 
891  }//have pull histo
892  } //TkSta muons
893  }
894 
895  //this part for Global Muons:
896  else{
897  string path = "Muons/MuonRecoAnalyzer/" + type + "_" + parameter;
898  MonitorElement * residualsHisto = dbe->get(path);
899 
900  if(residualsHisto){
901  LogTrace(metname) << "[MuonTestSummary]: Test of Charge Comparison "<<type<<"_"<<parameter<< endl;
902  if((residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4))!=0){
903  LogTrace(metname)<<"Charge comparison TkGlb: "<<residualsHisto->getBinContent(4)/double(residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4))<<endl;
904  if(residualsHisto->getBinContent(4)/double(residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4)) < resChargeLimit_tkGlb)
906  else
908  }
909  if((residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2))!=0){
910  LogTrace(metname)<<"charge comparison GlbSta: "<<residualsHisto->getBinContent(2)/double(residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2))<<endl;
911  if(residualsHisto->getBinContent(2)/double(residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2)) < resChargeLimit_glbSta)
913  else
915  }
916  if(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6)!=0){
917  LogTrace(metname)<<"charge comparison TkSta: "<<residualsHisto->getBinContent(6)/double(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6))<<endl;
918  if(residualsHisto->getBinContent(6)/double(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6)) < resChargeLimit_tkSta)
920  else
922  }
923  }
924  }
925 
926 }
type
Definition: HCALResponse.h:21
void setBinContent(int binx, double content)
set content of bin (1-D)
std::string metname
double resPhiSpread_tkGlb
double resEtaSpread_glbSta
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define LogTrace(id)
double resPhiSpread_glbSta
double resOneOvPSpread_glbSta
double resOneOvPSpread_tkGlb
double resEtaSpread_tkGlb
double resChargeLimit_glbSta
double getBinContent(int binx) const
get content of bin (1-D)
void GaussFit(std::string type, std::string parameter, MonitorElement *Histo, float &mean, float &mean_err, float &sigma, float &sigma_err)
double resChargeLimit_tkGlb
double resChargeLimit_tkSta
MonitorElement * residualsSummaryMap
void MuonTestSummary::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
protectedvirtual

Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 300 of file MuonTestSummary.cc.

300  {
301 
302  // LogTrace(metname)<<"[MuonTestSummary]: endLuminosityBlock, performing the DQM LS client operation";
303 
304 }
void MuonTestSummary::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 306 of file MuonTestSummary.cc.

References i, j, LogTrace, and metname.

306  {
307 
308  LogTrace(metname)<<"[MuonTestSummary]: endRun, performing the DQM end of run client operation";
309 
310  // fill the kinematics report summary
311  doKinematicsTests("GlbMuon_Glb_", 1);
312  doKinematicsTests("GlbMuon_Tk_", 2);
313  doKinematicsTests("GlbMuon_Sta_",3);
314  doKinematicsTests("TkMuon_", 4);
315  doKinematicsTests("StaMuon_", 5);
316 
317  // fill the residuals report summary
318  doResidualsTests("TkGlb", "eta", 1);
319  doResidualsTests("GlbSta", "eta", 2);
320  doResidualsTests("TkSta", "eta", 3);
321  doResidualsTests("TkGlb", "phi", 1);
322  doResidualsTests("GlbSta", "phi", 2);
323  doResidualsTests("TkSta", "phi", 3);
324  doResidualsTests("TkGlb", "oneOverp", 1);
325  doResidualsTests("GlbSta", "oneOverp", 2);
326  doResidualsTests("TkSta", "oneOverp", 3);
327  doResidualsTests("GlbMuon", "qComparison", -1);
328 
329  // fill the muonID report summary
330  doMuonIDTests();
331 
332  // fill the energy report summary
333  doEnergyTests("ecalS9PointingMuDepositedEnergy_","Glb_muons", 1);
334  doEnergyTests("hadS9PointingMuDepositedEnergy_", "Glb_muons", 1);
335  doEnergyTests("hoS9PointingMuDepositedEnergy_", "Glb_muons", 1);
336  doEnergyTests("ecalS9PointingMuDepositedEnergy_", "Tk_muons", 2);
337  doEnergyTests("hadS9PointingMuDepositedEnergy_", "Tk_muons", 2);
338  doEnergyTests("hoS9PointingMuDepositedEnergy_", "Tk_muons", 2);
339  doEnergyTests("ecalS9PointingMuDepositedEnergy_", "Sta_muons", 3);
340  doEnergyTests("hadS9PointingMuDepositedEnergy_", "Sta_muons", 3);
341  doEnergyTests("hoS9PointingMuDepositedEnergy_", "Sta_muons", 3);
342 
343  // fill the multiplicity test summary
345 
346  // fill the final report summary
347  /*
348  summaryReportMap->setBinContent(1,1,double(kinematicsSummaryMap->getBinContent(1,1)+kinematicsSummaryMap->getBinContent(2,1)+kinematicsSummaryMap->getBinContent(3,1))/3.0);
349  summaryReportMap->setBinContent(2,1,kinematicsSummaryMap->getBinContent(4,1));
350  summaryReportMap->setBinContent(3,1,kinematicsSummaryMap->getBinContent(5,1));
351  summaryReportMap->setBinContent(1,2,double(kinematicsSummaryMap->getBinContent(1,2)+kinematicsSummaryMap->getBinContent(2,2)+kinematicsSummaryMap->getBinContent(3,2))/3.0);
352  summaryReportMap->setBinContent(2,2,kinematicsSummaryMap->getBinContent(4,2));
353  summaryReportMap->setBinContent(3,2,kinematicsSummaryMap->getBinContent(5,2));
354  summaryReportMap->setBinContent(1,3,double(kinematicsSummaryMap->getBinContent(1,3)+kinematicsSummaryMap->getBinContent(2,3)+kinematicsSummaryMap->getBinContent(3,3))/3.0);
355  summaryReportMap->setBinContent(2,3,kinematicsSummaryMap->getBinContent(4,3));
356  summaryReportMap->setBinContent(3,3,kinematicsSummaryMap->getBinContent(5,3));
357  */
358  //Changed to KolmogorovQuality test--------------------------
368 
369 
370 
371  //-- modified GH
372  double residualsSummary = 0;
373  //put the TRK-STA resid & pulls in the first bin ("GLB")
374  //then the GLB-TRK and GLB-STA residuals in the 2nd and 3rd
375  for(int i=3; i<=residualsSummaryMap->getNbinsX(); i++)
376  for (int j=1; j<=residualsSummaryMap->getNbinsY(); j++)
377  residualsSummary += residualsSummaryMap->getBinContent(i,j);
378  residualsSummary /=2*residualsSummaryMap->getNbinsY();
379  summaryReportMap->setBinContent(1,4, residualsSummary);
380 
381  residualsSummary=0;
382  for(int i=1; i<=1; i++)
383  for (int j=1; j<=residualsSummaryMap->getNbinsY(); j++)
384  residualsSummary += residualsSummaryMap->getBinContent(i,j);
385  residualsSummary /=1*residualsSummaryMap->getNbinsY();
386  summaryReportMap->setBinContent(2,4,residualsSummary);
387 
388  residualsSummary=0;
389  for(int i=2; i<=2; i++)
390  for (int j=1; j<=residualsSummaryMap->getNbinsY(); j++)
391  residualsSummary += residualsSummaryMap->getBinContent(i,j);
392  residualsSummary /=1*residualsSummaryMap->getNbinsY();
393  summaryReportMap->setBinContent(3,4,residualsSummary);
394 
395  //--
396 
397 
398 
399  //-- modified GH
400  float idtest=0;
401  for(int i=1; i<=2; i++)
402  for(int j=1; j<=5; j++) {
403  if(j==3 || j==5) continue; //ignore pull widths for now
404  idtest+=muonIdSummaryMap->getBinContent(i,j);
405  }
406  // idtest/=10.;
407  idtest/=6.;
408  summaryReportMap->setBinContent(1,5, idtest);
409  idtest=0;
410  for(int i=3; i<=4; i++)
411  for(int j=1; j<=5; j++) {
412  if(j==3 || j==5) continue; //ignore pull widths for now
413  idtest+=muonIdSummaryMap->getBinContent(i,j);
414  }
415  // idtest/=10.;
416  idtest/=6.;
417  summaryReportMap->setBinContent(2,5,idtest);
418  summaryReportMap->setBinContent(3,5,-1.0/6.0);
419  //--
420 
421 
422 
423  //summaryReportMap->setBinContent(1,6,double(energySummaryMap->getBinContent(1,1)+energySummaryMap->getBinContent(1,2)+energySummaryMap->getBinContent(1,3))/3.0);
424  //summaryReportMap->setBinContent(2,6,double(energySummaryMap->getBinContent(2,1)+energySummaryMap->getBinContent(2,2)+energySummaryMap->getBinContent(2,3))/3.0);
425  //summaryReportMap->setBinContent(3,6,double(energySummaryMap->getBinContent(3,1)+energySummaryMap->getBinContent(3,2)+energySummaryMap->getBinContent(3,3))/3.0);
432 
433 
434  double kinematics_GLB = double(summaryReportMap->getBinContent(1,1)+summaryReportMap->getBinContent(1,2)+summaryReportMap->getBinContent(1,3))/3.0;
435  theSummaryContents[0]->Fill(kinematics_GLB);
436  double muonId_GLB = double(summaryReportMap->getBinContent(1,5));
437  theSummaryContents[1]->Fill(muonId_GLB);
438  double residuals_GLB = double(summaryReportMap->getBinContent(1,4));
439  theSummaryContents[2]->Fill(residuals_GLB);
440  double GLB = (kinematics_GLB+muonId_GLB+residuals_GLB)/3.0;
441  theSummaryContents[3]->Fill(GLB);
442 
443  double kinematics_TK = double(summaryReportMap->getBinContent(2,1)+summaryReportMap->getBinContent(2,2)+summaryReportMap->getBinContent(2,3))/3.0;
444  theSummaryContents[4]->Fill(kinematics_TK);
445  double muonId_TK = double(summaryReportMap->getBinContent(2,5));
446  theSummaryContents[5]->Fill(muonId_TK);
447  double residuals_TK = double(summaryReportMap->getBinContent(2,4));
448  theSummaryContents[6]->Fill(residuals_TK);
449  double TK = double(kinematics_TK+muonId_TK+residuals_TK)/3.0;
450  theSummaryContents[7]->Fill(TK);
451 
452  double kinematics_STA = double(summaryReportMap->getBinContent(3,1)+summaryReportMap->getBinContent(3,2)+summaryReportMap->getBinContent(3,3))/3.0;
453  theSummaryContents[8]->Fill(kinematics_STA);
454  double residuals_STA = double(summaryReportMap->getBinContent(3,4));
455  theSummaryContents[9]->Fill(residuals_STA);
456  double STA = double(kinematics_STA+residuals_STA)/2.0;
457  theSummaryContents[10]->Fill(STA);
458  double energyDeposits = double(summaryReportMap->getBinContent(1,6)+summaryReportMap->getBinContent(2,6)+summaryReportMap->getBinContent(3,6))/3.0;
459  theSummaryContents[11]->Fill(energyDeposits);
460  double multiplicity = double(summaryReportMap->getBinContent(1,7)+summaryReportMap->getBinContent(2,7)+summaryReportMap->getBinContent(3,7))/3.0;
461  theSummaryContents[12]->Fill(multiplicity);
462 
463  summaryReport->Fill((GLB+TK+STA+energyDeposits+multiplicity)/5.0);
464 
465 
466  //global barrel:
467  float muonIDsummary=0;
468  // for(int i=2; i<=5; i++)
469  // muonIDsummary += muonIdSummaryMap->getBinContent(2, i);
470  // summaryCertificationMap->setBinContent(4, 5, muonIDsummary/4.);
471  //for now, just report the mean:
472  muonIDsummary += muonIdSummaryMap->getBinContent(1, 2);
473  muonIDsummary += muonIdSummaryMap->getBinContent(1, 4);
474  summaryCertificationMap->setBinContent(4, 5, muonIDsummary/2.);
475 
476  //global EC:
477  muonIDsummary=0;
478  // for(int i=2; i<=5; i++)
479  // muonIDsummary += muonIdSummaryMap->getBinContent(2, i);
480  // summaryCertificationMap->setBinContent(7, 5, muonIDsummary/4.);
481  muonIDsummary += muonIdSummaryMap->getBinContent(2, 2);
482  muonIDsummary += muonIdSummaryMap->getBinContent(2, 4);
483  summaryCertificationMap->setBinContent(7, 5, muonIDsummary/2.);
484 
485  //tracker barrel:
486  muonIDsummary=0;
487  // for(int i=2; i<=5; i++)
488  // muonIDsummary += muonIdSummaryMap->getBinContent(3, i);
489  // summaryCertificationMap->setBinContent(5, 5, muonIDsummary/4.);
490  muonIDsummary += muonIdSummaryMap->getBinContent(3, 2);
491  muonIDsummary += muonIdSummaryMap->getBinContent(3, 4);
492  summaryCertificationMap->setBinContent(5, 5, muonIDsummary/2.);
493 
494  //tracker EC:
495  muonIDsummary=0;
496  // for(int i=2; i<=5; i++)
497  // muonIDsummary += muonIdSummaryMap->getBinContent(4, i);
498  // summaryCertificationMap->setBinContent(8, 5, muonIDsummary/4.);
499  muonIDsummary += muonIdSummaryMap->getBinContent(4, 2);
500  muonIDsummary += muonIdSummaryMap->getBinContent(4, 4);
501  summaryCertificationMap->setBinContent(8, 5, muonIDsummary/2.);
502 
503 
504  double muonId_GLB_B = double(summaryCertificationMap->getBinContent(4,5));
505  theCertificationContents[3]->Fill(muonId_GLB_B);
506  double muonId_GLB_EC = double(summaryCertificationMap->getBinContent(7,5));
507  theCertificationContents[6]->Fill(muonId_GLB_EC);
508 
509  double muonId_TK_B = double(summaryCertificationMap->getBinContent(5,5));
510  theCertificationContents[5]->Fill(muonId_TK_B);
511  double muonId_TK_EC = double(summaryCertificationMap->getBinContent(8,5));
512  theCertificationContents[8]->Fill(muonId_TK_EC);
513 
514 
515 
516 
517 
518 
519 
520 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * KolmogorovTestSummaryMap
MonitorElement * multiplicitySummaryMap
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
std::string metname
MonitorElement * muonIdSummaryMap
int j
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > theSummaryContents
#define LogTrace(id)
std::vector< MonitorElement * > theCertificationContents
MonitorElement * energySummaryMap
void doEnergyTests(std::string nameHisto, std::string muonType, int bin)
MonitorElement * summaryReport
void doResidualsTests(std::string type, std::string parameter, int bin)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * summaryCertificationMap
MonitorElement * summaryReportMap
MonitorElement * residualsSummaryMap
void doKinematicsTests(std::string muonType, int bin)
test operations
void MuonTestSummary::GaussFit ( std::string  type,
std::string  parameter,
MonitorElement Histo,
float &  mean,
float &  mean_err,
float &  sigma,
float &  sigma_err 
)
protected

Definition at line 780 of file MuonTestSummary.cc.

References MonitorElement::getMean(), MonitorElement::getRMS(), MonitorElement::getTH1F(), LogTrace, and metname.

780  {
781 
782  // Gaussian Fit
783  float statMean = Histo->getMean(1);
784  float statSigma = Histo->getRMS(1);
785  TH1F * histo_root = Histo->getTH1F();
786  if(histo_root->GetEntries()>20){
787  TF1 *gfit = new TF1("Gaussian","gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
788  try {
789  histo_root->Fit(gfit, "Q0");
790  } catch (cms::Exception& iException) {
791  edm::LogError (metname)<< "[MuonTestSummary]: Exception when fitting Res_"<<type<<"_"<<parameter;
792  mean=1;
793  mean_err=1;
794  sigma=1;
795  sigma_err=1;
796  return;
797  }
798  if(gfit){
799  mean = gfit->GetParameter(1);
800  mean_err = gfit->GetParErrors()[2];
801  sigma = gfit->GetParameter(2);
802  sigma_err = gfit->GetParErrors()[2];
803  LogTrace(metname)<<"Gaussian fit mean: "<<mean<<" +- "<<mean_err<<" for "<<type<<"_"<<parameter<<endl;
804  LogTrace(metname)<<"Gaussina fit sigma: "<<sigma<<" +- "<<sigma_err<<" for "<<type<<"_"<<parameter<<endl;
805  }
806  }
807  else{
808  LogTrace(metname) << "[MuonTestSummary]: Test of Res_"<<type<<"_"<<parameter<< " not performed because # entries < 20 ";
809  //auto-pass if not enough events.
810  mean=1;
811  mean_err=1;
812  sigma=1;
813  sigma_err=1;
814  }
815 }
type
Definition: HCALResponse.h:21
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
std::string metname
#define LogTrace(id)
TH1F * getTH1F(void) const
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void MuonTestSummary::ResidualCheck ( std::string  muType,
const std::vector< std::string > &  resHistos,
int &  numPlot,
double &  Mean,
double &  Mean_err,
double &  Sigma,
double &  Sigma_err 
)
protected

Definition at line 1124 of file MuonTestSummary.cc.

References MonitorElement::getTH1F(), LogTrace, timingPdfMaker::mean, metname, mergeVDriftHistosByStation::name, and mathSSE::sqrt().

Referenced by doMuonIDTests().

1124  {
1125 
1126  numPlot=0;
1127  Mean=0;
1128  Mean_err=0;
1129  Sigma=0;
1130  Sigma_err=0;
1131  for(uint name=0; name<resHistos.size(); name++){
1132  MonitorElement * resHisto = dbe->get("Muons/MuonIdDQM/" + muType + "/"+resHistos[name]);
1133 
1134  if(resHisto){
1135  TH1F * resHisto_root = resHisto->getTH1F();
1136  if(resHisto_root->GetEntries() < 20) {
1137  LogTrace(metname) << "[MuonTestSummary]: Test of "<< muType<<" for " <<resHistos[name]<< " not performed because # entries < 20 ";
1138  continue;
1139  }
1140 
1141  //we also want to check if the peak is away from zero.
1142  //so, try fitting in 3 sigma around the histogram mean.
1143  //alternatively, could use the maximum bin (less sensitive to 1-sided tails).
1144  // float mean = resHisto_root->GetMean();
1145  float mean = resHisto_root->GetBinLowEdge(resHisto_root->GetMaximumBin());
1146  TF1 *gfit = new TF1("Gaussian","gaus",mean-3,mean+3);
1147 
1148 
1149  try {
1150  resHisto_root->Fit(gfit, "Q0");
1151  } catch (cms::Exception& iException) {
1152  edm::LogError (metname)<< "[MuonTestSummary]: Exception when fitting "<<resHistos[name];
1153  continue;
1154  }
1155  if(gfit){
1156  double mean = gfit->GetParameter(1);
1157  double mean_err = gfit->GetParError(1);
1158  double sigma = gfit->GetParameter(2);
1159  double sigma_err = gfit->GetParError(2);
1160  LogTrace(metname)<<"meanRes: "<<mean<<" +- "<<mean_err<<" for "<<resHistos[name]<<endl;
1161  LogTrace(metname)<<"sigmaRes: "<<sigma<<" +- "<<sigma_err<<" for "<<resHistos[name]<<endl;
1162 
1163  Mean+=mean;
1164  Mean_err +=mean_err * mean_err;
1165  Sigma+=sigma;
1166  Sigma_err +=sigma_err * sigma_err;
1167  numPlot++;
1168  } //if gfit? why would we not have gfit?
1169 
1170  }//histogram exists...
1171  } // loop over residuals histos
1172 
1173 
1174  if(numPlot==0){ //eg no stats
1175  Mean_err = 1;
1176  Mean=1;
1177  Sigma_err =1;
1178  Sigma = 1;
1179  }
1180  else{
1181  Mean_err = sqrt(Mean_err);
1182  Mean_err/=numPlot;
1183  Mean/=numPlot;
1184 
1185  Sigma_err = sqrt(Sigma_err);
1186  Sigma_err/=numPlot;
1187  Sigma/=numPlot;
1188  }
1189  return;
1190 
1191 }
std::string metname
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1473
#define LogTrace(id)
TH1F * getTH1F(void) const

Member Data Documentation

double MuonTestSummary::chi2Fraction
private

Definition at line 79 of file MuonTestSummary.h.

double MuonTestSummary::chi2Spread
private

Definition at line 80 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::chi2TestSummaryMap
private

Definition at line 118 of file MuonTestSummary.h.

DQMStore* MuonTestSummary::dbe
private

Definition at line 72 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::energySummaryMap
private

Definition at line 123 of file MuonTestSummary.h.

double MuonTestSummary::etaExpected
private

Definition at line 77 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityGlb_max
private

Definition at line 111 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityGlb_min
private

Definition at line 108 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicitySta_max
private

Definition at line 113 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicitySta_min
private

Definition at line 110 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityTk_max
private

Definition at line 112 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityTk_min
private

Definition at line 109 of file MuonTestSummary.h.

double MuonTestSummary::expPeakEcalS9_max
private

Definition at line 105 of file MuonTestSummary.h.

double MuonTestSummary::expPeakEcalS9_min
private

Definition at line 104 of file MuonTestSummary.h.

double MuonTestSummary::expPeakHadS9_max
private

Definition at line 107 of file MuonTestSummary.h.

double MuonTestSummary::expPeakHadS9_min
private

Definition at line 106 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::kinematicsSummaryMap
private

Definition at line 120 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::KolmogorovTestSummaryMap
private

Definition at line 117 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionCsc_max
private

Definition at line 98 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionCsc_min
private

Definition at line 97 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionDt_max
private

Definition at line 96 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionDt_min
private

Definition at line 95 of file MuonTestSummary.h.

std::string MuonTestSummary::metname
private

Definition at line 74 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::multiplicitySummaryMap
private

Definition at line 124 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::muonIdSummaryMap
private

Definition at line 122 of file MuonTestSummary.h.

double MuonTestSummary::numMatchedExpected_max
private

Definition at line 94 of file MuonTestSummary.h.

double MuonTestSummary::numMatchedExpected_min
private

Definition at line 93 of file MuonTestSummary.h.

double MuonTestSummary::phiExpected
private

Definition at line 78 of file MuonTestSummary.h.

double MuonTestSummary::pullEtaSpread
private

Definition at line 87 of file MuonTestSummary.h.

double MuonTestSummary::pullOneOvPSpread
private

Definition at line 89 of file MuonTestSummary.h.

double MuonTestSummary::pullPhiSpread
private

Definition at line 88 of file MuonTestSummary.h.

double MuonTestSummary::resChargeLimit_glbSta
private

Definition at line 91 of file MuonTestSummary.h.

double MuonTestSummary::resChargeLimit_tkGlb
private

Definition at line 90 of file MuonTestSummary.h.

double MuonTestSummary::resChargeLimit_tkSta
private

Definition at line 92 of file MuonTestSummary.h.

double MuonTestSummary::resEtaSpread_glbSta
private

Definition at line 82 of file MuonTestSummary.h.

double MuonTestSummary::resEtaSpread_tkGlb
private

Definition at line 81 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::residualsSummaryMap
private

Definition at line 121 of file MuonTestSummary.h.

double MuonTestSummary::resOneOvPSpread_glbSta
private

Definition at line 86 of file MuonTestSummary.h.

double MuonTestSummary::resOneOvPSpread_tkGlb
private

Definition at line 85 of file MuonTestSummary.h.

double MuonTestSummary::resPhiSpread_glbSta
private

Definition at line 84 of file MuonTestSummary.h.

double MuonTestSummary::resPhiSpread_tkGlb
private

Definition at line 83 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_mean_max
private

Definition at line 102 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_mean_min
private

Definition at line 101 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_rms_max
private

Definition at line 100 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_rms_min
private

Definition at line 99 of file MuonTestSummary.h.

double MuonTestSummary::sigmaResSegmTrackExp
private

Definition at line 103 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryCertification
private

Definition at line 128 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryCertificationMap
private

Definition at line 129 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryReport
private

Definition at line 125 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryReportMap
private

Definition at line 126 of file MuonTestSummary.h.

std::vector<MonitorElement*> MuonTestSummary::theCertificationContents
private

Definition at line 130 of file MuonTestSummary.h.

std::vector<MonitorElement*> MuonTestSummary::theSummaryContents
private

Definition at line 127 of file MuonTestSummary.h.