CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes

MTVHistoProducerAlgo Class Reference

#include <MTVHistoProducerAlgo.h>

Inheritance diagram for MTVHistoProducerAlgo:
MTVHistoProducerAlgoForTracker

List of all members.

Public Member Functions

virtual void bookRecoHistos ()=0
virtual void bookRecoHistosForStandaloneRunning ()=0
virtual void bookSimHistos ()=0
virtual void fill_dedx_recoTrack_histos (int count, edm::RefToBase< reco::Track > &trackref, std::vector< edm::ValueMap< reco::DeDxData > > v_dEdx)=0
virtual void fill_generic_recoTrack_histos (int count, const reco::Track &track, math::XYZPoint bsPosition, bool isMatched)=0
virtual void fill_generic_simTrack_histos (int counter, ParticleBase::Vector, ParticleBase::Point vertex)=0
virtual void fill_recoAssociated_simTrack_histos (int count, const TrackingParticle &tp, ParticleBase::Vector momentumTP, ParticleBase::Point vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track)=0
virtual void fill_ResoAndPull_recoTrack_histos (int count, ParticleBase::Vector momentumTP, ParticleBase::Point vertexTP, int chargeTP, const reco::Track &track, math::XYZPoint bsPosition)=0
virtual void fill_simAssociated_recoTrack_histos (int count, const reco::Track &track)=0
virtual void fillHistosFromVectors (int counter)=0
virtual void fillProfileHistosFromVectors (int counter)=0
virtual void finalHistoFits (int counter)=0
virtual void initialize ()=0
 MTVHistoProducerAlgo (const edm::ParameterSet &pset)
void setDQMStore (DQMStore *dbe)

Protected Member Functions

void BinLogX (TH1 *h)
void doProfileX (MonitorElement *th2m, MonitorElement *me)
void doProfileX (TH2 *th2, MonitorElement *me)
void fillPlotFromVector (MonitorElement *h, std::vector< int > &vec)
void fillPlotFromVectors (MonitorElement *h, std::vector< int > &numerator, std::vector< int > &denominator, std::string type)
virtual double getEta (double eta)=0
virtual double getPt (double pt)=0

Protected Attributes

DQMStoredbe_

Private Attributes

const edm::ParameterSetpset_

Detailed Description

Definition at line 25 of file MTVHistoProducerAlgo.h.


Constructor & Destructor Documentation

MTVHistoProducerAlgo::MTVHistoProducerAlgo ( const edm::ParameterSet pset) [inline]

Definition at line 28 of file MTVHistoProducerAlgo.h.

: pset_(pset){};

Member Function Documentation

void MTVHistoProducerAlgo::BinLogX ( TH1 *  h) [protected]

Definition at line 45 of file MTVHistoProducerAlgo.cc.

References Capri::details::from(), i, and tablePrinter::width.

Referenced by MTVHistoProducerAlgoForTracker::bookRecoHistos(), and MTVHistoProducerAlgoForTracker::bookRecoHistosForStandaloneRunning().

                                       {  
  TAxis *axis = h->GetXaxis();
  int bins = axis->GetNbins();
  
  float from = axis->GetXmin();
  float to = axis->GetXmax();
  float width = (to - from) / bins;
  float *new_bins = new float[bins + 1];
  
  for (int i = 0; i <= bins; i++) {
    new_bins[i] = TMath::Power(10, from + i * width);
    
  }
  axis->Set(bins, new_bins);
  delete[] new_bins;
}
virtual void MTVHistoProducerAlgo::bookRecoHistos ( ) [pure virtual]
virtual void MTVHistoProducerAlgo::bookRecoHistosForStandaloneRunning ( ) [pure virtual]
virtual void MTVHistoProducerAlgo::bookSimHistos ( ) [pure virtual]
void MTVHistoProducerAlgo::doProfileX ( TH2 *  th2,
MonitorElement me 
) [protected]

Definition at line 3 of file MTVHistoProducerAlgo.cc.

References Exception, MonitorElement::getNbinsX(), MonitorElement::getTProfile(), and p1.

