CMS 3D CMS Logo

ClusterShapeHitFilterESProducer.cc
Go to the documentation of this file.
2 
4 
10 
11 
13 
14 /*****************************************************************************/
16  (const edm::ParameterSet& iConfig):
17  pixelShapeFile(iConfig.getParameter<std::string>("PixelShapeFile")),
18  pixelShapeFileL1(iConfig.getParameter<std::string>("PixelShapeFileL1"))
19 {
20 
21  std::string componentName = iConfig.getParameter<std::string>("ComponentName");
22  minGoodPixelCharge_= 0,
23  minGoodStripCharge_ = (clusterChargeCut(iConfig));
24  cutOnPixelCharge_ = false;
25  cutOnStripCharge_ = minGoodStripCharge_>0;
26  cutOnPixelShape_ = (iConfig.exists("doPixelShapeCut") ? iConfig.getParameter<bool>("doPixelShapeCut") : true);
27  cutOnStripShape_ = (iConfig.exists("doStripShapeCut") ? iConfig.getParameter<bool>("doStripShapeCut") : true);
28 
29  edm::LogInfo("ClusterShapeHitFilterESProducer")
30  << " with name: " << componentName;
31 
32  setWhatProduced(this, componentName);
33 }
34 
35 
36 /*****************************************************************************/
38  ()
39 {
40 }
41 
42 /*****************************************************************************/
46 {
47  using namespace edm::es;
48 
49  // get all from SiStripLorentzAngle (why not!)
50 
51  // Retrieve magnetic field
53  iRecord.getRecord<TkStripCPERecord>().getRecord<IdealMagneticFieldRecord>().get(field);
54 
55  // Retrieve geometry
57  iRecord.getRecord<TkStripCPERecord>().getRecord<TrackerDigiGeometryRecord>().get(geo);
58  // Retrieve topology
60  iRecord.getRecord<TrackerTopologyRcd>().get(topol);
61 
62 
63  // Retrieve pixel Lorentz
65  iRecord.getRecord<TkPixelCPERecord>().getRecord<SiPixelLorentzAngleRcd>().get(pixel);
66 
67  // Retrieve strip Lorentz
69  iRecord.getRecord<TkStripCPERecord>().getRecord<SiStripLorentzAngleDepRcd>().get(strip);
70 
71 
72 
73  // Produce the filter using the plugin factory
75  aFilter(new ClusterShapeHitFilter( geo.product(),
76  topol.product(),
77  field.product(),
78  pixel.product(),
79  strip.product(),
80  pixelShapeFile,
81  pixelShapeFileL1
82  ));
83 
84  aFilter->setShapeCuts(cutOnPixelShape_, cutOnStripShape_);
85  aFilter->setChargeCuts(cutOnPixelCharge_, minGoodPixelCharge_, cutOnStripCharge_,
86  minGoodStripCharge_);
87  return aFilter;
88 }
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
float clusterChargeCut(const edm::ParameterSet &conf, const char *name="clusterChargeCut")
ClusterShapeHitFilterESProducer(const edm::ParameterSet &)
ReturnType produce(const ClusterShapeHitFilter::Record &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< ClusterShapeHitFilter > ReturnType
T const * product() const
Definition: ESHandle.h:86