CMS 3D CMS Logo

WriteCTPPSPixelDAQMapping.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * Offline analyzer for writing CTPPS DAQ Mapping sqlite file
4 * H. Malbouisson
5 * based on TOTEM code from Jan Kašpar (jan.kaspar@gmail.com)
6 *
7 ****************************************************************************/
8 
9 
17 
20 
23 
28 
29 #include <stdint.h>
30 
31 //----------------------------------------------------------------------------------------------------
32 
37 {
38  public:
41 
42  private:
43  virtual void analyze(const edm::Event &e, const edm::EventSetup &es) override;
47 };
48 
49 using namespace std;
50 using namespace edm;
51 
52 //----------------------------------------------------------------------------------------------------
53 
55 daqmappingiov_(ps.getParameter<unsigned long long>("daqmappingiov")),
56 record_(ps.getParameter<string>("record")),
57 label_(ps.getParameter<string>("label"))
58 {}
59 
60 
62 {
63 
64  // get DAQ mapping
66  es.get<CTPPSPixelDAQMappingRcd>().get(label_, mapping);
67 
68  // print mapping
69  /*printf("* DAQ mapping\n");
70  for (const auto &p : mapping->ROCMapping)
71  cout << " " << p.first << " -> " << p.second << endl;
72  */
73 
74  // Write DAQ Mapping to sqlite file:
75  const CTPPSPixelDAQMapping* pCTPPSPixelDAQMapping = mapping.product(); // DAQ Mapping
77  if( poolDbService.isAvailable() ){
78  poolDbService->writeOne( pCTPPSPixelDAQMapping, daqmappingiov_, /*m_record*/ record_ );
79  }
80 
81 
82 }
83 
84 //----------------------------------------------------------------------------------------------------
85 
Prints the DAQ mapping loaded by TotemDAQMappingESSourceXML.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void analyze(const edm::Event &e, const edm::EventSetup &es) override
unsigned long long Time_t
Definition: Time.h:16
bool isAvailable() const
Definition: Service.h:46
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
const T & get() const
Definition: EventSetup.h:55
HLT enums.
WriteCTPPSPixelDAQMapping(const edm::ParameterSet &ps)
T const * product() const
Definition: ESHandle.h:86
The mapping between FramePosition and ROCInfo.