Repository: scikit-hep/uproot5

Issue:
Cannot read `TParameter<Long64_t>`
```py
>>> uproot.__version__
'4.3.4'
>>> v = uproot.open("bb-pdf-cables-cables_all-Co60.root")["NumberOfPrimariesEdep"] # <Unknown TParameter<Long64_t> at 0x7fae30e27e50>
>>> v.members
{}
```
So I cannot obviously ask for `fVal`. Bug? ([bb-pdf-cables-cables_all-Co60.root](https://github.com/scikit-hep/uproot5/files/9506174/bb-pdf-cables-cables_all-Co60.root.txt))




Discussion:
It's because the class name was `TParameter<Long64_t>` in the TKey, but `TParameter<long long>` in the TStreamerInfo.

In all of our tests, the template name is always based on C fundamental types, not ROOT's aliases:

```
BDSOutputROOTEventSampler<float>
ROOT::Detail::VecOps::RAdoptAllocator<float>
ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> >
ROOT::Math::PxPyPzE4D<float>
TMatrixT<double>
TMatrixTBase<double>
TMatrixTSym<double>
TParameter<bool>
TParameter<double>
TParameter<int>
pair<TLorentzVector,int>
pair<double,double>
pair<int,BDSOutputROOTGeant4Data::ParticleInfo>
pair<int,int>
pair<long,int>
pair<string,double>
pair<string,int>
pair<string,string>
pair<unsigned int,string>
vector<bool>
vector<char>
vector<double>
vector<float>
vector<int>
vector<pair<TLorentzVector,int> >
vector<set<unsigned int> >
vector<short>
vector<string>
vector<unsigned char>
vector<unsigned int>
vector<unsigned long long>
vector<unsigned long>
vector<unsigned short>
vector<vector<float> >
vector<vector<int> >
```

so I suppose the proper thing to do here is to always translate ROOT's aliases into C's fundamental type names, as part of the "classname regularization" step.

Resolving patch:
diff --git a/src/uproot/model.py b/src/uproot/model.py
--- a/src/uproot/model.py
+++ b/src/uproot/model.py
@@ -105,7 +105,28 @@ def reset_classes():
     reload(uproot.models.TMatrixT)
 
 
-_classname_regularize = re.compile(r"\s*(<|>|::)\s*")
+_root_alias_to_c_primitive = {
+    "Bool_t": "bool",
+    "Char_t": "char",
+    "UChar_t": "unsigned char",
+    "Short_t": "short",
+    "UShort_t": "unsigned short",
+    "Int_t": "int",
+    "UInt_t": "unsigned int",
+    "Long_t": "long",
+    "ULong_t": "unsigned long",
+    "Long64_t": "long long",
+    "ULong64_t": "unsigned long long",
+    "Size_t": "size_t",
+    "Float_t": "float",
+    "Double_t": "double",
+    "LongDouble_t": "long double",
+}
+
+_classname_regularize = re.compile(r"\s*(<|>|,|::)\s*")
+_classname_regularize_type = re.compile(
+    r"[<,](" + "|".join([re.escape(p) for p in _root_alias_to_c_primitive]) + r")[>,]"
+)
 _classname_encode_pattern = re.compile(rb"[^a-zA-Z0-9]+")
 _classname_decode_antiversion = re.compile(rb".*_([0-9a-f][0-9a-f])+_v([0-9]+)$")
 _classname_decode_version = re.compile(rb".*_v([0-9]+)$")
@@ -130,10 +151,20 @@ def classname_regularize(classname):
     If ``classname`` is None, this function returns None. Otherwise, it must be
     a string and it returns a string.
     """
-    if classname is None:
-        return classname
-    else:
-        return re.sub(_classname_regularize, r"\1", classname)
+    if classname is not None:
+        classname = re.sub(_classname_regularize, r"\1", classname)
+
+        m = _classname_regularize_type.search(classname)
+
+        while m is not None:
+            start, stop = m.span(1)
+            token = classname[start:stop]
+            replacement = _root_alias_to_c_primitive[token]
+            classname = classname[:start] + replacement + classname[stop:]
+
+            m = _classname_regularize_type.search(classname)
+
+    return classname
 
 
 def classname_decode(encoded_classname):


Test patch:
diff --git a/tests/test_0278-specializations-for-TParameter.py b/tests/test_0278-specializations-for-TParameter.py
--- a/tests/test_0278-specializations-for-TParameter.py
+++ b/tests/test_0278-specializations-for-TParameter.py
@@ -14,3 +14,9 @@ def test():
         assert p
         assert int(p) == 500
         assert float(p) == 500.0
+
+
+def test_issue_707():
+    with uproot.open(skhep_testdata.data_path("uproot-issue-707.root")) as file:
+        p = file["NumberOfPrimariesEdep"]
+        assert p.value == 100000004