Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:36

0001 use strict;
0002 use warnings;
0003 use CMSDetID;
0004 
0005 open ALL, $ENV{'CMSSW_RELEASE_BASE'}."/src/CalibTracker/SiStripCommon/data/SiStripDetInfo.dat" or die "Can't find SiStripDetInfo.dat";
0006 
0007 open OUT, "> BadModules.cff" or die "Can't write to BadModules.cff";
0008 print OUT <<_EOF;
0009 replace prod.BadModuleList = {
0010 _EOF
0011 
0012 my $first = 1;
0013 my $tot = 0; my $bads = 0;
0014 while(<ALL>) {
0015     my ($detid, $napv, $foo, $bar) = split(/\s+/, $_);
0016     my $bad = 0;
0017     my $DetId = CMSDetID->new($detid);
0018 
0019     # --- insert logic here ------    
0020 
0021     $bad = 1 if ($DetId->subdetName() eq 'TIB') && ($DetId->tiblayer() == 3);
0022     $bad = 1 if ($DetId->subdetName() eq 'TIB') && ($DetId->tiblayer() == 4);
0023 
0024     # --- end logic --------------
0025 
0026     if ($bad) {
0027         print OUT ($first ? "\t " : "\t,"), $detid, "\n";
0028         $first = 0;
0029         $bads++;
0030     }
0031     $tot++;
0032 }
0033 
0034 print OUT "}\n";
0035 close OUT;
0036 print "Summary: $bads modules over $tot total modules.\n";