CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
ClusterShapeHitFilter Class Reference

#include <ClusterShapeHitFilter.h>

Classes

struct  PixelData
 

Public Types

typedef TrajectoryFilter::Record Record
 

Public Member Functions

 ClusterShapeHitFilter (const TrackerGeometry *theTracker_, const MagneticField *theMagneticField_, const SiPixelLorentzAngle *theSiPixelLorentzAngle_, const SiStripLorentzAngle *theSiStripLorentzAngle_, const std::string *use_PixelShapeFile_)
 
bool getSizes (const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=0) const
 
bool getSizes (DetId detId, const SiStripCluster &cluster, const LocalPoint &lpos, const LocalVector &ldir, int &meas, float &pred) const
 
bool getSizes (const SiStripRecHit2D &recHit, const LocalPoint &lpos, const LocalVector &ldir, int &meas, float &pred) const
 
bool isCompatible (const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
 
bool isCompatible (const SiPixelRecHit &recHit, const GlobalVector &gdir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
 
bool isCompatible (DetId detId, const SiStripCluster &cluster, const LocalPoint &lpos, const LocalVector &ldir) const
 
bool isCompatible (DetId detId, const SiStripCluster &cluster, const LocalVector &ldir) const
 
bool isCompatible (DetId detId, const SiStripCluster &cluster, const GlobalPoint &gpos, const GlobalVector &gdir) const
 
bool isCompatible (DetId detId, const SiStripCluster &cluster, const GlobalVector &gdir) const
 
bool isCompatible (const SiStripRecHit2D &recHit, const LocalPoint &lpos, const LocalVector &ldir) const
 
bool isCompatible (const SiStripRecHit2D &recHit, const LocalVector &ldir) const
 
bool isCompatible (const SiStripRecHit2D &recHit, const GlobalPoint &gpos, const GlobalVector &gdir) const
 
bool isCompatible (const SiStripRecHit2D &recHit, const GlobalVector &gdir) const
 
void setChargeCuts (bool cutOnPixelCharge, float minGoodPixelCharge, bool cutOnStripCharge, float minGoodStripCharge)
 
void setShapeCuts (bool cutOnPixelShape, bool cutOnStripShape)
 
 ~ClusterShapeHitFilter ()
 

Private Member Functions

bool checkClusterCharge (DetId detId, const SiStripCluster &cluster, const LocalVector &ldir) const
 
bool checkClusterCharge (DetId detId, const SiPixelCluster &cluster, const LocalVector &ldir) const
 
 ClusterShapeHitFilter ()
 
void fillPixelData ()
 
std::pair< float, float > getCotangent (const PixelGeomDetUnit *pixelDet) const
 
float getCotangent (const StripGeomDetUnit *stripDet, const LocalPoint &p=LocalPoint(0, 0, 0)) const
 
std::pair< float, float > getDrift (const PixelGeomDetUnit *pixelDet) const
 
float getDrift (const StripGeomDetUnit *stripDet) const
 
const PixelDatagetpd (const SiPixelRecHit &recHit, PixelData const *pd=0) const
 
bool isNormalOriented (const GeomDetUnit *geomDet) const
 
void loadPixelLimits ()
 
void loadStripLimits ()
 

Private Attributes

bool cutOnPixelCharge_
 
bool cutOnPixelShape_
 
bool cutOnStripCharge_
 
bool cutOnStripShape_
 
float minGoodPixelCharge_
 
float minGoodStripCharge_
 
std::unordered_map< unsigned
int, PixelData
pixelData
 
PixelLimits pixelLimits [PixelKeys::N+1]
 
const std::string * PixelShapeFile
 
StripLimits stripLimits [StripKeys::N+1]
 
float theAngle [6]
 
const MagneticFieldtheMagneticField
 
const SiPixelLorentzAngletheSiPixelLorentzAngle
 
const SiStripLorentzAngletheSiStripLorentzAngle
 
const TrackerGeometrytheTracker
 

Friends

int test::ClusterShapeHitFilterTest::test ()
 

Detailed Description

Definition at line 151 of file ClusterShapeHitFilter.h.

Member Typedef Documentation

Definition at line 166 of file ClusterShapeHitFilter.h.

Constructor & Destructor Documentation

ClusterShapeHitFilter::ClusterShapeHitFilter ( const TrackerGeometry theTracker_,
const MagneticField theMagneticField_,
const SiPixelLorentzAngle theSiPixelLorentzAngle_,
const SiStripLorentzAngle theSiStripLorentzAngle_,
const std::string *  use_PixelShapeFile_ 
)

Definition at line 37 of file ClusterShapeHitFilter.cc.

42  : theTracker(theTracker_),
43  theMagneticField(theMagneticField_),
44  theSiPixelLorentzAngle(theSiPixelLorentzAngle_),
45  theSiStripLorentzAngle(theSiStripLorentzAngle_),
46  PixelShapeFile(use_PixelShapeFile_)
47 {
48  // Load pixel limits
50  fillPixelData();
51 
52  // Load strip limits
56 }
const std::string * PixelShapeFile
const MagneticField * theMagneticField
const SiStripLorentzAngle * theSiStripLorentzAngle
const TrackerGeometry * theTracker
const SiPixelLorentzAngle * theSiPixelLorentzAngle
ClusterShapeHitFilter::~ClusterShapeHitFilter ( )

Definition at line 59 of file ClusterShapeHitFilter.cc.

60 {
61 }
ClusterShapeHitFilter::ClusterShapeHitFilter ( )
inlineprivate

Definition at line 247 of file ClusterShapeHitFilter.h.

247 {}

Member Function Documentation

bool ClusterShapeHitFilter::checkClusterCharge ( DetId  detId,
const SiStripCluster cluster,
const LocalVector ldir 
) const
private

Definition at line 423 of file ClusterShapeHitFilter.cc.

References siStripClusterTools::chargePerCM().

424 {
425  return siStripClusterTools::chargePerCM(detId, cluster, ldir) > minGoodStripCharge_;
426 }
float chargePerCM(DetId detid, Iter a, Iter b)
bool ClusterShapeHitFilter::checkClusterCharge ( DetId  detId,
const SiPixelCluster cluster,
const LocalVector ldir 
) const
private

Definition at line 429 of file ClusterShapeHitFilter.cc.

References siStripClusterTools::chargePerCM().

430 {
431  return siStripClusterTools::chargePerCM(detId, cluster, ldir) > minGoodPixelCharge_;
432 }
float chargePerCM(DetId detid, Iter a, Iter b)
void ClusterShapeHitFilter::fillPixelData ( )
private

Definition at line 136 of file ClusterShapeHitFilter.cc.

References assert(), ClusterShapeHitFilter::PixelData::cotangent, ClusterShapeHitFilter::PixelData::det, ClusterShapeHitFilter::PixelData::drift, GeomDet::geographicalId(), and ClusterShapeHitFilter::PixelData::part.

136  {
137 
138  //barrel
139  for (auto det : theTracker->detsPXB()) {
140  // better not to fail..
141  const PixelGeomDetUnit * pixelDet =
142  dynamic_cast<const PixelGeomDetUnit*>(det);
143  assert(pixelDet);
144  PixelData & pd = pixelData[pixelDet->geographicalId()];
145  pd.det = pixelDet;
146  pd.part=0;
147  pd.cotangent=getCotangent(pixelDet);
148  pd.drift=getDrift(pixelDet);
149  }
150 
151  //endcap
152  for (auto det : theTracker->detsPXF()) {
153  // better not to fail..
154  const PixelGeomDetUnit * pixelDet =
155  dynamic_cast<const PixelGeomDetUnit*>(det);
156  assert(pixelDet);
157  PixelData & pd = pixelData[pixelDet->geographicalId()];
158  pd.det = pixelDet;
159  pd.part=1;
160  pd.cotangent=getCotangent(pixelDet);
161  pd.drift=getDrift(pixelDet);
162  }
163 
164 }
assert(m_qm.get())
std::unordered_map< unsigned int, PixelData > pixelData
const TrackerGeometry * theTracker
std::pair< float, float > getCotangent(const PixelGeomDetUnit *pixelDet) const
const DetContainer & detsPXB() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
std::pair< float, float > getDrift(const PixelGeomDetUnit *pixelDet) const
const DetContainer & detsPXF() const
pair< float, float > ClusterShapeHitFilter::getCotangent ( const PixelGeomDetUnit pixelDet) const
private

Definition at line 169 of file ClusterShapeHitFilter.cc.

References Surface::bounds(), PixelTopology::pitch(), PixelGeomDetUnit::specificTopology(), GeomDet::surface(), and Bounds::thickness().

170 {
171  pair<float,float> cotangent;
172 
173  cotangent.first = pixelDet->surface().bounds().thickness() /
174  pixelDet->specificTopology().pitch().first;
175  cotangent.second = pixelDet->surface().bounds().thickness() /
176  pixelDet->specificTopology().pitch().second;
177 
178  return cotangent;
179 }
const Bounds & bounds() const
Definition: Surface.h:128
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
virtual float thickness() const =0
virtual std::pair< float, float > pitch() const =0
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
float ClusterShapeHitFilter::getCotangent ( const StripGeomDetUnit stripDet,
const LocalPoint p = LocalPoint(0,0,0) 
) const
private

Definition at line 183 of file ClusterShapeHitFilter.cc.

References Surface::bounds(), StripTopology::localPitch(), StripGeomDetUnit::specificTopology(), GeomDet::surface(), and Bounds::thickness().

184 {
185  // FIXME may be problematic in case of RadialStriptolopgy
186  return stripDet->surface().bounds().thickness() /
187  stripDet->specificTopology().localPitch(pos);
188 }
const Bounds & bounds() const
Definition: Surface.h:128
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
virtual float thickness() const =0
virtual float localPitch(const LocalPoint &) const =0
pair< float, float > ClusterShapeHitFilter::getDrift ( const PixelGeomDetUnit pixelDet) const
private

Definition at line 192 of file ClusterShapeHitFilter.cc.

References dir, GeomDet::geographicalId(), GloballyPositioned< T >::position(), DetId::rawId(), GeomDet::surface(), toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

193 {
194  LocalVector lBfield =
195  (pixelDet->surface()).toLocal(
197  pixelDet->surface().position()));
198 
199  double theTanLorentzAnglePerTesla =
201  pixelDet->geographicalId().rawId());
202 
203  pair<float,float> dir;
204  dir.first = - theTanLorentzAnglePerTesla * lBfield.y();
205  dir.second = theTanLorentzAnglePerTesla * lBfield.x();
206 
207  return dir;
208 }
const MagneticField * theMagneticField
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T y() const
Definition: PV3DBase.h:63
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
const SiPixelLorentzAngle * theSiPixelLorentzAngle
float getLorentzAngle(const uint32_t &) const
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
float ClusterShapeHitFilter::getDrift ( const StripGeomDetUnit stripDet) const
private

