Exemple #1
0
    def test_extract_marcxml_2(self):
        """Test_format_marcxml_file - extract marcxml without report_nos, doi"""

        #Test with marcxml file 2
        marcxml = open("%s%sTest_marcxml_file_2.xml" % (TEST_DATA, os.sep)).read()
        metadata = format_marcxml_file(marcxml)
        self.assertEqual(metadata['id'], "arXiv:1001.1674")
        self.assertEqual(metadata['title'],  "Persistent storage of non-event data in the CMS databases")
        self.assertEqual(metadata['contributors'][0]['name'], "De Gruttola, M")
        self.assertEqual(metadata['contributors'][0]['affiliation'][0], "CERN")
        self.assertEqual(metadata['contributors'][0]['affiliation'][1], "INFN, Naples")
        self.assertEqual(metadata['contributors'][0]['affiliation'][2], "Naples U.")
        self.assertEqual(metadata['summary'], "In the CMS experiment, the non event data needed to set up the detector, or being produced by it, and needed to calibrate the physical responses of the detector itself are stored in ORACLE databases. The large amount of data to be stored, the number of clients involved and the performance requirements make the database system an essential service for the experiment to run. This note describes the CMS condition database architecture, the data-flow and PopCon, the tool built in order to populate the offline databases. Finally, the first results obtained during the 2008 and 2009 cosmic data taking are presented.")
        self.assertEqual(metadata['contributors'][1]['name'], "Di Guida, S")
        self.assertEqual(metadata['contributors'][1]['affiliation'][0], "CERN")
        self.assertEqual(metadata['contributors'][2]['name'], "Futyan, D")
        self.assertEqual(metadata['contributors'][2]['affiliation'][0], "Imperial Coll., London")
        nb_contributors = len(metadata['contributors'])
        self.assertEqual(nb_contributors, 11)
        self.assertEqual(metadata['contributors'][10]['name'], "Xie, Z")
        self.assertEqual(metadata['contributors'][10]['affiliation'][0], "Princeton U.")
        self.assertEqual(metadata['doi'], '')
        self.assertEqual(metadata['journal_refs'][0], "JINST: P04003 (2010) pp. 5")
        self.assertEqual(len(metadata['journal_refs']), 1)
        self.assertEqual('report_nos' in metadata, True)
        self.assertEqual(metadata['comment'], "Comments: 20 pages, submitted to IOP")
Exemple #2
0
    def test_extract_marcxml_2(self):
        """Test_format_marcxml_file - extract marcxml without report_nos, doi"""

        #Test with marcxml file 2
        marcxml = open("%s%sTest_marcxml_file_2.xml" % (TEST_DATA, os.sep)).read()
        metadata = format_marcxml_file(marcxml)
        self.assertEqual(metadata['id'], "arXiv:1001.1674")
        self.assertEqual(metadata['title'],  "Persistent storage of non-event data in the CMS databases")
        self.assertEqual(metadata['contributors'][0]['name'], "De Gruttola, M")
        self.assertEqual(metadata['contributors'][0]['affiliation'][0], "CERN")
        self.assertEqual(metadata['contributors'][0]['affiliation'][1], "INFN, Naples")
        self.assertEqual(metadata['contributors'][0]['affiliation'][2], "Naples U.")
        self.assertEqual(metadata['summary'], "In the CMS experiment, the non event data needed to set up the detector, or being produced by it, and needed to calibrate the physical responses of the detector itself are stored in ORACLE databases. The large amount of data to be stored, the number of clients involved and the performance requirements make the database system an essential service for the experiment to run. This note describes the CMS condition database architecture, the data-flow and PopCon, the tool built in order to populate the offline databases. Finally, the first results obtained during the 2008 and 2009 cosmic data taking are presented.")
        self.assertEqual(metadata['contributors'][1]['name'], "Di Guida, S")
        self.assertEqual(metadata['contributors'][1]['affiliation'][0], "CERN")
        self.assertEqual(metadata['contributors'][2]['name'], "Futyan, D")
        self.assertEqual(metadata['contributors'][2]['affiliation'][0], "Imperial Coll., London")
        nb_contributors = len(metadata['contributors'])
        self.assertEqual(nb_contributors, 11)
        self.assertEqual(metadata['contributors'][10]['name'], "Xie, Z")
        self.assertEqual(metadata['contributors'][10]['affiliation'][0], "Princeton U.")
        self.assertEqual(metadata['doi'], '')
        self.assertEqual(metadata['journal_refs'][0], "JINST: P04003 (2010) pp. 5")
        self.assertEqual(len(metadata['journal_refs']), 1)
        self.assertEqual('report_nos' in metadata, True)
        self.assertEqual(metadata['comment'], "Comments: 20 pages, submitted to IOP")
