Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:54

0001 #!/usr/bin/perl
0002 
0003 use lib "./lib";
0004 
0005 use warnings;
0006 use strict;
0007 $|++;
0008 
0009 use TB04::Importer;
0010 use ConnectionFile;
0011 
0012 print "Loading Importer (connect to DB)...";
0013 my $importer = new TB04::Importer;
0014 print "Done.\n";
0015 
0016 # an IoV for the duration of the 2004 test beam
0017 my $testbeam_IoV = { since => "2004-10-21 18:04:00", till => "2004-11-23 10:44:00" };
0018 
0019 # go to work
0020 fill_Xtal_alpha();
0021 fill_Xtal_T_coeff();
0022 fill_APD_T_coeff();
0023 
0024 # fill the Xtal alpha table with dummy values of 1.56 
0025 sub fill_Xtal_alpha {
0026   my $cond_name = "Xtal_alpha";
0027   my $view_name = "EB_crystal_number";
0028   my $dummy = 1.56;
0029 
0030   print "Loading view $view_name...";
0031   $importer->load_view($view_name);
0032   print "Done.\n";
0033 
0034   print "Filling $cond_name with dummy...";
0035   my $SM = 10;
0036   foreach my $xtal (1..1700) {
0037     $importer->insert($cond_name, $view_name, [$SM, $xtal], $testbeam_IoV, $dummy);
0038   }
0039   print "Done.\n";
0040 }
0041 
0042 sub fill_Xtal_T_coeff {
0043   my $cond_name = "Xtal_T_coeff";
0044   my $view_name = "EB_crystal_number";
0045   my $dummy = -0.02;
0046 
0047   print "Loading view $view_name...";
0048   $importer->load_view($view_name);
0049   print "Done.\n";
0050 
0051   print "Filling $cond_name with dummy...";
0052   my $SM = 10;
0053   foreach my $xtal (1..1700) {
0054     $importer->insert($cond_name, $view_name, [$SM, $xtal], $testbeam_IoV, $dummy);
0055   }
0056   print "Done.\n";
0057 }
0058 
0059 sub fill_APD_T_coeff {
0060   my $cond_name = "APD_T_coeff";
0061   my $view_name = "EB_crystal_number";
0062   my $dummy = -0.02;
0063 
0064   print "Loading view $view_name...";
0065   $importer->load_view($view_name);
0066   print "Done.\n";
0067 
0068   print "Filling $cond_name with dummy...";
0069   my $SM = 10;
0070   foreach my $xtal (1..1700) {
0071     $importer->insert($cond_name, $view_name, [$SM, $xtal], $testbeam_IoV, $dummy);
0072   }
0073   print "Done.\n";
0074 }
0075