CMS 3D CMS Logo

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

#include <QuadrupletSeedMerger.h>

Public Types

enum  Side { Minus =1, Plus =2, Undefined, SideError }
 

Public Member Functions

unsigned getLayerNumber (void) const
 
std::string getName (void) const
 
Side getSide (void) const
 
PixelSubdetector::SubDetector getSubdet (void) const
 
bool isContainsDetector (const DetId &, const TrackerTopology *tTopo) const
 
 SeedMergerPixelLayer (const std::string &)
 

Private Member Functions

bool isValidName (const std::string &)
 

Private Attributes

bool isValid_
 
unsigned layer_
 
std::string name_
 
SeedMergerPixelLayer::Side side_
 
PixelSubdetector::SubDetector subdet_
 

Detailed Description

helper class for extracting info from layer bare names

Definition at line 49 of file QuadrupletSeedMerger.h.

Member Enumeration Documentation

Enumerator
Minus 
Plus 
Undefined 
SideError 

Definition at line 52 of file QuadrupletSeedMerger.h.

Constructor & Destructor Documentation

SeedMergerPixelLayer::SeedMergerPixelLayer ( const std::string &  name)

Definition at line 699 of file QuadrupletSeedMerger.cc.

References dtNoiseDBValidation_cfg::cerr, isValid_, isValidName(), layer_, Minus, mergeVDriftHistosByStation::name, name_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, Plus, side_, SideError, subdet_, and Undefined.

699  {
700 
701  if( ! isValidName( name ) ) {
702  std::cerr << " [SeedMergerPixelLayer::SeedMergerPixelLayer] ** ERROR: illegal name: \"" << name << "\"." << std::endl;
703  isValid_ = false;
704  return;
705  }
706 
707  // bare name, can be done here
708  name_ = name;
709 
710  // (output format -> see DataFormats/SiPixelDetId/interface/PixelSubdetector.h)
711  if( std::string::npos != name_.find( "BPix" ) )
713  else if( std::string::npos != name_.find( "FPix" ) )
715  if( std::string::npos != name_.find( "pos", 6 ) ) side_ = Plus;
716  else if( std::string::npos != name_.find( "neg", 6 ) ) side_ = Minus;
717  else {
718  std::cerr << " [PixelLayerNameParser::side] ** ERROR: something's wrong here.." << std::endl;
719  side_ = SideError;
720  }
721  }
722  else {
723  std::cerr << " [PixelLayerNameParser::subdetector] ** ERROR: something's wrong here.." << std::endl;
724  }
725 
726  // layer
727  layer_ = atoi( name_.substr( 4, 1 ).c_str() );
728 
729 }
PixelSubdetector::SubDetector subdet_
SeedMergerPixelLayer::Side side_
bool isValidName(const std::string &)

Member Function Documentation

unsigned SeedMergerPixelLayer::getLayerNumber ( void  ) const
inline

Definition at line 55 of file QuadrupletSeedMerger.h.

References layer_.

Referenced by isContainsDetector().

55 { return layer_; }
std::string SeedMergerPixelLayer::getName ( void  ) const
inline

Definition at line 58 of file QuadrupletSeedMerger.h.

References name_.

58 { return name_; }
Side SeedMergerPixelLayer::getSide ( void  ) const
inline

Definition at line 56 of file QuadrupletSeedMerger.h.

References side_.

Referenced by isContainsDetector().

56 { return side_;}
SeedMergerPixelLayer::Side side_
PixelSubdetector::SubDetector SeedMergerPixelLayer::getSubdet ( void  ) const
inline

Definition at line 57 of file QuadrupletSeedMerger.h.

References subdet_.

Referenced by isContainsDetector().

57 { return subdet_; }
PixelSubdetector::SubDetector subdet_
bool SeedMergerPixelLayer::isContainsDetector ( const DetId detId,
const TrackerTopology tTopo 
) const

check if the layer or disk described by this object is the one carrying the detector: detId

Definition at line 762 of file QuadrupletSeedMerger.cc.

References getLayerNumber(), getSide(), getSubdet(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), TrackerTopology::pxfSide(), and DetId::subdetId().

Referenced by QuadrupletSeedMerger::isMergeableHitsInTriplets(), and QuadrupletSeedMerger::isTripletsShareHitsOnLayers().

762  {
763 
765 
766  // same subdet?
767  if( detId.subdetId() == subdet ) {
768 
769  // same barrel layer?
770  if( PixelSubdetector::PixelBarrel == subdet ) {
771  if (tTopo->pxbLayer(detId) == getLayerNumber()) {
772  return true;
773  }
774  }
775 
776  // same endcap disk?
777  else if( PixelSubdetector::PixelEndcap == subdet ) {
778 
779  if (tTopo->pxfDisk(detId) == getLayerNumber()) {
780  if (tTopo->pxfSide(detId) == (unsigned)getSide()) {
781  return true;
782  }
783  }
784  }
785 
786  }
787 
788  return false;
789 
790 }
unsigned int pxfDisk(const DetId &id) const
unsigned getLayerNumber(void) const
PixelSubdetector::SubDetector getSubdet(void) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int pxbLayer(const DetId &id) const
Side getSide(void) const
unsigned int pxfSide(const DetId &id) const
bool SeedMergerPixelLayer::isValidName ( const std::string &  name)
private

check if we have a name string as expected

Definition at line 736 of file QuadrupletSeedMerger.cc.

References dtNoiseDBValidation_cfg::cerr.

Referenced by SeedMergerPixelLayer().

736  {
737 
738  const int layer = atoi( name.substr( 4, 1 ).c_str() );
739 
740  if( std::string::npos != name.find( "BPix" ) ) {
741  if( layer > 0 && layer < 5 ) return true;
742  }
743 
744  else if( std::string::npos != name.find( "FPix" ) ) {
745  if( layer > 0 && layer < 4 ) {
746  if( std::string::npos != name.find( "pos", 6 ) || std::string::npos != name.find( "neg", 6 ) ) return true;
747  }
748 
749  }
750 
751  std::cerr << " [SeedMergerPixelLayer::isValidName] ** WARNING: invalid name: \"" << name << "\"." << std::endl;
752  return false;
753 
754 }

Member Data Documentation

bool SeedMergerPixelLayer::isValid_
private

Definition at line 63 of file QuadrupletSeedMerger.h.

Referenced by SeedMergerPixelLayer().

unsigned SeedMergerPixelLayer::layer_
private

Definition at line 66 of file QuadrupletSeedMerger.h.

Referenced by getLayerNumber(), and SeedMergerPixelLayer().

std::string SeedMergerPixelLayer::name_
private

Definition at line 64 of file QuadrupletSeedMerger.h.

Referenced by getName(), and SeedMergerPixelLayer().

SeedMergerPixelLayer::Side SeedMergerPixelLayer::side_
private

Definition at line 67 of file QuadrupletSeedMerger.h.

Referenced by getSide(), and SeedMergerPixelLayer().

PixelSubdetector::SubDetector SeedMergerPixelLayer::subdet_
private

Definition at line 65 of file QuadrupletSeedMerger.h.

Referenced by getSubdet(), and SeedMergerPixelLayer().