|Re: Recontruction of neutrals - macro is very slow [message #15417 is a reply to message #15413]
||Tue, 03 September 2013 13:32
Registered: June 2006
I think of two effects, which make your macros running slow:
1. When using neutrals, the combinatorics usually gets blown up quite significantly, since there are always huge numbers of neutral objects reconstructed.
2. This effect of getting slower and slower from event to event is a buggy effect of CINT I think. I observed it always, when the 'complexity' (however that really is defined) of the macro code gets above a certain threshold, which basically always happens at some point for complicated analyses.
An improvement for (1.) can be achieved but requiring a lower energy threshold for your gamma candidates, e.g. 30-100 MeV, in order to reduce the number of candidates.
This can be easily done with a RhoEnergyParticleSelector:
double minE = 0.03;
RhoEnergyParticleSelector *SelEnergy = new RhoEnergyParticleSelector("SelEnergy",50.+minE,100.);
You should try some values or take a look at the gamma energy distribution beforehand to find an appropriate threshold.
In order to cope with (2.), you should convert your analysis code to run in a task. I already sent you a task version of your Ds2535 macro last week or that before, where you can take a look how this can be done, or you read the corresponding section in the new tutorial wiki
where it is also described.