CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
MuonTestSummary Class Reference

#include <MuonTestSummary.h>

Inheritance diagram for MuonTestSummary:
DQMEDHarvester edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonTestSummary (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~MuonTestSummary ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) override final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void produce (edm::Event &, edm::EventSetup const &) override final
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void doEnergyTests (DQMStore::IGetter &, std::string nameHisto, std::string muonType, int bin)
 
void doKinematicsTests (DQMStore::IGetter &, std::string, int)
 test operations More...
 
void doMultiplicityTests (DQMStore::IGetter &)
 
void doMuonIDTests (DQMStore::IGetter &)
 
void doResidualsTests (DQMStore::IGetter &, std::string, std::string, int)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void GaussFit (std::string type, std::string parameter, MonitorElement *Histo, float &mean, float &mean_err, float &sigma, float &sigma_err)
 
void ResidualCheck (DQMStore::IGetter &, 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::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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 34 of file MuonTestSummary.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 28 of file MuonTestSummary.cc.

References edm::ParameterSet::getParameter().

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

70 {}

Member Function Documentation

void MuonTestSummary::doEnergyTests ( DQMStore::IGetter ,
std::string  nameHisto,
std::string  muonType,
int  bin 
)
protected

Definition at line 1127 of file MuonTestSummary.cc.

References DQMStore::IGetter::get(), MonitorElement::getEntries(), MonitorElement::getTH1F(), langaupro(), LogTrace, metname, and callgraph::path.

1127  {
1128 
1129  // num matches test
1130  string path = "Muons/MuonEnergyDepositAnalyzer/"+histname+muonType;
1131  MonitorElement * energyHisto = igetter.get(path);
1132  Double_t hPeak=-1, hFWHM=-1;
1133  if(energyHisto){
1134  TH1F * energyHisto_root = energyHisto->getTH1F();
1135 
1136  // Setting fit range and start values
1137  Double_t fitRange[2];
1138  Double_t startValues[4], parlimitslo[4], parlimitshi[4], fitPar[4], fitParErr[4];
1139 
1140  if (energyHisto->getEntries()>20){
1141  if(histname=="ecalS9PointingMuDepositedEnergy_"){
1142  fitRange[0]=0.04;
1143  fitRange[1]=3.0;
1144 
1145  startValues[0]=0.036; startValues[1]=0.193; startValues[2]=110.0; startValues[3]=0.06;
1146  parlimitslo[0]=0.0; parlimitslo[1]=0.; parlimitslo[2]=1.0; parlimitslo[3]=0.;
1147  parlimitshi[0]=0.05; parlimitshi[1]=0.5; parlimitshi[2]=80000.0; parlimitshi[3]=0.1;
1148 
1149  Double_t chisqr;
1150  Int_t ndf;
1151  TF1 *fit = langaufit(energyHisto_root,fitRange,startValues,parlimitslo,parlimitshi,fitPar,fitParErr,&chisqr,&ndf);
1152  if(fit){
1153  langaupro(fitPar,hPeak,hFWHM);
1154  LogTrace(metname)<<"hPeak from langau fit: "<<hPeak<<" for: "<<histname+muonType<<endl;
1155  LogTrace(metname)<<"hFWHM from langau fit: "<<hFWHM<<" for: "<<histname+muonType<<endl;
1156  }
1157  }
1158 
1159  if(histname=="hadS9PointingMuDepositedEnergy_"){
1160  fitRange[0]=0.0;
1161  fitRange[1]=7.0;
1162 
1163  startValues[0]=2.0; startValues[1]=2.4; startValues[2]=110.0; startValues[3]=4.0;
1164  parlimitslo[0]=0.0; parlimitslo[1]=0.; parlimitslo[2]=1.0; parlimitslo[3]=0.;
1165  parlimitshi[0]=4.0; parlimitshi[1]=4.0; parlimitshi[2]=80000.0; parlimitshi[3]=8.0;
1166 
1167  Double_t chisqr;
1168  Int_t ndf;
1169  TF1 *fit = langaufit(energyHisto_root,fitRange,startValues,parlimitslo,parlimitshi,fitPar,fitParErr,&chisqr,&ndf);
1170  if(fit){
1171  langaupro(fitPar,hPeak,hFWHM);
1172  LogTrace(metname)<<"hPeak from langau fit: "<<hPeak<<" for: "<<histname+muonType<<endl;
1173  LogTrace(metname)<<"hFWHM from langau fit: "<<hFWHM<<" for: "<<histname+muonType<<endl;
1174  }
1175  }
1176  }
1177  else{
1178  LogTrace(metname) << "[MuonTestSummary]: Test of Energy for "<< histname+muonType << " not performed because # entries < 20 ";
1179  }
1180  }
1181 
1182  if(histname=="ecalS9PointingMuDepositedEnergy_" && hPeak>expPeakEcalS9_min && hPeak<expPeakEcalS9_max)
1184  if(histname=="ecalS9PointingMuDepositedEnergy_" && (hPeak!=-1) &&!(hPeak>expPeakEcalS9_min && hPeak<expPeakEcalS9_max))
1186 
1187  if(histname=="hadS9PointingMuDepositedEnergy_" && hPeak>expPeakHadS9_min && hPeak<expPeakHadS9_max)
1189  if(histname=="hadS9PointingMuDepositedEnergy_" && (hPeak!=-1) && !(hPeak>expPeakHadS9_min && hPeak<expPeakHadS9_max))
1191 
1192  //missing test on ho distributions
1193 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double expPeakEcalS9_min
def binNumber(station, sector)
double getEntries(void) const
get # of entries
std::string metname
#define LogTrace(id)
double expPeakEcalS9_max
int32_t langaupro(double *params, double &maxx, double &FWHM)
Definition: fitUtilities.h:120
MonitorElement * energySummaryMap
TH1F * getTH1F(void) const
void MuonTestSummary::doKinematicsTests ( DQMStore::IGetter ,
std::string  ,
int   
)
protected

test operations

Definition at line 472 of file MuonTestSummary.cc.

References dedxEstimators_cff::fraction, DQMStore::IGetter::get(), QReport::getMessage(), MonitorElement::getQReport(), QReport::getQTresult(), QReport::getStatus(), MonitorElement::getTH1F(), createfilelist::int, LogTrace, metname, callgraph::path, mathSSE::sqrt(), and AlCaHLTBitMon_QueryRunRegistry::string.

472  {
473 
474  // chi2 test
475  string path = "Muons/MuonRecoAnalyzer/" + muonType + "chi2OverDf";
476  MonitorElement * chi2Histo = igetter.get(path);
477 
478  if(chi2Histo){
479  TH1F * chi2Histo_root = chi2Histo->getTH1F();
480  if(chi2Histo_root->GetEntries()>20){
481 
482  //Standard QT based on fraction of events below and above a cut
483  LogTrace(metname)<<"chi2 kin test based on fraction for "<<muonType<<endl;
484  int maxBin = chi2Histo_root->GetMaximumBin();
485  if(chi2Histo_root->Integral(maxBin+1,chi2Histo_root->GetNbinsX())!=0){
486  double fraction = double(chi2Histo_root->Integral(1,maxBin))/double(chi2Histo_root->Integral(maxBin+1,chi2Histo_root->GetNbinsX()));
487  LogTrace(metname)<<"chi2 fraction for "<<muonType<<" : "<<fraction<< " must be within "<< chi2Fraction-chi2Spread<<","<<chi2Fraction+chi2Spread<<endl;
488  if(fraction>(chi2Fraction-chi2Spread) && fraction<(chi2Fraction+chi2Spread))
490  else
492  }
493 
494  //QT based on comp wrt reference based on chi2
495  LogTrace(metname)<<"chi2 kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
496  const QReport * myQReport = chi2Histo->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
497  if(myQReport) {
498  LogTrace(metname) << "Chi2Report exists!!";
499  float qtresult = myQReport->getQTresult(); // get QT result value
500  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
501  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
502  LogTrace(metname) << "qtresult " <<qtresult << " qtstatus "<<qtstatus<<endl;
503  chi2TestSummaryMap->setBinContent(bin,1,qtresult);
504  }
505  //QT based on comp wrt reference based on kolmogorov test
506  LogTrace(metname)<<"chi2 kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
507  const QReport * myQReportKolmo = chi2Histo->getQReport("Mu_Comp2RefKolmogorov");
508  if(myQReportKolmo) {
509  LogTrace(metname) << "Chi2Report Kolmogorov exists!!";
510  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
511  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
512  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
513  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
515  }
516 
517  }
518  else{
519  LogTrace(metname) << "[MuonTestSummary]: Test of Chi2 Kin not performed for "<< muonType << " because # entries < 20 ";
520  }
521  }
522 
523 
524 
525  // pseudorapidity test
526  path = "Muons/MuonRecoAnalyzer/" + muonType + "eta";
527  MonitorElement * etaHisto = igetter.get(path);
528 
529  if(etaHisto){
530  TH1F * etaHisto_root = etaHisto->getTH1F();
531  if (etaHisto_root ->GetEntries()>20){
532 
533  //Standard QT based on fraction of events below and above a cut
534  LogTrace(metname)<<"eta kin test based on fraction for "<<muonType<<endl;
535  double binSize = (etaHisto_root->GetXaxis()->GetXmax()-etaHisto_root->GetXaxis()->GetXmin())/etaHisto_root->GetNbinsX();
536  int binZero = int((0-etaHisto_root->GetXaxis()->GetXmin())/binSize);
537  if(etaHisto_root->Integral(1,binZero-1)!=0 && etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX())!=0){
538  double symmetryFactor =
539  double(etaHisto_root->Integral(1,binZero-1)) / double(etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX()));
540  double errSymmetryFactor =
541  symmetryFactor*sqrt(1.0/double(etaHisto_root->Integral(1,binZero-1)) + 1.0/double(etaHisto_root->Integral(binZero,etaHisto_root->GetNbinsX())));
542  LogTrace(metname)<<"eta symmetryFactor for "<<muonType<<" : "<<symmetryFactor<< " (expected :" <<etaExpected <<")"<<endl;
543  LogTrace(metname)<<"eta errSymmetryFactor for "<<muonType<<" : "<<errSymmetryFactor<<endl;
544  double tParameter;
545  if((symmetryFactor-etaExpected)>0) tParameter=double(symmetryFactor-etaExpected)/errSymmetryFactor;
546  else tParameter=double(-symmetryFactor+etaExpected)/errSymmetryFactor;
547  LogTrace(metname)<<"eta tParameter for "<<muonType<<" : "<<tParameter<<" (expected < 1.95)" <<endl;
548  if (tParameter<1.95) //2sigma rejection
550  else
552  }
553 
554  //QT based on comp wrt reference based on chi2
555  LogTrace(metname)<<"eta kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
556  const QReport * myQReport = etaHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
557  if(myQReport) {
558  LogTrace(metname) << "EtaReport exists!!";
559  float qtresult = myQReport->getQTresult(); // get QT result value
560  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
561  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
562  LogTrace(metname) << "qtresult " <<qtresult << " qtstatus "<<qtstatus<<endl;
563  chi2TestSummaryMap->setBinContent(bin,2,qtresult);
564  }
565 
566  //QT based on comp wrt reference based on kolmogorov test
567  LogTrace(metname)<<"eta kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
568  const QReport * myQReportKolmo = etaHisto->getQReport("Mu_Comp2RefKolmogorov");
569  if(myQReportKolmo) {
570  LogTrace(metname) << "EtaReport Kolmogorov exists!!";
571  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
572  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
573  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
574  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
576  }
577 
578  }
579  else{
580  LogTrace(metname) << "[MuonTestSummary]: Test of Eta Kin not performed for "<< muonType << " because # entries < 20 ";
581  }
582  }
583 
584 
585 
586  // phi test
587  path = "Muons/MuonRecoAnalyzer/" + muonType + "phi";
588  MonitorElement * phiHisto = igetter.get(path);
589 
590  if(phiHisto ){
591  TH1F * phiHisto_root = phiHisto->getTH1F();
592  if(phiHisto_root ->GetEntries()>20){
593 
594  //Standard QT based on fraction of events below and above a cut
595  LogTrace(metname)<<"phi kin test based on fraction for "<<muonType<<endl;
596  double binSize = (phiHisto_root->GetXaxis()->GetXmax()-phiHisto_root->GetXaxis()->GetXmin())/phiHisto_root->GetNbinsX();
597  int binZero = int((0-phiHisto_root->GetXaxis()->GetXmin())/binSize);
598  if(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())!=0 && phiHisto_root->Integral(1,binZero)!=0){
599  double symmetryFactor =
600  double(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())) / double(phiHisto_root->Integral(1,binZero));
601  double errSymmetryFactor =
602  symmetryFactor*sqrt(1.0/double(phiHisto_root->Integral(binZero+1,phiHisto_root->GetNbinsX())) + 1.0/double(phiHisto_root->Integral(1,binZero)));
603  LogTrace(metname)<<"phi symmetryFactor for "<<muonType<<" : "<<symmetryFactor<< "(phi expected :" <<phiExpected <<")"<<endl;
604  LogTrace(metname)<<"phi errSymmetryFactor for "<<muonType<<" : "<<errSymmetryFactor<<endl;
605  double tParameter;
606  if((symmetryFactor-phiExpected)>0) tParameter=double(symmetryFactor-phiExpected)/errSymmetryFactor;
607  else tParameter=double(-symmetryFactor+phiExpected)/errSymmetryFactor;
608  LogTrace(metname)<<"phi tParameter for "<<muonType<<" : "<<tParameter<<" (expected < 1.95)" <<endl;
609  if (tParameter<1.95) //2sigma rejection
611  else
613  }
614 
615  //QT based on comp wrt reference based on chi2
616  LogTrace(metname)<<"phi kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
617  const QReport * myQReport = phiHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
618  if(myQReport) {
619  LogTrace(metname) << "PhiReport exists!!";
620  float qtresult = myQReport->getQTresult(); // get QT result value
621  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
622  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
623  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
624  chi2TestSummaryMap->setBinContent(bin,3,qtresult);
625  }
626 
627  //QT based on comp wrt reference based on kolmogorov test
628  LogTrace(metname)<<"phi kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
629  const QReport * myQReportKolmo = phiHisto->getQReport("Mu_Comp2RefKolmogorov");
630  if(myQReportKolmo) {
631  LogTrace(metname) << "PhiReport Kolmogorov exists!!";
632  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
633  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
634  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
635  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
637  }
638 
639  }
640  else{
641  LogTrace(metname) << "[MuonTestSummary]: Test of Phi Kin not performed for "<< muonType << " because # entries < 20 ";
642  }
643  }
644 
645  // pt test
646  path = "Muons/MuonRecoAnalyzer/" + muonType + "pt";
647  MonitorElement * ptHisto = igetter.get(path);
648 
649  if(ptHisto ){
650  TH1F * ptHisto_root = ptHisto->getTH1F();
651  if(ptHisto_root ->GetEntries()>20){
652 
653  //QT based on comp wrt reference based on chi2
654  LogTrace(metname)<<"pt kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
655  const QReport * myQReport = ptHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
656  if(myQReport) {
657  LogTrace(metname) << "PtReport exists!!";
658  float qtresult = myQReport->getQTresult(); // get QT result value
659  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
660  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
661  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
662  chi2TestSummaryMap->setBinContent(bin,4,qtresult);
663  }
664 
665  //QT based on comp wrt reference based on kolmogorov test
666  LogTrace(metname)<<"pt kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
667  const QReport * myQReportKolmo = ptHisto->getQReport("Mu_Comp2RefKolmogorov");
668  if(myQReportKolmo) {
669  LogTrace(metname) << "PtReport Kolmogorov exists!!";
670  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
671  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
672  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
673  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
675  }
676  }
677  else{
678  LogTrace(metname) << "[MuonTestSummary]: Test of Pt Kin not performed for "<< muonType << " because # entries < 20 ";
679  }
680  }
681 
682  // q test
683  path = "Muons/MuonRecoAnalyzer/" + muonType + "q";
684  MonitorElement * qHisto = igetter.get(path);
685 
686  if(ptHisto ){
687  TH1F * qHisto_root = qHisto->getTH1F();
688  if(qHisto_root ->GetEntries()>20){
689 
690  //QT based on comp wrt reference based on chi2
691  LogTrace(metname)<<"q kin test based on comp wrt reference on terms of chi2 for "<<muonType<<endl;
692  const QReport * myQReport = qHisto->getQReport("Mu_Comp2RefChi2"); //get QReport associated to your ME
693  if(myQReport) {
694  LogTrace(metname) << "qReport exists!!";
695  float qtresult = myQReport->getQTresult(); // get QT result value
696  int qtstatus = myQReport->getStatus() ; // get QT status value (see table below)
697  std::string qtmessage = myQReport->getMessage() ; // get the whole QT result message
698  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
699  chi2TestSummaryMap->setBinContent(bin,5,qtresult);
700  }
701 
702  //QT based on comp wrt reference based on kolmogorov test
703  LogTrace(metname)<<"q kin test based on comp wrt reference using kolmogorov for "<<muonType<<endl;
704  const QReport * myQReportKolmo = qHisto->getQReport("Mu_Comp2RefKolmogorov");
705  if(myQReportKolmo) {
706  LogTrace(metname) << "qReport Kolmogorov exists!!";
707  float qtresult = myQReportKolmo->getQTresult(); // get QT result value
708  int qtstatus = myQReportKolmo->getStatus() ; // get QT status value (see table below)
709  std::string qtmessage = myQReportKolmo->getMessage() ; // get the whole QT result message
710  LogTrace(metname) << "qtresult " <<qtresult<< " qtstatus "<<qtstatus<<endl;
712  }
713  }
714  else{
715  LogTrace(metname) << "[MuonTestSummary]: Test of q Kin not performed for "<< muonType << " because # entries < 20 ";
716  }
717  }
718 
719 }
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (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:18
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
Definition: QReport.h:16
#define LogTrace(id)
bin
set the eta bin as selection string.
TH1F * getTH1F(void) const
float getQTresult(void) const
get test result i.e. prob value
Definition: QReport.h:20
MonitorElement * chi2TestSummaryMap
void MuonTestSummary::doMultiplicityTests ( DQMStore::IGetter igetter)
protected

Definition at line 1194 of file MuonTestSummary.cc.

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

1194  {
1195 
1196  MonitorElement* multiplicityHisto = igetter.get("Muons/MuonRecoAnalyzer/muReco");
1197 
1198  if(multiplicityHisto){
1199  if(multiplicityHisto->getEntries()>20){
1200  double multiplicity_GLB = double(multiplicityHisto->getBinContent(1)+multiplicityHisto->getBinContent(2))/double(multiplicityHisto->getEntries());
1201  LogTrace(metname)<<"multiplicity_GLB: "<<multiplicity_GLB<< " ExpMultiplicityGlb_min " <<expMultiplicityGlb_min <<" ExpMultiplicityGlb_max " <<expMultiplicityGlb_max<<endl;
1202  double multiplicity_TK = double(multiplicityHisto->getBinContent(3)+multiplicityHisto->getBinContent(4))/double(multiplicityHisto->getEntries());
1203  LogTrace(metname)<<"multiplicity_TK: "<<multiplicity_TK<< " ExpMultiplicityTk_min " <<expMultiplicityTk_min <<" ExpMultiplicityTk_max " <<expMultiplicityTk_max<<endl;
1204  double multiplicity_STA = double(multiplicityHisto->getBinContent(3)+multiplicityHisto->getBinContent(5))/double(multiplicityHisto->getEntries());
1205  LogTrace(metname)<<"multiplicity_STA: "<<multiplicity_STA<< " ExpMultiplicitySta_min " <<expMultiplicitySta_min <<" ExpMultiplicitySta_max " <<expMultiplicitySta_max<<endl;
1206 
1207  if(multiplicity_GLB>expMultiplicityGlb_min && multiplicity_GLB<expMultiplicityGlb_max)
1209  else
1211 
1212  if(multiplicity_TK>expMultiplicityTk_min && multiplicity_TK<expMultiplicityTk_max)
1214  else
1216 
1217  if(multiplicity_STA>expMultiplicitySta_min && multiplicity_STA<expMultiplicitySta_max)
1219  else
1221  }
1222  else{
1223  LogTrace(metname) << "[MuonTestSummary]: Test of Multiplicity not performed because # entries < 20 ";
1224  }
1225  }
1226 
1227 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double expMultiplicityTk_max
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
double expMultiplicityGlb_min
MonitorElement * multiplicitySummaryMap
double getEntries(void) const
get # of entries
std::string metname
#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 ( DQMStore::IGetter igetter)
protected

Definition at line 863 of file MuonTestSummary.cc.

References DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getTH1F(), mps_fire::i, LogTrace, metname, callgraph::path, and ResidualCheck().

863  {
864 
865  vector<string> muType;
866  muType.push_back("GlobalMuons");
867  muType.push_back("TrackerMuons");
868 
869  for(int i=0; i<=1; i++){
870 
871  // num matches test
872  string path = "Muons/MuonIdDQM/" + muType[i] + "/hNumMatches";
873  MonitorElement * matchesHisto = igetter.get(path);
874 
875  if(matchesHisto){
876  TH1F * matchesHisto_root = matchesHisto->getTH1F();
877  if(matchesHisto_root->GetMaximumBin() >= numMatchedExpected_min && matchesHisto_root->GetMaximumBin() <= numMatchedExpected_max)
879  else
881  }
882 
883 
884  // num of 0 associated segments
885  double numOneSegm_dt = 0;
886  int numHistos_dt=0;
887  int numHistos_csc=0;
888  MonitorElement * DT1Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT1NumSegments");
889  if(DT1Histo)
890  {numHistos_dt++;
891  if(DT1Histo->getEntries()!=0) numOneSegm_dt+=double(DT1Histo->getBinContent(2))/double(DT1Histo->getEntries());}
892  MonitorElement * DT2Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT2NumSegments");
893  if(DT2Histo)
894  {numHistos_dt++;
895  if(DT2Histo->getEntries()!=0) numOneSegm_dt+=double(DT2Histo->getBinContent(2))/double(DT2Histo->getEntries());}
896  MonitorElement * DT3Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT3NumSegments");
897  if(DT3Histo)
898  {numHistos_dt++;
899  if(DT3Histo->getEntries()!=0) numOneSegm_dt+=double(DT3Histo->getBinContent(2))/double(DT3Histo->getEntries());}
900  MonitorElement * DT4Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hDT4NumSegments");
901  if(DT4Histo)
902  {numHistos_dt++;
903  if(DT4Histo->getEntries()!=0) numOneSegm_dt+=double(DT4Histo->getBinContent(2))/double(DT4Histo->getEntries());}
904  double fraction_dt=0;
905  if(numOneSegm_dt!=0){
906  fraction_dt = numOneSegm_dt/double(numHistos_dt);
907  LogTrace(metname)<<"fraction_dt: "<<fraction_dt<<" for "<<muType[i]<<endl;
908  }
909 
910  double numOneSegm_csc = 0;
911  MonitorElement * CSC1Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC1NumSegments");
912  if(CSC1Histo)
913  {numHistos_csc++;
914  if(CSC1Histo->getEntries()!=0) numOneSegm_csc+=double(CSC1Histo->getBinContent(2))/double(CSC1Histo->getEntries());}
915  MonitorElement * CSC2Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC2NumSegments");
916  if(CSC2Histo)
917  {numHistos_csc++;
918  if(CSC2Histo->getEntries()!=0) numOneSegm_csc+=double(CSC2Histo->getBinContent(2))/double(CSC2Histo->getEntries());}
919  MonitorElement * CSC3Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC3NumSegments");
920  if(CSC3Histo)
921  {numHistos_csc++;
922  if(CSC3Histo->getEntries()!=0) numOneSegm_csc+=double(CSC3Histo->getBinContent(2))/double(CSC3Histo->getEntries());}
923  MonitorElement * CSC4Histo = igetter.get("Muons/MuonIdDQM/" + muType[i] + "/hCSC4NumSegments");
924  if(CSC4Histo)
925  {numHistos_csc++;
926  if(CSC4Histo->getEntries()!=0) numOneSegm_csc+=double(CSC4Histo->getBinContent(2))/double(CSC4Histo->getEntries());}
927  double fraction_csc=0;
928  if(numOneSegm_csc!=0){
929  fraction_csc = numOneSegm_csc/double(numHistos_csc);
930  LogTrace(metname)<<"fraction_csc: "<<fraction_csc<<" for "<<muType[i]<<endl;
931  }
932 
933 
934 
935  //--GH modified
936 
937  if(fraction_dt>matchesFractionDt_min && fraction_dt<matchesFractionDt_max)
938  muonIdSummaryMap->setBinContent(2*i+1,1,1);
939  else
940  muonIdSummaryMap->setBinContent(2*i+1,1,0);
941 
942  if(fraction_csc>matchesFractionCsc_min && fraction_csc<matchesFractionCsc_max)
943  muonIdSummaryMap->setBinContent(2*i+2,1,1);
944  else
945  muonIdSummaryMap->setBinContent(2*i+2,1,0);
946 
947 
948 
949  //--GH modified
950 
951  // residuals test
952  vector<string> DTXresHistos, DTYresHistos, CSCXresHistos, CSCYresHistos;
953  DTXresHistos.push_back("hDT1Pullx");
954  DTXresHistos.push_back("hDT2Pullx");
955  DTXresHistos.push_back("hDT3Pullx");
956  DTXresHistos.push_back("hDT4Pullx");
957 
958  DTYresHistos.push_back("hDT1Pully");
959  DTYresHistos.push_back("hDT2Pully");
960  DTYresHistos.push_back("hDT3Pully");
961 
962  CSCXresHistos.push_back("hCSC1Pullx");
963  CSCXresHistos.push_back("hCSC2Pullx");
964  CSCXresHistos.push_back("hCSC3Pullx");
965  CSCXresHistos.push_back("hCSC4Pullx");
966 
967  CSCYresHistos.push_back("hCSC1Pully");
968  CSCYresHistos.push_back("hCSC2Pully");
969  CSCYresHistos.push_back("hCSC3Pully");
970  CSCYresHistos.push_back("hCSC4Pully");
971 
972  int numPlot_dtX, numPlot_dtY, numPlot_cscX, numPlot_cscY;
973  double dtSigmaX, dtSigmaY, cscSigmaX, cscSigmaY;
974  double dtSigmaX_err, dtSigmaY_err, cscSigmaX_err, cscSigmaY_err;
975  double dtMeanX, dtMeanY, cscMeanX, cscMeanY;
976  double dtMeanX_err, dtMeanY_err, cscMeanX_err, cscMeanY_err;
977  MuonTestSummary::ResidualCheck(igetter, muType[i], DTXresHistos, numPlot_dtX, dtMeanX, dtMeanX_err, dtSigmaX, dtSigmaX_err);
978  MuonTestSummary::ResidualCheck(igetter, muType[i], DTYresHistos, numPlot_dtY, dtMeanY, dtMeanY_err, dtSigmaY, dtSigmaY_err);
979  MuonTestSummary::ResidualCheck(igetter, muType[i], CSCXresHistos, numPlot_cscX, cscMeanX, cscMeanX_err, cscSigmaX, cscSigmaX_err);
980  MuonTestSummary::ResidualCheck(igetter, muType[i], CSCYresHistos, numPlot_cscY, cscMeanY, cscMeanY_err, cscSigmaY, cscSigmaY_err);
981 
982 
983  LogTrace(metname)<<"DT mean must be between: "<<resSegmTrack_mean_min <<" and "<<resSegmTrack_mean_max<<endl;
984  LogTrace(metname)<<"DT rms must be between: "<<resSegmTrack_rms_min <<" and "<<resSegmTrack_rms_max<<endl;
985  LogTrace(metname)<<"DT X residual "<< muType[i]<<" mean: " << dtMeanX<<" +- "<< dtMeanX_err
986  <<", sigma: "<< dtSigmaX <<" +- "<<dtSigmaX_err<< endl;
987  LogTrace(metname)<<"DT Y residual "<< muType[i]<<" mean: " << dtMeanY<<" +- "<< dtMeanY_err
988  <<", sigma: "<< dtSigmaY <<" +- "<<dtSigmaY_err<< endl;
989  LogTrace(metname)<<"CSC X residual "<< muType[i]<<" mean: " << cscMeanX<<" +- "<< cscMeanX_err
990  <<", sigma: "<< cscSigmaX <<" +- "<<cscSigmaX_err<< endl;
991  LogTrace(metname)<<"CSC Y residual "<< muType[i]<<" mean: " << cscMeanY<<" +- "<< cscMeanY_err
992  <<", sigma: "<< cscSigmaY <<" +- "<<cscSigmaY_err<< endl;
993 
994 
995  //require the mean and rms to be within nsig sigma of preferred range;
996  const int nsig=2;
997  if(numPlot_dtX > 0 ) {
998  if( dtMeanX + nsig*dtMeanX_err>resSegmTrack_mean_min &&
999  dtMeanX - nsig*dtMeanX_err<resSegmTrack_mean_max)
1000  muonIdSummaryMap->setBinContent(2*i+1,2,1);
1001  else
1002  muonIdSummaryMap->setBinContent(2*i+1,2,0);
1003 
1004  if( dtSigmaX + nsig*dtSigmaX_err>resSegmTrack_rms_min &&
1005  dtSigmaX - nsig*dtSigmaX_err<resSegmTrack_rms_max)
1006  muonIdSummaryMap->setBinContent(2*i+1,3,1);
1007  else
1008  muonIdSummaryMap->setBinContent(2*i+1,3,0);
1009  }
1010  if(numPlot_dtY > 0 ){
1011  if( dtMeanY + nsig*dtMeanY_err>resSegmTrack_mean_min &&
1012  dtMeanY - nsig*dtMeanY_err<resSegmTrack_mean_max)
1013  muonIdSummaryMap->setBinContent(2*i+1,4,1);
1014  else
1015  muonIdSummaryMap->setBinContent(2*i+1,4,0);
1016 
1017  if( dtSigmaY + nsig*dtSigmaY_err>resSegmTrack_rms_min &&
1018  dtSigmaY - nsig*dtSigmaX_err<resSegmTrack_rms_max)
1019  muonIdSummaryMap->setBinContent(2*i+1,5,1);
1020  else
1021  muonIdSummaryMap->setBinContent(2*i+1,5,0);
1022  }
1023 
1024 
1025  if(numPlot_cscX > 0 ) {
1026  if( cscMeanX + nsig*cscMeanX_err>resSegmTrack_mean_min &&
1027  cscMeanX - nsig*cscMeanX_err<resSegmTrack_mean_max)
1028  muonIdSummaryMap->setBinContent(2*i+2,2,1);
1029  else
1030  muonIdSummaryMap->setBinContent(2*i+2,2,0);
1031 
1032  if( cscSigmaX + nsig*cscSigmaX_err>resSegmTrack_rms_min &&
1033  cscSigmaX - nsig*cscSigmaX_err<resSegmTrack_rms_max)
1034  muonIdSummaryMap->setBinContent(2*i+2,3,1);
1035  else
1036  muonIdSummaryMap->setBinContent(2*i+2,3,0);
1037  }
1038  if(numPlot_cscY > 0 ){
1039  if( cscMeanY + nsig*cscMeanY_err>resSegmTrack_mean_min &&
1040  cscMeanY - nsig*cscMeanY_err<resSegmTrack_mean_max)
1041  muonIdSummaryMap->setBinContent(2*i+2,4,1);
1042  else
1043  muonIdSummaryMap->setBinContent(2*i+2,4,0);
1044 
1045  if( cscSigmaY + nsig*cscSigmaY_err>resSegmTrack_rms_min &&
1046  cscSigmaY - nsig*cscSigmaY_err<resSegmTrack_rms_max)
1047  muonIdSummaryMap->setBinContent(2*i+2,5,1);
1048  else
1049  muonIdSummaryMap->setBinContent(2*i+2,5,0);
1050  }
1051 
1052  //---- end of modification
1053 
1054 
1055  }
1056 
1057 }
double matchesFractionCsc_max
void setBinContent(int binx, double content)
set content of bin (1-D)
void ResidualCheck(DQMStore::IGetter &, std::string muType, const std::vector< std::string > &resHistos, int &numPlot, double &Mean, double &Mean_err, double &Sigma, double &Sigma_err)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
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
#define LogTrace(id)
double numMatchedExpected_min
TH1F * getTH1F(void) const
double numMatchedExpected_max
double getBinContent(int binx) const
get content of bin (1-D)
double matchesFractionDt_min
void MuonTestSummary::doResidualsTests ( DQMStore::IGetter ,
std::string  ,
std::string  ,
int   
)
protected

Definition at line 757 of file MuonTestSummary.cc.

References DQMStore::IGetter::get(), MonitorElement::getBinContent(), LogTrace, RecoTauDiscriminantConfiguration::mean, metname, and callgraph::path.

757  {
758 
759  // residuals test
760  if(type!="GlbMuon"){
761  string path = "Muons/MuonRecoAnalyzer/Res_" + type + "_" + parameter;
762  MonitorElement * residualsHisto = igetter.get(path);
763 
764  float mean = -1;
765  float mean_err = -1;
766  float sigma = -1;
767  float sigma_err = -1;
768 
769  if(residualsHisto){
770 
771  LogTrace(metname) << "[MuonTestSummary]: Starting Gaussian fit for Test of Res_"<<type<<"_"<<parameter<< endl;
772  GaussFit( type, parameter, residualsHisto, mean, mean_err, sigma, sigma_err);
773 
774  if(sigma!=-1 && parameter=="eta" && type=="TkGlb"){
775  if(sigma-sigma_err<resEtaSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 1, 1);
777  }
778  if(sigma!=-1 && parameter=="eta" && (type=="GlbSta" || type=="TkSta")) {
779  if(sigma-sigma_err<resEtaSpread_glbSta) residualsSummaryMap->setBinContent(bin, 1, 1);
781  }
782  if(sigma!=-1 && parameter=="phi" && type=="TkGlb"){
783  if(sigma-sigma_err<resPhiSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 2, 1);
785  }
786  if(sigma!=-1 && parameter=="phi" && (type=="GlbSta" || type=="TkSta")){
787  if(sigma-sigma_err<resPhiSpread_glbSta) residualsSummaryMap->setBinContent(bin, 2, 1);
788  else residualsSummaryMap->setBinContent(bin, 2, 0);
789  }
790  if(sigma!=-1 && parameter=="oneOverp" && type=="TkGlb"){
791  if(sigma-sigma_err<resOneOvPSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 3, 1);
793  }
794  if(sigma!=-1 && parameter=="oneOverp" && (type=="GlbSta" || type=="TkSta")) {
795  if(sigma-sigma_err<resOneOvPSpread_glbSta) residualsSummaryMap->setBinContent(bin, 3, 1);
797  }
798  }
799 
800 
801 
802  //--GH modified
803  if(type=="TkSta"){
804  //look at the pull:
805  string path = "Muons/MuonRecoAnalyzer/Pull_" + type + "_" + parameter;
806  MonitorElement * pullHisto = igetter.get(path);
807 
808  if(pullHisto){
809 
810  LogTrace(metname) << "[MuonTestSummary]: Starting Gaussian fit for Test of Pull_"<<type<<"_"<<parameter<< endl;
811  GaussFit( type, parameter, pullHisto, mean, mean_err, sigma, sigma_err);
812 
813  if(sigma!=-1 && parameter=="eta" ){
814  if(sigma-sigma_err<pullEtaSpread) residualsSummaryMap->setBinContent(4, 1, 1);
815  else residualsSummaryMap->setBinContent(4, 1, 0);
816  }
817  if(sigma!=-1 && parameter=="phi"){
818  if(sigma-sigma_err<pullPhiSpread) residualsSummaryMap->setBinContent(4, 2, 1);
819  else residualsSummaryMap->setBinContent(4, 2, 0);
820  }
821  if(sigma!=-1 && parameter=="oneOverp"){
822  if(sigma-sigma_err<pullOneOvPSpread) residualsSummaryMap->setBinContent(4, 3, 1);
823  else residualsSummaryMap->setBinContent(4, 3, 0);
824  }
825 
826  }//have pull histo
827  } //TkSta muons
828  }
829 
830  //this part for Global Muons:
831  else{
832  string path = "Muons/MuonRecoAnalyzer/" + type + "_" + parameter;
833  MonitorElement * residualsHisto = igetter.get(path);
834 
835  if(residualsHisto){
836  LogTrace(metname) << "[MuonTestSummary]: Test of Charge Comparison "<<type<<"_"<<parameter<< endl;
837  if((residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4))!=0){
838  LogTrace(metname)<<"Charge comparison TkGlb: "<<residualsHisto->getBinContent(4)/double(residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4))<<endl;
839  if(residualsHisto->getBinContent(4)/double(residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4)) < resChargeLimit_tkGlb)
841  else
843  }
844  if((residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2))!=0){
845  LogTrace(metname)<<"charge comparison GlbSta: "<<residualsHisto->getBinContent(2)/double(residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2))<<endl;
846  if(residualsHisto->getBinContent(2)/double(residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2)) < resChargeLimit_glbSta)
848  else
850  }
851  if(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6)!=0){
852  LogTrace(metname)<<"charge comparison TkSta: "<<residualsHisto->getBinContent(6)/double(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6))<<endl;
853  if(residualsHisto->getBinContent(6)/double(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6)) < resChargeLimit_tkSta)
855  else
857  }
858  }
859  }
860 
861 }
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
#define LogTrace(id)
double resPhiSpread_glbSta
double resOneOvPSpread_glbSta
bin
set the eta bin as selection string.
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::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

