test
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 630 of file QuadrupletSeedMerger.cc.

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

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

Referenced by plotting.Plot::draw().

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 693 of file QuadrupletSeedMerger.cc.

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

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

References ecal_dqm_sourceclient-live_cfg::cerr.

Referenced by SeedMergerPixelLayer().

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

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