CMS 3D CMS Logo

CTPPSAlignmentInfo.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * Authors:
4 * Jan Kašpar (jan.kaspar@gmail.com)
5 *
6 ****************************************************************************/
7 
16 
19 
21 
22 //----------------------------------------------------------------------------------------------------
23 
28 public:
29  explicit CTPPSAlignmentInfo(const edm::ParameterSet&);
30 
31 private:
33 
36 
37  void analyze(const edm::Event&, const edm::EventSetup&) override;
38 
39  void printInfo(const CTPPSRPAlignmentCorrectionsData& alignments, const edm::Event& event) const;
40 };
41 
42 //----------------------------------------------------------------------------------------------------
43 //----------------------------------------------------------------------------------------------------
44 
45 using namespace std;
46 using namespace edm;
47 
48 //----------------------------------------------------------------------------------------------------
49 
51  : alignmentType_(iConfig.getUntrackedParameter<std::string>("alignmentType", "real")) {}
52 
53 //----------------------------------------------------------------------------------------------------
54 
57 
58  if (alignmentType_ == "real") {
59  if (watcherRealAlignments_.check(iSetup)) {
60  iSetup.get<RPRealAlignmentRecord>().get(alignments);
61  printInfo(*alignments, iEvent);
62  }
63  return;
64  }
65 
66  else if (alignmentType_ == "misaligned") {
67  if (watcherMisalignedAlignments_.check(iSetup)) {
68  iSetup.get<RPMisalignedAlignmentRecord>().get(alignments);
69  printInfo(*alignments, iEvent);
70  }
71  return;
72  }
73 
74  throw cms::Exception("CTPPSAlignmentInfo") << "Unknown geometry type: `" << alignmentType_ << "'.";
75 }
76 
77 //----------------------------------------------------------------------------------------------------
78 
80  time_t unixTime = event.time().unixTime();
81  char timeStr[50];
82  strftime(timeStr, 50, "%F %T", localtime(&unixTime));
83 
84  edm::LogInfo("CTPPSAlignmentInfo") << "New " << alignmentType_ << " alignments found in run=" << event.id().run()
85  << ", event=" << event.id().event() << ", UNIX timestamp=" << unixTime << " ("
86  << timeStr << "):\n"
87  << alignments;
88 }
89 
90 //----------------------------------------------------------------------------------------------------
91 
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
EDAnalyzer.h
edm::ESWatcher< RPRealAlignmentRecord >
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
CTPPSAlignmentInfo::alignmentType_
std::string alignmentType_
Definition: CTPPSAlignmentInfo.cc:35
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
RPMisalignedAlignmentRecord
Definition: RPMisalignedAlignmentRecord.h:6
CTPPSAlignmentInfo::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CTPPSAlignmentInfo.cc:54
RPMisalignedAlignmentRecord.h
MakerMacros.h
RPRealAlignmentRecord
Definition: RPRealAlignmentRecord.h:6
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
RPRealAlignmentRecord.h
edm::ESHandle
Definition: DTSurvey.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
CTPPSAlignmentInfo
Class to print out information on current geometry.
Definition: CTPPSAlignmentInfo.cc:26
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
std
Definition: JetResolutionObject.h:76
CTPPSAlignmentInfo::CTPPSAlignmentInfo
CTPPSAlignmentInfo(const edm::ParameterSet &)
Definition: CTPPSAlignmentInfo.cc:49
ESWatcher.h
Exception
Definition: hltDiff.cc:246
CTPPSRPAlignmentCorrectionsData
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
Definition: CTPPSRPAlignmentCorrectionsData.h:24
EventSetup.h
Exception.h
CTPPSRPAlignmentCorrectionsData.h
CTPPSAlignmentInfo::watcherMisalignedAlignments_
edm::ESWatcher< RPMisalignedAlignmentRecord > watcherMisalignedAlignments_
Definition: CTPPSAlignmentInfo.cc:38
ParameterSet.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
CTPPSAlignmentInfo::printInfo
void printInfo(const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event &event) const
Definition: CTPPSAlignmentInfo.cc:78
CTPPSAlignmentInfo::watcherRealAlignments_
edm::ESWatcher< RPRealAlignmentRecord > watcherRealAlignments_
Definition: CTPPSAlignmentInfo.cc:37