Segmentation violation when making an array-type branch using MyClass::Loop()

In the end of your “Loop” method, try to add:
fChain->ResetBranchAddresses(); // disconnect from local variables

That said, the TTree::MakeClass generated analysis skeleton opens the ROOT file in “READ” mode. So, expect problems when you try to modify the tree in your “Loop” method.