Hi @nkx,
I have a bit of confusion again with the units used at TRestDetectorDriftVolume
and TRestDetectorGas
.
Obviously, TRestDetectorDriftVolume
is using standard REST units, i.e. V/mm
. So, when I do pointer->SetElectricField(x)
x is in V/mm
and therefore it is directly assigned to fElectricField
. The TRestDetectorDriftVolume::fElectricField
is measured then in V/mm
.
So, if I want to get the drift velocity at 10bar
and 100V/cm
, I believe I should do:
gas->SetPressure(10);
gas->SetElectricField(1000);
since I assume I must give the field in V/mm
. Is this right?
If I look at the code, it is a bit misleading if the result will be returned in mm/us
or cm/us
. From the code I believe the result will be returned in cm/us
, although the comment says //in standard unit mm/us
.
If I use the standard PandaX-III gas mixture that I know well the result, and test this code:
TRestDetectorGas *gg = new TRestDetectorGas("server", "Xenon-TMA 1Pct 0.1-10E3Vcm");
gg->SetPressure(10);
gg->SetElectricField(1000);
gg->GetDriftVelocity()
(double) 11.425579
I believe I do not get the right result. But I do if I set
gg->SetElectricField(100);
root [10] gg->GetDriftVelocity()
(double) 1.8736602
That is, as if I would give the argument in V/cm
and returned value in cm/us
. But from the code I deduce the argument of SetElectricField
should be in V/mm
.
Where I am getting it wrong?