Could you be more exact, i.e. in which line does that error appear (i.e. post the complete error message).
The loop seems strange. v1 is connected to the tree, but you didn’t call GetEntry, yet you are calling the size() function. Do you want to loop over the tree instead?
treeEntries = DTTree->GetEntries();
for (Long64_t i = 0; i < treeEntries; ++i) { ... }
It seems to me that you should have two loops, one over the tree entries and one over the vector.
Other than that:
Note that your histogram has 1 bin in x and 1 bin in y. Seems pointless!
I’d suggest to write std::vector<short> *v1 = {0}; as std::vector<short> *v1 = nullptr; (makes it clearer that the pointer is initialized).
Edit:
v1 and v2 are pointers to vectors. Use (*v1)[i] to access the i-th element.
Ok. When using two nested loops, use different names for the loop variables to avoid confusion.
v1 is a pointer to vector<short> v1[0] is *(v1 + 0) - that’s the vector itself. v1[1] would be another vector<short>, not the first element! *v1 is your vector (*v1)[0] is the first element of the vector. Alternative: v1->operator[](0)