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 35 of file SiStripClusters2ApproxClusters.cc.

Constructor & Destructor Documentation

◆ SiStripClusters2ApproxClusters()

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

Definition at line 68 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_.

68  {
69  inputClusters = conf.getParameter<edm::InputTag>("inputClusters");
70  maxNSat = conf.getParameter<unsigned int>("maxSaturatedStrips");
71 
72  clusterToken = consumes<edmNew::DetSetVector<SiStripCluster> >(inputClusters);
73 
74  beamSpot_ = conf.getParameter<edm::InputTag>("beamSpot");
75  beamSpotToken_ = consumes<reco::BeamSpot>(beamSpot_);
76 
78 
81 
82  csfLabel_ = conf.getParameter<std::string>("clusterShapeHitFilterLabel");
84 
86 
87  produces<edmNew::DetSetVector<SiStripApproximateCluster> >();
88 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string fullPath() const
Definition: FileInPath.cc:161
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
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 151 of file SiStripClusters2ApproxClusters.cc.

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

151  {
153  desc.add<edm::InputTag>("inputClusters", edm::InputTag("siStripClusters"));
154  desc.add<unsigned int>("maxSaturatedStrips", 3);
155  desc.add<std::string>("clusterShapeHitFilterLabel", "ClusterShapeHitFilter"); // add CSF label
156  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot")); // add BeamSpot tag
157  descriptions.add("SiStripClusters2ApproxClusters", desc);
158 }
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(), HLTObjectsMonitor_cfi::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(), ctpps_dqm_sourceclient-live_cfg::test, theNoise_, Bounds::thickness(), tkGeomToken_, Surface::toGlobal(), GeomDet::toLocal(), Bounds::width(), and PV3DBase< T, PVType, FrameType >::z().

90  {
91  auto result = std::make_unique<edmNew::DetSetVector<SiStripApproximateCluster> >();
92  const auto& clusterCollection = event.get(clusterToken);
93 
94  auto const beamSpotHandle = event.getHandle(beamSpotToken_);
95  auto const& bs = beamSpotHandle.isValid() ? *beamSpotHandle : reco::BeamSpot();
96  if (not beamSpotHandle.isValid()) {
97  edm::LogError("SiStripClusters2ApproxClusters")
98  << "didn't find a valid beamspot with label \"" << beamSpot_.encode() << "\" -> using (0,0,0)";
99  }
100 
101  const auto& tkGeom = &iSetup.getData(tkGeomToken_);
102  const auto& theFilter = &iSetup.getData(csfToken_);
103  const auto& theNoise_ = &iSetup.getData(stripNoiseToken_);
104 
105  for (const auto& detClusters : clusterCollection) {
107 
108  unsigned int detId = detClusters.id();
109  const GeomDet* det = tkGeom->idToDet(detId);
110  double nApvs = detInfo_.getNumberOfApvsAndStripLength(detId).first;
111  double stripLength = detInfo_.getNumberOfApvsAndStripLength(detId).second;
112  double barycenter_ypos = 0.5 * stripLength;
113 
114  const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(det);
115  float mip = 3.9 / (sistrip::MeVperADCStrip / stripDet->surface().bounds().thickness());
116 
117  for (const auto& cluster : detClusters) {
118  const LocalPoint& lp = LocalPoint(((cluster.barycenter() * 10 / (sistrip::STRIPS_PER_APV * nApvs)) -
119  ((stripDet->surface().bounds().width()) * 0.5f)),
120  barycenter_ypos - (0.5f * stripLength),
121  0.);
122  const GlobalPoint& gpos = det->surface().toGlobal(lp);
123  GlobalPoint beamspot(bs.position().x(), bs.position().y(), bs.position().z());
124  const GlobalVector& gdir = gpos - beamspot;
125  const LocalVector& ldir = det->toLocal(gdir);
126 
127  int hitStrips;
128  float hitPredPos;
129  theFilter->getSizes(detId, cluster, lp, ldir, hitStrips, hitPredPos);
130 
131  bool peakFilter = false;
132  SlidingPeakFinder pf(std::max<int>(2, std::ceil(std::abs(hitPredPos) + subclusterWindow_)));
133  float mipnorm = mip / std::abs(ldir.z());
134  PeakFinderTest test(mipnorm,
135  detId,
136  cluster.firstStrip(),
137  theNoise_,
138  seedCutMIPs_,
139  seedCutSN_,
142  peakFilter = pf.apply(cluster.amplitudes(), test);
143 
144  ff.push_back(SiStripApproximateCluster(cluster, maxNSat, hitPredPos, peakFilter));
145  }
146  }
147 
148  event.put(std::move(result));
149 }
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 53 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ beamSpotToken_

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

Definition at line 54 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ clusterToken

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

Definition at line 44 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ csfLabel_

std::string SiStripClusters2ApproxClusters::csfLabel_
private

Definition at line 61 of file SiStripClusters2ApproxClusters.cc.

Referenced by SiStripClusters2ApproxClusters().

◆ csfToken_

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

Definition at line 62 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ detInfo_

SiStripDetInfo SiStripClusters2ApproxClusters::detInfo_
private

Definition at line 59 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ fileInPath_

edm::FileInPath SiStripClusters2ApproxClusters::fileInPath_
private

Definition at line 58 of file SiStripClusters2ApproxClusters.cc.

Referenced by SiStripClusters2ApproxClusters().

◆ inputClusters

edm::InputTag SiStripClusters2ApproxClusters::inputClusters
private

Definition at line 43 of file SiStripClusters2ApproxClusters.cc.

Referenced by SiStripClusters2ApproxClusters().

◆ maxNSat

unsigned int SiStripClusters2ApproxClusters::maxNSat
private

Definition at line 46 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ seedCutMIPs_

constexpr double SiStripClusters2ApproxClusters::seedCutMIPs_ = .35
staticprivate

Definition at line 48 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ seedCutSN_

constexpr double SiStripClusters2ApproxClusters::seedCutSN_ = 7.
staticprivate

Definition at line 49 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ stripNoiseToken_

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

Definition at line 64 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().

◆ subclusterCutMIPs_

constexpr double SiStripClusters2ApproxClusters::subclusterCutMIPs_ = .45
staticprivate

Definition at line 50 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ subclusterCutSN_

constexpr double SiStripClusters2ApproxClusters::subclusterCutSN_ = 12.
staticprivate

Definition at line 51 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ subclusterWindow_

constexpr double SiStripClusters2ApproxClusters::subclusterWindow_ = .7
staticprivate

Definition at line 47 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ theNoise_

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

Definition at line 65 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce().

◆ tkGeomToken_

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

Definition at line 56 of file SiStripClusters2ApproxClusters.cc.

Referenced by produce(), and SiStripClusters2ApproxClusters().