Definition at line 211 of file ClusterShapeHitFilter.cc.

References dir, GeomDet::geographicalId(), GloballyPositioned< T >::position(), DetId::rawId(), GeomDet::surface(), toLocal(), and PV3DBase< T, PVType, FrameType >::y().

213 {
214  LocalVector lBfield =
215  (stripDet->surface()).toLocal(
217  stripDet->surface().position()));
218 
219  double theTanLorentzAnglePerTesla =
221  stripDet->geographicalId().rawId());
222 
223  float dir = theTanLorentzAnglePerTesla * lBfield.y();
224 
225  return dir;
226 }
const MagneticField * theMagneticField
const SiStripLorentzAngle * theSiStripLorentzAngle
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
T y() const
Definition: PV3DBase.h:63
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
float getLorentzAngle(const uint32_t &) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
dbl *** dir
Definition: mlp_gen.cc:35
const PositionType & position() const
const PixelData& ClusterShapeHitFilter::getpd ( const SiPixelRecHit recHit,
PixelData const *  pd = 0 
) const
inlineprivate

Definition at line 249 of file ClusterShapeHitFilter.h.

References TrackingRecHit::geographicalId(), AlCaHLTBitMon_ParallelJobs::p, and pixelData.

249  {
250  if (pd) return *pd;
251  // Get detector
252  DetId id = recHit.geographicalId();
253  auto p = pixelData.find(id);
254  return (*p).second;
255  }
std::unordered_map< unsigned int, PixelData > pixelData
Definition: DetId.h:18
DetId geographicalId() const
bool ClusterShapeHitFilter::getSizes ( const SiPixelRecHit recHit,
const LocalVector ldir,
const SiPixelClusterShapeCache clusterShapeCache,
int &  part,
ClusterData::ArrayType meas,
std::pair< float, float > &  predr,
PixelData const *  pd = 0 
) const

