45 pos1 =
new TVector3();
46 pos2 =
new TVector3();
47 pos3 =
new TVector3();
48 posvtx =
new TVector3();
49 mom1 =
new TVector3();
50 mom2 =
new TVector3();
51 mom3 =
new TVector3();
52 momvtx =
new TVector3();
53 rec_mom1 =
new TVector3();
54 rec_momvtx =
new TVector3();
55 rec_posvtx =
new TVector3();
56 rec_momtgt =
new TVector3();
57 rec_postgt =
new TVector3();
60 pmom =
new TVector3();
61 nmom =
new TVector3();
62 rec_pmom =
new TVector3();
63 rec_nmom =
new TVector3();
64 rec_ppos =
new TVector3();
65 rec_npos =
new TVector3();
66 rec_vtx =
new TVector3();
73 int ret = GetNodes(topNode);
83 int nTracks = trackVector->
size();
84 int nRecTracks = legacyContainer ? recEvent->
getNTracks() : recTrackVector->
size();
85 for(
int i = 0; i < nTracks; ++i)
97 if(recid >= 0 && recid < nRecTracks)
108 rec_mom1->SetXYZ(-999., -999., -999.);
109 rec_momvtx->SetXYZ(999., -999., -999.);
110 rec_posvtx->SetXYZ(999., -999., -999.);
116 int nDimuons = dimuonVector->
size();
117 int nRecDimuons = legacyContainer ? recEvent->
getNDimuons() : (recDimuonVector ? recDimuonVector->
size() : -1);
118 for(
int i = 0; i < nDimuons; ++i)
127 if(recid >= 0 && recid < nRecDimuons)
130 rec_mass = recDimuon->
mass;
131 *rec_pmom = recDimuon->
p_pos.Vect();
132 *rec_nmom = recDimuon->
p_neg.Vect();
133 *rec_ppos = recDimuon->
vtx_pos;
134 *rec_npos = recDimuon->
vtx_neg;
135 *rec_vtx = recDimuon->
vtx;
161 hitVector = findNode::getClass<SQHitVector>(topNode,
"SQHitVector");
162 trackVector = findNode::getClass<SQTrackVector>(topNode,
"SQTruthTrackVector");
163 dimuonVector = findNode::getClass<SQDimuonVector>(topNode,
"SQTruthDimuonVector");
164 if(!hitVector || !trackVector || !dimuonVector)
171 recEvent = findNode::getClass<SRecEvent>(topNode,
"SRecEvent");
180 recTrackVector = findNode::getClass<SQTrackVector>(topNode,
"SQRecTrackVector");
181 recDimuonVector = findNode::getClass<SQDimuonVector>(topNode,
"SQRecDimuonVector");
191 void AnaModule::MakeTree()
193 saveFile =
new TFile(saveName,
"RECREATE");
195 saveTree1 =
new TTree(
"trk",
"Track Tree Created by AnaModule");
196 saveTree1->Branch(
"eventID", &eventID,
"eventID/I");
197 saveTree1->Branch(
"charge", &charge,
"charge/I");
198 saveTree1->Branch(
"pos1", &pos1, 256000, 99);
199 saveTree1->Branch(
"pos2", &pos2, 256000, 99);
200 saveTree1->Branch(
"pos3", &pos3, 256000, 99);
201 saveTree1->Branch(
"posvtx", &posvtx, 256000, 99);
202 saveTree1->Branch(
"mom1", &mom1, 256000, 99);
203 saveTree1->Branch(
"mom2", &mom2, 256000, 99);
204 saveTree1->Branch(
"mom3", &mom3, 256000, 99);
205 saveTree1->Branch(
"momvtx", &momvtx, 256000, 99);
206 saveTree1->Branch(
"rec_mom1", &rec_mom1, 256000, 99);
207 saveTree1->Branch(
"rec_momvtx", &rec_momvtx, 256000, 99);
208 saveTree1->Branch(
"rec_posvtx", &rec_posvtx, 256000, 99);
209 saveTree1->Branch(
"rec_momtgt", &rec_momtgt, 256000, 99);
210 saveTree1->Branch(
"rec_postgt", &rec_postgt, 256000, 99);
212 saveTree2 =
new TTree(
"dim",
"Dimuon Tree Created by AnaModule");
213 saveTree2->Branch(
"eventID", &eventID,
"eventID/I");
214 saveTree2->Branch(
"mass", &mass,
"mass/D");
215 saveTree2->Branch(
"rec_mass", &rec_mass,
"rec_mass/D");
216 saveTree2->Branch(
"vtx", &vtx, 256000, 99);
217 saveTree2->Branch(
"pmom", &pmom, 256000, 99);
218 saveTree2->Branch(
"nmom", &nmom, 256000, 99);
219 saveTree2->Branch(
"rec_pmom", &rec_pmom, 256000, 99);
220 saveTree2->Branch(
"rec_nmom", &rec_nmom, 256000, 99);
221 saveTree2->Branch(
"rec_ppos", &rec_ppos, 256000, 99);
222 saveTree2->Branch(
"rec_npos", &rec_npos, 256000, 99);
223 saveTree2->Branch(
"rec_vtx", &rec_vtx, 256000, 99);
int End(PHCompositeNode *topNode)
Called at the end of all processing.
int Init(PHCompositeNode *topNode)
int InitRun(PHCompositeNode *topNode)
int process_event(PHCompositeNode *topNode)
virtual const SQDimuon * at(const size_t id) const =0
virtual size_t size() const =0
An SQ interface class to hold one true or reconstructed dimuon.
virtual TLorentzVector get_mom_neg() const =0
Return the momentum of the negative track at vertex.
virtual TLorentzVector get_mom_pos() const =0
Return the momentum of the positive track at vertex.
virtual int get_rec_dimuon_id() const =0
Return the dimuon ID of associated reconstructed dimuon. Valid only if this object holds truth dimuon...
virtual TLorentzVector get_mom() const =0
Return the dimuon momentum at vertex.
virtual TVector3 get_pos() const =0
Return the dimuon position at vertex.
virtual const SQTrack * at(const size_t id) const =0
virtual size_t size() const =0
An SQ interface class to hold one true or reconstructed track.
virtual TVector3 get_pos_vtx() const =0
Return the track position at vertex.
virtual int get_charge() const =0
Return the charge, i.e. +1 or -1.
virtual int get_rec_track_id() const =0
Return the track ID of associated reconstructed track. Valid only if this object holds truth track in...
virtual TLorentzVector get_mom_vtx() const =0
Return the track momentum at vertex.
virtual TLorentzVector get_mom_st1() const =0
Return the track momentum at Station 1.
virtual TVector3 get_pos_st3() const =0
Return the track position at Station 3.
virtual TVector3 get_pos_st1() const =0
Return the track position at Station 1.
virtual TLorentzVector get_mom_st3() const =0
Return the track momentum at Station 3.
TVector3 vtx
3-vector vertex position
TLorentzVector p_pos
4-momentum of the muon tracks after vertex fit
Double_t mass
Kinematic variables.
SRecDimuon & getDimuon(Int_t i)
Int_t getNTracks()
Get tracks.
SRecTrack & getTrack(Int_t i)
Int_t getNDimuons()
Get dimuons.
TVector3 getMomentumVecSt1() const