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 51 of file QuadrupletSeedMerger.h.

Member Enumeration Documentation

Enumerator
Minus 
Plus 
Undefined 
SideError 

Definition at line 54 of file QuadrupletSeedMerger.h.

Constructor & Destructor Documentation

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

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

636  {
637 
638  if( ! isValidName( name ) ) {
639  std::cerr << " [SeedMergerPixelLayer::SeedMergerPixelLayer] ** ERROR: illegal name: \"" << name << "\"." << std::endl;
640  isValid_ = false;
641  return;
642  }
643 
644  // bare name, can be done here
645  name_ = name;
646 
647  // (output format -> see DataFormats/SiPixelDetId/interface/PixelSubdetector.h)
648  if( std::string::npos != name_.find( "BPix" ) )
650  else if( std::string::npos != name_.find( "FPix" ) )
652  if( std::string::npos != name_.find( "pos", 6 ) ) side_ = Plus;
653  else if( std::string::npos != name_.find( "neg", 6 ) ) side_ = Minus;
654  else {
655  std::cerr << " [PixelLayerNameParser::side] ** ERROR: something's wrong here.." << std::endl;
656  side_ = SideError;
657  }
658  }
659  else {
660  std::cerr << " [PixelLayerNameParser::subdetector] ** ERROR: something's wrong here.." << std::endl;
661  }
662 
663  // layer
664  layer_ = atoi( name_.substr( 4, 1 ).c_str() );
665 
666 }
PixelSubdetector::SubDetector subdet_
SeedMergerPixelLayer::Side side_
bool isValidName(const std::string &)

Member Function Documentation

unsigned SeedMergerPixelLayer::getLayerNumber ( void  ) const
inline

Definition at line 57 of file QuadrupletSeedMerger.h.

References layer_.

Referenced by isContainsDetector().

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

Definition at line 60 of file QuadrupletSeedMerger.h.

References name_.

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

Definition at line 58 of file QuadrupletSeedMerger.h.

References side_.

Referenced by isContainsDetector().

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

Definition at line 59 of file QuadrupletSeedMerger.h.

References subdet_.

Referenced by isContainsDetector().

59 { 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 699 of file QuadrupletSeedMerger.cc.

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

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

References dtNoiseDBValidation_cfg::cerr.

Referenced by SeedMergerPixelLayer().

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

Member Data Documentation

bool SeedMergerPixelLayer::isValid_
private

Definition at line 65 of file QuadrupletSeedMerger.h.

Referenced by SeedMergerPixelLayer().

unsigned SeedMergerPixelLayer::layer_
private

Definition at line 68 of file QuadrupletSeedMerger.h.

Referenced by getLayerNumber(), and SeedMergerPixelLayer().

std::string SeedMergerPixelLayer::name_
private

Definition at line 66 of file QuadrupletSeedMerger.h.

Referenced by getName(), and SeedMergerPixelLayer().

SeedMergerPixelLayer::Side SeedMergerPixelLayer::side_
private

Definition at line 69 of file QuadrupletSeedMerger.h.

Referenced by getSide(), and SeedMergerPixelLayer().

PixelSubdetector::SubDetector SeedMergerPixelLayer::subdet_
private

Definition at line 67 of file QuadrupletSeedMerger.h.

Referenced by getSubdet(), and SeedMergerPixelLayer().