#include <Alignment/CommonAlignmentMonitor/interface/AlignmentMonitorBase.h>
Public Types | |
typedef std::pair< const Trajectory *, const reco::Track * > | ConstTrajTrackPair |
typedef std::vector < ConstTrajTrackPair > | ConstTrajTrackPairCollection |
Public Member Functions | |
virtual void | afterAlignment (const edm::EventSetup &iSetup) |
AlignmentMonitorBase (const edm::ParameterSet &cfg, std::string name) | |
Constructor. | |
void | beginOfJob (AlignableTracker *pTracker, AlignableMuon *pMuon, AlignmentParameterStore *pStore) |
Called at beginning of job: don't reimplement. | |
virtual void | book ()=0 |
Book or retrieve histograms; MUST be reimplemented. | |
void | duringLoop (const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) |
Called for each event: don't reimplement. | |
void | endOfJob () |
Called at end of processing: don't implement. | |
void | endOfLoop (const edm::EventSetup &iSetup) |
Called at end of loop: don't reimplement. | |
virtual void | event (const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) |
Called for each event (by "run()"): may be reimplemented. | |
void | startingNewLoop () |
Called at beginning of loop: don't reimplement. | |
virtual | ~AlignmentMonitorBase () |
Destructor. | |
Protected Member Functions | |
TH1F * | book1D (std::string dir, std::string name, std::string title, int nchX, double lowX, double highX) |
TH2F * | book2D (std::string dir, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY) |
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 | iteration () |
AlignableMuon * | pMuon () |
AlignableNavigator * | pNavigator () |
AlignmentParameterStore * | pStore () |
AlignableTracker * | pTracker () |
Protected Attributes | |
const edm::InputTag | m_beamSpotTag |
Private Member Functions | |
AlignmentMonitorBase (const AlignmentMonitorBase &) | |
const AlignmentMonitorBase & | operator= (const AlignmentMonitorBase &) |
Private Attributes | |
std::map< std::vector < std::string > , TFileDirectory * > | m_baseDirMap |
int | m_iteration |
std::map< std::vector < std::string > , TFileDirectory * > | m_iterDirMap |
AlignableMuon * | mp_muon |
AlignableNavigator * | mp_navigator |
AlignmentParameterStore * | mp_store |
AlignableTracker * | mp_tracker |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 42 of file AlignmentMonitorBase.h.
typedef std::pair<const Trajectory*, const reco::Track*> AlignmentMonitorBase::ConstTrajTrackPair |
Definition at line 45 of file AlignmentMonitorBase.h.
typedef std::vector<ConstTrajTrackPair> AlignmentMonitorBase::ConstTrajTrackPairCollection |
Definition at line 46 of file AlignmentMonitorBase.h.
AlignmentMonitorBase::AlignmentMonitorBase | ( | const edm::ParameterSet & | cfg, |
std::string | name | ||
) |
Constructor.
Definition at line 21 of file AlignmentMonitorBase.cc.
References m_baseDirMap.
: m_beamSpotTag(cfg.getUntrackedParameter<edm::InputTag>("beamSpotTag",edm::InputTag("offlineBeamSpot"))) , m_iteration(0), mp_tracker(0), mp_muon(0), mp_store(0) { edm::Service<TFileService> tFileService; m_baseDirMap[std::vector<std::string>()] = new TFileDirectory(tFileService->mkdir(name)); }
virtual AlignmentMonitorBase::~AlignmentMonitorBase | ( | ) | [inline, virtual] |
AlignmentMonitorBase::AlignmentMonitorBase | ( | const AlignmentMonitorBase & | ) | [private] |
virtual void AlignmentMonitorBase::afterAlignment | ( | const edm::EventSetup & | iSetup | ) | [inline, virtual] |
Called after updating AlignableTracker and AlignableMuon (by "endOfLoop()"): may be reimplemented
Reimplemented in AlignmentMonitorGeneric, AlignmentMonitorMuonResiduals, AlignmentMonitorMuonSystemMap1D, AlignmentMonitorMuonVsCurvature, AlignmentMonitorSegmentDifferences, AlignmentMonitorTemplate, and AlignmentMonitorTracksFromTrajectories.
Definition at line 79 of file AlignmentMonitorBase.h.
Referenced by endOfLoop().
{ }
void AlignmentMonitorBase::beginOfJob | ( | AlignableTracker * | pTracker, |
AlignableMuon * | pMuon, | ||
AlignmentParameterStore * | pStore | ||
) |
Called at beginning of job: don't reimplement.
Definition at line 30 of file AlignmentMonitorBase.cc.
References mp_muon, mp_navigator, mp_store, mp_tracker, pMuon(), pStore(), and pTracker().
{ mp_tracker = pTracker; mp_muon = pMuon; mp_store = pStore; if (!pMuon) mp_navigator = new AlignableNavigator(pTracker); else if (!pTracker) mp_navigator = new AlignableNavigator(pMuon); else mp_navigator = new AlignableNavigator(pTracker, pMuon); }
virtual void AlignmentMonitorBase::book | ( | ) | [pure virtual] |
Book or retrieve histograms; MUST be reimplemented.
Implemented in AlignmentMonitorGeneric, AlignmentMonitorMuonResiduals, AlignmentMonitorMuonSystemMap1D, AlignmentMonitorMuonVsCurvature, AlignmentMonitorSegmentDifferences, AlignmentMonitorSurvey, AlignmentMonitorTemplate, and AlignmentMonitorTracksFromTrajectories.
Referenced by startingNewLoop().
TH1F * AlignmentMonitorBase::book1D | ( | std::string | dir, |
std::string | name, | ||
std::string | title, | ||
int | nchX, | ||
double | lowX, | ||
double | highX | ||
) | [protected] |
Use this every time you book a histogram (so that AlignmentMonitorBase can find your histograms in a collector (parallel-processing) job)
Definition at line 107 of file AlignmentMonitorBase.cc.
References directory(), and TFileDirectory::make().
Referenced by AlignmentMonitorGeneric::book(), AlignmentMonitorMuonResiduals::book(), AlignmentMonitorTemplate::book(), AlignmentMonitorSegmentDifferences::book(), AlignmentMonitorTracksFromTrajectories::book(), AlignmentMonitorMuonVsCurvature::book(), and AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::MuonSystemMapPlot1D().
TH2F * AlignmentMonitorBase::book2D | ( | std::string | dir, |
std::string | name, | ||
std::string | title, | ||
int | nchX, | ||
double | lowX, | ||
double | highX, | ||
int | nchY, | ||
double | lowY, | ||
double | highY | ||
) | [protected] |
Definition at line 124 of file AlignmentMonitorBase.cc.
References directory(), and TFileDirectory::make().
Referenced by AlignmentMonitorMuonVsCurvature::book(), and AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::MuonSystemMapPlot1D().
TProfile * AlignmentMonitorBase::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" |
||
) | [protected] |
Definition at line 113 of file AlignmentMonitorBase.cc.
References directory(), and TFileDirectory::make().
Referenced by AlignmentMonitorSegmentDifferences::book(), and AlignmentMonitorMuonVsCurvature::book().
TFileDirectory * AlignmentMonitorBase::directory | ( | std::string | dir | ) | [protected] |
Definition at line 71 of file AlignmentMonitorBase.cc.
References i, prof2calltree::last, m_baseDirMap, m_iterDirMap, TFileDirectory::mkdir(), pos, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by AlignmentMonitorMuonResiduals::book(), AlignmentMonitorSurvey::book(), book1D(), book2D(), and bookProfile().
{ std::string::size_type lastPos = dir.find_first_not_of("/", 0); std::string::size_type pos = dir.find_first_of("/", lastPos); std::vector<std::string> dirs; bool isIter = false; if (dir.substr(lastPos, pos - lastPos) == std::string("iterN")) { isIter = true; lastPos = dir.find_first_not_of("/", pos); pos = dir.find_first_of("/", lastPos); } while (std::string::npos != pos || std::string::npos != lastPos) { dirs.push_back(dir.substr(lastPos, pos - lastPos)); lastPos = dir.find_first_not_of("/", pos); pos = dir.find_first_of("/", lastPos); } std::map<std::vector<std::string>, TFileDirectory*> *theMap; if (isIter) theMap = &m_iterDirMap; else theMap = &m_baseDirMap; std::vector<std::string> partial; TFileDirectory *last = (*theMap)[partial]; for (unsigned int i = 0; i < dirs.size(); i++) { partial.push_back(dirs[i]); if (theMap->find(partial) == theMap->end()) { (*theMap)[partial] = new TFileDirectory(last->mkdir(dirs[i])); } last = (*theMap)[partial]; } return last; }
void AlignmentMonitorBase::duringLoop | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup, | ||
const ConstTrajTrackPairCollection & | iTrajTracks | ||
) |
Called for each event: don't reimplement.
Definition at line 59 of file AlignmentMonitorBase.cc.
References event().
{ event(iEvent, iSetup, iTrajTracks); }
void AlignmentMonitorBase::endOfJob | ( | ) | [inline] |
Called at end of processing: don't implement.
Definition at line 67 of file AlignmentMonitorBase.h.
{}
void AlignmentMonitorBase::endOfLoop | ( | const edm::EventSetup & | iSetup | ) |
Called at end of loop: don't reimplement.
Definition at line 65 of file AlignmentMonitorBase.cc.
References afterAlignment().
{ afterAlignment(iSetup); }
virtual void AlignmentMonitorBase::event | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup, | ||
const ConstTrajTrackPairCollection & | iTrajTracks | ||
) | [inline, virtual] |
Called for each event (by "run()"): may be reimplemented.
Reimplemented in AlignmentMonitorGeneric, AlignmentMonitorMuonResiduals, AlignmentMonitorMuonSystemMap1D, AlignmentMonitorMuonVsCurvature, AlignmentMonitorSegmentDifferences, AlignmentMonitorSurvey, AlignmentMonitorTemplate, and AlignmentMonitorTracksFromTrajectories.
Definition at line 75 of file AlignmentMonitorBase.h.
Referenced by duringLoop().
{ }
int AlignmentMonitorBase::iteration | ( | ) | [inline, protected] |
Definition at line 90 of file AlignmentMonitorBase.h.
References m_iteration.
Referenced by AlignmentMonitorTemplate::afterAlignment(), AlignmentMonitorTemplate::event(), and startingNewLoop().
{ return m_iteration; }
const AlignmentMonitorBase& AlignmentMonitorBase::operator= | ( | const AlignmentMonitorBase & | ) | [private] |
AlignableMuon* AlignmentMonitorBase::pMuon | ( | ) | [inline, protected] |
Definition at line 92 of file AlignmentMonitorBase.h.
References mp_muon.
Referenced by AlignmentMonitorMuonResiduals::afterAlignment(), beginOfJob(), and AlignmentMonitorMuonResiduals::book().
{ return mp_muon; }
AlignableNavigator* AlignmentMonitorBase::pNavigator | ( | ) | [inline, protected] |
Definition at line 94 of file AlignmentMonitorBase.h.
References mp_navigator.
Referenced by AlignmentMonitorSegmentDifferences::event(), AlignmentMonitorTemplate::event(), AlignmentMonitorMuonResiduals::event(), AlignmentMonitorMuonVsCurvature::event(), AlignmentMonitorMuonSystemMap1D::event(), and AlignmentMonitorGeneric::event().
{ return mp_navigator; }
AlignmentParameterStore* AlignmentMonitorBase::pStore | ( | ) | [inline, protected] |
Definition at line 93 of file AlignmentMonitorBase.h.
References mp_store.
Referenced by beginOfJob(), AlignmentMonitorGeneric::book(), AlignmentMonitorSurvey::book(), and AlignmentMonitorTemplate::book().
{ return mp_store; }
AlignableTracker* AlignmentMonitorBase::pTracker | ( | ) | [inline, protected] |
Definition at line 91 of file AlignmentMonitorBase.h.
References mp_tracker.
Referenced by beginOfJob().
{ return mp_tracker; }
void AlignmentMonitorBase::startingNewLoop | ( | ) |
Called at beginning of loop: don't reimplement.
Definition at line 42 of file AlignmentMonitorBase.cc.
References book(), TrackerOfflineValidation_Dqm_cff::dirName, i, iteration(), m_baseDirMap, m_iteration, m_iterDirMap, and Association::map.
{ m_iteration++; for (std::map<std::vector<std::string>, TFileDirectory*>::const_iterator i = m_iterDirMap.begin(); i != m_iterDirMap.end(); ++i) { delete i->second; } m_iterDirMap.clear(); std::ostringstream dirName; dirName << "iter" << iteration(); m_iterDirMap[std::vector<std::string>()] = new TFileDirectory(m_baseDirMap[std::vector<std::string>()]->mkdir(dirName.str())); book(); }
std::map<std::vector<std::string>, TFileDirectory*> AlignmentMonitorBase::m_baseDirMap [private] |
Definition at line 110 of file AlignmentMonitorBase.h.
Referenced by AlignmentMonitorBase(), directory(), and startingNewLoop().
const edm::InputTag AlignmentMonitorBase::m_beamSpotTag [protected] |
Definition at line 96 of file AlignmentMonitorBase.h.
Referenced by AlignmentMonitorSegmentDifferences::event(), AlignmentMonitorMuonVsCurvature::event(), and AlignmentMonitorMuonSystemMap1D::event().
int AlignmentMonitorBase::m_iteration [private] |
Definition at line 104 of file AlignmentMonitorBase.h.
Referenced by iteration(), and startingNewLoop().
std::map<std::vector<std::string>, TFileDirectory*> AlignmentMonitorBase::m_iterDirMap [private] |
Definition at line 110 of file AlignmentMonitorBase.h.
Referenced by directory(), and startingNewLoop().
AlignableMuon* AlignmentMonitorBase::mp_muon [private] |
Definition at line 106 of file AlignmentMonitorBase.h.
Referenced by beginOfJob(), and pMuon().
Definition at line 108 of file AlignmentMonitorBase.h.
Referenced by beginOfJob(), and pNavigator().
Definition at line 107 of file AlignmentMonitorBase.h.
Referenced by beginOfJob(), and pStore().
AlignableTracker* AlignmentMonitorBase::mp_tracker [private] |
Definition at line 105 of file AlignmentMonitorBase.h.
Referenced by beginOfJob(), and pTracker().