This should really be
```C++
selectedSignalPFCands_.reserve(onfile.selectedSignalPFCands_.size());
for(auto const& ref : onfile.selectedSignalPFCands_) { 
   selectedSignalPFCands_.push_back(edm::refToPtr(ref));
}
```
You need the ```push_back``` since ```selectedSignalPFCands_``` doesn't have the correct size.