CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
AlignmentMonitorBase Class Referenceabstract

#include <Alignment/CommonAlignmentMonitor/interface/AlignmentMonitorBase.h>

Inheritance diagram for AlignmentMonitorBase:
AlignmentMonitorGeneric AlignmentMonitorMuonResiduals AlignmentMonitorMuonSystemMap1D AlignmentMonitorMuonVsCurvature AlignmentMonitorSegmentDifferences AlignmentMonitorSurvey AlignmentMonitorTemplate AlignmentMonitorTracksFromTrajectories

Public Types

typedef std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
 
typedef std::vector< ConstTrajTrackPairConstTrajTrackPairCollection
 

Public Member Functions

virtual void afterAlignment ()
 
 AlignmentMonitorBase (const edm::ParameterSet &cfg, std::string name)
 Constructor. More...
 
void beginOfJob (AlignableTracker *pTracker, AlignableMuon *pMuon, AlignmentParameterStore *pStore)
 Called at beginning of job: don't reimplement. More...
 
virtual void book ()=0
 Book or retrieve histograms; MUST be reimplemented. More...
 
void duringLoop (const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
 Called for each event: don't reimplement. More...
 
void endOfJob ()
 Called at end of processing: don't implement. More...
 
void endOfLoop ()
 Called at end of loop: don't reimplement. More...
 
virtual void event (const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
 Called for each event (by "run()"): may be reimplemented. More...
 
void startingNewLoop ()
 Called at beginning of loop: don't reimplement. More...
 
virtual ~AlignmentMonitorBase ()
 Destructor. More...
 

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")
 
TFileDirectorydirectory (std::string dir)
 
int iteration ()
 
AlignableMuonpMuon ()
 
AlignableNavigatorpNavigator ()
 
AlignmentParameterStorepStore ()
 
AlignableTrackerpTracker ()
 

Protected Attributes

const edm::InputTag m_beamSpotTag
 

Private Member Functions

 AlignmentMonitorBase (const AlignmentMonitorBase &)=delete
 
const AlignmentMonitorBaseoperator= (const AlignmentMonitorBase &)=delete
 

Private Attributes

std::map< std::vector< std::string >, TFileDirectory * > m_baseDirMap
 
int m_iteration
 
std::map< std::vector< std::string >, TFileDirectory * > m_iterDirMap
 
AlignableMuonmp_muon
 
AlignableNavigatormp_navigator
 
AlignmentParameterStoremp_store
 
AlignableTrackermp_tracker
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 42 of file AlignmentMonitorBase.h.

Member Typedef Documentation

◆ ConstTrajTrackPair

Definition at line 44 of file AlignmentMonitorBase.h.

◆ ConstTrajTrackPairCollection

Definition at line 45 of file AlignmentMonitorBase.h.

Constructor & Destructor Documentation

◆ AlignmentMonitorBase() [1/2]

AlignmentMonitorBase::AlignmentMonitorBase ( const edm::ParameterSet cfg,
std::string  name 
)

Constructor.

Definition at line 20 of file AlignmentMonitorBase.cc.

21  : m_beamSpotTag(cfg.getUntrackedParameter<edm::InputTag>("beamSpotTag", edm::InputTag("offlineBeamSpot"))),
22  m_iteration(0),
23  mp_tracker(nullptr),
24  mp_muon(nullptr),
25  mp_store(nullptr) {
26  edm::Service<TFileService> tFileService;
27  m_baseDirMap[std::vector<std::string>()] = new TFileDirectory(tFileService->mkdir(name));
28 }

References m_baseDirMap, TFileService::mkdir(), and Skims_PA_cff::name.

◆ ~AlignmentMonitorBase()

virtual AlignmentMonitorBase::~AlignmentMonitorBase ( )
inlinevirtual

Destructor.

Definition at line 51 of file AlignmentMonitorBase.h.

51 {}

◆ AlignmentMonitorBase() [2/2]

AlignmentMonitorBase::AlignmentMonitorBase ( const AlignmentMonitorBase )
privatedelete

Member Function Documentation

◆ afterAlignment()

virtual void AlignmentMonitorBase::afterAlignment ( )
inlinevirtual

Called after updating AlignableTracker and AlignableMuon (by "endOfLoop()"): may be reimplemented

Reimplemented in AlignmentMonitorMuonSystemMap1D, AlignmentMonitorMuonResiduals, AlignmentMonitorTemplate, and AlignmentMonitorTracksFromTrajectories.

Definition at line 82 of file AlignmentMonitorBase.h.

82 {}

Referenced by endOfLoop().

◆ beginOfJob()

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.

32  {
34  mp_muon = pMuon;
35  mp_store = pStore;
36 
37  if (!pMuon)
39  else if (!pTracker)
41  else
43 }

References mp_muon, mp_navigator, mp_store, mp_tracker, pMuon(), pStore(), and pTracker().

◆ book()

virtual void AlignmentMonitorBase::book ( )
pure virtual

◆ book1D()

TH1F * AlignmentMonitorBase::book1D ( std::string  dir,
std::string  name,
std::string  title,
int  nchX,
double  lowX,
double  highX 
)
protected

◆ book2D()

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 129 of file AlignmentMonitorBase.cc.

137  {
138  return directory(dir)->make<TH2F>(name.c_str(), title.c_str(), nchX, lowX, highX, nchY, lowY, highY);
139 }

References DeadROC_duringRun::dir, directory(), TFileDirectory::make(), Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by AlignmentMonitorMuonVsCurvature::book(), and AlignmentMonitorMuonSystemMap1D::MuonSystemMapPlot1D::MuonSystemMapPlot1D().

◆ bookProfile()

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 112 of file AlignmentMonitorBase.cc.

121  {
122  if (lowY == highY) {
123  return directory(dir)->make<TProfile>(name.c_str(), title.c_str(), nchX, lowX, highX, option);
124  } else {
125  return directory(dir)->make<TProfile>(name.c_str(), title.c_str(), nchX, lowX, highX, lowY, highY, option);
126  }
127 }

References DeadROC_duringRun::dir, directory(), TFileDirectory::make(), Skims_PA_cff::name, fileinputsource_cfi::option, and runGCPTkAlMap::title.

Referenced by AlignmentMonitorMuonVsCurvature::book(), and AlignmentMonitorSegmentDifferences::book().

◆ directory()

TFileDirectory * AlignmentMonitorBase::directory ( std::string  dir)
protected

Definition at line 71 of file AlignmentMonitorBase.cc.

71  {
72  std::string::size_type lastPos = dir.find_first_not_of('/', 0);
73  std::string::size_type pos = dir.find_first_of('/', lastPos);
74  std::vector<std::string> dirs;
75 
76  bool isIter = false;
77  if (dir.substr(lastPos, pos - lastPos) == std::string("iterN")) {
78  isIter = true;
79  lastPos = dir.find_first_not_of('/', pos);
80  pos = dir.find_first_of('/', lastPos);
81  }
82 
83  while (std::string::npos != pos || std::string::npos != lastPos) {
84  dirs.push_back(dir.substr(lastPos, pos - lastPos));
85  lastPos = dir.find_first_not_of('/', pos);
86  pos = dir.find_first_of('/', lastPos);
87  }
88 
89  std::map<std::vector<std::string>, TFileDirectory *> *theMap;
90  if (isIter)
91  theMap = &m_iterDirMap;
92  else
93  theMap = &m_baseDirMap;
94 
95  std::vector<std::string> partial;
96  TFileDirectory *last = (*theMap)[partial];
97  for (unsigned int i = 0; i < dirs.size(); i++) {
98  partial.push_back(dirs[i]);
99  if (theMap->find(partial) == theMap->end()) {
100  (*theMap)[partial] = new TFileDirectory(last->mkdir(dirs[i]));
101  }
102  last = (*theMap)[partial];
103  }
104  return last;
105 }

References DeadROC_duringRun::dir, heppy_check::dirs, mps_fire::i, dqmdumpme::last, m_baseDirMap, m_iterDirMap, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by AlignmentMonitorSurvey::book(), AlignmentMonitorMuonResiduals::book(), book1D(), book2D(), and bookProfile().

◆ duringLoop()

void AlignmentMonitorBase::duringLoop ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const ConstTrajTrackPairCollection iTrajTracks 
)

Called for each event: don't reimplement.

Definition at line 63 of file AlignmentMonitorBase.cc.

65  {
66  event(iEvent, iSetup, iTrajTracks);
67 }

References event(), and iEvent.

◆ endOfJob()

void AlignmentMonitorBase::endOfJob ( )
inline

Called at end of processing: don't implement.

Definition at line 68 of file AlignmentMonitorBase.h.

68 {}

◆ endOfLoop()

void AlignmentMonitorBase::endOfLoop ( )

Called at end of loop: don't reimplement.

Definition at line 69 of file AlignmentMonitorBase.cc.

69 { afterAlignment(); }

References afterAlignment().

◆ event()

virtual void AlignmentMonitorBase::event ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const ConstTrajTrackPairCollection iTrajTracks 
)
inlinevirtual

