CMS 3D CMS Logo

SiPixelClusterShapeCacheProducer.cc
Go to the documentation of this file.
6 
9 
13 
17 
20 
23 
24 #include <cassert>
25 
27 public:
28  explicit SiPixelClusterShapeCacheProducer(const edm::ParameterSet& iConfig);
30 
31  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
32 
33  void produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
34 
35 private:
37 
39 };
40 
42  : token_(consumes<InputCollection>(iConfig.getParameter<edm::InputTag>("src"))) {
43  if (iConfig.getParameter<bool>("onDemand")) {
44  throw cms::Exception("OnDemandNotAllowed")
45  << "Use of the `onDemand` feature of SiPixelClusterShapeCacheProducer is no longer supported";
46  }
47  produces<SiPixelClusterShapeCache>();
48 }
49 
51 
54  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClusters"));
55  desc.add<bool>("onDemand", false)->setComment("The on demand feature is no longer supported");
56  descriptions.add("siPixelClusterShapeCache", desc);
57 }
58 
61  iEvent.getByToken(token_, input);
62 
65 
66  auto output = std::make_unique<SiPixelClusterShapeCache>(input);
67  output->resize(input->data().size());
68 
69  ClusterData data; // reused
70  ClusterShape clusterShape;
71 
72  for (const auto& detSet : *input) {
73  const GeomDetUnit* genericDet = geom->idToDetUnit(detSet.detId());
74  const PixelGeomDetUnit* pixDet = dynamic_cast<const PixelGeomDetUnit*>(genericDet);
75  assert(pixDet);
76 
77  edmNew::DetSet<SiPixelCluster>::const_iterator iCluster = detSet.begin(), endCluster = detSet.end();
78  for (; iCluster != endCluster; ++iCluster) {
80  if (not output->isFilled(clusterRef)) {
81  data.size.clear();
82  clusterShape.determineShape(*pixDet, *iCluster, data);
83  output->insert(clusterRef, data);
84  }
85  }
86  }
87  output->shrink_to_fit();
88 
89  iEvent.put(std::move(output));
90 }
91 
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
Handle.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
input
static const std::string input
Definition: EdmProvDump.cc:48
TrackerGeometry.h
GeomDet
Definition: GeomDet.h:27
ESHandle.h
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::EDGetTokenT< InputCollection >
ClusterShape
Definition: ClusterShape.h:14
edm
HLT enums.
Definition: AlignableModifier.h:19
SiPixelClusterShapeCacheProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: SiPixelClusterShapeCacheProducer.cc:52
edmNew::makeRefTo
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
Definition: DetSetVectorNew.h:735
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
SiPixelClusterShapeCacheProducer::token_
const edm::EDGetTokenT< InputCollection > token_
Definition: SiPixelClusterShapeCacheProducer.cc:38
cms::cuda::assert
assert(be >=bs)
SiPixelClusterShapeCacheProducer::produce
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition: SiPixelClusterShapeCacheProducer.cc:59
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelClusterShapeCacheProducer
Definition: SiPixelClusterShapeCacheProducer.cc:26
edm::Ref
Definition: AssociativeIterator.h:58
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
ParameterSetDescription.h
EDGetToken.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
ClusterShape.h
TrackerDigiGeometryRecord.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
ClusterShape::determineShape
void determineShape(const PixelGeomDetUnit &pixelDet, const SiPixelRecHit &recHit, ClusterData &data)
Definition: ClusterShape.cc:75
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edmNew::DetSetVector
Definition: DetSetNew.h:13
eostools.move
def move(src, dest)
Definition: eostools.py:511
ClusterData.h
SiPixelClusterShapeCacheProducer::~SiPixelClusterShapeCacheProducer
~SiPixelClusterShapeCacheProducer() override
Definition: SiPixelClusterShapeCacheProducer.cc:50
Exception
Definition: hltDiff.cc:246
PixelGeomDetUnit.h
EventSetup.h
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
SiPixelClusterShapeCacheProducer::SiPixelClusterShapeCacheProducer
SiPixelClusterShapeCacheProducer(const edm::ParameterSet &iConfig)
Definition: SiPixelClusterShapeCacheProducer.cc:41
SiPixelClusterShapeCache.h
ClusterData
Definition: ClusterData.h:7
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31