DO OTHER OPERATIONS WITH HISTOGRAMS

Implements DQMEDHarvester.

Definition at line 72 of file MuonTestSummary.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::cd(), MonitorElement::Fill(), mps_fire::i, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and cuy::yBin.

72  {
73  // BOOKING NEW HISTOGRAMS
74  ibooker.cd();
75  ibooker.setCurrentFolder("Muons/TestSummary");
76 
77  // kinematics test report
78  kinematicsSummaryMap = ibooker.book2D("kinematicsSummaryMap","Kinematics test summary",5,1,6,3,1,4);
79  kinematicsSummaryMap->setAxisTitle("track monitored",1);
81  kinematicsSummaryMap->setBinLabel(2,"TKfromGLB",1);
82  kinematicsSummaryMap->setBinLabel(3,"STAfromGLB",1);
85  kinematicsSummaryMap->setAxisTitle("parameter tested",2);
86  kinematicsSummaryMap->setBinLabel(1,"#chi^{2}",2);
87  kinematicsSummaryMap->setBinLabel(2,"#eta",2);
88  kinematicsSummaryMap->setBinLabel(3,"#phi",2);
89 
90  //chi2 kinematics quality test report
91  chi2TestSummaryMap = ibooker.book2D("chi2TestSummaryMap","#chi2 quality test summary",5,1,6,5,1,6);
92  chi2TestSummaryMap->setAxisTitle("track monitored",1);
93  chi2TestSummaryMap->setBinLabel(1,"GLB",1);
94  chi2TestSummaryMap->setBinLabel(2,"TKfromGLB",1);
95  chi2TestSummaryMap->setBinLabel(3,"STAfromGLB",1);
97  chi2TestSummaryMap->setBinLabel(5,"STA",1);
98  chi2TestSummaryMap->setAxisTitle("parameter tested",2);
99  chi2TestSummaryMap->setBinLabel(1,"#chi^{2}",2);
100  chi2TestSummaryMap->setBinLabel(2,"#eta",2);
101  chi2TestSummaryMap->setBinLabel(3,"#phi",2);
102  chi2TestSummaryMap->setBinLabel(4,"#pt",2);
103  chi2TestSummaryMap->setBinLabel(5,"#q",2);
104 
105 //Kolmogorov kinematics quality test report
106  KolmogorovTestSummaryMap = ibooker.book2D("KolmogorovTestSummaryMap","Kolmogorov quality test summary",5,1,6,5,1,6);
107  KolmogorovTestSummaryMap->setAxisTitle("track monitored",1);
109  KolmogorovTestSummaryMap->setBinLabel(2,"TKfromGLB",1);
110  KolmogorovTestSummaryMap->setBinLabel(3,"STAfromGLB",1);
113  KolmogorovTestSummaryMap->setAxisTitle("parameter tested",2);
114  KolmogorovTestSummaryMap->setBinLabel(1,"#chi^{2}",2);
119 
120 
121  // residuals test report
122  residualsSummaryMap = ibooker.book2D("residualsSummaryMap","Residuals test summary",4,1,5,4,1,5);
123  residualsSummaryMap->setAxisTitle("residuals",1);
124  residualsSummaryMap->setBinLabel(1,"TK-GLB",1);
125  residualsSummaryMap->setBinLabel(2,"GLB-STA",1);
126  residualsSummaryMap->setBinLabel(3,"TK-STA",1);
127  residualsSummaryMap->setBinLabel(4,"TK-STA Pull",1);
128  residualsSummaryMap->setAxisTitle("parameter tested",2);
129  residualsSummaryMap->setBinLabel(1,"#eta",2);
130  residualsSummaryMap->setBinLabel(2,"#phi",2);
131  residualsSummaryMap->setBinLabel(3,"1/p",2);
133 
134  // muonId test report
135  muonIdSummaryMap = ibooker.book2D("muonIdSummaryMap","muonId test summary",4,1,5, 5,1,6);
136  muonIdSummaryMap->setAxisTitle("muons",1);
137  muonIdSummaryMap->setBinLabel(1,"GLB DT",1);
138  muonIdSummaryMap->setBinLabel(2,"GLB CSC",1);
139  muonIdSummaryMap->setBinLabel(3,"TK DT",1);
140  muonIdSummaryMap->setBinLabel(4,"TK CSC",1);
141  muonIdSummaryMap->setAxisTitle("tests",2);
142  muonIdSummaryMap->setBinLabel(1,"#assSeg",2);
143  muonIdSummaryMap->setBinLabel(2,"x mean",2);
144  muonIdSummaryMap->setBinLabel(3,"x rms",2);
145  muonIdSummaryMap->setBinLabel(4,"y mean",2);
146  muonIdSummaryMap->setBinLabel(5,"y rms",2);
147 
148  // energy test report
149  energySummaryMap = ibooker.book2D("energySummaryMap","Energy deposits test summary",3,1,4,3,1,4);
150  energySummaryMap->setAxisTitle("muons",1);
151  energySummaryMap->setBinLabel(1,"GLB",1);
152  energySummaryMap->setBinLabel(2,"TK",1);
153  energySummaryMap->setBinLabel(3,"STA",1);
154  energySummaryMap->setAxisTitle("calorimeter tested",2);
155  energySummaryMap->setBinLabel(1,"ECAL",2);
156  energySummaryMap->setBinLabel(2,"HAD",2);
157  energySummaryMap->setBinLabel(3,"H0",2);
158 
159  // multiplicity tests report
160  multiplicitySummaryMap = ibooker.book1D("multiplicitySummaryMap","muon multiplicity test summary",3,1,4);
165 
166 
167  // summary test report
168  ibooker.setCurrentFolder("Muons/EventInfo");
169  summaryReport = ibooker.bookFloat("reportSummary");
170 
171  summaryReportMap = ibooker.book2D("reportSummaryMap","Muon Report Summary Map",3,1,4,7,1,8);
172  summaryReportMap->setAxisTitle("muons",1);
173  summaryReportMap->setBinLabel(1,"GLB",1);
174  summaryReportMap->setBinLabel(2,"TK",1);
175  summaryReportMap->setBinLabel(3,"STA",1);
176  summaryReportMap->setAxisTitle("test",2);
177  summaryReportMap->setBinLabel(1,"#chi^{2}/Df",2);
178  summaryReportMap->setBinLabel(2,"#eta",2);
179  summaryReportMap->setBinLabel(3,"#phi",2);
180  summaryReportMap->setBinLabel(4,"residuals",2);
181  summaryReportMap->setBinLabel(5,"muonId",2);
182  summaryReportMap->setBinLabel(6,"energyDeposits",2);
183  summaryReportMap->setBinLabel(7,"multiplicity",2);
184 
185  ibooker.setCurrentFolder("Muons/EventInfo/reportSummaryContents");
186  theSummaryContents.push_back(ibooker.bookFloat("kinematics_GLB"));
187  theSummaryContents.push_back(ibooker.bookFloat("muonId_GLB"));
188  theSummaryContents.push_back(ibooker.bookFloat("residuals_GLB"));
189  theSummaryContents.push_back(ibooker.bookFloat("GLB"));
190  theSummaryContents.push_back(ibooker.bookFloat("kinematics_TK"));
191  theSummaryContents.push_back(ibooker.bookFloat("muonId_TK"));
192  theSummaryContents.push_back(ibooker.bookFloat("residuals_TK"));
193  theSummaryContents.push_back(ibooker.bookFloat("TK"));
194  theSummaryContents.push_back(ibooker.bookFloat("kinematics_STA"));
195  theSummaryContents.push_back(ibooker.bookFloat("residuals_STA"));
196  theSummaryContents.push_back(ibooker.bookFloat("STA"));
197  theSummaryContents.push_back(ibooker.bookFloat("energyDeposits"));
198  theSummaryContents.push_back(ibooker.bookFloat("multiplicity"));
199 
200  // certification report
201  ibooker.setCurrentFolder("Muons/EventInfo");
202  summaryCertification = ibooker.bookFloat("CertificationSummary");
204 
205  summaryCertificationMap = ibooker.book2D("CertificationSummaryMap","Muon Certification Summary Map",9,1,10,7,1,8);
207  summaryCertificationMap->setBinLabel(1,"GLB_Tot",1);
208  summaryCertificationMap->setBinLabel(2,"TK_Tot",1);
209  summaryCertificationMap->setBinLabel(3,"STA_tot",1);
210  summaryCertificationMap->setBinLabel(4,"GLB_B",1);
212  summaryCertificationMap->setBinLabel(6,"STA_B",1);
213  summaryCertificationMap->setBinLabel(7,"GLB_EC",1);
214  summaryCertificationMap->setBinLabel(8,"TK_EC",1);
215  summaryCertificationMap->setBinLabel(9,"STA_EC",1);
217  summaryCertificationMap->setBinLabel(1,"#chi^{2}/Df",2);
220  summaryCertificationMap->setBinLabel(4,"residuals",2);
221  summaryCertificationMap->setBinLabel(5,"muonId",2);
222  summaryCertificationMap->setBinLabel(6,"energyDeposits",2);
223  summaryCertificationMap->setBinLabel(7,"multiplicity",2);
224 
225  ibooker.setCurrentFolder("Muons/EventInfo/CertificationContents");
226  theCertificationContents.push_back(ibooker.bookFloat("GLB_Tot"));
227  theCertificationContents.push_back(ibooker.bookFloat("STA_Tot"));
228  theCertificationContents.push_back(ibooker.bookFloat("TK_Tot"));
229  theCertificationContents.push_back(ibooker.bookFloat("GLB_B"));
230  theCertificationContents.push_back(ibooker.bookFloat("STA_B"));
231  theCertificationContents.push_back(ibooker.bookFloat("TK_B"));
232  theCertificationContents.push_back(ibooker.bookFloat("GLB_EC"));
233  theCertificationContents.push_back(ibooker.bookFloat("STA_EC"));
234  theCertificationContents.push_back(ibooker.bookFloat("TK_EC"));
235 
236 
237  for (unsigned int icert=0;icert <theCertificationContents.size();icert++){
238  theCertificationContents[icert]->Fill(-1);
239  }
240 
241  // initialisation of histo bins
242  for(int xBin=1; xBin<=5; xBin++){
243  for(int yBin=1; yBin<=3; yBin++){
244  kinematicsSummaryMap->Fill(xBin,yBin,1);
245  }
246  for(int yBin=1; yBin<=5; yBin++){
247  chi2TestSummaryMap->Fill(xBin,yBin,1);
249  }
250  }
251  for(int xBin=1; xBin<=residualsSummaryMap->getNbinsX(); xBin++){
252  for(int yBin=1; yBin<=residualsSummaryMap->getNbinsY(); yBin++){
253  residualsSummaryMap->Fill(xBin,yBin,1);
254  }
255  }
256  residualsSummaryMap->setBinContent(4, 4, 1); //not used for now
257 
258  for(int xBin=1; xBin<=muonIdSummaryMap->getNbinsX(); xBin++){
259  for(int yBin=1; yBin<=muonIdSummaryMap->getNbinsY(); yBin++){
260  muonIdSummaryMap->Fill(xBin,yBin,1);
261  }
262  }
263  for(int xBin=1; xBin<=3; xBin++){
264  for(int yBin=1; yBin<=3; yBin++){
265  energySummaryMap->Fill(xBin,yBin,1);
266  }
267  }
268  for(int xBin=1; xBin<=3; xBin++){
269  multiplicitySummaryMap->Fill(xBin,1);
270  }
271  for(int xBin=1; xBin<=3; xBin++){
272  for(int yBin=1; yBin<=7; yBin++){
273  summaryReportMap->Fill(xBin,yBin,1);
274  }
275  }
276  for(int xBin=1; xBin<=9; xBin++){
277  for(int yBin=1; yBin<=7; yBin++){
279  }
280  }
283 
284  // fill the kinematics report summary
285  doKinematicsTests(igetter,"GlbMuon_Glb_", 1);
286  doKinematicsTests(igetter,"GlbMuon_Tk_", 2);
287  doKinematicsTests(igetter,"GlbMuon_Sta_",3);
288  doKinematicsTests(igetter,"TkMuon_", 4);
289  doKinematicsTests(igetter,"StaMuon_", 5);
290 
291  // fill the residuals report summary
292  doResidualsTests(igetter,"TkGlb", "eta", 1);
293  doResidualsTests(igetter,"GlbSta", "eta", 2);
294  doResidualsTests(igetter,"TkSta", "eta", 3);
295  doResidualsTests(igetter,"TkGlb", "phi", 1);
296  doResidualsTests(igetter,"GlbSta", "phi", 2);
297  doResidualsTests(igetter,"TkSta", "phi", 3);
298  doResidualsTests(igetter,"TkGlb", "oneOverp", 1);
299  doResidualsTests(igetter,"GlbSta", "oneOverp", 2);
300  doResidualsTests(igetter,"TkSta", "oneOverp", 3);
301  doResidualsTests(igetter,"GlbMuon", "qComparison", -1);
302 
303  // fill the muonID report summary
304  doMuonIDTests(igetter);
305 
306  // fill the energy report summary
307  doEnergyTests(igetter,"ecalS9PointingMuDepositedEnergy_","Glb_muons", 1);
308  doEnergyTests(igetter,"hadS9PointingMuDepositedEnergy_", "Glb_muons", 1);
309  doEnergyTests(igetter,"hoS9PointingMuDepositedEnergy_", "Glb_muons", 1);
310  doEnergyTests(igetter,"ecalS9PointingMuDepositedEnergy_", "Tk_muons", 2);
311  doEnergyTests(igetter,"hadS9PointingMuDepositedEnergy_", "Tk_muons", 2);
312  doEnergyTests(igetter,"hoS9PointingMuDepositedEnergy_", "Tk_muons", 2);
313  doEnergyTests(igetter,"ecalS9PointingMuDepositedEnergy_", "Sta_muons", 3);
314  doEnergyTests(igetter,"hadS9PointingMuDepositedEnergy_", "Sta_muons", 3);
315  doEnergyTests(igetter,"hoS9PointingMuDepositedEnergy_", "Sta_muons", 3);
316 
317  // fill the multiplicity test summary
318  doMultiplicityTests(igetter);
319 
320  // fill the final report summary
321  //Changed to KolmogorovQuality test--------------------------
331 
332  //-- modified GH
333  double residualsSummary = 0;
334  //put the TRK-STA resid & pulls in the first bin ("GLB")
335  //then the GLB-TRK and GLB-STA residuals in the 2nd and 3rd
336  for(int i=3; i<=residualsSummaryMap->getNbinsX(); i++)
337  for (int j=1; j<=residualsSummaryMap->getNbinsY(); j++)
338  residualsSummary += residualsSummaryMap->getBinContent(i,j);
339  residualsSummary /=2*residualsSummaryMap->getNbinsY();
340  summaryReportMap->setBinContent(1,4, residualsSummary);
341 
342  residualsSummary=0;
343  for(int i=1; i<=1; i++)
344  for (int j=1; j<=residualsSummaryMap->getNbinsY(); j++)
345  residualsSummary += residualsSummaryMap->getBinContent(i,j);
346  residualsSummary /=1*residualsSummaryMap->getNbinsY();
347  summaryReportMap->setBinContent(2,4,residualsSummary);
348 
349  residualsSummary=0;
350  for(int i=2; i<=2; i++)
351  for (int j=1; j<=residualsSummaryMap->getNbinsY(); j++)
352  residualsSummary += residualsSummaryMap->getBinContent(i,j);
353  residualsSummary /=1*residualsSummaryMap->getNbinsY();
354  summaryReportMap->setBinContent(3,4,residualsSummary);
355 
356  //--
357 
358 
359 
360  //-- modified GH
361  float idtest=0;
362  for(int i=1; i<=2; i++)
363  for(int j=1; j<=5; j++) {
364  if(j==3 || j==5) continue; //ignore pull widths for now
365  idtest+=muonIdSummaryMap->getBinContent(i,j);
366  }
367  // idtest/=10.;
368  idtest/=6.;
369  summaryReportMap->setBinContent(1,5, idtest);
370  idtest=0;
371  for(int i=3; i<=4; i++)
372  for(int j=1; j<=5; j++) {
373  if(j==3 || j==5) continue; //ignore pull widths for now
374  idtest+=muonIdSummaryMap->getBinContent(i,j);
375  }
376  // idtest/=10.;
377  idtest/=6.;
378  summaryReportMap->setBinContent(2,5,idtest);
379  summaryReportMap->setBinContent(3,5,-1.0/6.0);
380  //--
381 
388 
389 
390  double kinematics_GLB = double(summaryReportMap->getBinContent(1,1)+summaryReportMap->getBinContent(1,2)+summaryReportMap->getBinContent(1,3))/3.0;
391  theSummaryContents[0]->Fill(kinematics_GLB);
392  double muonId_GLB = double(summaryReportMap->getBinContent(1,5));
393  theSummaryContents[1]->Fill(muonId_GLB);
394  double residuals_GLB = double(summaryReportMap->getBinContent(1,4));
395  theSummaryContents[2]->Fill(residuals_GLB);
396  double GLB = (kinematics_GLB+muonId_GLB+residuals_GLB)/3.0;
397  theSummaryContents[3]->Fill(GLB);
398 
399  double kinematics_TK = double(summaryReportMap->getBinContent(2,1)+summaryReportMap->getBinContent(2,2)+summaryReportMap->getBinContent(2,3))/3.0;
400  theSummaryContents[4]->Fill(kinematics_TK);
401  double muonId_TK = double(summaryReportMap->getBinContent(2,5));
402  theSummaryContents[5]->Fill(muonId_TK);
403  double residuals_TK = double(summaryReportMap->getBinContent(2,4));
404  theSummaryContents[6]->Fill(residuals_TK);
405  double TK = double(kinematics_TK+muonId_TK+residuals_TK)/3.0;
406  theSummaryContents[7]->Fill(TK);
407 
408  double kinematics_STA = double(summaryReportMap->getBinContent(3,1)+summaryReportMap->getBinContent(3,2)+summaryReportMap->getBinContent(3,3))/3.0;
409  theSummaryContents[8]->Fill(kinematics_STA);
410  double residuals_STA = double(summaryReportMap->getBinContent(3,4));
411  theSummaryContents[9]->Fill(residuals_STA);
412  double STA = double(kinematics_STA+residuals_STA)/2.0;
413  theSummaryContents[10]->Fill(STA);
414  double energyDeposits = double(summaryReportMap->getBinContent(1,6)+summaryReportMap->getBinContent(2,6)+summaryReportMap->getBinContent(3,6))/3.0;
415  theSummaryContents[11]->Fill(energyDeposits);
416  double multiplicity = double(summaryReportMap->getBinContent(1,7)+summaryReportMap->getBinContent(2,7)+summaryReportMap->getBinContent(3,7))/3.0;
417  theSummaryContents[12]->Fill(multiplicity);
418 
419  summaryReport->Fill((GLB+TK+STA+energyDeposits+multiplicity)/5.0);
420 
421 
422  //global barrel:
423  float muonIDsummary=0;
424  // for(int i=2; i<=5; i++)
425  // muonIDsummary += muonIdSummaryMap->getBinContent(2, i);
426  // summaryCertificationMap->setBinContent(4, 5, muonIDsummary/4.);
427  //for now, just report the mean:
428  muonIDsummary += muonIdSummaryMap->getBinContent(1, 2);
429  muonIDsummary += muonIdSummaryMap->getBinContent(1, 4);
430  summaryCertificationMap->setBinContent(4, 5, muonIDsummary/2.);
431 
432  //global EC:
433  muonIDsummary=0;
434  // for(int i=2; i<=5; i++)
435  // muonIDsummary += muonIdSummaryMap->getBinContent(2, i);
436  // summaryCertificationMap->setBinContent(7, 5, muonIDsummary/4.);
437  muonIDsummary += muonIdSummaryMap->getBinContent(2, 2);
438  muonIDsummary += muonIdSummaryMap->getBinContent(2, 4);
439  summaryCertificationMap->setBinContent(7, 5, muonIDsummary/2.);
440 
441  //tracker barrel:
442  muonIDsummary=0;
443  // for(int i=2; i<=5; i++)
444  // muonIDsummary += muonIdSummaryMap->getBinContent(3, i);
445  // summaryCertificationMap->setBinContent(5, 5, muonIDsummary/4.);
446  muonIDsummary += muonIdSummaryMap->getBinContent(3, 2);
447  muonIDsummary += muonIdSummaryMap->getBinContent(3, 4);
448  summaryCertificationMap->setBinContent(5, 5, muonIDsummary/2.);
449 
450  //tracker EC:
451  muonIDsummary=0;
452  // for(int i=2; i<=5; i++)
453  // muonIDsummary += muonIdSummaryMap->getBinContent(4, i);
454  // summaryCertificationMap->setBinContent(8, 5, muonIDsummary/4.);
455  muonIDsummary += muonIdSummaryMap->getBinContent(4, 2);
456  muonIDsummary += muonIdSummaryMap->getBinContent(4, 4);
457  summaryCertificationMap->setBinContent(8, 5, muonIDsummary/2.);
458 
459 
460  double muonId_GLB_B = double(summaryCertificationMap->getBinContent(4,5));
461  theCertificationContents[3]->Fill(muonId_GLB_B);
462  double muonId_GLB_EC = double(summaryCertificationMap->getBinContent(7,5));
463  theCertificationContents[6]->Fill(muonId_GLB_EC);
464 
465  double muonId_TK_B = double(summaryCertificationMap->getBinContent(5,5));
466  theCertificationContents[5]->Fill(muonId_TK_B);
467  double muonId_TK_EC = double(summaryCertificationMap->getBinContent(8,5));
468  theCertificationContents[8]->Fill(muonId_TK_EC);
469 }
void setBinContent(int binx, double content)
set content of bin (1-D)
void cd(void)
Definition: DQMStore.cc:269
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
void doMultiplicityTests(DQMStore::IGetter &)
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
MonitorElement * kinematicsSummaryMap
void doMuonIDTests(DQMStore::IGetter &)
MonitorElement * muonIdSummaryMap
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * summaryCertification
std::vector< MonitorElement * > theSummaryContents
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::vector< MonitorElement * > theCertificationContents
MonitorElement * energySummaryMap
MonitorElement * summaryReport
void doKinematicsTests(DQMStore::IGetter &, std::string, int)
test operations
double getBinContent(int binx) const
get content of bin (1-D)
void doEnergyTests(DQMStore::IGetter &, std::string nameHisto, std::string muonType, int bin)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * summaryCertificationMap
MonitorElement * summaryReportMap
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
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
yBin
Definition: cuy.py:891
void doResidualsTests(DQMStore::IGetter &, std::string, std::string, int)
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 721 of file MuonTestSummary.cc.

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

