CMS 3D CMS Logo

Public Member Functions | Private Attributes

MultiplicityCorrelatorHistogramMaker Class Reference

#include <MultiplicityCorrelatorHistogramMaker.h>

List of all members.

Public Member Functions

void beginRun (const edm::Run &iRun)
void fill (const edm::Event &iEvent, const int xmult, const int ymult)
 MultiplicityCorrelatorHistogramMaker (const edm::ParameterSet &iConfig)
 MultiplicityCorrelatorHistogramMaker ()
 ~MultiplicityCorrelatorHistogramMaker ()

Private Attributes

TH1F * m_atanyoverx
TH1F ** m_atanyoverxrun
TProfile ** m_atanyoverxvsbxrun
TH2F ** m_atanyoverxvsbxrun2D
RunHistogramManager m_fhm
RunHistogramManager m_rhm
bool m_runHisto
bool m_runHisto2D
bool m_runHistoBX
bool m_runHistoBXProfile
bool m_runHistoProfileBX
double m_scfact
TProfile2D ** m_xvsymultprofvsbxrun
TH2F * m_yvsxmult
TProfile2D ** m_yvsxmultprofvsbxrun
TH2F ** m_yvsxmultrun

Detailed Description

Definition at line 15 of file MultiplicityCorrelatorHistogramMaker.h.


Constructor & Destructor Documentation

MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker ( )
MultiplicityCorrelatorHistogramMaker::MultiplicityCorrelatorHistogramMaker ( const edm::ParameterSet iConfig)

Definition at line 19 of file MultiplicityCorrelatorHistogramMaker.cc.

References edm::ParameterSet::getParameter(), m_atanyoverx, m_atanyoverxrun, m_atanyoverxvsbxrun, m_atanyoverxvsbxrun2D, m_fhm, m_rhm, m_runHisto, m_runHisto2D, m_runHistoBX, m_runHistoBXProfile, m_runHistoProfileBX, m_scfact, m_xvsymultprofvsbxrun, m_yvsxmult, m_yvsxmultprofvsbxrun, m_yvsxmultrun, RunHistogramManager::makeTH1F(), RunHistogramManager::makeTH2F(), RunHistogramManager::makeTProfile(), RunHistogramManager::makeTProfile2D(), and AlCaHLTBitMon_QueryRunRegistry::string.

                                                                                                        :
  m_rhm(false), m_fhm(true),
  m_runHisto(iConfig.getParameter<bool>("runHisto")),
  m_runHistoBXProfile(iConfig.getParameter<bool>("runHistoBXProfile")),
  m_runHistoBX(iConfig.getParameter<bool>("runHistoBX")),
  m_runHisto2D(iConfig.getParameter<bool>("runHisto2D")),
  m_runHistoProfileBX(iConfig.getUntrackedParameter<bool>("runHistoProfileBX",false)),
  m_scfact(iConfig.getUntrackedParameter<double>("scaleFactor",1.)),
  m_atanyoverxrun(0), m_atanyoverxvsbxrun(0), m_atanyoverxvsbxrun2D(0), m_yvsxmultrun(0),
  m_yvsxmultprofvsbxrun(0), m_xvsymultprofvsbxrun(0)  
 { 

  edm::Service<TFileService> tfserv;

  char hname[300];
  sprintf(hname,"%sVs%s",
          iConfig.getParameter<std::string>("yDetLabel").c_str(),
          iConfig.getParameter<std::string>("xDetLabel").c_str());
  char htitle[300];
  sprintf(htitle,"%s Vs %s multiplicity",
          iConfig.getParameter<std::string>("yDetLabel").c_str(),
          iConfig.getParameter<std::string>("xDetLabel").c_str());

  m_yvsxmult = tfserv->make<TH2F>(hname,htitle,
                     iConfig.getParameter<unsigned int>("xBins"),0.,iConfig.getParameter<double>("xMax"),
                     iConfig.getParameter<unsigned int>("yBins"),0.,iConfig.getParameter<double>("yMax"));

  if(m_runHisto && m_runHisto2D) {
    m_yvsxmultrun = m_rhm.makeTH2F(hname,htitle,
                     iConfig.getParameter<unsigned int>("xBins"),0.,iConfig.getParameter<double>("xMax"),
                     iConfig.getParameter<unsigned int>("yBins"),0.,iConfig.getParameter<double>("yMax"));
  }

  if(m_runHisto && m_runHistoProfileBX) {
    sprintf(hname,"%sVs%sprofvsbx",
            iConfig.getParameter<std::string>("yDetLabel").c_str(),
            iConfig.getParameter<std::string>("xDetLabel").c_str());
    sprintf(htitle,"%s Vs %s multiplicity vs BX",
            iConfig.getParameter<std::string>("yDetLabel").c_str(),
            iConfig.getParameter<std::string>("xDetLabel").c_str());
    m_yvsxmultprofvsbxrun = m_fhm.makeTProfile2D(hname,htitle,
                                                 3564,-0.5,3564-0.5,
                                                 iConfig.getParameter<unsigned int>("xBins"),0.,iConfig.getParameter<double>("xMax"));
    sprintf(hname,"%sVs%sprofvsbx",
            iConfig.getParameter<std::string>("xDetLabel").c_str(),
            iConfig.getParameter<std::string>("yDetLabel").c_str());
    sprintf(htitle,"%s Vs %s multiplicity vs BX",
            iConfig.getParameter<std::string>("xDetLabel").c_str(),
            iConfig.getParameter<std::string>("yDetLabel").c_str());
    m_xvsymultprofvsbxrun = m_fhm.makeTProfile2D(hname,htitle,
                                                 3564,-0.5,3564-0.5,
                                                 iConfig.getParameter<unsigned int>("yBins"),0.,iConfig.getParameter<double>("yMax"));
  }
  
  sprintf(hname,"%sOver%s",
          iConfig.getParameter<std::string>("yDetLabel").c_str(),
          iConfig.getParameter<std::string>("xDetLabel").c_str());
  sprintf(htitle,"atan (%4.2f*%s / %s multiplicity ratio)",
          m_scfact,       
          iConfig.getParameter<std::string>("yDetLabel").c_str(),
          iConfig.getParameter<std::string>("xDetLabel").c_str()
          );

  m_atanyoverx = tfserv->make<TH1F>(hname,htitle,
                                   iConfig.getParameter<unsigned int>("rBins"),0.,1.6);
    
  if(m_runHisto) {
    sprintf(hname,"%sOver%srun",
            iConfig.getParameter<std::string>("yDetLabel").c_str(),
            iConfig.getParameter<std::string>("xDetLabel").c_str());
    m_atanyoverxrun = m_rhm.makeTH1F(hname,htitle,
                                     iConfig.getParameter<unsigned int>("rBins"),0.,1.6);
    if(m_runHistoBX) {

      sprintf(hname,"%sOver%svsbx2D",
              iConfig.getParameter<std::string>("yDetLabel").c_str(),
              iConfig.getParameter<std::string>("xDetLabel").c_str());
      sprintf(htitle,"atan (%4.2f*%s / %s multiplicity ratio)",
              m_scfact,       
              iConfig.getParameter<std::string>("yDetLabel").c_str(),
              iConfig.getParameter<std::string>("xDetLabel").c_str()
              );
      m_atanyoverxvsbxrun2D = m_fhm.makeTH2F(hname,htitle,3564,-0.5,3564-0.5,
                                           iConfig.getParameter<unsigned int>("rBins"),0.,1.6);
    }
    if(m_runHistoBXProfile) {
      sprintf(hname,"%sOver%svsbx",
              iConfig.getParameter<std::string>("yDetLabel").c_str(),
              iConfig.getParameter<std::string>("xDetLabel").c_str());
      sprintf(htitle,"atan (%4.2f*%s / %s multiplicity ratio)",
              m_scfact,
              iConfig.getParameter<std::string>("yDetLabel").c_str(),
              iConfig.getParameter<std::string>("xDetLabel").c_str()
              );
      m_atanyoverxvsbxrun = m_fhm.makeTProfile(hname,htitle,3564,-0.5,3564-0.5);
    }
  }

}
MultiplicityCorrelatorHistogramMaker::~MultiplicityCorrelatorHistogramMaker ( )

