RawDataConversion: use static variable in loop