CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
AlignmentMonitorSurvey Class Reference

#include <AlignmentMonitorSurvey.h>

Inheritance diagram for AlignmentMonitorSurvey:
AlignmentMonitorBase

Public Member Functions

 AlignmentMonitorSurvey (const edm::ParameterSet &)
 
void book () override
 Book or retrieve histograms; MUST be reimplemented. More...
 
void event (const edm::Event &, const edm::EventSetup &, const ConstTrajTrackPairCollection &) override
 Called for each event (by "run()"): may be reimplemented. More...
 
- Public Member Functions inherited from AlignmentMonitorBase
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...
 
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...
 
void startingNewLoop ()
 Called at beginning of loop: don't reimplement. More...
 
virtual ~AlignmentMonitorBase ()
 Destructor. More...
 

Private Attributes

std::vector< std::string > levelNames_
 
std::vector< align::StructureTypetheLevels
 

Additional Inherited Members

- Public Types inherited from AlignmentMonitorBase
typedef std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
 
typedef std::vector< ConstTrajTrackPairConstTrajTrackPairCollection
 
- Protected Member Functions inherited from AlignmentMonitorBase
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 inherited from AlignmentMonitorBase
const edm::InputTag m_beamSpotTag
 

Detailed Description

Definition at line 21 of file AlignmentMonitorSurvey.h.

Constructor & Destructor Documentation

◆ AlignmentMonitorSurvey()

AlignmentMonitorSurvey::AlignmentMonitorSurvey ( const edm::ParameterSet cfg)

Definition at line 7 of file AlignmentMonitorSurvey.cc.

8  : AlignmentMonitorBase(cfg, "AlignmentMonitorSurvey"),
9  levelNames_(cfg.getUntrackedParameter<std::vector<std::string> >("surveyResiduals")) {}

Member Function Documentation

◆ book()

void AlignmentMonitorSurvey::book ( )
overridevirtual

Book or retrieve histograms; MUST be reimplemented.

Implements AlignmentMonitorBase.

Definition at line 11 of file AlignmentMonitorSurvey.cc.

11  {
12  align::ID id;
14 
15  // fill 'theLevels' only once (and only if necessary)
16  if (theLevels.empty() && !levelNames_.empty()) {
17  auto alignableObjectId = AlignableObjectId::commonObjectIdProvider(pTracker(), pMuon());
18  for (const auto& levelName : levelNames_) {
19  theLevels.push_back(alignableObjectId.stringToId(levelName));
20  }
21  }
22 
23  double par[6]; // survey residual
24 
25  TTree* tree = directory("/iterN/")->make<TTree>("survey", "");
26 
27  tree->Branch("id", &id, "id/i");
28  tree->Branch("level", &level, "level/I");
29  tree->Branch("par", &par, "par[6]/D");
30 
31  const align::Alignables& all = pStore()->alignables();
32 
33  const unsigned int nAlignable = all.size();
34 
35  for (unsigned int i = 0; i < nAlignable; ++i) {
36  const Alignable* ali = all[i];
37 
38  id = ali->id();
39 
40  for (unsigned int l = 0; l < theLevels.size(); ++l) {
41  level = theLevels[l];
42 
43  SurveyResidual resid(*ali, level, true);
44  AlgebraicVector resParams = resid.sensorResidual();
45 
46  par[0] = resParams[0];
47  par[1] = resParams[1];
48  par[2] = resParams[2];
49  par[3] = resParams[3];
50  par[4] = resParams[4];
51  par[5] = resParams[5];
52 
53  tree->Fill();
54  }
55  }
56 }

References AlignmentParameterStore::alignables(), python.cmstools::all(), AlignableObjectId::commonObjectIdProvider(), AlignmentMonitorBase::directory(), mps_fire::i, triggerObjects_cff::id, Alignable::id(), cmsLHEtoEOSManager::l, personalPlayback::level, fwlog::levelName(), levelNames_, TFileDirectory::make(), AlignmentMonitorBase::pMuon(), AlignmentMonitorBase::pStore(), AlignmentMonitorBase::pTracker(), SurveyResidual::sensorResidual(), and theLevels.

◆ event()

void AlignmentMonitorSurvey::event ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const ConstTrajTrackPairCollection iTrajTracks 
)
inlineoverridevirtual

Called for each event (by "run()"): may be reimplemented.

Reimplemented from AlignmentMonitorBase.

Definition at line 27 of file AlignmentMonitorSurvey.h.

27 {}

Referenced by Types.EventID::cppID().

Member Data Documentation

◆ levelNames_

std::vector<std::string> AlignmentMonitorSurvey::levelNames_
private

Definition at line 30 of file AlignmentMonitorSurvey.h.

Referenced by book().

◆ theLevels

std::vector<align::StructureType> AlignmentMonitorSurvey::theLevels
private

Definition at line 32 of file AlignmentMonitorSurvey.h.

Referenced by book().

personalPlayback.level
level
Definition: personalPlayback.py:22
mps_fire.i
i
Definition: mps_fire.py:428
AlignmentMonitorBase::AlignmentMonitorBase
AlignmentMonitorBase(const edm::ParameterSet &cfg, std::string name)
Constructor.
Definition: AlignmentMonitorBase.cc:20
AlignmentParameterStore::alignables
const align::Alignables & alignables(void) const
get all alignables
Definition: AlignmentParameterStore.h:47
AlignmentMonitorBase::pTracker
AlignableTracker * pTracker()
Definition: AlignmentMonitorBase.h:111
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
tree
Definition: tree.py:1
Alignable
Definition: Alignable.h:27
AlignableObjectId::commonObjectIdProvider
static AlignableObjectId commonObjectIdProvider(const AlignableObjectId &, const AlignableObjectId &)
Definition: AlignableObjectId.cc:320
AlignmentMonitorBase::pStore
AlignmentParameterStore * pStore()
Definition: AlignmentMonitorBase.h:113
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
AlignmentMonitorSurvey::levelNames_
std::vector< std::string > levelNames_
Definition: AlignmentMonitorSurvey.h:30
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
align::StructureType
StructureType
Definition: StructureType.h:16
AlignmentMonitorSurvey::theLevels
std::vector< align::StructureType > theLevels
Definition: AlignmentMonitorSurvey.h:32
align::ID
uint32_t ID
Definition: Definitions.h:24
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
fwlog::levelName
const char * levelName(LogLevel)
Definition: fwLog.cc:32
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
looper.cfg
cfg
Definition: looper.py:297
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
SurveyResidual
Definition: SurveyResidual.h:22
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
AlignmentMonitorBase::pMuon
AlignableMuon * pMuon()
Definition: AlignmentMonitorBase.h:112