Definition at line 250 of file ClusterShapeHitFilter.cc.

References assert(), edm::VecArray< T, N >::capacity(), edm::VecArray< T, N >::clear(), SiPixelRecHit::cluster(), ClusterShapeHitFilter::PixelData::cotangent, data, ClusterShapeHitFilter::PixelData::det, HLT_25ns14e33_v1_cff::distance, shallow::drift(), ClusterShapeHitFilter::PixelData::drift, SiPixelClusterShapeCache::get(), SiPixelClusterShapeData::isComplete(), SiPixelClusterShapeData::isStraight(), ClusterShapeHitFilter::PixelData::part, edm::VecArray< T, N >::push_back_unchecked(), alignCSCRings::s, SiPixelClusterShapeData::size(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by getSizes().

254 {
255  // Get detector
256  const PixelData & pd = getpd(recHit,ipd);
257 
258  // Get shape information
259  const SiPixelClusterShapeData& data = clusterShapeCache.get(recHit.cluster(), pd.det);
260  bool usable = (data.isStraight() && data.isComplete());
261 
262  // Usable?
263  //if(usable)
264  {
265  part = pd.part;
266 
267  // Predicted size
268  pred.first = ldir.x() / ldir.z();
269  pred.second = ldir.y() / ldir.z();
270 
271  SiPixelClusterShapeData::Range sizeRange = data.size();
272  if(sizeRange.first->second < 0)
273  pred.second = - pred.second;
274 
275  meas.clear();
276  assert(meas.capacity() >= std::distance(sizeRange.first, sizeRange.second));
277  for(auto s=sizeRange.first; s != sizeRange.second; ++s) {
278  meas.push_back_unchecked(*s);
279  }
280  if(sizeRange.first->second < 0) {
281  for(auto& s: meas)
282  s.second = -s.second;
283  }
284 
285  // Take out drift
286  std::pair<float,float> const & drift = pd.drift;
287  pred.first += drift.first;
288  pred.second += drift.second;
289 
290  // Apply cotangent
291  std::pair<float,float> const & cotangent = pd.cotangent;
292  pred.first *= cotangent.first;
293  pred.second *= cotangent.second;
294  }
295 
296  // Usable?
297  return usable;
298 }
const PixelData & getpd(const SiPixelRecHit &recHit, PixelData const *pd=0) const
assert(m_qm.get())
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:39
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
std::pair< const_iterator, const_iterator > Range
void clear()
Definition: VecArray.h:73
part
Definition: HCALResponse.h:20
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void push_back_unchecked(const T &value)
Definition: VecArray.h:85
SiPixelClusterShapeData get(const ClusterRef &cluster, const PixelGeomDetUnit *pixDet) const
T x() const
Definition: PV3DBase.h:62
static constexpr size_type capacity() noexcept
Definition: VecArray.h:71
bool ClusterShapeHitFilter::getSizes ( DetId  detId,
const SiStripCluster cluster,
const LocalPoint lpos,
const LocalVector ldir,
int &  meas,
float &  pred 
) const

Definition at line 347 of file ClusterShapeHitFilter.cc.

References SiStripCluster::amplitudes(), shallow::drift(), SiStripCluster::firstStrip(), StripTopology::nstrips(), StripGeomDetUnit::specificTopology(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

349 {
350  // Get detector
351  const StripGeomDetUnit* stripDet =
352  dynamic_cast<const StripGeomDetUnit*> (theTracker->idToDet(id));
353 
354  // Measured width
355  meas = cluster.amplitudes().size();
356 
357  // Usable?
358  int fs = cluster.firstStrip();
359  int ns = stripDet->specificTopology().nstrips();
360  // bool usable = (fs > 1 && fs + meas - 1 < ns);
361  bool usable = (fs >= 1 && fs + meas - 1 <= ns);
362 
363  // Usable?
364  //if(usable)
365  {
366  // Predicted width
367  pred = ldir.x() / ldir.z();
368 
369  // Take out drift
370  float drift = getDrift(stripDet);
371  pred += drift;
372 
373  // Apply cotangent
374  pred *= getCotangent(stripDet,lpos);
375  }
376 
377  return usable;
378 }
virtual int nstrips() const =0
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:39
uint16_t firstStrip() const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const TrackerGeometry * theTracker
std::pair< float, float > getCotangent(const PixelGeomDetUnit *pixelDet) const
T z() const
Definition: PV3DBase.h:64
std::pair< float, float > getDrift(const PixelGeomDetUnit *pixelDet) const
T x() const
Definition: PV3DBase.h:62
const std::vector< uint8_t > & amplitudes() const
virtual const TrackerGeomDet * idToDet(DetId) const
bool ClusterShapeHitFilter::getSizes ( const SiStripRecHit2D recHit,
const LocalPoint lpos,
const LocalVector ldir,
int &  meas,
float &  pred 
) const
inline

Definition at line 203 of file ClusterShapeHitFilter.h.

References TrackingRecHit::geographicalId(), getSizes(), and TrackerSingleRecHit::stripCluster().

204  {
205  return getSizes(recHit.geographicalId(), recHit.stripCluster(), lpos, ldir, meas, pred);
206  }
SiStripCluster const & stripCluster() const
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=0) const
DetId geographicalId() const
bool ClusterShapeHitFilter::isCompatible ( const SiPixelRecHit recHit,
const LocalVector ldir,
const SiPixelClusterShapeCache clusterShapeCache,
PixelData const *  pd = 0 
) const

Definition at line 301 of file ClusterShapeHitFilter.cc.

References SiPixelRecHit::cluster(), TrackingRecHit::geographicalId(), PixelKeys::isValid(), relval_steps::key, and visualization-live-secondInstance_cfg::m.

Referenced by MultiHitGeneratorFromChi2::hitSets(), and isCompatible().

304 {
305  // Get detector
306  if (cutOnPixelCharge_ && (!checkClusterCharge(recHit.geographicalId(), *(recHit.cluster()), ldir))) return false;
307  if (!cutOnPixelShape_) return true;
308 
309  const PixelData & pd = getpd(recHit,ipd);
310 
311  int part;
313  pair<float,float> pred;
314 
315  if(getSizes(recHit, ldir, clusterShapeCache, part,meas, pred,&pd))
316  {
317  for(const auto& m: meas)
318  {
319  PixelKeys key(part, m.first, m.second);
320  if (!key.isValid()) return true; // FIXME original logic
321  if (pixelLimits[key].isInside(pred)) return true;
322  }
323  // none of the choices worked
324  return false;
325  }
326  // not usable
327  return true;
328 }
const PixelData & getpd(const SiPixelRecHit &recHit, PixelData const *pd=0) const
bool checkClusterCharge(DetId detId, const SiStripCluster &cluster, const LocalVector &ldir) const
PixelLimits pixelLimits[PixelKeys::N+1]
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
part
Definition: HCALResponse.h:20
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=0) const
DetId geographicalId() const
bool ClusterShapeHitFilter::isCompatible ( const SiPixelRecHit recHit,
const GlobalVector gdir,
const SiPixelClusterShapeCache clusterShapeCache,
PixelData const *  pd = 0 
) const

