Get the size of a TTReeReaderArray

Dear Experts,

I am trying to get the size of a TTReeReaderArray by referring here:

> TFile *f = new TFile("FileName.root");
>   TTreeReader reader("events", f);
> 
>   TTreeReaderArray<Float_t> pxArray(reader, "ReconstructedParticles.p.x");
>   Int_t px_size = pxArray.GetSize();                                                                                                          
>   cout << "Length of pxArray is: " << px_size;

I am getting a *** Break *** segmentation violation error while trying to get the length of the array.

I would appreciate any help to get this right.
The root file is : FileName.root


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Before “pxArray.GetSize()”, add: reader.Next();

Thank you @Wile_E_Coyote