Skip to content
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

Bump to 2.3.45, and start using AnaToolHandle #532

Merged
merged 3 commits into from
Mar 7, 2016

Conversation

mmilesi
Copy link
Contributor

@mmilesi mmilesi commented Mar 7, 2016

See commit messages for details.

The bottom line is:

  1. make the tool handle as a member of a xAH algorithm
  2. in the xAH algorithm initialisation list, call the tool handle constructor. The argument of the constructor must be a string like "TOOL_TYPE/TOOL_NAME" . In general, "TOOL_NAME" here can be a dummy string, as it can be changed afterwards.
  3. If the name of the tool needs to be changed, e.g. in EL::initialize() (this is the case for the efficiency correctors, where tool names get created depending on the configuration), just call my_tool_handle.make("TOOL_TYPE/NEW_TOOL_NAME");
  4. In EL::initialize() set the properties and initialise the tool handle. A NB: after initialize() has been called on the tool handle, it will effectively become a pointer to the tool itself.
  5. In EL::execute(), use the tool via calls like my_tool_handle->doStuff() If the tool with that given name needs to be used afterwards, just make a tool handle with the same tool_type/tool_name as intended, and call initialize() on it. It will automagically get the pointer to the correct tool, and all its properties will be preserved from the previous initialisation.
  6. The tool will be automatically destroyed at the end of the job. Hence, no need to call delete anywhere.

The content of this PR shows an effective example for the above.

@xAH-bot
Copy link

xAH-bot commented Mar 7, 2016

Everything checked out ok, 👍 to merge. 🍻

Commit sha1: 4dd356f

@mmilesi mmilesi force-pushed the upgrade/StartUsingAnaToolHandle branch from 4dd356f to 91a0ab7 Compare March 7, 2016 01:09
@xAH-bot
Copy link

xAH-bot commented Mar 7, 2016

Everything checked out ok, 👍 to merge. 🍻

Commit sha1: 91a0ab7

@mmilesi mmilesi force-pushed the upgrade/StartUsingAnaToolHandle branch from 91a0ab7 to 66756bb Compare March 7, 2016 01:34
…umber (from the PRW tool) is set as default.

Users can switch it off from config, and set a default run number as usual.
@mmilesi mmilesi force-pushed the upgrade/StartUsingAnaToolHandle branch from 66756bb to a0f9496 Compare March 7, 2016 01:35
@xAH-bot
Copy link

xAH-bot commented Mar 7, 2016

Everything checked out ok, 👍 to merge. 🍻

Commit sha1: 66756bb

@xAH-bot
Copy link

xAH-bot commented Mar 7, 2016

Everything checked out ok, 👍 to merge. 🍻

Commit sha1: a0f9496

@kratsg
Copy link
Contributor

kratsg commented Mar 7, 2016

Hi,

I think we're going to need to add some of these instructions to the xAH documentation somewhere. This is definitely a gotcha and is going to bite me in the butt later because I'm definitely not going to remember how to do this... and would have to remember to search the PRs for this content/message explaining how.

@mmilesi
Copy link
Contributor Author

mmilesi commented Mar 7, 2016

Hi Giordon,

yep, sounds like a good thing to do.

Is https://xaodanahelpers.readthedocs.org/en/latest/FAQs.html the right place for it?

@kratsg
Copy link
Contributor

kratsg commented Mar 7, 2016

Is https://xaodanahelpers.readthedocs.org/en/latest/FAQs.html the right place for it?

Yeah, this might be the best spot for now. It's super generic.

@xAH-bot
Copy link

xAH-bot commented Mar 7, 2016

Everything checked out ok, 👍 to merge. 🍻

Commit sha1: 3117685

@mmilesi mmilesi force-pushed the upgrade/StartUsingAnaToolHandle branch from 3117685 to f0276d6 Compare March 7, 2016 08:01
@xAH-bot
Copy link

xAH-bot commented Mar 7, 2016

Everything checked out ok, 👍 to merge. 🍻

Commit sha1: f0276d6

mmilesi added a commit that referenced this pull request Mar 7, 2016
Bump to 2.3.45, and start using AnaToolHandle
@mmilesi mmilesi merged commit ff0bd18 into master Mar 7, 2016
@mmilesi mmilesi deleted the upgrade/StartUsingAnaToolHandle branch March 7, 2016 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants