CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
SiStripClusters2ApproxClusters Class Reference
Inheritance diagram for SiStripClusters2ApproxClusters:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
 SiStripClusters2ApproxClusters (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag beamSpot_
 
edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken
 
std::string csfLabel_
 
edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecordcsfToken_
 
SiStripDetInfo detInfo_
 
edm::FileInPath fileInPath_
 
edm::InputTag inputClusters
 
unsigned int maxNSat
 
edm::ESGetToken< SiStripNoises, SiStripNoisesRcdstripNoiseToken_
 
edm::ESHandle< SiStripNoisestheNoise_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtkGeomToken_
 

Static Private Attributes

static constexpr double seedCutMIPs_ = .35
 
static constexpr double seedCutSN_ = 7.
 
static constexpr double subclusterCutMIPs_ = .45
 
static constexpr double subclusterCutSN_ = 12.
 
static constexpr double subclusterWindow_ = .7
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 36 of file SiStripClusters2ApproxClusters.cc.

Constructor & Destructor Documentation

◆ SiStripClusters2ApproxClusters()

SiStripClusters2ApproxClusters::SiStripClusters2ApproxClusters ( const edm::ParameterSet conf)
explicit

Definition at line 69 of file SiStripClusters2ApproxClusters.cc.

References beamSpot_, beamSpotToken_, clusterToken, csfLabel_, csfToken_, detInfo_, deDxTools::esConsumes(), fileInPath_, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), inputClusters, SiStripDetInfoFileReader::kDefaultFile, maxNSat, SiStripDetInfoFileReader::read(), AlCaHLTBitMon_QueryRunRegistry::string, stripNoiseToken_, and tkGeomToken_.

69  {
70  inputClusters = conf.getParameter<edm::InputTag>("inputClusters");
71  maxNSat = conf.getParameter<unsigned int>("maxSaturatedStrips");
72 
73  clusterToken = consumes<edmNew::DetSetVector<SiStripCluster> >(inputClusters);
74 
75  beamSpot_ = conf.getParameter<edm::InputTag>("beamSpot");
76  beamSpotToken_ = consumes<reco::BeamSpot>(beamSpot_);
77 
79 
82 
83  csfLabel_ = conf.getParameter<std::string>("clusterShapeHitFilterLabel");
85 
87  produces<SiStripApproximateClusterCollection>();
88 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > csfToken_
SiStripDetInfo read(std::string filePath)
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > stripNoiseToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
static constexpr char const *const kDefaultFile
const std::string & fullPath() const
Definition: FileInPath.cc:144
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken

Member Function Documentation

◆ fillDescriptions()

void SiStripClusters2ApproxClusters::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 158 of file SiStripClusters2ApproxClusters.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

158  {
160  desc.add<edm::InputTag>("inputClusters", edm::InputTag("siStripClusters"));
161  desc.add<unsigned int>("maxSaturatedStrips", 3);
162  desc.add<std::string>("clusterShapeHitFilterLabel", "ClusterShapeHitFilter"); // add CSF label
163  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot")); // add BeamSpot tag
164  descriptions.add("SiStripClusters2ApproxClusters", desc);
165 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void SiStripClusters2ApproxClusters::produce ( edm::Event event,
const edm::EventSetup iSetup 
)
override

Definition at line 90 of file SiStripClusters2ApproxClusters.cc.

References funct::abs(), ConfigBuilder::beamspot, align::BeamSpot, beamSpot_, beamSpotToken_, Surface::bounds(), cms::cuda::bs, reco::ceil(), ALCARECOSiPixelCalSingleMuonDQM_cff::clusterCollection, clusterToken, csfToken_, hcalRecHitTable_cff::detId, detInfo_, edm::InputTag::encode(), f, alignCSCRings::ff, edm::EventSetup::getData(), SiStripDetInfo::getNumberOfApvsAndStripLength(), maxNSat, sistrip::MeVperADCStrip, eostools::move(), hcaltpdigi_cfi::peakFilter, packedPFCandidateRefMixer_cfi::pf, mps_fire::result, seedCutMIPs_, seedCutSN_, stripNoiseToken_, sistrip::STRIPS_PER_APV, subclusterCutMIPs_, subclusterCutSN_, subclusterWindow_, GeomDet::surface(), builder_last_value_cfg::test, theNoise_, Bounds::thickness(), tkGeomToken_, Surface::toGlobal(), GeomDet::toLocal(), Bounds::width(), and PV3DBase< T, PVType, FrameType >::z().

90  {
91  const auto& clusterCollection = event.get(clusterToken);
92  auto result = std::make_unique<SiStripApproximateClusterCollection>();
93  result->reserve(clusterCollection.size(), clusterCollection.dataSize());
94 
95  auto const beamSpotHandle = event.getHandle(beamSpotToken_);
96  auto const& bs = beamSpotHandle.isValid() ? *beamSpotHandle : reco::BeamSpot();
97  if (not beamSpotHandle.isValid()) {
98  edm::LogError("SiStripClusters2ApproxClusters")
99  << "didn't find a valid beamspot with label \"" << beamSpot_.encode() << "\" -> using (0,0,0)";
100  }
101 
102  const auto& tkGeom = &iSetup.getData(tkGeomToken_);
103  const auto& theFilter = &iSetup.getData(csfToken_);
104  const auto& theNoise_ = &iSetup.getData(stripNoiseToken_);
105 
106  for (const auto& detClusters : clusterCollection) {
107  auto ff = result->beginDet(detClusters.id());
108 
109  unsigned int detId = detClusters.id();
110  const GeomDet* det = tkGeom->idToDet(detId);
111  double nApvs = detInfo_.getNumberOfApvsAndStripLength(detId).first;
112  double stripLength = detInfo_.getNumberOfApvsAndStripLength(detId).second;
113  double barycenter_ypos = 0.5 * stripLength;
114 
115  const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(det);
116  float mip = 3.9 / (sistrip::MeVperADCStrip / stripDet->surface().bounds().thickness());
117 
118  for (const auto& cluster : detClusters) {
119  const LocalPoint& lp = LocalPoint(((cluster.barycenter() * 10 / (sistrip::STRIPS_PER_APV * nApvs)) -
120  ((stripDet->surface().bounds().width()) * 0.5f)),
121  barycenter_ypos - (0.5f * stripLength),
122  0.);
123  const GlobalPoint& gpos = det->surface().toGlobal(lp);
124  GlobalPoint beamspot(bs.position().x(), bs.position().y(), bs.position().z());
125  const GlobalVector& gdir = gpos - beamspot;
126  const LocalVector& ldir = det->toLocal(gdir);
127 
128  int hitStrips;
129  float hitPredPos;
130  bool usable = theFilter->getSizes(detId, cluster, lp, ldir, hitStrips, hitPredPos);
131  // (almost) same logic as in StripSubClusterShapeTrajectoryFilter
132  bool isTrivial = (std::abs(hitPredPos) < 2.f && hitStrips <= 2);
133 
134  if (!usable || isTrivial) {
135  ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, true));
136  } else {
137  bool peakFilter = false;
138  SlidingPeakFinder pf(std::max<int>(2, std::ceil(std::abs(hitPredPos) + subclusterWindow_)));
139  float mipnorm = mip / std::abs(ldir.z());
140  PeakFinderTest test(mipnorm,
141  detId,
142  cluster.firstStrip(),
143  theNoise_,
144  seedCutMIPs_,
145  seedCutSN_,
148  peakFilter = pf.apply(cluster.amplitudes(), test);
149 
150  ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, peakFilter));
151  }
152  }
153  }
154 
155  event.put(std::move(result));
156 }
constexpr int32_t ceil(float num)
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
T z() const
Definition: PV3DBase.h:61
std::string encode() const
Definition: InputTag.cc:159
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
edm::ESHandle< SiStripNoises > theNoise_
Log< level::Error, false > LogError
edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > csfToken_
virtual float thickness() const =0
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > stripNoiseToken_
static const uint16_t STRIPS_PER_APV
static constexpr float MeVperADCStrip
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
virtual float width() const =0
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken
def move(src, dest)
Definition: eostools.py:511
const Bounds & bounds() const
Definition: Surface.h:87