◆ iteration()

int AlignmentMonitorBase::iteration ( )
inlineprotected

◆ operator=()

const AlignmentMonitorBase& AlignmentMonitorBase::operator= ( const AlignmentMonitorBase )
privatedelete

◆ pMuon()

AlignableMuon* AlignmentMonitorBase::pMuon ( )
inlineprotected

◆ pNavigator()

AlignableNavigator* AlignmentMonitorBase::pNavigator ( )
inlineprotected

◆ pStore()

AlignmentParameterStore* AlignmentMonitorBase::pStore ( )
inlineprotected

◆ pTracker()

AlignableTracker* AlignmentMonitorBase::pTracker ( )
inlineprotected

Definition at line 111 of file AlignmentMonitorBase.h.

111 { return mp_tracker; }

References mp_tracker.

Referenced by beginOfJob(), AlignmentMonitorSurvey::book(), and AlignmentMonitorGeneric::book().

◆ startingNewLoop()

void AlignmentMonitorBase::startingNewLoop ( )

Called at beginning of loop: don't reimplement.

Definition at line 45 of file AlignmentMonitorBase.cc.

45  {
46  m_iteration++;
47 
48  for (std::map<std::vector<std::string>, TFileDirectory *>::const_iterator i = m_iterDirMap.begin();
49  i != m_iterDirMap.end();
50  ++i) {
51  delete i->second;
52  }
53  m_iterDirMap.clear();
54 
55  std::ostringstream dirName;
56  dirName << "iter" << iteration();
57  m_iterDirMap[std::vector<std::string>()] =
58  new TFileDirectory(m_baseDirMap[std::vector<std::string>()]->mkdir(dirName.str()));
59 
60  book();
61 }

