CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
MTVHistoProducerAlgo Class Referenceabstract

#include <MTVHistoProducerAlgo.h>

Inheritance diagram for MTVHistoProducerAlgo:
MTVHistoProducerAlgoForTracker

Public Member Functions

virtual void bookRecoHistos (DQMStore::IBooker &ibook)=0
 
virtual void bookRecoHistosForStandaloneRunning (DQMStore::IBooker &ibook)=0
 
virtual void bookSimHistos (DQMStore::IBooker &ibook)=0
 
virtual void fill_dedx_recoTrack_histos (int count, edm::RefToBase< reco::Track > &trackref, const std::vector< edm::ValueMap< reco::DeDxData > > &v_dEdx)=0
 
virtual void fill_generic_recoTrack_histos (int count, const reco::Track &track, const math::XYZPoint &bsPosition, bool isMatched, bool isSigMatched, bool isChargeMatched, int numAssocRecoTracks, int numVertices, int nSimHits, double sharedFraction, double dR)=0
 
virtual void fill_generic_simTrack_histos (int counter, const TrackingParticle::Vector &, const TrackingParticle::Point &vertex, int bx)=0
 
virtual void fill_recoAssociated_simTrack_histos (int count, const TrackingParticle &tp, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track, int numVertices, double dR)=0
 
virtual void fill_recoAssociated_simTrack_histos (int count, const reco::GenParticle &tp, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, double dxy, double dz, int nSimHits, const reco::Track *track, int numVertices)=0
 
virtual void fill_ResoAndPull_recoTrack_histos (int count, const TrackingParticle::Vector &momentumTP, const TrackingParticle::Point &vertexTP, int chargeTP, const reco::Track &track, const math::XYZPoint &bsPosition)=0
 
virtual void fill_simAssociated_recoTrack_histos (int count, const reco::Track &track)=0
 
virtual void fill_trackBased_histos (int count, int assTracks, int numRecoTracks, int numSimTracks)=0
 
virtual void fillProfileHistosFromVectors (int counter)=0
 
virtual void finalHistoFits (int counter)=0
 