Exemple #3
0
    def test_extract_full_marcxml_3(self):
        """Test_format_marcxml_file - extract marcxml without doi"""

        #Test with marcxml file 3
        marcxml = open("%s%sTest_marcxml_file_3.xml" % (TEST_DATA, os.sep)).read()
        metadata = format_marcxml_file(marcxml)
        self.assertEqual(metadata['id'], "ATL-PHYS-CONF-2007-008")
        self.assertEqual(metadata['title'],  "Early Standard Model physics and early discovery strategy in ATLAS")
        self.assertEqual(metadata['contributors'][0]['name'], "Grosse-Knetter, J")
        self.assertEqual(metadata['contributors'][0]['affiliation'][0], "Bonn U.")
        self.assertEqual(metadata['summary'], "In 2008 the LHC will open a new energy domain for physics within the Standard Model and beyond. The physics channels which will be addressed by the ATLAS experiment in the initial period of operation will be discussed. These include Standard Model processes such as W/Z production and early top measurements. This will be followed by a description of the searches for a low-mass Higgs boson, new heavy di-lepton resonances, and Supersymmetry, for which a striking signal might be observed after only a few months of data taking.")
        self.assertEqual(len(metadata['contributors']), 1)
        self.assertEqual(metadata['doi'], '')
        self.assertEqual(metadata['journal_refs'][0], "Nucl. Phys. B, Proc. Suppl.: 55-59 (2008) pp. 177-178")
        self.assertEqual(len(metadata['journal_refs']), 1)
        self.assertEqual(len(metadata['report_nos']), 2)
        self.assertEqual(metadata['report_nos'][0], "ATL-COM-PHYS-2007-036")
        self.assertEqual(metadata['report_nos'][1], "CERN-ATL-COM-PHYS-2007-036")
        self.assertEqual(metadata['comment'], '')
Exemple #4
0
    def test_extract_full_marcxml_3(self):
        """Test_format_marcxml_file - extract marcxml without doi"""

        #Test with marcxml file 3
        marcxml = open("%s%sTest_marcxml_file_3.xml" % (TEST_DATA, os.sep)).read()
        metadata = format_marcxml_file(marcxml)
        self.assertEqual(metadata['id'], "ATL-PHYS-CONF-2007-008")
        self.assertEqual(metadata['title'],  "Early Standard Model physics and early discovery strategy in ATLAS")
        self.assertEqual(metadata['contributors'][0]['name'], "Grosse-Knetter, J")
        self.assertEqual(metadata['contributors'][0]['affiliation'][0], "Bonn U.")
        self.assertEqual(metadata['summary'], "In 2008 the LHC will open a new energy domain for physics within the Standard Model and beyond. The physics channels which will be addressed by the ATLAS experiment in the initial period of operation will be discussed. These include Standard Model processes such as W/Z production and early top measurements. This will be followed by a description of the searches for a low-mass Higgs boson, new heavy di-lepton resonances, and Supersymmetry, for which a striking signal might be observed after only a few months of data taking.")
        self.assertEqual(len(metadata['contributors']), 1)
        self.assertEqual(metadata['doi'], '')
        self.assertEqual(metadata['journal_refs'][0], "Nucl. Phys. B, Proc. Suppl.: 55-59 (2008) pp. 177-178")
        self.assertEqual(len(metadata['journal_refs']), 1)
        self.assertEqual(len(metadata['report_nos']), 2)
        self.assertEqual(metadata['report_nos'][0], "ATL-COM-PHYS-2007-036")
        self.assertEqual(metadata['report_nos'][1], "CERN-ATL-COM-PHYS-2007-036")
        self.assertEqual(metadata['comment'], '')
Exemple #5
0
 def test_extract_marcxml_1(self):
     """Test_format_marcxml_file - extract marcxml without id, report_nos and comment"""
     # Test with marcxml file 1
     marcxml = open("%s%sTest_marcxml_file_1.xml" % (TEST_DATA, os.sep)).read()
     metadata = format_marcxml_file(marcxml)
     self.assertEqual(metadata['id'], '')
     self.assertEqual(metadata['title'],  "Calorimetry triggering in ATLAS")
     self.assertEqual(metadata['contributors'][0]['name'], "Igonkina, O")
     self.assertEqual(metadata['contributors'][0]['affiliation'][0], "NIKHEF, Amsterdam")
     self.assertEqual(metadata['summary'], "The ATLAS experiment is preparing for data taking at 14 TeV collision energy. A rich discovery physics program is being prepared in addition to the detailed study of Standard Model processes which will be produced in abundance. The ATLAS multi-level trigger system is designed to accept one event in 2 105 to enable the selection of rare and unusual physics events. The ATLAS calorimeter system is a precise instrument, which includes liquid Argon electro-magnetic and hadronic components as well as a scintillator-tile hadronic calorimeter. All these components are used in the various levels of the trigger system. A wide physics coverage is ensured by inclusively selecting events with candidate electrons, photons, taus, jets or those with large missing transverse energy. The commissioning of the trigger system is being performed with cosmic ray events and by replaying simulated Monte Carlo events through the trigger and data acquisition system.")
     self.assertEqual(metadata['contributors'][1]['name'], "Achenbach, R")
     self.assertEqual(metadata['contributors'][1]['affiliation'][0], "Kirchhoff Inst. Phys.")
     self.assertEqual(metadata['contributors'][2]['name'], "Adragna, P")
     self.assertEqual(metadata['contributors'][2]['affiliation'][0], "Queen Mary, U. of London")
     nb_contributors = len(metadata['contributors'])
     self.assertEqual(nb_contributors, 205)
     self.assertEqual(metadata['contributors'][204]['name'], "Özcan, E")
     self.assertEqual(metadata['contributors'][204]['affiliation'][0], "University Coll. London")
     self.assertEqual(metadata['doi'], "10.1088/1742-6596/160/1/012061")
     self.assertEqual(metadata['journal_refs'][0], "J. Phys.: Conf. Ser.: 012061 (2009) pp. 160")
     self.assertEqual(len(metadata['journal_refs']), 1)
     self.assertEqual('report_nos' in metadata, True)
     self.assertEqual(metadata['comment'], '')