Definition at line 331 of file ClusterShapeHitFilter.cc.

References ClusterShapeHitFilter::PixelData::det, and GeomDet::toLocal().

334 {
335  // Get detector
336  const PixelData & pd = getpd(recHit,ipd);
337 
338  LocalVector ldir =pd.det->toLocal(gdir);
339 
340  return isCompatible(recHit, ldir, clusterShapeCache, &pd);
341 }
const PixelData & getpd(const SiPixelRecHit &recHit, PixelData const *pd=0) const
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
bool ClusterShapeHitFilter::isCompatible ( DetId  detId,
const SiStripCluster cluster,
const LocalPoint lpos,
const LocalVector ldir 
) const

Definition at line 383 of file ClusterShapeHitFilter.cc.

References StripKeys::isValid(), and relval_steps::key.

384 {
385  int meas;
386  float pred;
387 
388  if (cutOnStripCharge_ && (!checkClusterCharge(detId, cluster, ldir))) return false;
389  if (!cutOnStripShape_) return true;
390 
391  if(getSizes(detId, cluster, lpos, ldir, meas, pred))
392  {
393  StripKeys key(meas);
394  if (key.isValid())
395  return stripLimits[key].isInside(pred);
396  }
397 
398  // Not usable or no limits
399  return true;
400 }
bool checkClusterCharge(DetId detId, const SiStripCluster &cluster, const LocalVector &ldir) const
StripLimits stripLimits[StripKeys::N+1]
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=0) const
bool ClusterShapeHitFilter::isCompatible ( DetId  detId,
const SiStripCluster cluster,
const LocalVector ldir 
) const
inline