virtual void initialize ()=0
 
 MTVHistoProducerAlgo (const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
 
 MTVHistoProducerAlgo (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 
virtual ~MTVHistoProducerAlgo ()
 

Protected Member Functions

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

Private Attributes

const edm::ParameterSetpset_
 

Detailed Description

Definition at line 27 of file MTVHistoProducerAlgo.h.

Constructor & Destructor Documentation

MTVHistoProducerAlgo::MTVHistoProducerAlgo ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 30 of file MTVHistoProducerAlgo.h.

30 : MTVHistoProducerAlgo(pset, iC){};
MTVHistoProducerAlgo(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
MTVHistoProducerAlgo::MTVHistoProducerAlgo ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
inline

Definition at line 31 of file MTVHistoProducerAlgo.h.

31 : pset_(pset){};
const edm::ParameterSet & pset_
virtual MTVHistoProducerAlgo::~MTVHistoProducerAlgo ( )
inlinevirtual

Definition at line 32 of file MTVHistoProducerAlgo.h.

32 {}

Member Function Documentation

void MTVHistoProducerAlgo::BinLogX ( TH1 *  h)
protected

Definition at line 71 of file MTVHistoProducerAlgo.cc.

References i, and create_public_lumi_plots::width.

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

71  {
72  TAxis *axis = h->GetXaxis();
73  int bins = axis->GetNbins();
74 
75  float from = axis->GetXmin();
76  float to = axis->GetXmax();
77  float width = (to - from) / bins;
78  float *new_bins = new float[bins + 1];
79 
80  for (int i = 0; i <= bins; i++) {
81  new_bins[i] = TMath::Power(10, from + i * width);
82 
83  }
84  axis->Set(bins, new_bins);
85  delete[] new_bins;
86 }
int i
Definition: DBlmapReader.cc:9
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
virtual void MTVHistoProducerAlgo::bookRecoHistos ( DQMStore::IBooker ibook)
pure virtual
virtual void MTVHistoProducerAlgo::bookRecoHistosForStandaloneRunning ( DQMStore::IBooker ibook)
pure virtual
virtual void MTVHistoProducerAlgo::bookSimHistos ( DQMStore::IBooker ibook)
pure virtual
void MTVHistoProducerAlgo::doProfileX ( TH2 *  th2,
MonitorElement me 
)
protected

Definition at line 3 of file MTVHistoProducerAlgo.cc.

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

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

3  {
4  if (th2->GetNbinsX()==me->getNbinsX()){
5  TProfile * p1 = (TProfile*) th2->ProfileX();
6  p1->Copy(*me->getTProfile());
7  delete p1;
8  } else {
9  throw cms::Exception("MultiTrackValidator") << "Different number of bins!";
10  }
11 }
double p1[4]
Definition: TauolaWrapper.h:89
TProfile * getTProfile(void) const
int getNbinsX(void) const
get # of bins in X-axis
void MTVHistoProducerAlgo::doProfileX ( MonitorElement th2m,
MonitorElement me 
)
inlineprotected

Definition at line 101 of file MTVHistoProducerAlgo.h.

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

101  {
102  doProfileX(th2m->getTH2F(), me);
103  }
void doProfileX(TH2 *th2, MonitorElement *me)
TH2F * getTH2F(void) const
virtual void MTVHistoProducerAlgo::fill_dedx_recoTrack_histos ( int  count,
edm::RefToBase< reco::Track > &  trackref,
const std::vector< edm::ValueMap< reco::DeDxData > > &  v_dEdx 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_generic_recoTrack_histos ( int  count,
const reco::Track track,
const math::XYZPoint bsPosition,
bool  isMatched,
bool  isSigMatched,
bool  isChargeMatched,
int  numAssocRecoTracks,
int  numVertices,
int  nSimHits,
double  sharedFraction,
double  dR 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_generic_simTrack_histos ( int  counter,
const TrackingParticle::Vector ,
const TrackingParticle::Point vertex,
int  bx 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_recoAssociated_simTrack_histos ( int  count,
const TrackingParticle tp,
const TrackingParticle::Vector momentumTP,
const TrackingParticle::Point vertexTP,
double  dxy,
double  dz,
int  nSimHits,
const reco::Track track,
int  numVertices,
double  dR 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_recoAssociated_simTrack_histos ( int  count,
const reco::GenParticle tp,
const TrackingParticle::Vector momentumTP,
const TrackingParticle::Point vertexTP,
double  dxy,
double  dz,
int  nSimHits,
const reco::Track track,
int  numVertices 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_ResoAndPull_recoTrack_histos ( int  count,
const TrackingParticle::Vector momentumTP,
const TrackingParticle::Point vertexTP,
int  chargeTP,
const reco::Track track,
const math::XYZPoint bsPosition 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_simAssociated_recoTrack_histos ( int  count,
const reco::Track track 
)
pure virtual
virtual void MTVHistoProducerAlgo::fill_trackBased_histos ( int  count,
int  assTracks,
int  numRecoTracks,
int  numSimTracks 
)
pure virtual
void MTVHistoProducerAlgo::fillPlotFromPlots ( MonitorElement h,
TH1 *  numerator,
TH1 *  denominator,
std::string  type 
)
protected

Definition at line 46 of file MTVHistoProducerAlgo.cc.

References assert(), newFWLiteAna::bin, MonitorElement::getNbinsX(), MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.

Referenced by MTVHistoProducerAlgoForTracker::finalHistoFits().

49  {
50  assert(h->getNbinsX()==numerator->GetNbinsX());
51  assert(h->getNbinsX()==denominator->GetNbinsX());
52  double value,err;
53  for (int bin=1;bin<=h->getNbinsX();++bin) {
54  if (denominator->GetBinContent(bin)!=0) {
55  if (type=="effic"){
56  value = ((double) numerator->GetBinContent(bin))/((double) denominator->GetBinContent(bin));
57  err = sqrt( value*(1.-value)/((double) denominator->GetBinContent(bin)) );
58  } else if (type=="fakerate"){
59  value = 1.-((double) numerator->GetBinContent(bin))/((double) denominator->GetBinContent(bin));
60  err = sqrt( value*(1.-value)/(double)denominator->GetBinContent(bin) );
61  } else if (type=="pileup"){
62  value = ((double) numerator->GetBinContent(bin))/((double) denominator->GetBinContent(bin));
63  err = sqrt( value*(1.+value)/(double) denominator->GetBinContent(bin) );
64  } else return;
65  h->setBinContent(bin,value);
66  h->setBinError(bin,err);
67  }
68  }
69 }
type
Definition: HCALResponse.h:21
void setBinContent(int binx, double content)
set content of bin (1-D)
list numerator
Definition: cuy.py:483
assert(m_qm.get())
list denominator
Definition: cuy.py:484
T sqrt(T t)
Definition: SSEVec.h:48
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void MTVHistoProducerAlgo::fillPlotFromVector ( MonitorElement h,
std::vector< int > &  vec 
)
protected

Definition at line 13 of file MTVHistoProducerAlgo.cc.

References j, and MonitorElement::setBinContent().

13  {
14  for (unsigned int j=0; j<vec.size(); j++){
15  h->setBinContent(j+1, vec[j]);
16  }
17 }
void setBinContent(int binx, double content)
set content of bin (1-D)
int j
Definition: DBlmapReader.cc:9
void MTVHistoProducerAlgo::fillPlotFromVectors ( MonitorElement h,
std::vector< int > &  numerator,
std::vector< int > &  denominator,
std::string  type 
)
protected

Definition at line 19 of file MTVHistoProducerAlgo.cc.

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

22  {
23  double value,err;
24  for (unsigned int j=0; j<numerator.size(); j++){
25  if (denominator[j]!=0){
26  if (type=="effic"){
27  value = ((double) numerator[j])*1./((double) denominator[j]);
28  err = sqrt( value*(1-value)/(double) denominator[j] );
29  } else if (type=="fakerate"){
30  value = 1-((double) numerator[j])*1./((double) denominator[j]);
31  err = sqrt( value*(1-value)/(double) denominator[j] );
32  } else if (type=="pileup"){
33  value = ((double) numerator[j])*1./((double) denominator[j]);
34  err = sqrt( value*(1+value)/(double) denominator[j] );
35  } else return;
36  h->setBinContent(j+1, value);
37  h->setBinError(j+1, err);
38  }
39  else {
40  h->setBinContent(j+1, 0.);
41  h->setBinError(j+1, 0.);
42  }
43  }
44 }
type
Definition: HCALResponse.h:21
void setBinContent(int binx, double content)
set content of bin (1-D)
list numerator
Definition: cuy.py:483
list denominator
Definition: cuy.py:484
T sqrt(T t)
Definition: SSEVec.h:48
int j
Definition: DBlmapReader.cc:9
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
template<typename T >
void MTVHistoProducerAlgo::fillPlotNoFlow ( MonitorElement h,
T  val 
)
inlineprotected

Definition at line 105 of file MTVHistoProducerAlgo.h.

References MonitorElement::Fill(), MonitorElement::getTH1(), bookConverter::max, and min().

Referenced by MTVHistoProducerAlgoForTracker::fill_generic_recoTrack_histos(), and MTVHistoProducerAlgoForTracker::fill_recoAssociated_simTrack_histos().

105  {
106  h->Fill(std::min(std::max(val,((T) h->getTH1()->GetXaxis()->GetXmin())),((T) h->getTH1()->GetXaxis()->GetXmax())));
107  }
void Fill(long long x)
TH1 * getTH1(void) const
T min(T a, T b)
Definition: MathUtil.h:58
long double T
virtual void MTVHistoProducerAlgo::fillProfileHistosFromVectors ( int  counter)
pure virtual
virtual void MTVHistoProducerAlgo::finalHistoFits ( int  counter)
pure virtual
virtual double MTVHistoProducerAlgo::getEta ( double  eta)
protectedpure virtual
virtual double MTVHistoProducerAlgo::getPt ( double  pt)
protectedpure virtual
virtual void MTVHistoProducerAlgo::initialize ( )
pure virtual

Member Data Documentation

const edm::ParameterSet& MTVHistoProducerAlgo::pset_
private

Definition at line 125 of file MTVHistoProducerAlgo.h.