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 
40 };
41 
43  : token_(consumes<InputCollection>(iConfig.getParameter<edm::InputTag>("src"))), geomToken_(esConsumes()) {
44  if (iConfig.getParameter<bool>("onDemand")) {
45  throw cms::Exception("OnDemandNotAllowed")
46  << "Use of the `onDemand` feature of SiPixelClusterShapeCacheProducer is no longer supported";
47  }
48  produces<SiPixelClusterShapeCache>();
49 }
50 
52 
55  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClusters"));
56  desc.add<bool>("onDemand", false)->setComment("The on demand feature is no longer supported");
57  descriptions.add("siPixelClusterShapeCache", desc);
58 }
59 
62  iEvent.getByToken(token_, input);
63 
64  const auto& geom = &iSetup.getData(geomToken_);
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
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:72
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:53
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
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:689
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:60
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelClusterShapeCacheProducer
Definition: SiPixelClusterShapeCacheProducer.cc:26
edm::Ref
Definition: AssociativeIterator.h:58
MakerMacros.h
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
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
edm::ParameterSet
Definition: ParameterSet.h:47
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
SiPixelClusterShapeCacheProducer::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: SiPixelClusterShapeCacheProducer.cc:39
edm::EventSetup
Definition: EventSetup.h:58
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
InputTag.h
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
ClusterData.h
SiPixelClusterShapeCacheProducer::~SiPixelClusterShapeCacheProducer
~SiPixelClusterShapeCacheProducer() override
Definition: SiPixelClusterShapeCacheProducer.cc:51
Exception
Definition: hltDiff.cc:245
PixelGeomDetUnit.h
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ParameterSet.h
EDProducer.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
SiPixelClusterShapeCacheProducer::SiPixelClusterShapeCacheProducer
SiPixelClusterShapeCacheProducer(const edm::ParameterSet &iConfig)
Definition: SiPixelClusterShapeCacheProducer.cc:42
SiPixelClusterShapeCache.h
ClusterData
Definition: ClusterData.h:7
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31