Definition at line 211 of file ClusterShapeHitFilter.h.

References isCompatible().

213  {
214  return isCompatible(detId, cluster, LocalPoint(0,0,0), ldir);
215  }
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
bool ClusterShapeHitFilter::isCompatible ( DetId  detId,
const SiStripCluster cluster,
const GlobalPoint gpos,
const GlobalVector gdir 
) const

Definition at line 405 of file ClusterShapeHitFilter.cc.

References GeomDet::toLocal(), and PV3DBase< T, PVType, FrameType >::z().

406 {
407  const GeomDet *det = theTracker->idToDet(detId);
408  LocalVector ldir = det->toLocal(gdir);
409  LocalPoint lpos = det->toLocal(gpos);
410  // now here we do the transformation
411  lpos -= ldir * lpos.z()/ldir.z();
412  return isCompatible(detId, cluster, lpos, ldir);
413 }
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
const TrackerGeometry * theTracker
T z() const
Definition: PV3DBase.h:64
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
virtual const TrackerGeomDet * idToDet(DetId) const
bool ClusterShapeHitFilter::isCompatible ( DetId  detId,
const SiStripCluster cluster,
const GlobalVector gdir 
) const

Definition at line 415 of file ClusterShapeHitFilter.cc.

416 {
417  return isCompatible(detId, cluster, theTracker->idToDet(detId)->toLocal(gdir));
418 }
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
const TrackerGeometry * theTracker
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
virtual const TrackerGeomDet * idToDet(DetId) const
bool ClusterShapeHitFilter::isCompatible ( const SiStripRecHit2D recHit,
const LocalPoint lpos,
const LocalVector ldir 
) const
inline

