TRestGas GetDriftVelocity is not accessible anymore

REST version : v2.2.14
REST commit : ae8e29ac

How can I access now to the properties of the gas through TRestGas?

The method TRestGas::GetDriftVelocity( E ); has been made private!

I am having the same problem in the previous version (v2.2.13) with, for example, GetLongitudinalDiffusion.

ROOT_prompt_7:1:4: error: 'GetLongitudinalDiffusion' is a private member of 'TRestGas'
g->GetLongitudinalDiffusion(100.)
~~~^~~~~~~~~~~~~~~~~~~~~~~~
/home/eruizchl/REST_v2/install/include/TRestGas.h:121:14: note: declared private here
Double_t GetLongitudinalDiffusion(Double_t E);

This method does not need any argument now. You can directly use GetDriftVelocity().

To get drift velocity for specific pressure and E-field, you need to first call TRestGas::SetPressure(XX) and TRestGas::SetElectricField(XXX).

The reason for such change is that, now TRestGas is made to be inherited fromTRestDriftVolume. This base class stores constant values of drift velocity, diffusion, electron life time, etc., which represents the detector status in certain period of time. In TRestGas, I kept the definition of GetDriftVelocity() from from TRestDriftVolume, and made the old GetDriftVelocity(E) method private.

Still, we could have a public method GetDriftVelocity(E) that sets fElectricField = E and calls GetDriftVelocity(). Could that cause any unexpected problem? Or, it is worth to make the explicit call of SetElectricField(E) to make users aware that TRestGas now will do calculations at that given field?

We can make TRestGas::GetDriftVelocity(E) public, no problem for compliation. But I still recommend to use GetDriftVelocity() in some low-leveled processes like TRestHitsToSignalProcess. We are not going to re-set e-field from these processes. In future we may totally replace TRestGas with TRestDriftVolume in these processes, to make it generic. At that time we must use GetDriftVelocity().

Actually it is not for notification. We don’t want to set electric field frequently inside a metadata class. We better hope it is fixed when retrieved from root file or generated from rml file.

That it to say, I prefer to setup e-field from the TRestGas section, not from the process parameter.

Yes, I understand, that field is fixed by the framework during processing, and to set the field just once is the best in that scenario. But we should also keep in mind the potential it has that we can use the classes stand alone.

But sure, it is no problem for me, in any case, to call SetElectricField(E) each time I want to change the field, in case I want to do a standalone study changing the properties of the chamber.

1 Like