CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MultiplicityCorrelator Class Reference

#include <DPGAnalysis/SiStripTools/src/MultiplicityCorrelator.cc>

Inheritance diagram for MultiplicityCorrelator:
edm::EDAnalyzer

List of all members.

Public Member Functions

 MultiplicityCorrelator (const edm::ParameterSet &)
 ~MultiplicityCorrelator ()

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
virtual void endJob ()
virtual void endRun (const edm::Run &, const edm::EventSetup &)

Private Attributes

std::vector
< MultiplicityCorrelatorHistogramMaker * > 
m_mchms
std::vector< std::string > m_xLabels
std::vector< edm::InputTagm_xMultiplicityMaps
std::vector< unsigned int > m_xSelections
std::vector< std::string > m_yLabels
std::vector< edm::InputTagm_yMultiplicityMaps
std::vector< unsigned int > m_ySelections

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 45 of file MultiplicityCorrelator.cc.


Constructor & Destructor Documentation

MultiplicityCorrelator::MultiplicityCorrelator ( const edm::ParameterSet iConfig) [explicit]

Definition at line 83 of file MultiplicityCorrelator.cc.

References edm::ParameterSet::getParameter(), m_mchms, m_xLabels, m_xMultiplicityMaps, m_xSelections, m_yLabels, m_yMultiplicityMaps, and m_ySelections.

                                                                            :
  m_mchms(),
  m_xMultiplicityMaps(),m_yMultiplicityMaps(),
  m_xLabels(),m_yLabels(), m_xSelections(),m_ySelections()
{
   //now do what ever initialization is needed

  std::vector<edm::ParameterSet> correlationConfigs = 
    iConfig.getParameter<std::vector<edm::ParameterSet> >("correlationConfigurations");

  for(std::vector<edm::ParameterSet>::const_iterator ps=correlationConfigs.begin();ps!=correlationConfigs.end();++ps) {

    m_xMultiplicityMaps.push_back(ps->getParameter<edm::InputTag>("xMultiplicityMap"));
    m_yMultiplicityMaps.push_back(ps->getParameter<edm::InputTag>("yMultiplicityMap"));
    m_xLabels.push_back(ps->getParameter<std::string>("xDetLabel"));
    m_yLabels.push_back(ps->getParameter<std::string>("yDetLabel"));
    m_xSelections.push_back(ps->getParameter<unsigned int>("xDetSelection"));
    m_ySelections.push_back(ps->getParameter<unsigned int>("yDetSelection"));

    m_mchms.push_back(new MultiplicityCorrelatorHistogramMaker(*ps));

  }

}
MultiplicityCorrelator::~MultiplicityCorrelator ( )

Definition at line 109 of file MultiplicityCorrelator.cc.

References i, and m_mchms.

{
 
  for(unsigned int i=0;i<m_mchms.size();++i) {
    delete m_mchms[i];
  }

}

Member Function Documentation

void MultiplicityCorrelator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 125 of file MultiplicityCorrelator.cc.

References edm::Event::getByLabel(), i, m_mchms, m_xMultiplicityMaps, m_xSelections, m_yMultiplicityMaps, and m_ySelections.

{
  using namespace edm;
  
  for(unsigned int i=0;i<m_mchms.size();++i) {
    Handle<std::map<unsigned int, int> > xMults;
    iEvent.getByLabel(m_xMultiplicityMaps[i],xMults);
    Handle<std::map<unsigned int, int> > yMults;
    iEvent.getByLabel(m_yMultiplicityMaps[i],yMults);

    // check if the selection exists

    std::map<unsigned int, int>::const_iterator xmult = xMults->find(m_xSelections[i]);
    std::map<unsigned int, int>::const_iterator ymult = yMults->find(m_ySelections[i]);

    if(xmult!=xMults->end() && ymult!=yMults->end()) {


      m_mchms[i]->fill(iEvent,xmult->second,ymult->second);

    }
    else {
      edm::LogWarning("DetSelectionNotFound") << " DetSelection " 
                                              << m_xSelections[i] << " " 
                                              << m_ySelections[i] << " not found"; 
    }
  }
  
}
void MultiplicityCorrelator::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file MultiplicityCorrelator.cc.

{

}
void MultiplicityCorrelator::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file MultiplicityCorrelator.cc.

References i, and m_mchms.

                                                                                {

  for(unsigned int i=0;i<m_mchms.size();++i) {
    m_mchms[i]->beginRun(iRun);
  }
}
void MultiplicityCorrelator::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 176 of file MultiplicityCorrelator.cc.

                               {
}
void MultiplicityCorrelator::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 172 of file MultiplicityCorrelator.cc.

                                                                              {
}

Member Data Documentation

std::vector<std::string> MultiplicityCorrelator::m_xLabels [private]

Definition at line 64 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

Definition at line 62 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

std::vector<unsigned int> MultiplicityCorrelator::m_xSelections [private]

Definition at line 66 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

std::vector<std::string> MultiplicityCorrelator::m_yLabels [private]

Definition at line 65 of file MultiplicityCorrelator.cc.

Referenced by MultiplicityCorrelator().

Definition at line 63 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().

std::vector<unsigned int> MultiplicityCorrelator::m_ySelections [private]

Definition at line 67 of file MultiplicityCorrelator.cc.

Referenced by analyze(), and MultiplicityCorrelator().