Definition at line 224 of file ClusterShapeHitFilter.h.

References TrackingRecHit::geographicalId(), isCompatible(), and TrackerSingleRecHit::stripCluster().

226  {
227  return isCompatible(recHit.geographicalId(), recHit.stripCluster(), lpos, ldir);
228  }
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
SiStripCluster const & stripCluster() const
DetId geographicalId() const
bool ClusterShapeHitFilter::isCompatible ( const SiStripRecHit2D recHit,
const LocalVector ldir 
) const
inline

Definition at line 229 of file ClusterShapeHitFilter.h.

References TrackingRecHit::geographicalId(), isCompatible(), and TrackerSingleRecHit::stripCluster().

230  {
231  return isCompatible(recHit.geographicalId(), recHit.stripCluster(), ldir);
232  }
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
SiStripCluster const & stripCluster() const
DetId geographicalId() const
bool ClusterShapeHitFilter::isCompatible ( const SiStripRecHit2D recHit,
const GlobalPoint gpos,
const GlobalVector gdir 
) const
inline

Definition at line 233 of file ClusterShapeHitFilter.h.

References TrackingRecHit::geographicalId(), isCompatible(), and TrackerSingleRecHit::stripCluster().

235  {
236  return isCompatible(recHit.geographicalId(), recHit.stripCluster(), gpos, gdir);
237  }
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
SiStripCluster const & stripCluster() const
DetId geographicalId() const
bool ClusterShapeHitFilter::isCompatible ( const SiStripRecHit2D recHit,
const GlobalVector gdir 
) const
inline

