CMS 3D CMS Logo

PPSPixelTopologyESSource.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * CondFormats/PPSObjects/plugins/PPSPixelTopologyESSource.cc
4  *
5  * Description : - Loads PPSPixelTopology from the PPSPixelTopologyESSource_cfi.py
6  * config file.
7  *
8  *
9  * Author: F.Ferro ferro@ge.infn.it
10  *
11  *
12  ****************************************************************************/
13 
17 
24 
27 
28 #include <memory>
29 
35 public:
37  ~PPSPixelTopologyESSource() override = default;
38 
39  std::unique_ptr<PPSPixelTopology> produce(const PPSPixelTopologyRcd&);
41 
42 private:
46  std::unique_ptr<PPSPixelTopology> fillPPSPixelTopology();
47 
48  // Topology parameters
50  double pitch_simY_;
51  double pitch_simX_;
52  double thickness_;
53  unsigned short no_of_pixels_simX_;
54  unsigned short no_of_pixels_simY_;
55  unsigned short no_of_pixels_;
56  double simX_width_;
57  double simY_width_;
58  double dead_edge_width_;
61 
62 protected:
67 };
68 
69 //----------------------------------------------------------------------------------------------------
70 
72  : runType_(""),
73  pitch_simY_(0.),
74  pitch_simX_(0.),
75  thickness_(0.),
76  no_of_pixels_simX_(0.),
77  no_of_pixels_simY_(0.),
78  no_of_pixels_(0.),
79  simX_width_(0.),
80  simY_width_(0.),
81  dead_edge_width_(0.),
82  active_edge_sigma_(0.),
83  phys_active_edge_dist_(0.) {
84  setPPSPixelTopology(iConfig);
85  setWhatProduced(this);
86  findingRecord<PPSPixelTopologyRcd>();
87 }
88 
89 //----------------------------------------------------------------------------------------------------
90 
91 std::unique_ptr<PPSPixelTopology> PPSPixelTopologyESSource::produce(const PPSPixelTopologyRcd&) {
92  auto topo = fillPPSPixelTopology();
93 
94  edm::LogInfo("PPS") << "PixelTopologyESSource::produce \n" << *topo;
95 
96  return topo;
97 }
98 
99 //----------------------------------------------------------------------------------------------------
100 
102  runType_ = iConfig.getParameter<std::string>("RunType");
103  pitch_simY_ = iConfig.getParameter<double>("PitchSimY");
104  pitch_simX_ = iConfig.getParameter<double>("PitchSimX");
105  thickness_ = iConfig.getParameter<double>("thickness");
106  no_of_pixels_simX_ = iConfig.getParameter<int>("noOfPixelSimX");
107  no_of_pixels_simY_ = iConfig.getParameter<int>("noOfPixelSimY");
108  no_of_pixels_ = iConfig.getParameter<int>("noOfPixels");
109  simX_width_ = iConfig.getParameter<double>("simXWidth");
110  simY_width_ = iConfig.getParameter<double>("simYWidth");
111  dead_edge_width_ = iConfig.getParameter<double>("deadEdgeWidth");
112  active_edge_sigma_ = iConfig.getParameter<double>("activeEdgeSigma");
113  phys_active_edge_dist_ = iConfig.getParameter<double>("physActiveEdgeDist");
114 }
115 
116 //----------------------------------------------------------------------------------------------------
117 
118 std::unique_ptr<PPSPixelTopology> PPSPixelTopologyESSource::fillPPSPixelTopology() {
119  auto p = std::make_unique<PPSPixelTopology>();
120 
121  p->setRunType(runType_);
122  p->setPitchSimY(pitch_simY_);
123  p->setPitchSimX(pitch_simX_);
124  p->setThickness(thickness_);
125  p->setNoPixelsSimX(no_of_pixels_simX_);
126  p->setNoPixelsSimY(no_of_pixels_simY_);
127  p->setNoPixels(no_of_pixels_);
128  p->setSimXWidth(simX_width_);
129  p->setSimYWidth(simY_width_);
130  p->setDeadEdgeWidth(dead_edge_width_);
131  p->setActiveEdgeSigma(active_edge_sigma_);
132  p->setPhysActiveEdgeDist(phys_active_edge_dist_);
133  p->setActiveEdgeX(simX_width_ / 2. - phys_active_edge_dist_);
134  p->setActiveEdgeY(simY_width_ / 2. - phys_active_edge_dist_);
135 
136  return p;
137 }
138 
139 //----------------------------------------------------------------------------------------------------
140 
142  const edm::IOVSyncValue& iosv,
143  edm::ValidityInterval& oValidity) {
144  edm::LogInfo("PPS") << ">> PPSPixelTopologyESSource::setIntervalFor(" << key.name() << ")\n"
145  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
146 
148  oValidity = infinity;
149 }
150 
151 //----------------------------------------------------------------------------------------------------
152 
155  desc.add<std::string>("RunType", "Run3");
156  desc.add<double>("PitchSimY", 150e-3);
157  desc.add<double>("PitchSimX", 100e-3);
158  desc.add<double>("thickness", 0.23);
159  desc.add<int>("noOfPixelSimX", 160);
160  desc.add<int>("noOfPixelSimY", 156);
161  desc.add<int>("noOfPixels", 160 * 156);
162  desc.add<double>("simXWidth", 16.6);
163  desc.add<double>("simYWidth", 16.2);
164  desc.add<double>("deadEdgeWidth", 200e-3);
165  desc.add<double>("activeEdgeSigma", 0.02);
166  desc.add<double>("physActiveEdgeDist", 0.150);
167 
168  descriptions.add("ppsPixelTopologyESSource", desc);
169 }
170 
171 //----------------------------------------------------------------------------------------------------
172 
PPSPixelTopology.h
PPSPixelTopologyRcd
Definition: PPSPixelTopologyRcd.h:8
MessageLogger.h
PPSPixelTopologyESSource::~PPSPixelTopologyESSource
~PPSPixelTopologyESSource() override=default
ESHandle.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PPSPixelTopologyESSource::runType_
std::string runType_
Definition: PPSPixelTopologyESSource.cc:59
PPSPixelTopologyESSource::dead_edge_width_
double dead_edge_width_
Definition: PPSPixelTopologyESSource.cc:68
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ValidityInterval
Definition: ValidityInterval.h:28
PPSPixelTopologyESSource::simY_width_
double simY_width_
Definition: PPSPixelTopologyESSource.cc:67
ESProducer.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
infinity
const double infinity
Definition: CSCChamberFitter.cc:10
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
PPSPixelTopologyESSource::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: PPSPixelTopologyESSource.cc:153
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
MakerMacros.h
PPSPixelTopologyESSource::no_of_pixels_
unsigned short no_of_pixels_
Definition: PPSPixelTopologyESSource.cc:65
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PPSPixelTopologyESSource::no_of_pixels_simX_
unsigned short no_of_pixels_simX_
Definition: PPSPixelTopologyESSource.cc:63
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
DEFINE_FWK_EVENTSETUP_SOURCE
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
EventSetupRecordIntervalFinder.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ESProducts.h
SourceFactory.h
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
PPSPixelTopologyESSource::fillPPSPixelTopology
std::unique_ptr< PPSPixelTopology > fillPPSPixelTopology()
Fill PPSPixelTopology object.
Definition: PPSPixelTopologyESSource.cc:118
edm::ParameterSet
Definition: ParameterSet.h:47
PPSPixelTopologyESSource::phys_active_edge_dist_
double phys_active_edge_dist_
Definition: PPSPixelTopologyESSource.cc:70
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
PPSPixelTopologyESSource::thickness_
double thickness_
Definition: PPSPixelTopologyESSource.cc:62
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
PPSPixelTopologyESSource::no_of_pixels_simY_
unsigned short no_of_pixels_simY_
Definition: PPSPixelTopologyESSource.cc:64
PPSPixelTopologyESSource::active_edge_sigma_
double active_edge_sigma_
Definition: PPSPixelTopologyESSource.cc:69
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
PPSPixelTopologyESSource::setPPSPixelTopology
void setPPSPixelTopology(const edm::ParameterSet &)
Set PPS Topology parameters to their values from config.
Definition: PPSPixelTopologyESSource.cc:101
PPSPixelTopologyESSource::simX_width_
double simX_width_
Definition: PPSPixelTopologyESSource.cc:66
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
PPSPixelTopologyESSource
Loads PPSPixelTopology from a config file.
Definition: PPSPixelTopologyESSource.cc:34
ParameterSet.h
PPSPixelTopologyESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
sets infinite validity of this data
Definition: PPSPixelTopologyESSource.cc:141
PPSPixelTopologyESSource::pitch_simX_
double pitch_simX_
Definition: PPSPixelTopologyESSource.cc:61
PPSPixelTopologyESSource::PPSPixelTopologyESSource
PPSPixelTopologyESSource(const edm::ParameterSet &)
Definition: PPSPixelTopologyESSource.cc:71
crabWrapper.key
key
Definition: crabWrapper.py:19
PPSPixelTopologyESSource::pitch_simY_
double pitch_simY_
Definition: PPSPixelTopologyESSource.cc:60
PPSPixelTopologyRcd.h
PPSPixelTopologyESSource::produce
std::unique_ptr< PPSPixelTopology > produce(const PPSPixelTopologyRcd &)
Definition: PPSPixelTopologyESSource.cc:91
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37