Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:12

0001 package CMSDetID;
0002 
0003 use strict;
0004 use warnings;
0005 
0006 require Exporter;
0007 
0008 our @ISA = qw(Exporter);
0009 
0010 # Items to export into callers namespace by default. Note: do not export
0011 # names by default without a very good reason. Use EXPORT_OK instead.
0012 # Do not simply export all your public functions/methods/constants.
0013 
0014 # This allows declaration       use Foo::Bar ':all';
0015 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
0016 # will save memory.
0017 our %EXPORT_TAGS = ( 'all' => [ qw(
0018 ) ] );
0019 
0020 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
0021 
0022 our @EXPORT = qw(
0023 
0024 );
0025 
0026 our $VERSION = '0.01';
0027 
0028 
0029 # Preloaded methods go here.
0030 
0031 sub new {
0032       my $class = shift;
0033       my $detid = shift;
0034       bless \$detid, $class;
0035 }
0036 sub det {
0037     my $self = shift; my $detid = $$self;
0038     #print "MyDetID is $detid\n";
0039     return ($detid >> 28) & (0xF);
0040 }
0041 sub subdet {
0042     my $self = shift; my $detid = $$self;
0043     return ($detid >> 25) & (0x7);
0044 }
0045 my %subdetNames = (3 => 'TIB', 4=>'TID', 5=>'TOB', 6=>'TEC' );
0046 sub subdetName { return $subdetNames{shift->subdet()}; }
0047 
0048 sub tiblayer {
0049     my $self = shift; my $detid = $$self;
0050     return ($detid >> 14) & 0x7;
0051 }
0052 
0053 # Autoload methods go after =cut, and are processed by the autosplit program.
0054 
0055 1;
0056 __END__