CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/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.12 2011/10/12 22:25:58 khotilov 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 {
00044    public:
00045       typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair; 
00046       typedef std::vector<ConstTrajTrackPair>  ConstTrajTrackPairCollection;
00047 
00049       AlignmentMonitorBase(const edm::ParameterSet &cfg, std::string name);
00050       
00052       virtual ~AlignmentMonitorBase() {}
00053 
00055       void beginOfJob(AlignableTracker *pTracker, AlignableMuon *pMuon, AlignmentParameterStore *pStore);
00056 
00058       void startingNewLoop();
00059 
00061       void duringLoop(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks);
00062 
00064       void endOfLoop(const edm::EventSetup &iSetup);
00065 
00067       void endOfJob() {}
00068 
00070 
00072       virtual void book() = 0;
00073 
00075       virtual void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) { }
00076 
00079       virtual void afterAlignment(const edm::EventSetup &iSetup) { }
00080 
00081    protected:
00085       TH1F *book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX);
00086       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");
00087       TH2F *book2D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY);
00088       TFileDirectory *directory(std::string dir);
00089       
00090       int                     iteration()    { return m_iteration; }
00091       AlignableTracker        *pTracker()    { return mp_tracker; }
00092       AlignableMuon           *pMuon()       { return mp_muon; }
00093       AlignmentParameterStore *pStore()      { return mp_store; }
00094       AlignableNavigator      *pNavigator()  { return mp_navigator; }
00095 
00096       const edm::InputTag m_beamSpotTag;
00097 
00098    private:
00099       AlignmentMonitorBase(const AlignmentMonitorBase&); // stop default
00100       const AlignmentMonitorBase& operator=(const AlignmentMonitorBase&); // stop default
00101 
00102       // ---------- member data --------------------------------
00103 
00104       int m_iteration;
00105       AlignableTracker         *mp_tracker;
00106       AlignableMuon            *mp_muon;
00107       AlignmentParameterStore  *mp_store;
00108       AlignableNavigator       *mp_navigator;
00109 
00110       std::map<std::vector<std::string>, TFileDirectory*> m_baseDirMap, m_iterDirMap;
00111 };
00112 
00113 
00114 #endif