CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

MuonTrackResidualsTest Class Reference

#include <MuonTrackResidualsTest.h>

Inheritance diagram for MuonTrackResidualsTest:
edm::EDAnalyzer

List of all members.

Public Member Functions

 MuonTrackResidualsTest (const edm::ParameterSet &ps)
 Constructor.
virtual ~MuonTrackResidualsTest ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob (void)
 BeginJob.
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
void endJob ()
 Endjob.
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 DQM Client Diagnostic.
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)

Private Attributes

std::map< std::string,
std::vector< std::string > > 
histoNames
std::map< std::string,
MonitorElement * > 
MeanHistos
std::string metname
int nevents
unsigned int nLumiSegs
edm::ParameterSet parameters
int prescaleFactor
int run
std::map< std::string,MonitorElement * > SigmaHistos
DQMStoretheDbe

Detailed Description

* DQMOffline Test Client check the residuals of the track parameters comparing STA/tracker only/global muons

Date:
2009/12/22 17:43:26
Revision:
1.5
Author:
G. Mila - INFN Torino

Definition at line 39 of file MuonTrackResidualsTest.h.


Constructor & Destructor Documentation

MuonTrackResidualsTest::MuonTrackResidualsTest ( const edm::ParameterSet ps)
MuonTrackResidualsTest::~MuonTrackResidualsTest ( ) [virtual]

Destructor.

Definition at line 47 of file MuonTrackResidualsTest.cc.

References LogTrace, metname, and nevents.

                                               {

  LogTrace(metname) << "DTResolutionTest: analyzed " << nevents << " events";

}

Member Function Documentation

void MuonTrackResidualsTest::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Analyze.

Implements edm::EDAnalyzer.

Definition at line 119 of file MuonTrackResidualsTest.cc.

References LogTrace, metname, and nevents.

                                                                                   {

  nevents++;
  LogTrace(metname)<< "[MuonTrackResidualsTest]: "<<nevents<<" events";

}
void MuonTrackResidualsTest::beginJob ( void  ) [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file MuonTrackResidualsTest.cc.

References trackerHits::c, LogTrace, metname, and nevents.

                                         {

  metname = "trackResidualsTest";
  theDbe->setCurrentFolder("Muons/Tests/trackResidualsTest");

  LogTrace(metname) << "[MuonTrackResidualsTest] beginJob: Parameters initialization"<<endl;
 

  string histName, MeanHistoName, SigmaHistoName,  MeanHistoTitle, SigmaHistoTitle;
  vector<string> type;
  type.push_back("eta");
  type.push_back("theta");
  type.push_back("phi");


  for(unsigned int c=0; c<type.size(); c++){

    MeanHistoName =  "MeanTest_" + type[c]; 
    SigmaHistoName =  "SigmaTest_" + type[c];

    MeanHistoTitle =  "Mean of the #" + type[c] + " residuals distribution"; 
    SigmaHistoTitle =  "Sigma of the #" + type[c] + " residuals distribution"; 
 
    histName = "Res_GlbSta_"+type[c];
    histoNames[type[c]].push_back(histName);
    histName = "Res_TkGlb_"+type[c];
    histoNames[type[c]].push_back(histName);
    histName = "Res_TkSta_"+type[c];
    histoNames[type[c]].push_back(histName);

    
    MeanHistos[type[c]] = theDbe->book1D(MeanHistoName.c_str(),MeanHistoTitle.c_str(),3,0.5,3.5);
    (MeanHistos[type[c]])->setBinLabel(1,"Res_StaGlb",1);
    (MeanHistos[type[c]])->setBinLabel(2,"Res_TkGlb",1);
    (MeanHistos[type[c]])->setBinLabel(3,"Res_TkSta",1);
    
    
    SigmaHistos[type[c]] = theDbe->book1D(SigmaHistoName.c_str(),SigmaHistoTitle.c_str(),3,0.5,3.5);
    (SigmaHistos[type[c]])->setBinLabel(1,"Res_StaGlb",1);  
    (SigmaHistos[type[c]])->setBinLabel(2,"Res_TkGlb",1);
    (SigmaHistos[type[c]])->setBinLabel(3,"Res_TkSta",1);
    
  }

  nevents = 0;

}
void MuonTrackResidualsTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file MuonTrackResidualsTest.cc.

                                                                                                           {

  //  LogTrace(metname)<<"[MuonTrackResidualsTest]: beginLuminosityBlock";

  // Get the run number
  //  run = lumiSeg.run();

}
void MuonTrackResidualsTest::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 103 of file MuonTrackResidualsTest.cc.

References LogTrace, and metname.

                                                                              {

  LogTrace(metname)<<"[MuonTrackResidualsTest]: beginRun";

}
void MuonTrackResidualsTest::endJob ( void  ) [protected, virtual]

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 207 of file MuonTrackResidualsTest.cc.

References LogTrace, and metname.

                                   {
  
  LogTrace(metname)<< "[MuonTrackResidualsTest] endJob called!";
  theDbe->rmdir("Muons/Tests/trackResidualsTest");
  
}
void MuonTrackResidualsTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
) [protected, virtual]

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 128 of file MuonTrackResidualsTest.cc.

References edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), and dtDQMClient_cfg::prescaleFactor.

                                                                                                         {

  //  LogTrace(metname)<<"[MuonTrackResidualsTest]: endLuminosityBlock, performing the DQM LS client operation"<<endl;

  // counts number of lumiSegs 
  nLumiSegs = lumiSeg.id().luminosityBlock();
  
  // prescale factor
  if ( nLumiSegs%prescaleFactor != 0 ) return;
  
  
}
void MuonTrackResidualsTest::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file MuonTrackResidualsTest.cc.

References QReport::getBadChannels(), QReport::getMessage(), MonitorElement::getQReport(), QReport::getStatus(), timingPdfMaker::histo, LogTrace, timingPdfMaker::mean, metname, Parameters::parameters, and getHLTPrescaleColumns::path.

                                                                            {

  LogTrace(metname)<<"[MuonTrackResidualsTest]: endRun, performing the DQM end of run client operation";

  for(map<string, vector<string> > ::const_iterator histo = histoNames.begin();
      histo != histoNames.end();
      histo++) {
   
    for (unsigned int type=0; type< (*histo).second.size(); type++){

      string path = "Muons/MuonRecoAnalyzer/" + (*histo).second[type];
      MonitorElement * res_histo = theDbe->get(path);
      if (res_histo) {
 
        // gaussian test
        string GaussianCriterionName = 
          parameters.getUntrackedParameter<string>("resDistributionTestName",
                                                   "ResidualsDistributionGaussianTest");
        const QReport * GaussianReport = res_histo->getQReport(GaussianCriterionName);
        if(GaussianReport){
          LogTrace(metname) << "-------- histo : "<<(*histo).second[type]<<"  "<<GaussianReport->getMessage()<<" ------- "<<GaussianReport->getStatus();
        }
        int BinNumber = type+1;
        float mean = (*res_histo).getMean(1);
        float sigma = (*res_histo).getRMS(1);
        MeanHistos.find((*histo).first)->second->setBinContent(BinNumber, mean);        
        SigmaHistos.find((*histo).first)->second->setBinContent(BinNumber, sigma);
      }
    }
  }


  // Mean test 
  string MeanCriterionName = parameters.getUntrackedParameter<string>("meanTestName","ResidualsMeanInRange"); 
  for(map<string, MonitorElement*>::const_iterator hMean = MeanHistos.begin();
      hMean != MeanHistos.end();
      hMean++) {
    const QReport * theMeanQReport = (*hMean).second->getQReport(MeanCriterionName);
    if(theMeanQReport) {
      vector<dqm::me_util::Channel> badChannels = theMeanQReport->getBadChannels();
      for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); 
           channel != badChannels.end(); channel++) {
        LogTrace(metname)<< "type:"<<(*hMean).first<<" Bad mean channels: "<<(*channel).getBin()<<"  Contents : "<<(*channel).getContents()<<endl;
      }
      LogTrace(metname)<< "-------- type: "<<(*hMean).first<<"  "<<theMeanQReport->getMessage()<<" ------- "<<theMeanQReport->getStatus()<<endl; 
    }
  }
  
  // Sigma test
  string SigmaCriterionName = parameters.getUntrackedParameter<string>("sigmaTestName","ResidualsSigmaInRange"); 
  for(map<string, MonitorElement*>::const_iterator hSigma = SigmaHistos.begin();
      hSigma != SigmaHistos.end();
      hSigma++) {
    const QReport * theSigmaQReport = (*hSigma).second->getQReport(SigmaCriterionName);
    if(theSigmaQReport) {
      vector<dqm::me_util::Channel> badChannels = theSigmaQReport->getBadChannels();
      for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); 
           channel != badChannels.end(); channel++) {
        LogTrace(metname)<< "type:"<<(*hSigma).first<<" Bad sigma channels: "<<(*channel).getBin()<<" Contents : "<<(*channel).getContents()<<endl;
      }
      LogTrace(metname) << "-------- type: "<<(*hSigma).first<<"  "<<theSigmaQReport->getMessage()<<" ------- "<<theSigmaQReport->getStatus()<<endl;
    }
  }
}

Member Data Documentation

std::map< std::string, std::vector<std::string> > MuonTrackResidualsTest::histoNames [private]

Definition at line 82 of file MuonTrackResidualsTest.h.

std::map< std::string, MonitorElement* > MuonTrackResidualsTest::MeanHistos [private]

Definition at line 85 of file MuonTrackResidualsTest.h.

std::string MuonTrackResidualsTest::metname [private]

Definition at line 76 of file MuonTrackResidualsTest.h.

Definition at line 71 of file MuonTrackResidualsTest.h.

unsigned int MuonTrackResidualsTest::nLumiSegs [private]

Definition at line 72 of file MuonTrackResidualsTest.h.

Definition at line 79 of file MuonTrackResidualsTest.h.

Definition at line 73 of file MuonTrackResidualsTest.h.

Definition at line 74 of file MuonTrackResidualsTest.h.

std::map< std::string ,MonitorElement* > MuonTrackResidualsTest::SigmaHistos [private]

Definition at line 86 of file MuonTrackResidualsTest.h.

Definition at line 78 of file MuonTrackResidualsTest.h.