Member Data Documentation

◆ beamSpot_

edm::InputTag SiStripClusters2ApproxClusters::beamSpot_
private

Definition at line 54 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ beamSpotToken_

edm::EDGetTokenT<reco::BeamSpot> SiStripClusters2ApproxClusters::beamSpotToken_
private

Definition at line 55 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ clusterToken

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > SiStripClusters2ApproxClusters::clusterToken
private

Definition at line 45 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ csfLabel_

std::string SiStripClusters2ApproxClusters::csfLabel_
private

Definition at line 62 of file SiStripClusters2ApproxClusters.cc.

Referenced by SiStripClusters2ApproxClusters().

◆ csfToken_

edm::ESGetToken<ClusterShapeHitFilter, CkfComponentsRecord> SiStripClusters2ApproxClusters::csfToken_
private

Definition at line 63 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ detInfo_

SiStripDetInfo SiStripClusters2ApproxClusters::detInfo_
private

Definition at line 60 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ fileInPath_

edm::FileInPath SiStripClusters2ApproxClusters::fileInPath_
private

Definition at line 59 of file SiStripClusters2ApproxClusters.cc.

Referenced by SiStripClusters2ApproxClusters().

◆ inputClusters

edm::InputTag SiStripClusters2ApproxClusters::inputClusters
private

Definition at line 44 of file SiStripClusters2ApproxClusters.cc.

Referenced by SiStripClusters2ApproxClusters().

◆ maxNSat

unsigned int SiStripClusters2ApproxClusters::maxNSat
private

Definition at line 47 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ seedCutMIPs_

constexpr double SiStripClusters2ApproxClusters::seedCutMIPs_ = .35
staticprivate

Definition at line 49 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ seedCutSN_

constexpr double SiStripClusters2ApproxClusters::seedCutSN_ = 7.
staticprivate

Definition at line 50 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ stripNoiseToken_

edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> SiStripClusters2ApproxClusters::stripNoiseToken_
private

Definition at line 65 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ subclusterCutMIPs_

constexpr double SiStripClusters2ApproxClusters::subclusterCutMIPs_ = .45
staticprivate

Definition at line 51 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ subclusterCutSN_

constexpr double SiStripClusters2ApproxClusters::subclusterCutSN_ = 12.
staticprivate

Definition at line 52 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ subclusterWindow_

constexpr double SiStripClusters2ApproxClusters::subclusterWindow_ = .7
staticprivate

Definition at line 48 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ theNoise_

edm::ESHandle<SiStripNoises> SiStripClusters2ApproxClusters::theNoise_
private

Definition at line 66 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ tkGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripClusters2ApproxClusters::tkGeomToken_
private

Definition at line 57 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().