Skip to content

TRD Digitizer: moving temporary variables to class members#3389

Merged
sawenzel merged 8 commits into
AliceO2Group:devfrom
jolopezl:trd-dev
May 1, 2020
Merged

TRD Digitizer: moving temporary variables to class members#3389
sawenzel merged 8 commits into
AliceO2Group:devfrom
jolopezl:trd-dev

Conversation

@jolopezl
Copy link
Copy Markdown
Contributor

@jolopezl jolopezl commented Apr 20, 2020

Two minor improvements were spotted while developing the pileup implementation for the TRD digitizer:

  • Make several variables class members rather than local variables. They are initialized at the construction of the digitizer.
  • Swapped a for-if loop for a if-for loop to minimize the number of if-else comparisons.

I prefer to make this small PR now and do not mix this with the pileup implementation.

In 10 pp events:
(Now) TRD: Digitization took 0.949013s
(Before) TRD: Digitization took 1.11397s

In 1 hi event:
(Now) TRD: Digitization took 124.626s
(Before) TRD: Digitization took 136.157s

@jolopezl jolopezl changed the title TRD: moving temporary variables to class members TRD Digitizer: moving temporary variables to class members Apr 20, 2020
@jolopezl jolopezl marked this pull request as ready for review April 27, 2020 20:11
Comment thread Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h Outdated
Comment thread Detectors/TRD/simulation/src/Digitizer.cxx Outdated
Comment thread Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h Outdated
@jolopezl jolopezl requested review from bazinski and sawenzel April 29, 2020 13:24
Comment thread Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h Outdated
@jolopezl
Copy link
Copy Markdown
Contributor Author

@sawenzel, current issues in build/o2checkcode/o2 look unrelated to this pull request.

@jolopezl jolopezl requested a review from sawenzel April 29, 2020 20:31
Comment thread Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h Outdated
@sawenzel sawenzel merged commit 25750e2 into AliceO2Group:dev May 1, 2020
@jolopezl jolopezl deleted the trd-dev branch May 4, 2020 15:25
amorsch pushed a commit to amorsch/AliceO2 that referenced this pull request May 28, 2020
…oup#3389)

* moving variables to class members for speedup

* removed unused variables

* changed method name to setSimulationParameters

* redefined the number of timebins for clarity and changed if/log(debug) for an assert

* additional naming convention changes

* making static constexpr some variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants