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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonTestSummary (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~MuonTestSummary () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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 ( )
override

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 1117 of file MuonTestSummary.cc.

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

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

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

Definition at line 1184 of file MuonTestSummary.cc.

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

1184  {
1185 
1186  MonitorElement* multiplicityHisto = igetter.get("Muons/MuonRecoAnalyzer/muReco");
1187 
1188  if(multiplicityHisto){
1189  if(multiplicityHisto->getEntries()>20){
1190  double multiplicity_GLB = double(multiplicityHisto->getBinContent(1)+multiplicityHisto->getBinContent(2))/double(multiplicityHisto->getEntries());
1191  LogTrace(metname)<<"multiplicity_GLB: "<<multiplicity_GLB<< " ExpMultiplicityGlb_min " <<expMultiplicityGlb_min <<" ExpMultiplicityGlb_max " <<expMultiplicityGlb_max<<endl;
1192  double multiplicity_TK = double(multiplicityHisto->getBinContent(3)+multiplicityHisto->getBinContent(4))/double(multiplicityHisto->getEntries());
1193  LogTrace(metname)<<"multiplicity_TK: "<<multiplicity_TK<< " ExpMultiplicityTk_min " <<expMultiplicityTk_min <<" ExpMultiplicityTk_max " <<expMultiplicityTk_max<<endl;
1194  double multiplicity_STA = double(multiplicityHisto->getBinContent(3)+multiplicityHisto->getBinContent(5))/double(multiplicityHisto->getEntries());
1195  LogTrace(metname)<<"multiplicity_STA: "<<multiplicity_STA<< " ExpMultiplicitySta_min " <<expMultiplicitySta_min <<" ExpMultiplicitySta_max " <<expMultiplicitySta_max<<endl;
1196 
1197  if(multiplicity_GLB>expMultiplicityGlb_min && multiplicity_GLB<expMultiplicityGlb_max)
1199  else
1201 
1202  if(multiplicity_TK>expMultiplicityTk_min && multiplicity_TK<expMultiplicityTk_max)
1204  else
1206 
1207  if(multiplicity_STA>expMultiplicitySta_min && multiplicity_STA<expMultiplicitySta_max)
1209  else
1211  }
1212  else{
1213  LogTrace(metname) << "[MuonTestSummary]: Test of Multiplicity not performed because # entries < 20 ";
1214  }
1215  }
1216 
1217 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double expMultiplicityTk_max
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
double expMultiplicityGlb_min
MonitorElement * multiplicitySummaryMap
std::string metname
#define LogTrace(id)
double getEntries() const
get # of entries
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 853 of file MuonTestSummary.cc.

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

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

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

747  {
748 
749  // residuals test
750  if(type!="GlbMuon"){
751  string path = "Muons/MuonRecoAnalyzer/Res_" + type + "_" + parameter;
752  MonitorElement * residualsHisto = igetter.get(path);
753 
754  float mean = -1;
755  float mean_err = -1;
756  float sigma = -1;
757  float sigma_err = -1;
758 
759  if(residualsHisto){
760 
761  LogTrace(metname) << "[MuonTestSummary]: Starting Gaussian fit for Test of Res_"<<type<<"_"<<parameter<< endl;
762  GaussFit( type, parameter, residualsHisto, mean, mean_err, sigma, sigma_err);
763 
764  if(sigma!=-1 && parameter=="eta" && type=="TkGlb"){
765  if(sigma-sigma_err<resEtaSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 1, 1);
767  }
768  if(sigma!=-1 && parameter=="eta" && (type=="GlbSta" || type=="TkSta")) {
769  if(sigma-sigma_err<resEtaSpread_glbSta) residualsSummaryMap->setBinContent(bin, 1, 1);
771  }
772  if(sigma!=-1 && parameter=="phi" && type=="TkGlb"){
773  if(sigma-sigma_err<resPhiSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 2, 1);
775  }
776  if(sigma!=-1 && parameter=="phi" && (type=="GlbSta" || type=="TkSta")){
777  if(sigma-sigma_err<resPhiSpread_glbSta) residualsSummaryMap->setBinContent(bin, 2, 1);
778  else residualsSummaryMap->setBinContent(bin, 2, 0);
779  }
780  if(sigma!=-1 && parameter=="oneOverp" && type=="TkGlb"){
781  if(sigma-sigma_err<resOneOvPSpread_tkGlb) residualsSummaryMap->setBinContent(bin, 3, 1);
783  }
784  if(sigma!=-1 && parameter=="oneOverp" && (type=="GlbSta" || type=="TkSta")) {
785  if(sigma-sigma_err<resOneOvPSpread_glbSta) residualsSummaryMap->setBinContent(bin, 3, 1);
787  }
788  }
789 
790 
791 
792  //--GH modified
793  if(type=="TkSta"){
794  //look at the pull:
795  string path = "Muons/MuonRecoAnalyzer/Pull_" + type + "_" + parameter;
796  MonitorElement * pullHisto = igetter.get(path);
797 
798  if(pullHisto){
799 
800  LogTrace(metname) << "[MuonTestSummary]: Starting Gaussian fit for Test of Pull_"<<type<<"_"<<parameter<< endl;
801  GaussFit( type, parameter, pullHisto, mean, mean_err, sigma, sigma_err);
802 
803  if(sigma!=-1 && parameter=="eta" ){
804  if(sigma-sigma_err<pullEtaSpread) residualsSummaryMap->setBinContent(4, 1, 1);
805  else residualsSummaryMap->setBinContent(4, 1, 0);
806  }
807  if(sigma!=-1 && parameter=="phi"){
808  if(sigma-sigma_err<pullPhiSpread) residualsSummaryMap->setBinContent(4, 2, 1);
809  else residualsSummaryMap->setBinContent(4, 2, 0);
810  }
811  if(sigma!=-1 && parameter=="oneOverp"){
812  if(sigma-sigma_err<pullOneOvPSpread) residualsSummaryMap->setBinContent(4, 3, 1);
813  else residualsSummaryMap->setBinContent(4, 3, 0);
814  }
815 
816  }//have pull histo
817  } //TkSta muons
818  }
819 
820  //this part for Global Muons:
821  else{
822  string path = "Muons/MuonRecoAnalyzer/" + type + "_" + parameter;
823  MonitorElement * residualsHisto = igetter.get(path);
824 
825  if(residualsHisto){
826  LogTrace(metname) << "[MuonTestSummary]: Test of Charge Comparison "<<type<<"_"<<parameter<< endl;
827  if((residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4))!=0){
828  LogTrace(metname)<<"Charge comparison TkGlb: "<<residualsHisto->getBinContent(4)/double(residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4))<<endl;
829  if(residualsHisto->getBinContent(4)/double(residualsHisto->getBinContent(3)+residualsHisto->getBinContent(4)) < resChargeLimit_tkGlb)
831  else
833  }
834  if((residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2))!=0){
835  LogTrace(metname)<<"charge comparison GlbSta: "<<residualsHisto->getBinContent(2)/double(residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2))<<endl;
836  if(residualsHisto->getBinContent(2)/double(residualsHisto->getBinContent(1)+residualsHisto->getBinContent(2)) < resChargeLimit_glbSta)
838  else
840  }
841  if(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6)!=0){
842  LogTrace(metname)<<"charge comparison TkSta: "<<residualsHisto->getBinContent(6)/double(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6))<<endl;
843  if(residualsHisto->getBinContent(6)/double(residualsHisto->getBinContent(5)+residualsHisto->getBinContent(6)) < resChargeLimit_tkSta)
845  else
847  }
848  }
849  }
850 
851 }
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)
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 &)
void Fill(long long x)
MonitorElement * kinematicsSummaryMap
void doMuonIDTests(DQMStore::IGetter &)
MonitorElement * muonIdSummaryMap
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
MonitorElement * summaryCertification
std::vector< MonitorElement * > theSummaryContents
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
std::vector< MonitorElement * > theCertificationContents
MonitorElement * energySummaryMap
MonitorElement * summaryReport
void doKinematicsTests(DQMStore::IGetter &, std::string, int)
test operations
int getNbinsY() const
get # of bins in Y-axis
double getBinContent(int binx) const
get content of bin (1-D)
void doEnergyTests(DQMStore::IGetter &, std::string nameHisto, std::string muonType, int bin)
MonitorElement * summaryCertificationMap
MonitorElement * summaryReportMap
int getNbinsX() const
get # of bins in X-axis
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
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:892
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 711 of file MuonTestSummary.cc.

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

711  {
712 
713  // Gaussian Fit
714  float statMean = Histo->getMean(1);
715  float statSigma = Histo->getRMS(1);
716  TH1F * histo_root = Histo->getTH1F();
717  if(histo_root->GetEntries()>20){
718  TF1 *gfit = new TF1("Gaussian","gaus",(statMean-(2*statSigma)),(statMean+(2*statSigma)));
719  try {
720  histo_root->Fit(gfit, "Q0");
721  } catch (cms::Exception& iException) {
722  edm::LogError (metname)<< "[MuonTestSummary]: Exception when fitting Res_"<<type<<"_"<<parameter;
723  mean=1;
724  mean_err=1;
725  sigma=1;
726  sigma_err=1;
727  return;
728  }
729  if(gfit){
730  mean = gfit->GetParameter(1);
731  mean_err = gfit->GetParErrors()[2];
732  sigma = gfit->GetParameter(2);
733  sigma_err = gfit->GetParErrors()[2];
734  LogTrace(metname)<<"Gaussian fit mean: "<<mean<<" +- "<<mean_err<<" for "<<type<<"_"<<parameter<<endl;
735  LogTrace(metname)<<"Gaussina fit sigma: "<<sigma<<" +- "<<sigma_err<<" for "<<type<<"_"<<parameter<<endl;
736  }
737  }
738  else{
739  LogTrace(metname) << "[MuonTestSummary]: Test of Res_"<<type<<"_"<<parameter<< " not performed because # entries < 20 ";
740  //auto-pass if not enough events.
741  mean=1;
742  mean_err=1;
743  sigma=1;
744  sigma_err=1;
745  }
746 }
type
Definition: HCALResponse.h:21
TH1F * getTH1F() const
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)
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 1049 of file MuonTestSummary.cc.

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

Referenced by doMuonIDTests().

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

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.