Exemple #6
0
 def test_extract_marcxml_1(self):
     """Test_format_marcxml_file - extract marcxml without id, report_nos and comment"""
     # Test with marcxml file 1
     marcxml = open("%s%sTest_marcxml_file_1.xml" % (TEST_DATA, os.sep)).read()
     metadata = format_marcxml_file(marcxml)
     self.assertEqual(metadata['id'], '')
     self.assertEqual(metadata['title'],  "Calorimetry triggering in ATLAS")
     self.assertEqual(metadata['contributors'][0]['name'], "Igonkina, O")
     self.assertEqual(metadata['contributors'][0]['affiliation'][0], "NIKHEF, Amsterdam")
     self.assertEqual(metadata['summary'], "The ATLAS experiment is preparing for data taking at 14 TeV collision energy. A rich discovery physics program is being prepared in addition to the detailed study of Standard Model processes which will be produced in abundance. The ATLAS multi-level trigger system is designed to accept one event in 2 105 to enable the selection of rare and unusual physics events. The ATLAS calorimeter system is a precise instrument, which includes liquid Argon electro-magnetic and hadronic components as well as a scintillator-tile hadronic calorimeter. All these components are used in the various levels of the trigger system. A wide physics coverage is ensured by inclusively selecting events with candidate electrons, photons, taus, jets or those with large missing transverse energy. The commissioning of the trigger system is being performed with cosmic ray events and by replaying simulated Monte Carlo events through the trigger and data acquisition system.")
     self.assertEqual(metadata['contributors'][1]['name'], "Achenbach, R")
     self.assertEqual(metadata['contributors'][1]['affiliation'][0], "Kirchhoff Inst. Phys.")
     self.assertEqual(metadata['contributors'][2]['name'], "Adragna, P")
     self.assertEqual(metadata['contributors'][2]['affiliation'][0], "Queen Mary, U. of London")
     nb_contributors = len(metadata['contributors'])
     self.assertEqual(nb_contributors, 205)
     self.assertEqual(metadata['contributors'][204]['name'], "Özcan, E")
     self.assertEqual(metadata['contributors'][204]['affiliation'][0], "University Coll. London")
     self.assertEqual(metadata['doi'], "10.1088/1742-6596/160/1/012061")
     self.assertEqual(metadata['journal_refs'][0], "J. Phys.: Conf. Ser.: 012061 (2009) pp. 160")
     self.assertEqual(len(metadata['journal_refs']), 1)
     self.assertEqual('report_nos' in metadata, True)
     self.assertEqual(metadata['comment'], '')
Exemple #7
0
    def test_extract_wrong_file(self):
        """Test_format_marcxml_file - unexistant metadata file"""

        #Test with a unknown marcxml file
        metadata = format_marcxml_file("%s%sTest_marcxml_file_false.xml" % (TEST_DATA, os.sep), True)
        self.assertEqual(metadata["error"], "Unable to open marcxml file !")
Exemple #8
0
    def test_extract_null_marcxml(self):
        """Test_format_marcxml_file - no metadata"""

        #Test without any marcxml file
        metadata = format_marcxml_file("")
        self.assertEqual(metadata["error"], "MARCXML string is empty !")
Exemple #9
0
    def test_extract_wrong_file(self):
        """Test_format_marcxml_file - unexistant metadata file"""

        #Test with a unknown marcxml file
        metadata = format_marcxml_file("%s%sTest_marcxml_file_false.xml" % (TEST_DATA, os.sep), True)
        self.assertEqual(metadata["error"], "Unable to open marcxml file !")
Exemple #10
0
    def test_extract_null_marcxml(self):
        """Test_format_marcxml_file - no metadata"""

        #Test without any marcxml file
        metadata = format_marcxml_file("")
        self.assertEqual(metadata["error"], "MARCXML string is empty !")