Skip to content

Use vector in the HZZAnalysis notebook #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Saransh-cpp
Copy link
Member

The notebook now uses vector in the calc_mllll function. I wasn't able to run the notebook locally because of an error, but I am hoping that the function is correct. The function has been taken up from this notebook.


The error that I getting while running the notebook -

ServiceXException: (ServiceXException(...), 'Unable to find name/type uproot in api_endpoints in servicex.yaml configuration file. Saw only names (default, default) and types (xaod, cms_run1_aod)')

Full stack trace:

Trace:
---------------------------------------------------------------------------
ServiceXException                         Traceback (most recent call last)
Input In [10], in <cell line: 4>()
      1 import time
      3 start_time = time.time()
----> 4 output = await run_analysis()
      5 finish_time = time.time()
      7 print("Total runtime in seconds: " + str(finish_time - start_time))

Input In [9], in run_analysis()
      6 ds_names = list(fileset.keys())
      8 # Create the query
----> 9 ds = ServiceXSourceUpROOT('cernopendata://dummy',  'mini', backend_name='uproot')
     10 ds.return_qastle = True
     11 leptons = good_leptons(ds)

File c:\users\saransh\saransh_softwares\python_3.9\lib\site-packages\func_adl_servicex\ServiceX.py:207, in ServiceXSourceUpROOT.__init__(self, sx, treename, backend_name)
    203 def __init__(self, sx: Union[ServiceXDataset, DatasetType], treename: str, backend_name='uproot'):
    204     '''
    205     Create a servicex dataset sequence from a servicex dataset
    206     '''
--> 207     super().__init__(sx, backend_name)
    209     # Modify the argument list in EventDataSset to include a dummy filename and
    210     # tree name
    211     self.query_ast.args.append(ast.Str(s='bogus.root'))  # type: ignore

File c:\users\saransh\saransh_softwares\python_3.9\lib\site-packages\func_adl_servicex\ServiceX.py:57, in ServiceXDatasetSourceBase.__init__(self, sx, backend_name)
     55 # Get the base created
     56 if isinstance(sx, (str, Iterable)):
---> 57     ds = ServiceXDataset(sx, backend_name=backend_name)
     58 else:
     59     ds = sx

File c:\users\saransh\saransh_softwares\python_3.9\lib\site-packages\servicex\servicex.py:270, in ServiceXDataset.__init__(self, dataset, backend_name, image, max_workers, result_destination, servicex_adaptor, minio_adaptor, cache_adaptor, status_callback_factory, local_log, session_generator, config_adaptor, data_convert_adaptor, ignore_cache)
    256 self._cache = (
    257     Cache(
    258         get_configured_cache_path(config.settings),
   (...)
    265     else cache_adaptor
    266 )
    268 if not servicex_adaptor:
    269     # Given servicex adaptor is none, this should be ok. Fixes type checkers
--> 270     end_point, token = config.get_servicex_adaptor_config(backend_name)
    271     servicex_adaptor = ServiceXAdaptor(end_point, token)
    272 self._servicex_adaptor = servicex_adaptor

File c:\users\saransh\saransh_softwares\python_3.9\lib\site-packages\servicex\servicex_config.py:196, in ServiceXConfigAdaptor.get_servicex_adaptor_config(self, backend_name)
    183 def get_servicex_adaptor_config(
    184     self, backend_name: Optional[str] = None
    185 ) -> Tuple[str, Optional[str]]:
    186     """Return the servicex (endpoint, token) from a given backend configuration.
    187 
    188     Args:
   (...)
    194         token (optionally).
    195     """
--> 196     config = self._get_backend_info(backend_name)
    198     endpoint = config["endpoint"]
    199     token = config["token"] if "token" in config else None

File c:\users\saransh\saransh_softwares\python_3.9\lib\site-packages\servicex\servicex_config.py:136, in ServiceXConfigAdaptor._get_backend_info(self, backend_name)
    125         seen_types = [
    126             str(ep["type"].as_str_expanded())
    127             for ep in endpoints
    128             if ep["type"].exists()
    129         ]
    130         seen_names = [
    131             str(ep["name"].as_str_expanded())
    132             for ep in endpoints
    133             if ep["name"].exists()
    134         ]
--> 136         raise ServiceXException(
    137             f"Unable to find name/type {backend_name} "
    138             "in api_endpoints in servicex.yaml configuration file. Saw"
    139             f' only names ({", ".join(seen_names)}) and types '
    140             f'({", ".join(seen_types)})'
    141         )
    143 # Nope - now we are going to have to just use the first one there.
    144 else:
    145     for ep in endpoints:

ServiceXException: (ServiceXException(...), 'Unable to find name/type uproot in api_endpoints in servicex.yaml configuration file. Saw only names (default, default) and types (xaod, cms_run1_aod)')

@alexander-held
Copy link
Member

Thanks for including vector here! The ServiceX issue is unrelated to the changes, I will contact you separately regarding this.

@alexander-held
Copy link
Member

vector version 0.8.5 is known to slightly change the results compared to the old implementation, this is expected to change in the next release via scikit-hep/vector#172 and scikit-hep/vector#173 (vector master produces the same results as the old code).

@alexander-held alexander-held merged commit 89dcf8b into iris-hep:main Jul 8, 2022
@Saransh-cpp Saransh-cpp deleted the add-vector-to-HZZ-analysis branch July 8, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants