Hey, all. I’m trying to make some event cuts and having a heck of a time doing so. I want to cut for Vz < 40.0 cm and Vr < 2.0 cm. This is the code I’m trying to use to call Vx, Vy, and Vz:
if (TMath::Abs(event->primaryVertex().z()) > 40.0 )
{
continue;
}
if (TMath::Abs( sqrt(pow(event->primaryVertex().x(),2) + pow(event->primaryVertex().y(),2))) > 2.0 )
{
continue;
}
The code runs fine, but The cuts seem to do nothing. I created some histograms to check the output, and they’re all at 0 for Vz and Vr both before and after the cuts. I looked at the picos I’m using and Vz, Vx, and Vy are all in there. What am I doing wrong?
I thought that might be the case, but when I would change the histogram axis scale nothing would happen. I had done some cout statements and they all came up 0. Here’s the cout code, in the event loop prior to the cuts:
And here’s what I get when I run it, as an example; obviously there are thousands of these, but they all have 0 for every primaryVertex() entry:
Vz: 0
Vr: 0
VzVPD: 5.60292
Full Vertex: 0 0 0
When I do the cuts in Python, everything is fine. Python calls (via uproot) “Event.mPrimaryVertexX”. My code for reading those is as follows:
data = up.open('st_physics_19999_raw_1234.picoDst.root')
PicoDst = data["PicoDst"]
# These jagged arrays are to get the data out of the .root file.
mEpdId = PicoDst.arrays([b"EpdHit.mId"])
mEpdnMIP = PicoDst.arrays([b"EpdHit.mnMIP"])
mRefMult = PicoDst.arrays([b"Event.mGRefMult"])
mxVert = PicoDst.arrays([b"Event.mPrimaryVertexX"])
myVert = PicoDst.arrays([b"Event.mPrimaryVertexY"])
mzVert = PicoDst.arrays([b"Event.mPrimaryVertexZ"])
mVzVpd = PicoDst.arrays([b"Event.mVzVpd"])
mNBTOFMatch = PicoDst.arrays([b"Event.mNBTOFMatch"])
Is there a way I can just call these in ROOT? I thought that would be event->primaryVertex().X(), but that clearly isn’t working.
It’s for 27 GeV Au+Au. Not sure what all’s included, but I can get the primary vertex information out of this in Python and the pico has histograms for it in ROOT.
Ok, it looks like this file has to be processed in a dedicated framework, which I don’t have obviously. But you should definitely access branches named Event.mPrimaryVertexX, Event.mPrimaryVertexY, and Event.mPrimaryVertexZ rather than event->primaryVertex().x() and so on.
Problem solved. I was using an outdated version of StPicoEvent.h, so it was reading something that was allowed (i.e. no syntax errors), but that didn’t have any values associated. It feels like that ought to throw an error, but instead it just gave back all zeroes.