721  {
722 
723  // Gaussian Fit
724  float statMean = Histo->getMean(1);
725  float statSigma = Histo->getRMS(1);
726  TH1F * histo_root = Histo->getTH1F();
727  if(histo_root->GetEntries()>20){
728  TF1 *gfit = new TF1("Gaussian","gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
729  try {
730  histo_root->Fit(gfit, "Q0");
731  } catch (cms::Exception& iException) {
732  edm::LogError (metname)<< "[MuonTestSummary]: Exception when fitting Res_"<<type<<"_"<<parameter;
733  mean=1;
734  mean_err=1;
735  sigma=1;
736  sigma_err=1;
737  return;
738  }
739  if(gfit){
740  mean = gfit->GetParameter(1);
741  mean_err = gfit->GetParErrors()[2];
742  sigma = gfit->GetParameter(2);
743  sigma_err = gfit->GetParErrors()[2];
744  LogTrace(metname)<<"Gaussian fit mean: "<<mean<<" +- "<<mean_err<<" for "<<type<<"_"<<parameter<<endl;
745  LogTrace(metname)<<"Gaussina fit sigma: "<<sigma<<" +- "<<sigma_err<<" for "<<type<<"_"<<parameter<<endl;
746  }
747  }
748  else{
749  LogTrace(metname) << "[MuonTestSummary]: Test of Res_"<<type<<"_"<<parameter<< " not performed because # entries < 20 ";
750  //auto-pass if not enough events.
751  mean=1;
752  mean_err=1;
753  sigma=1;
754  sigma_err=1;
755  }
756 }
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 ( DQMStore::IGetter igetter,
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 1059 of file MuonTestSummary.cc.

References DQMStore::IGetter::get(), MonitorElement::getTH1F(), LogTrace, RecoTauDiscriminantConfiguration::mean, metname, dataset::name, and mathSSE::sqrt().

Referenced by doMuonIDTests().

1059  {
1060 
1061  numPlot=0;
1062  Mean=0;
1063  Mean_err=0;
1064  Sigma=0;
1065  Sigma_err=0;
1066  for(uint name=0; name<resHistos.size(); name++){
1067  MonitorElement * resHisto = igetter.get("Muons/MuonIdDQM/" + muType + "/"+resHistos[name]);
1068 
1069  if(resHisto){
1070  TH1F * resHisto_root = resHisto->getTH1F();
1071  if(resHisto_root->GetEntries() < 20) {
1072  LogTrace(metname) << "[MuonTestSummary]: Test of "<< muType<<" for " <<resHistos[name]<< " not performed because # entries < 20 ";
1073  continue;
1074  }
1075 
1076  //we also want to check if the peak is away from zero.
1077  //so, try fitting in 3 sigma around the histogram mean.
1078  //alternatively, could use the maximum bin (less sensitive to 1-sided tails).
1079  // float mean = resHisto_root->GetMean();
1080  float mean = resHisto_root->GetBinLowEdge(resHisto_root->GetMaximumBin());
1081  TF1 *gfit = new TF1("Gaussian","gaus",mean-3,mean+3);
1082 
1083 
1084  try {
1085  resHisto_root->Fit(gfit, "Q0");
1086  } catch (cms::Exception& iException) {
1087  edm::LogError (metname)<< "[MuonTestSummary]: Exception when fitting "<<resHistos[name];
1088  continue;
1089  }
1090  if(gfit){
1091  double mean = gfit->GetParameter(1);
1092  double mean_err = gfit->GetParError(1);
1093  double sigma = gfit->GetParameter(2);
1094  double sigma_err = gfit->GetParError(2);
1095  LogTrace(metname)<<"meanRes: "<<mean<<" +- "<<mean_err<<" for "<<resHistos[name]<<endl;
1096  LogTrace(metname)<<"sigmaRes: "<<sigma<<" +- "<<sigma_err<<" for "<<resHistos[name]<<endl;
1097 
1098  Mean+=mean;
1099  Mean_err +=mean_err * mean_err;
1100  Sigma+=sigma;
1101  Sigma_err +=sigma_err * sigma_err;
1102  numPlot++;
1103  } //if gfit? why would we not have gfit?
1104 
1105  }//histogram exists...
1106  } // loop over residuals histos
1107 
1108 
1109  if(numPlot==0){ //eg no stats
1110  Mean_err = 1;
1111  Mean=1;
1112  Sigma_err =1;
1113  Sigma = 1;
1114  }
1115  else{
1116  Mean_err = sqrt(Mean_err);
1117  Mean_err/=numPlot;
1118  Mean/=numPlot;
1119 
1120  Sigma_err = sqrt(Sigma_err);
1121  Sigma_err/=numPlot;
1122  Sigma/=numPlot;
1123  }
1124  return;
1125 
1126 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
std::string metname
T sqrt(T t)
Definition: SSEVec.h:18
#define LogTrace(id)
TH1F * getTH1F(void) const

Member Data Documentation

double MuonTestSummary::chi2Fraction
private

Definition at line 68 of file MuonTestSummary.h.

double MuonTestSummary::chi2Spread
private

Definition at line 69 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::chi2TestSummaryMap
private

Definition at line 107 of file MuonTestSummary.h.

DQMStore* MuonTestSummary::dbe
private

Definition at line 61 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::energySummaryMap
private

Definition at line 112 of file MuonTestSummary.h.

double MuonTestSummary::etaExpected
private

Definition at line 66 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityGlb_max
private

Definition at line 100 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityGlb_min
private

Definition at line 97 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicitySta_max
private

Definition at line 102 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicitySta_min
private

Definition at line 99 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityTk_max
private

Definition at line 101 of file MuonTestSummary.h.

double MuonTestSummary::expMultiplicityTk_min
private

Definition at line 98 of file MuonTestSummary.h.

double MuonTestSummary::expPeakEcalS9_max
private

Definition at line 94 of file MuonTestSummary.h.

double MuonTestSummary::expPeakEcalS9_min
private

Definition at line 93 of file MuonTestSummary.h.

double MuonTestSummary::expPeakHadS9_max
private

Definition at line 96 of file MuonTestSummary.h.

double MuonTestSummary::expPeakHadS9_min
private

Definition at line 95 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::kinematicsSummaryMap
private

Definition at line 109 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::KolmogorovTestSummaryMap
private

Definition at line 106 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionCsc_max
private

Definition at line 87 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionCsc_min
private

Definition at line 86 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionDt_max
private

Definition at line 85 of file MuonTestSummary.h.

double MuonTestSummary::matchesFractionDt_min
private

Definition at line 84 of file MuonTestSummary.h.

std::string MuonTestSummary::metname
private

Definition at line 63 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::multiplicitySummaryMap
private

Definition at line 113 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::muonIdSummaryMap
private

Definition at line 111 of file MuonTestSummary.h.

double MuonTestSummary::numMatchedExpected_max
private

Definition at line 83 of file MuonTestSummary.h.

double MuonTestSummary::numMatchedExpected_min
private

Definition at line 82 of file MuonTestSummary.h.

double MuonTestSummary::phiExpected
private

Definition at line 67 of file MuonTestSummary.h.

double MuonTestSummary::pullEtaSpread
private

Definition at line 76 of file MuonTestSummary.h.

double MuonTestSummary::pullOneOvPSpread
private

Definition at line 78 of file MuonTestSummary.h.

double MuonTestSummary::pullPhiSpread
private

Definition at line 77 of file MuonTestSummary.h.

double MuonTestSummary::resChargeLimit_glbSta
private

Definition at line 80 of file MuonTestSummary.h.

double MuonTestSummary::resChargeLimit_tkGlb
private

Definition at line 79 of file MuonTestSummary.h.

double MuonTestSummary::resChargeLimit_tkSta
private

Definition at line 81 of file MuonTestSummary.h.

double MuonTestSummary::resEtaSpread_glbSta
private

Definition at line 71 of file MuonTestSummary.h.

double MuonTestSummary::resEtaSpread_tkGlb
private

Definition at line 70 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::residualsSummaryMap
private

Definition at line 110 of file MuonTestSummary.h.

double MuonTestSummary::resOneOvPSpread_glbSta
private

Definition at line 75 of file MuonTestSummary.h.

double MuonTestSummary::resOneOvPSpread_tkGlb
private

Definition at line 74 of file MuonTestSummary.h.

double MuonTestSummary::resPhiSpread_glbSta
private

Definition at line 73 of file MuonTestSummary.h.

double MuonTestSummary::resPhiSpread_tkGlb
private

Definition at line 72 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_mean_max
private

Definition at line 91 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_mean_min
private

Definition at line 90 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_rms_max
private

Definition at line 89 of file MuonTestSummary.h.

double MuonTestSummary::resSegmTrack_rms_min
private

Definition at line 88 of file MuonTestSummary.h.

double MuonTestSummary::sigmaResSegmTrackExp
private

Definition at line 92 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryCertification
private

Definition at line 117 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryCertificationMap
private

Definition at line 118 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryReport
private

Definition at line 114 of file MuonTestSummary.h.

MonitorElement* MuonTestSummary::summaryReportMap
private

Definition at line 115 of file MuonTestSummary.h.

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

Definition at line 119 of file MuonTestSummary.h.

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

Definition at line 116 of file MuonTestSummary.h.