References book(), TrackerOfflineValidation_Dqm_cff::dirName, mps_fire::i, iteration(), m_baseDirMap, m_iteration, m_iterDirMap, genParticles_cff::map, and eostools::mkdir().

Member Data Documentation

◆ m_baseDirMap

std::map<std::vector<std::string>, TFileDirectory *> AlignmentMonitorBase::m_baseDirMap
private

Definition at line 130 of file AlignmentMonitorBase.h.

Referenced by AlignmentMonitorBase(), directory(), and startingNewLoop().

◆ m_beamSpotTag

const edm::InputTag AlignmentMonitorBase::m_beamSpotTag
protected

◆ m_iteration

int AlignmentMonitorBase::m_iteration
private

Definition at line 124 of file AlignmentMonitorBase.h.

Referenced by iteration(), and startingNewLoop().

◆ m_iterDirMap

std::map<std::vector<std::string>, TFileDirectory *> AlignmentMonitorBase::m_iterDirMap
private

Definition at line 130 of file AlignmentMonitorBase.h.

Referenced by directory(), and startingNewLoop().

◆ mp_muon

AlignableMuon* AlignmentMonitorBase::mp_muon
private

Definition at line 126 of file AlignmentMonitorBase.h.

Referenced by beginOfJob(), and pMuon().

