CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlignmentMonitorBase.h
Go to the documentation of this file.
1 #ifndef CommonAlignmentMonitor_AlignmentMonitorBase_h
2 #define CommonAlignmentMonitor_AlignmentMonitorBase_h
3 // -*- C++ -*-
4 //
5 // Package: CommonAlignmentMonitor
6 // Class : AlignmentMonitorBase
7 //
16 //
17 // Original Author: Jim Pivarski
18 // Created: Fri Mar 30 12:21:02 CDT 2007
19 // $Id: AlignmentMonitorBase.h,v 1.11 2010/01/06 15:23:09 mussgill Exp $
20 //
21 
22 // system include files
23 
32 
33 // user include files
35 #include "TH1F.h"
36 #include "TH2F.h"
37 #include "TProfile.h"
38 #include "TTree.h"
40 
41 // forward declarations
42 
44 public:
45  typedef std::pair<const Trajectory *, const reco::Track *> ConstTrajTrackPair;
46  typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
47 
50 
52  virtual ~AlignmentMonitorBase() {}
53 
56 
58  void startingNewLoop();
59 
61  void duringLoop(const edm::Event &iEvent,
62  const edm::EventSetup &iSetup,
63  const ConstTrajTrackPairCollection &iTrajTracks);
64 
66  void endOfLoop();
67 
69  void endOfJob() {}
70 
72 
74  virtual void book() = 0;
75 
77  virtual void event(const edm::Event &iEvent,
78  const edm::EventSetup &iSetup,
79  const ConstTrajTrackPairCollection &iTrajTracks) {}
80 
83  virtual void afterAlignment() {}
84 
85 protected:
89  TH1F *book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX);
90  TProfile *bookProfile(std::string dir,
93  int nchX,
94  double lowX,
95  double highX,
96  int nchY = 1,
97  double lowY = 0.,
98  double highY = 0.,
99  const char *option = "s");
100  TH2F *book2D(std::string dir,
103  int nchX,
104  double lowX,
105  double highX,
106  int nchY,
107  double lowY,
108  double highY);
110 
111  int iteration() { return m_iteration; }
113  AlignableMuon *pMuon() { return mp_muon; }
116 
118 
119 public:
120  AlignmentMonitorBase(const AlignmentMonitorBase &) = delete; // stop default
121  const AlignmentMonitorBase &operator=(const AlignmentMonitorBase &) = delete; // stop default
122 
123 private:
124  // ---------- member data --------------------------------
125 
131 
132  std::map<std::vector<std::string>, TFileDirectory *> m_baseDirMap, m_iterDirMap;
133 };
134 
135 /*** Global typedefs ***/
136 using AlignmentMonitors = std::vector<std::unique_ptr<AlignmentMonitorBase> >;
137 
138 #endif
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
AlignableNavigator * pNavigator()
AlignmentParameterStore * pStore()
std::map< std::vector< std::string >, TFileDirectory * > m_baseDirMap
tuple cfg
Definition: looper.py:296
std::map< std::vector< std::string >, TFileDirectory * > m_iterDirMap
AlignmentMonitorBase(const edm::ParameterSet &cfg, const edm::ConsumesCollector &iC, std::string name)
Constructor.
virtual void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
Called for each event (by &quot;run()&quot;): may be reimplemented.
TH2F * book2D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
AlignmentParameterStore * mp_store
std::vector< std::unique_ptr< AlignmentMonitorBase > > AlignmentMonitors
AlignableTracker * pTracker()
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")
TFileDirectory * directory(std::string dir)
int iEvent
Definition: GenABIO.cc:224
virtual ~AlignmentMonitorBase()
Destructor.
void endOfJob()
Called at end of processing: don&#39;t implement.
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
const edm::InputTag m_beamSpotTag
TH1F * book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX)
AlignableTracker * mp_tracker
void beginOfJob(AlignableTracker *pTracker, AlignableMuon *pMuon, AlignmentParameterStore *pStore)
Called at beginning of job: don&#39;t reimplement.
virtual void afterAlignment()
AlignableNavigator * mp_navigator
const AlignmentMonitorBase & operator=(const AlignmentMonitorBase &)=delete
void startingNewLoop()
Called at beginning of loop: don&#39;t reimplement.
void duringLoop(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
Called for each event: don&#39;t reimplement.
virtual void book()=0
Book or retrieve histograms; MUST be reimplemented.
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38
void endOfLoop()
Called at end of loop: don&#39;t reimplement.