Definition at line 238 of file ClusterShapeHitFilter.h.

References TrackingRecHit::geographicalId(), isCompatible(), and TrackerSingleRecHit::stripCluster().

239  {
240  return isCompatible(recHit.geographicalId(), recHit.stripCluster(), gdir);
241  }
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=0) const
SiStripCluster const & stripCluster() const
DetId geographicalId() const
bool ClusterShapeHitFilter::isNormalOriented ( const GeomDetUnit geomDet) const
private

Definition at line 230 of file ClusterShapeHitFilter.cc.

References GeomDetType::isBarrel(), PV3DBase< T, PVType, FrameType >::perp(), makeMuonMisalignmentScenario::rot, GeomDet::toGlobal(), GeomDet::type(), and PV3DBase< T, PVType, FrameType >::z().

231 {
232  if(geomDet->type().isBarrel())
233  { // barrel
234  float perp0 = geomDet->toGlobal( Local3DPoint(0.,0.,0.) ).perp();
235  float perp1 = geomDet->toGlobal( Local3DPoint(0.,0.,1.) ).perp();
236  return (perp1 > perp0);
237  }
238  else
239  { // endcap
240  float rot = geomDet->toGlobal( LocalVector (0.,0.,1.) ).z();
241  float pos = geomDet->toGlobal( Local3DPoint(0.,0.,0.) ).z();
242  return (rot * pos > 0);
243  }
244 }
bool isBarrel() const
Definition: GeomDetType.cc:13
T perp() const
Definition: PV3DBase.h:72
virtual const GeomDetType & type() const
Definition: GeomDet.cc:90
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
T z() const
Definition: PV3DBase.h:64
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9
void ClusterShapeHitFilter::loadPixelLimits ( )
private

Definition at line 64 of file ClusterShapeHitFilter.cc.

References b, ztail::d, f, relval_steps::k, relval_steps::key, LogTrace, and HLT_25ns14e33_v1_cff::PixelShapeFile.

65 {
67  fileInPath(PixelShapeFile->c_str());
68  //fileInPath("RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape.par");
69  //fileInPath("RecoPixelVertexing/PixelLowPtUtilities/data/pixelShape_Phase1Tk.par");
70  ifstream inFile(fileInPath.fullPath().c_str());
71 
72 
73  while(inFile.eof() == false)
74  {
75  int part,dx,dy;
76 
77  inFile >> part; // 0or 1
78  inFile >> dx; // 0 to 10
79  inFile >> dy; // 0 to 15 ...
80 
81  const PixelKeys key(part,dx,dy);
82  auto & pl = pixelLimits[key];
83 
84  for(int b = 0; b<2 ; b++) // branch
85  for(int d = 0; d<2 ; d++) // direction
86  for(int k = 0; k<2 ; k++) // lower and upper
87  inFile >> pl.data[b][d][k];
88 
89 
90  double f;
91  int d;
92 
93  inFile >> f; // density
94  inFile >> d; // points
95  inFile >> f; // density
96  inFile >> d; // points
97  }
98 
99  inFile.close();
100 
101  LogTrace("MinBiasTracking|ClusterShapeHitFilter")
102  << " [ClusterShapeHitFilter] pixel-cluster-shape filter loaded";
103  }
const std::string * PixelShapeFile
PixelLimits pixelLimits[PixelKeys::N+1]
tuple d
Definition: ztail.py:151
double f[11][100]
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
#define LogTrace(id)
part
Definition: HCALResponse.h:20
double b
Definition: hdecay.h:120
float data[2][2][2]
void ClusterShapeHitFilter::loadStripLimits ( )
private

Definition at line 106 of file ClusterShapeHitFilter.cc.

References b, edm::FileInPath::fullPath(), relval_steps::k, relval_steps::key, and LogTrace.