Definition at line 120 of file MultiplicityCorrelatorHistogramMaker.cc.

{ }

Member Function Documentation

void MultiplicityCorrelatorHistogramMaker::beginRun ( const edm::Run iRun)

Definition at line 122 of file MultiplicityCorrelatorHistogramMaker.cc.

References RunHistogramManager::beginRun(), m_fhm, and m_rhm.

                                                                      {

  m_rhm.beginRun(iRun);
  m_fhm.beginRun(iRun);

}
void MultiplicityCorrelatorHistogramMaker::fill ( const edm::Event iEvent,
const int  xmult,
const int  ymult 
)

Definition at line 129 of file MultiplicityCorrelatorHistogramMaker.cc.

References edm::EventBase::bunchCrossing(), m_atanyoverx, m_atanyoverxrun, m_atanyoverxvsbxrun, m_atanyoverxvsbxrun2D, m_scfact, m_xvsymultprofvsbxrun, m_yvsxmult, m_yvsxmultprofvsbxrun, and m_yvsxmultrun.

                                                                                                        {
  


  const int bx = iEvent.bunchCrossing();

  if(m_yvsxmult) m_yvsxmult->Fill(xmult,ymult);
  if(m_atanyoverx) m_atanyoverx->Fill(atan2(ymult*m_scfact,xmult));

  if(m_yvsxmultrun && *m_yvsxmultrun) (*m_yvsxmultrun)->Fill(xmult,ymult);
  if(m_atanyoverxrun && *m_atanyoverxrun) (*m_atanyoverxrun)->Fill(atan2(ymult*m_scfact,xmult));
  if(m_atanyoverxvsbxrun && *m_atanyoverxvsbxrun) (*m_atanyoverxvsbxrun)->Fill(bx,atan2(ymult*m_scfact,xmult));
  if(m_atanyoverxvsbxrun2D && *m_atanyoverxvsbxrun2D) (*m_atanyoverxvsbxrun2D)->Fill(bx,atan2(ymult*m_scfact,xmult));

  if(m_yvsxmultprofvsbxrun && *m_yvsxmultprofvsbxrun) (*m_yvsxmultprofvsbxrun)->Fill(bx,xmult,ymult); 
  if(m_xvsymultprofvsbxrun && *m_xvsymultprofvsbxrun) (*m_xvsymultprofvsbxrun)->Fill(bx,ymult,xmult); 
}

Member Data Documentation