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 ( const edm::ParameterSet cfg)

Definition at line 7 of file AlignmentMonitorSurvey.cc.

7  :
8  AlignmentMonitorBase(cfg, "AlignmentMonitorSurvey"),
9  levelNames_(cfg.getUntrackedParameter<std::vector<std::string> >("surveyResiduals"))
10 {
11 }
T getUntrackedParameter(std::string const &, T const &) const
AlignmentMonitorBase(const edm::ParameterSet &cfg, std::string name)
Constructor.
std::vector< std::string > levelNames_

Member Function Documentation

void AlignmentMonitorSurvey::book ( )
overridevirtual

Book or retrieve histograms; MUST be reimplemented.

Implements AlignmentMonitorBase.

Definition at line 13 of file AlignmentMonitorSurvey.cc.

References AlignmentParameterStore::alignables(), Vispa.Plugins.EdmBrowser.EdmDataAccessor::all(), AlignableObjectId::commonObjectIdProvider(), DEFINE_EDM_PLUGIN, AlignmentMonitorBase::directory(), mps_fire::i, triggerObjects_cff::id, Alignable::id(), checklumidiff::l, hcalDigis_cfi::level, fwlog::levelName(), levelNames_, TFileDirectory::make(), AlignmentMonitorBase::pMuon(), AlignmentMonitorBase::pStore(), AlignmentMonitorBase::pTracker(), SurveyResidual::sensorResidual(), and theLevels.

14 {
15  align::ID id;
17 
18  // fill 'theLevels' only once (and only if necessary)
19  if (theLevels.empty() && !levelNames_.empty()) {
20  auto alignableObjectId =
22  for (const auto& levelName: levelNames_) {
23  theLevels.push_back(alignableObjectId.stringToId(levelName));
24  }
25  }
26 
27  double par[6]; // survey residual
28 
29  TTree* tree = directory("/iterN/")->make<TTree>("survey", "");
30 
31  tree->Branch("id" , &id , "id/i");
32  tree->Branch("level", &level, "level/I");
33  tree->Branch("par" , &par , "par[6]/D");
34 
35  const align::Alignables& all = pStore()->alignables();
36 
37  const unsigned int nAlignable = all.size();
38 
39  for (unsigned int i = 0; i < nAlignable; ++i)
40  {
41  const Alignable* ali = all[i];
42 
43  id = ali->id();
44 
45  for (unsigned int l = 0; l < theLevels.size(); ++l)
46  {
47  level = theLevels[l];
48 
49  SurveyResidual resid(*ali, level, true);
50  AlgebraicVector resParams = resid.sensorResidual();
51 
52  par[0] = resParams[0];
53  par[1] = resParams[1];
54  par[2] = resParams[2];
55  par[3] = resParams[3];
56  par[4] = resParams[4];
57  par[5] = resParams[5];
58 
59  tree->Fill();
60  }
61  }
62 }
AlignableMuon * pMuon()
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:189
AlignmentParameterStore * pStore()
std::vector< align::StructureType > theLevels
static AlignableObjectId commonObjectIdProvider(const AlignableObjectId &, const AlignableObjectId &)
uint32_t ID
Definition: Definitions.h:26
AlignableTracker * pTracker()
TFileDirectory * directory(std::string dir)
T * make(const Args &...args) const
make new ROOT object
const char * levelName(LogLevel)
Definition: fwLog.cc:34
CLHEP::HepVector AlgebraicVector
std::vector< std::string > levelNames_
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
Definition: tree.py:1
const align::Alignables & alignables(void) const
get all alignables
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 30 of file AlignmentMonitorSurvey.h.

Referenced by Types.EventID::cppID().

32  {}

Member Data Documentation

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

Definition at line 35 of file AlignmentMonitorSurvey.h.

Referenced by book().

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

Definition at line 37 of file AlignmentMonitorSurvey.h.

Referenced by book().