CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Alignment/CommonAlignmentMonitor/interface/AlignmentMonitorBase.h

Go to the documentation of this file.
00001 #ifndef CommonAlignmentMonitor_AlignmentMonitorBase_h
00002 #define CommonAlignmentMonitor_AlignmentMonitorBase_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     CommonAlignmentMonitor
00006 // Class  :     AlignmentMonitorBase
00007 // 
00016 //
00017 // Original Author:  Jim Pivarski
00018 //         Created:  Fri Mar 30 12:21:02 CDT 2007
00019 // $Id: AlignmentMonitorBase.h,v 1.11 2010/01/06 15:23:09 mussgill Exp $
00020 //
00021 
00022 // system include files
00023 
00024 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00025 #include "Alignment/CommonAlignment/interface/AlignableNavigator.h"
00026 #include "Alignment/TrackerAlignment/interface/AlignableTracker.h"
00027 #include "Alignment/MuonAlignment/interface/AlignableMuon.h"
00028 #include "FWCore/Framework/interface/Frameworkfwd.h"
00029 #include "FWCore/Framework/interface/Event.h"
00030 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentParameterStore.h"
00031 #include "DataFormats/TrackReco/interface/Track.h"
00032 
00033 // user include files
00034 #include "CommonTools/Utils/interface/TFileDirectory.h"
00035 #include "TH1F.h"
00036 #include "TH2F.h"
00037 #include "TProfile.h"
00038 #include "TTree.h"
00039 
00040 // forward declarations
00041 
00042 class AlignmentMonitorBase {
00043    public:
00044       typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair; 
00045       typedef std::vector<ConstTrajTrackPair>  ConstTrajTrackPairCollection;
00046 
00048       AlignmentMonitorBase(const edm::ParameterSet &cfg, std::string name);
00049       
00051       virtual ~AlignmentMonitorBase() {}
00052 
00054       void beginOfJob(AlignableTracker *pTracker, AlignableMuon *pMuon, AlignmentParameterStore *pStore);
00055 
00057       void startingNewLoop();
00058 
00060       void duringLoop(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks);
00061 
00063       void endOfLoop(const edm::EventSetup &iSetup);
00064 
00066       void endOfJob();
00067 
00069 
00071       virtual void book() = 0;
00072 
00074       virtual void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) { };
00075 
00078       virtual void afterAlignment(const edm::EventSetup &iSetup) { };
00079 
00080    protected:
00084       TH1F *book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX);
00085       TProfile *bookProfile(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY=1, double lowY=0., double highY=0., const char *option="s");
00086       TH2F *book2D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
00087       TFileDirectory *directory(std::string dir);
00088       
00089       int                     iteration()    { return m_iteration; };
00090       AlignableTracker        *pTracker()    { return mp_tracker; };
00091       AlignableMuon           *pMuon()       { return mp_muon; };
00092       AlignmentParameterStore *pStore()      { return mp_store; };
00093       AlignableNavigator      *pNavigator()  { return mp_navigator; };
00094 
00095    private:
00096       AlignmentMonitorBase(const AlignmentMonitorBase&); // stop default
00097       const AlignmentMonitorBase& operator=(const AlignmentMonitorBase&); // stop default
00098 
00099       // ---------- member data --------------------------------
00100 
00101       int m_iteration;
00102       AlignableTracker         *mp_tracker;
00103       AlignableMuon            *mp_muon;
00104       AlignmentParameterStore  *mp_store;
00105       AlignableNavigator       *mp_navigator;
00106 
00107       std::map<std::vector<std::string>, TFileDirectory*> m_baseDirMap, m_iterDirMap;
00108 };
00109 
00110 
00111 #endif