Referenced by doProfileX(), and MTVHistoProducerAlgoForTracker::fillProfileHistosFromVectors().

                                                                  {
  if (th2->GetNbinsX()==me->getNbinsX()){
    TProfile * p1 = (TProfile*) th2->ProfileX();
    p1->Copy(*me->getTProfile());
    delete p1;
  } else {
    throw cms::Exception("MultiTrackValidator") << "Different number of bins!";
  }
}
void MTVHistoProducerAlgo::doProfileX ( MonitorElement th2m,
MonitorElement me 
) [inline, protected]

Definition at line 81 of file MTVHistoProducerAlgo.h.

References doProfileX(), and MonitorElement::getTH2F().

                                                             {
    doProfileX(th2m->getTH2F(), me);
  }
virtual void MTVHistoProducerAlgo::fill_dedx_recoTrack_histos ( int  count,
edm::RefToBase< reco::Track > &  trackref,
std::vector< edm::ValueMap< reco::DeDxData > >  v_dEdx 
) [pure virtual]
virtual void MTVHistoProducerAlgo::fill_generic_recoTrack_histos ( int  count,
const reco::Track track,
math::XYZPoint  bsPosition,
bool  isMatched 
) [pure virtual]
virtual void MTVHistoProducerAlgo::fill_generic_simTrack_histos ( int  counter,
ParticleBase::Vector  ,
ParticleBase::Point  vertex 
) [pure virtual]
virtual void MTVHistoProducerAlgo::fill_recoAssociated_simTrack_histos ( int  count,
const TrackingParticle tp,
ParticleBase::Vector  momentumTP,
ParticleBase::Point  vertexTP,
double  dxy,
double  dz,
int  nSimHits,
const reco::Track track 
) [pure virtual]
virtual void MTVHistoProducerAlgo::fill_ResoAndPull_recoTrack_histos ( int  count,
ParticleBase::Vector  momentumTP,
ParticleBase::Point  vertexTP,
int  chargeTP,
const reco::Track track,
math::XYZPoint  bsPosition 
) [pure virtual]
virtual void MTVHistoProducerAlgo::fill_simAssociated_recoTrack_histos ( int  count,
const reco::Track track 
) [pure virtual]
virtual void MTVHistoProducerAlgo::fillHistosFromVectors ( int  counter) [pure virtual]
void MTVHistoProducerAlgo::fillPlotFromVector ( MonitorElement h,
std::vector< int > &  vec 
) [protected]

Definition at line 14 of file MTVHistoProducerAlgo.cc.

References j, and MonitorElement::setBinContent().

Referenced by MTVHistoProducerAlgoForTracker::fillHistosFromVectors().

                                                                                    {
  for (unsigned int j=0; j<vec.size(); j++){
    h->setBinContent(j+1, vec[j]);
  }
}
void MTVHistoProducerAlgo::fillPlotFromVectors ( MonitorElement h,
std::vector< int > &  numerator,
std::vector< int > &  denominator,
std::string  type 
) [protected]

Definition at line 20 of file MTVHistoProducerAlgo.cc.

References j, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.

Referenced by MTVHistoProducerAlgoForTracker::finalHistoFits().

                                                              {
  double value,err;
  for (unsigned int j=0; j<numerator.size(); j++){
    if (denominator[j]!=0){
      if (type=="effic")
        value = ((double) numerator[j])/((double) denominator[j]);
      else if (type=="fakerate")
        value = 1-((double) numerator[j])/((double) denominator[j]);
      else return;
      err = sqrt( value*(1-value)/(double) denominator[j] );
      h->setBinContent(j+1, value);
      h->setBinError(j+1,err);
    }
    else {
      h->setBinContent(j+1, 0);
    }
  }
}
virtual void MTVHistoProducerAlgo::fillProfileHistosFromVectors ( int  counter) [pure virtual]
virtual void MTVHistoProducerAlgo::finalHistoFits ( int  counter) [pure virtual]
virtual double MTVHistoProducerAlgo::getEta ( double  eta) [protected, pure virtual]
virtual double MTVHistoProducerAlgo::getPt ( double  pt) [protected, pure virtual]
virtual void MTVHistoProducerAlgo::initialize ( ) [pure virtual]
void MTVHistoProducerAlgo::setDQMStore ( DQMStore dbe) [inline]

Definition at line 33 of file MTVHistoProducerAlgo.h.

References dbe_.

{dbe_ = dbe;}

Member Data Documentation

Definition at line 97 of file MTVHistoProducerAlgo.h.