CMS 3D CMS Logo

SiPixelCalibConfigurationObjectMaker.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelCalibConfigurationObjectMaker
4 // Class: SiPixelCalibConfigurationObjectMaker
5 //
13 //
14 // Original Author: Freya Blekman
15 // Created: Wed Sep 19 13:43:52 CEST 2007
16 // $Id: SiPixelCalibConfigurationObjectMaker.cc,v 1.5 2009/10/21 15:53:31 heyburn Exp $
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
25 
27 
31 
34 #include <string>
35 //
36 // class decleration
37 //
38 
40 public:
43  void analyze(const edm::Event&, const edm::EventSetup&) override;
44 
45 private:
46  // ----------member data ---------------------------
48 };
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62  : inputfilename(iConfig.getUntrackedParameter<std::string>(
63  "inputFileName", "/afs/cern.ch/cms/Tracker/Pixel/forward/ryd/calib_070106d.dat"))
64 
65 {
66  //now do what ever initialization is needed
67  ::putenv((char*)"CORAL_AUTH_USER=testuser");
68  ::putenv((char*)"CORAL_AUTH_PASSWORD=test");
69 }
70 
72 
73 //
74 // member functions
75 //
76 
79  SiPixelCalibConfiguration myCalib(fancyCalib);
80 
81  std::string fixedmode = fancyCalib.mode();
82  std::string tobereplaced = "WithSLink";
83  edm::LogPrint("SiPixelCalibConfigurationObjectMaker") << "mode = " << fixedmode << std::endl;
84  if (fixedmode.find(tobereplaced) != std::string::npos)
85  fixedmode.erase(fixedmode.find(tobereplaced), tobereplaced.length());
86  edm::LogPrint("SiPixelCalibConfigurationObjectMaker") << "mode = " << fixedmode << std::endl;
87  myCalib.setCalibrationMode(fixedmode);
88 
90 
91  if (poolDbService.isAvailable()) {
92  if (poolDbService->isNewTagRequest("SiPixelCalibConfigurationRcd")) {
94  myCalib, poolDbService->beginOfTime(), "SiPixelCalibConfigurationRcd");
95  } else {
97  myCalib, poolDbService->currentTime(), "SiPixelCalibConfigurationRcd");
98  }
99  }
100 }
101 
102 //define this as a plug-in
void analyze(const edm::Event &, const edm::EventSetup &) override
std::string mode() const override
void setCalibrationMode(const std::string &in)
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
bool isNewTagRequest(const std::string &recordName)
This class implements the steps that are used in a scan over Threshold and CalDelay.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Log< level::Warning, true > LogPrint
bool isAvailable() const
Definition: Service.h:40
This class implements the steps that are used in a scan over Threshold and CalDelay.