107 {
108  // Load strip
110  fileInPath("RecoPixelVertexing/PixelLowPtUtilities/data/stripShape.par");
111  ifstream inFile(fileInPath.fullPath().c_str());
112 
113 
114  while(inFile.eof() == false)
115  {
116  int dx;
117  inFile >> dx;
118 
119  StripKeys key(dx);
120  auto & sl = stripLimits[key];
121 
122  for(int b = 0; b<2 ; b++) // branch
123  for(int k = 0; k<2 ; k++) // lower and upper
124  inFile >> sl.data[b][k];
125 
126  }
127 
128  inFile.close();
129 
130  LogTrace("MinBiasTracking|ClusterShapeHitFilter")
131  << " [ClusterShapeHitFilter] strip-cluster-width filter loaded";
132 }
StripLimits stripLimits[StripKeys::N+1]
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
#define LogTrace(id)
double b
Definition: hdecay.h:120
void ClusterShapeHitFilter::setChargeCuts ( bool  cutOnPixelCharge,
float  minGoodPixelCharge,
bool  cutOnStripCharge,
float  minGoodStripCharge 
)
inline

Definition at line 180 of file ClusterShapeHitFilter.h.

References cutOnPixelCharge_, cutOnStripCharge_, minGoodPixelCharge_, and minGoodStripCharge_.

181  {
182  cutOnPixelCharge_ = cutOnPixelCharge; minGoodPixelCharge_= minGoodPixelCharge;
183  cutOnStripCharge_ = cutOnStripCharge; minGoodStripCharge_= minGoodStripCharge; }
void ClusterShapeHitFilter::setShapeCuts ( bool  cutOnPixelShape,
bool  cutOnStripShape 
)
inline

Definition at line 177 of file ClusterShapeHitFilter.h.

References cutOnPixelShape_, and cutOnStripShape_.

177  {
178  cutOnPixelShape_ = cutOnPixelShape; cutOnStripShape_ = cutOnStripShape;}

Friends And Related Function Documentation

Member Data Documentation

bool ClusterShapeHitFilter::cutOnPixelCharge_
private

Definition at line 284 of file ClusterShapeHitFilter.h.

Referenced by setChargeCuts().

bool ClusterShapeHitFilter::cutOnPixelShape_
private

Definition at line 286 of file ClusterShapeHitFilter.h.

Referenced by setShapeCuts().

bool ClusterShapeHitFilter::cutOnStripCharge_
private

Definition at line 284 of file ClusterShapeHitFilter.h.

Referenced by setChargeCuts().

bool ClusterShapeHitFilter::cutOnStripShape_
private

Definition at line 286 of file ClusterShapeHitFilter.h.

Referenced by setShapeCuts().

float ClusterShapeHitFilter::minGoodPixelCharge_
private

Definition at line 285 of file ClusterShapeHitFilter.h.

Referenced by setChargeCuts().

float ClusterShapeHitFilter::minGoodStripCharge_
private

Definition at line 285 of file ClusterShapeHitFilter.h.

Referenced by setChargeCuts().

std::unordered_map<unsigned int, PixelData> ClusterShapeHitFilter::pixelData
private

Definition at line 277 of file ClusterShapeHitFilter.h.

Referenced by getpd().

PixelLimits ClusterShapeHitFilter::pixelLimits[PixelKeys::N+1]
private

Definition at line 279 of file ClusterShapeHitFilter.h.

const std::string* ClusterShapeHitFilter::PixelShapeFile
private

Definition at line 275 of file ClusterShapeHitFilter.h.

StripLimits ClusterShapeHitFilter::stripLimits[StripKeys::N+1]
private

Definition at line 281 of file ClusterShapeHitFilter.h.

float ClusterShapeHitFilter::theAngle[6]
private

Definition at line 283 of file ClusterShapeHitFilter.h.

const MagneticField* ClusterShapeHitFilter::theMagneticField
private

Definition at line 270 of file ClusterShapeHitFilter.h.

const SiPixelLorentzAngle* ClusterShapeHitFilter::theSiPixelLorentzAngle
private

Definition at line 272 of file ClusterShapeHitFilter.h.

const SiStripLorentzAngle* ClusterShapeHitFilter::theSiStripLorentzAngle
private

Definition at line 273 of file ClusterShapeHitFilter.h.

const TrackerGeometry* ClusterShapeHitFilter::theTracker
private

Definition at line 269 of file ClusterShapeHitFilter.h.