CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/Validation/RecoTrack/interface/MTVHistoProducerAlgo.h

Go to the documentation of this file.
00001 #ifndef Validation_RecoTrack_MTVHistoProducerAlgo_h
00002 #define Validation_RecoTrack_MTVHistoProducerAlgo_h
00003 
00004 /* \author B.Mangano, UCSD
00005  *
00006  * Base class which defines the interface of a generic HistoProducerAlogs 
00007  * to be used within the MultiTrackValidator module. 
00008  * The concrete algorithms will be plugged into the MTV to produce all 
00009  * the validation plots that the user wants.
00010  */
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00012 
00013 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
00014 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00015 #include "DataFormats/TrackReco/interface/Track.h"
00016 
00017 #include "DQMServices/Core/interface/MonitorElement.h"
00018 #include "DQMServices/Core/interface/DQMStore.h"
00019 
00020 #include "DataFormats/TrackReco/interface/DeDxData.h"
00021 #include "DataFormats/Common/interface/ValueMap.h"
00022 
00023 #include <TH1F.h>
00024 #include <TH2F.h>
00025 
00026 class MTVHistoProducerAlgo{
00027  public:
00028   
00029  MTVHistoProducerAlgo(const edm::ParameterSet& pset) : pset_(pset){};
00030   virtual ~MTVHistoProducerAlgo() {}
00031   // to be implemented in the concrete classes
00032   virtual void initialize()=0; 
00033 
00034   void setDQMStore(DQMStore* dbe) {dbe_ = dbe;}
00035 
00036   virtual void bookSimHistos()=0;
00037   virtual void bookRecoHistos()=0;
00038   virtual void bookRecoHistosForStandaloneRunning()=0;
00039 
00040   virtual void fill_generic_simTrack_histos(int counter,ParticleBase::Vector,ParticleBase::Point vertex, int bx)=0;
00041 
00042   virtual void fill_recoAssociated_simTrack_histos(int count,
00043                                                    const TrackingParticle& tp,
00044                                                    ParticleBase::Vector momentumTP,ParticleBase::Point vertexTP,
00045                                                    double dxy, double dz, int nSimHits,
00046                                                    const reco::Track* track,
00047                                                    int numVertices, double vertz)=0;
00048 
00049   virtual void fill_recoAssociated_simTrack_histos(int count,
00050                                                    const reco::GenParticle& tp,
00051                                                    ParticleBase::Vector momentumTP,ParticleBase::Point vertexTP,
00052                                                    double dxy, double dz, int nSimHits,
00053                                                    const reco::Track* track,
00054                                                    int numVertices, double vertz)=0;
00055 
00056   virtual void fill_generic_recoTrack_histos(int count,
00057                                              const reco::Track& track,
00058                                              math::XYZPoint bsPosition,
00059                                              bool isMatched,
00060                                              bool isSigMatched,
00061                                              bool isChargeMatched,
00062                                              int numAssocRecoTracks,
00063                                              int numVertices, 
00064                                              int tpbunchcrossing,
00065                                              int nSimHits,
00066                                              double sharedFraction)=0;
00067 
00068   virtual void fill_dedx_recoTrack_histos(int count, edm::RefToBase<reco::Track>& trackref, std::vector< edm::ValueMap<reco::DeDxData> > v_dEdx)=0;
00069   //  virtual void fill_dedx_recoTrack_histos(reco::TrackRef trackref, std::vector< edm::ValueMap<reco::DeDxData> > v_dEdx)=0;
00070 
00071   virtual void fill_simAssociated_recoTrack_histos(int count,
00072                                                    const reco::Track& track)=0;
00073 
00074   virtual void fill_trackBased_histos(int count, 
00075                                       int assTracks, 
00076                                       int numRecoTracks,
00077                                       int numSimTracks)=0;
00078 
00079   virtual void fill_ResoAndPull_recoTrack_histos(int count,
00080                                                  ParticleBase::Vector momentumTP,
00081                                                  ParticleBase::Point vertexTP,
00082                                                  int chargeTP,
00083                                                  const reco::Track& track,
00084                                                  math::XYZPoint bsPosition)=0;
00085 
00086   virtual void finalHistoFits(int counter)=0;
00087 
00088 
00089   virtual void fillHistosFromVectors(int counter)=0;
00090   virtual void fillProfileHistosFromVectors(int counter)=0;
00091 
00092 
00093  protected: 
00094   //protected functions 
00095 
00096   virtual double getEta(double eta)=0;
00097   
00098   virtual double getPt(double pt)=0;
00099 
00100   void doProfileX(TH2 * th2, MonitorElement* me);
00101 
00102   void doProfileX(MonitorElement * th2m, MonitorElement* me) {
00103     doProfileX(th2m->getTH2F(), me);
00104   }
00105   
00106   void fillPlotFromVector(MonitorElement* h, std::vector<int>& vec);
00107   
00108   void fillPlotFromVectors(MonitorElement* h, 
00109                            std::vector<int>& numerator, 
00110                            std::vector<int>& denominator,
00111                            std::string type);
00112 
00113   void BinLogX(TH1*h);
00114 
00115   DQMStore* dbe_;
00116  private:
00117   //private data members
00118   const edm::ParameterSet& pset_;
00119 
00120 
00121 };
00122 
00123 #endif