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 633 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.

633  {
634 
635  if( ! isValidName( name ) ) {
636  std::cerr << " [SeedMergerPixelLayer::SeedMergerPixelLayer] ** ERROR: illegal name: \"" << name << "\"." << std::endl;
637  isValid_ = false;
638  return;
639  }
640 
641  // bare name, can be done here
642  name_ = name;
643 
644  // (output format -> see DataFormats/SiPixelDetId/interface/PixelSubdetector.h)
645  if( std::string::npos != name_.find( "BPix" ) )
647  else if( std::string::npos != name_.find( "FPix" ) )
649  if( std::string::npos != name_.find( "pos", 6 ) ) side_ = Plus;
650  else if( std::string::npos != name_.find( "neg", 6 ) ) side_ = Minus;
651  else {
652  std::cerr << " [PixelLayerNameParser::side] ** ERROR: something's wrong here.." << std::endl;
653  side_ = SideError;
654  }
655  }
656  else {
657  std::cerr << " [PixelLayerNameParser::subdetector] ** ERROR: something's wrong here.." << std::endl;
658  }
659 
660  // layer
661  layer_ = atoi( name_.substr( 4, 1 ).c_str() );
662 
663 }
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 696 of file QuadrupletSeedMerger.cc.

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

696  {
697 
699 
700  // same subdet?
701  if( detId.subdetId() == subdet ) {
702 
703  // same barrel layer?
704  if( PixelSubdetector::PixelBarrel == subdet ) {
705  if (tTopo->pxbLayer(detId) == getLayerNumber()) {
706  return true;
707  }
708  }
709 
710  // same endcap disk?
711  else if( PixelSubdetector::PixelEndcap == subdet ) {
712 
713  if (tTopo->pxfDisk(detId) == getLayerNumber()) {
714  if (tTopo->pxfSide(detId) == (unsigned)getSide()) {
715  return true;
716  }
717  }
718  }
719 
720  }
721 
722  return false;
723 
724 }
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:37
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 670 of file QuadrupletSeedMerger.cc.

References dtNoiseDBValidation_cfg::cerr.

Referenced by SeedMergerPixelLayer().

670  {
671 
672  const int layer = atoi( name.substr( 4, 1 ).c_str() );
673 
674  if( std::string::npos != name.find( "BPix" ) ) {
675  if( layer > 0 && layer < 5 ) return true;
676  }
677 
678  else if( std::string::npos != name.find( "FPix" ) ) {
679  if( layer > 0 && layer < 4 ) {
680  if( std::string::npos != name.find( "pos", 6 ) || std::string::npos != name.find( "neg", 6 ) ) return true;
681  }
682 
683  }
684 
685  std::cerr << " [SeedMergerPixelLayer::isValidName] ** WARNING: invalid name: \"" << name << "\"." << std::endl;
686  return false;
687 
688 }

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().