CMS 3D CMS Logo

CTPPSRPAlignmentInfoReader.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 #include <iostream>
11 
16 
17 using namespace std;
18 
20 public:
21 
24 
26  iov_(iConfig.getParameter<unsigned long long>("iov")),
27  record_(iConfig.getParameter<string>("record"))
28  {}
29  explicit CTPPSRPAlignmentInfoReader(int i) {}
31  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
32  void printInfo(const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event& event);
33 };
34 
35 
36 void
38 
39  using namespace edm;
40 
41 
42  //this part gets the handle of the event source and the record (i.e. the Database)
43  if (e.id().run() == iov_){
45  if(strcmp(record_.c_str(),"CTPPSRPAlignmentCorrectionsDataRcd")==0){
46  context.get<CTPPSRPAlignmentCorrectionsDataRcd>().get(alignments);
47  }
48  else if(strcmp(record_.c_str(),"RPRealAlignmentRecord")==0){
49  context.get<RPRealAlignmentRecord>().get(alignments);
50  }
51  else {
52  context.get<RPMisalignedAlignmentRecord>().get(alignments);
53  }
54 
55 
56  //std::cout
57  edm::LogPrint("CTPPSRPAlignmentInfoReader")<< "New alignments found in run="
58  << e.id().run() << ", event=" << e.id().event() << ":\n"
59  << *alignments;
60  }
61 
62 }
63 
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
void analyze(const edm::Event &e, const edm::EventSetup &c) override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
CTPPSRPAlignmentInfoReader(edm::ParameterSet const &iConfig)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned long long Time_t
Definition: Time.h:16
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
T get() const
Definition: EventSetup.h:71
def printInfo(self, event)
Definition: event.py:1