◆ mp_navigator

AlignableNavigator* AlignmentMonitorBase::mp_navigator
private

Definition at line 128 of file AlignmentMonitorBase.h.

Referenced by beginOfJob(), and pNavigator().

◆ mp_store

AlignmentParameterStore* AlignmentMonitorBase::mp_store
private

Definition at line 127 of file AlignmentMonitorBase.h.

Referenced by beginOfJob(), and pStore().

◆ mp_tracker

AlignableTracker* AlignmentMonitorBase::mp_tracker
private

Definition at line 125 of file AlignmentMonitorBase.h.

Referenced by beginOfJob(), and pTracker().

runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
AlignmentMonitorBase::mp_tracker
AlignableTracker * mp_tracker
Definition: AlignmentMonitorBase.h:125
mps_fire.i
i
Definition: mps_fire.py:428
AlignmentMonitorBase::mp_navigator
AlignableNavigator * mp_navigator
Definition: AlignmentMonitorBase.h:128
AlignmentMonitorBase::pTracker
AlignableTracker * pTracker()
Definition: AlignmentMonitorBase.h:111
heppy_check.dirs
dirs
Definition: heppy_check.py:26
TFileDirectory::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileDirectory.h:53
AlignmentMonitorBase::directory
TFileDirectory * directory(std::string dir)
Definition: AlignmentMonitorBase.cc:71
pos
Definition: PixelAliasList.h:18
AlignmentMonitorBase::pStore
AlignmentParameterStore * pStore()
Definition: AlignmentMonitorBase.h:113
AlignmentMonitorBase::event
virtual void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks)
Called for each event (by "run()"): may be reimplemented.
Definition: AlignmentMonitorBase.h:76
AlignmentMonitorBase::afterAlignment
virtual void afterAlignment()
Definition: AlignmentMonitorBase.h:82
AlignmentMonitorBase::m_iteration
int m_iteration
Definition: AlignmentMonitorBase.h:124
TFileDirectory
Definition: TFileDirectory.h:24
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
AlignmentMonitorBase::mp_store
AlignmentParameterStore * mp_store
Definition: AlignmentMonitorBase.h:127
dqmdumpme.last
last
Definition: dqmdumpme.py:56
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
eostools.mkdir
def mkdir(path)
Definition: eostools.py:251
AlignableNavigator
Definition: AlignableNavigator.h:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AlignmentMonitorBase::m_baseDirMap
std::map< std::vector< std::string >, TFileDirectory * > m_baseDirMap
Definition: AlignmentMonitorBase.h:130
TFileService::mkdir
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
edm::Service< TFileService >
iEvent
int iEvent
Definition: GenABIO.cc:224
AlignmentMonitorBase::m_beamSpotTag
const edm::InputTag m_beamSpotTag
Definition: AlignmentMonitorBase.h:116
AlignmentMonitorBase::mp_muon
AlignableMuon * mp_muon
Definition: AlignmentMonitorBase.h:126
AlignmentMonitorBase::book
virtual void book()=0
Book or retrieve histograms; MUST be reimplemented.
looper.cfg
cfg
Definition: looper.py:297
AlignmentMonitorBase::iteration
int iteration()
Definition: AlignmentMonitorBase.h:110
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
genParticles_cff.map
map
Definition: genParticles_cff.py:11
AlignmentMonitorBase::m_iterDirMap
std::map< std::vector< std::string >, TFileDirectory * > m_iterDirMap
Definition: AlignmentMonitorBase.h:130
AlignmentMonitorBase::pMuon
AlignableMuon * pMuon()
Definition: AlignmentMonitorBase.h:112
edm::InputTag
Definition: InputTag.h:15
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23