5 return os.environ[
'CMSSW_BASE'].
split(
'/')[-1]
21 ibrel = re.compile(
'^CMSSW_(\d+)_(\d+)_X.*$')
22 m = ibrel.match(release)
25 medium = int(m.group(2))
27 rerel = re.compile(
'^CMSSW_(\d+)_(\d+)_(\d+)(_\S+)*$')
28 m = rerel.match(release)
30 raise ValueError(
'malformed release string '+release)
32 medium = int(m.group(2))
33 small = int(m.group(3))
35 prel = re.compile(
'_pre(\d+)')
36 patch = re.compile(
'_patch(\d+)')
37 pm = prel.match(m.group(4))
39 pre = int(pm.group(1))
40 return big, medium, small, pre
42 pm2 = patch.match(m.group(4))
44 pat = int(pm2.group(1))
45 return big, medium, small, pat
47 raise ValueError(
'patch or prerelease string malformed '+m.group(4))
49 return big, medium, small
52 """Checks the orders of two releases. If release2 is not set, it is taken as the current release"""
56 if __name__ ==
'__main__':
63 self.assertTrue(rel.startswith(
'CMSSW_'))
66 self.assertEqual(out, (7,2,1))
68 self.assertEqual(out, (10,2,1,4))
70 self.assertEqual(out, (7,3))
72 self.assertEqual(out, (7,3,0,2))
73 self.assertRaises(ValueError, releaseNumber,
'foobar')
74 self.assertRaises(ValueError, releaseNumber,
'CMSSW_1_2_3_xat3')
75 self.assertRaises(ValueError, releaseNumber,
'CMSSW_1_2_a')
77 self.assertTrue(
isNewerThan(
'CMSSW_5_3_1',
'CMSSW_7_1_0') )
78 self.assertTrue(
isNewerThan(
'CMSSW_5_3_1',
'CMSSW_5_3_1_patch1') )
79 self.assertTrue(
isNewerThan(
'CMSSW_5_3_1',
'CMSSW_5_3_1_pre1') )
80 self.assertTrue(
isNewerThan(
'CMSSW_5_3_1_pre1',
'CMSSW_5_3_1_pre2') )
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)