3 #include "StChargedPionMcEvent.h"
9 #include "TLorentzVector.h"
12 #include "StChargedPionTypes.h"
13 #include "StChargedPionTrack.h"
14 #include "StChargedPionJet.h"
15 #include "StChargedPionVertex.h"
20 mVertices =
new TClonesArray(
"StChargedPionVertex", 20);
21 mTracks =
new TClonesArray(
"StChargedPionTrack", 50);
22 mJets =
new TClonesArray(
"StChargedPionJet", 50);
24 memset(mL2ResultEmulated, 0, 36);
26 StChargedPionMcEvent::Class()->IgnoreTObjectStreamer();
27 StChargedPionVertex::Class()->IgnoreTObjectStreamer();
28 StChargedPionTrack::Class()->IgnoreTObjectStreamer();
29 StChargedPionJet::Class()->IgnoreTObjectStreamer();
30 StChargedPionMcTrack::Class()->IgnoreTObjectStreamer();
31 StChargedPionMcJet::Class()->IgnoreTObjectStreamer();
34 StChargedPionMcEvent::~StChargedPionMcEvent() {
35 if(mVertices)
delete mVertices;
36 if(mTracks)
delete mTracks;
37 if(mJets)
delete mJets;
40 void StChargedPionMcEvent::Clear(Option_t* o) {
49 mTriggerPatches.clear();
54 mMatchedPairs.clear();
60 mPythiaRecord.clear();
63 StChargedPionLorentzVector
64 StChargedPionMcEvent::parton(
int id, StChargedPionMcEvent::Frame frame)
const {
65 const StChargedPionLorentzVector *v;
67 case 1: v = &mParton1;
break;
68 case 2: v = &mParton2;
break;
69 case 3: v = &mParton3;
break;
70 case 4: v = &mParton4;
break;
74 Boost boost( (mParton1+mParton2).BoostToCM() );
75 LorentzRotation rotate( RotationY(-1.0 * boost(mParton1).Theta()) );
76 rotate *= RotationZ(-1.0 * boost(mParton1).Phi());
77 return rotate(boost(*v));
84 TLorentzVector StChargedPionMcEvent::lv(
const StChargedPionLorentzVector& v) {
85 return TLorentzVector(v.X(), v.Y(), v.Z(), v.E());
88 double StChargedPionMcEvent::beta34()
const {
89 return TMath::Sqrt( pow(1 - mParton3.mass2()/s() - mParton4.mass2()/s(), 2) -
90 4 * mParton3.mass2()/s() * mParton4.mass2()/s());
93 double StChargedPionMcEvent::s()
const {
94 return (mParton1 + mParton2).Dot(mParton1 + mParton2);
109 return parton(3, StChargedPionMcEvent::CM).Pt();
115 return ::cos(parton(3, StChargedPionMcEvent::CM).Theta());
120 return t() *
u() / s();
123 double StChargedPionMcEvent::x1()
const {
127 double StChargedPionMcEvent::x2()
const {
131 double StChargedPionMcEvent::tau()
const {
132 return s() / (200*200);
135 double StChargedPionMcEvent::y()
const {
136 return 0.5 * TMath::Log(x1()/x2());
139 double StChargedPionMcEvent::xF()
const {
140 return (x1() - x2());
146 double StChargedPionMcEvent::t_alternative()
const {
147 return (mParton1 - mParton3).Dot(mParton1 - mParton3);
151 double StChargedPionMcEvent::u_alternative()
const {
152 return (mParton1 - mParton4).Dot(mParton1 - mParton4);
157 return (mParton3.mass2() + mParton4.mass2()) / 2 +
158 (
t()*
u() - mParton3.mass2()*mParton4.mass2()) / s();
162 double StChargedPionMcEvent::Q2_alternative2()
const {
163 return ::pow((parton(3, StChargedPionMcEvent::CM).Et() +
164 parton(4, StChargedPionMcEvent::CM).Et()) / 2, 2);
167 bool StChargedPionMcEvent::isSimuTrigger(
unsigned int trigId)
const {
168 map<unsigned int, unsigned int>::const_iterator it = mTriggerLookup.find(trigId);
169 if(it==mTriggerLookup.end())
return false;
170 return mSimuTriggerBits & it->second;
173 int StChargedPionMcEvent::highTowerAdc(
short towerId)
const {
174 map<short, int>::const_iterator it = mHighTowers.find(towerId);
175 if(it==mHighTowers.end())
return -1;
179 int StChargedPionMcEvent::triggerPatchAdc(
short patchId)
const {
180 map<short, int>::const_iterator it = mTriggerPatches.find(patchId);
181 if(it==mTriggerPatches.end())
return -1;
185 int StChargedPionMcEvent::jetPatchAdc(
short patchId)
const {
186 map<short, int>::const_iterator it = mJetPatches.find(patchId);
187 if(it==mJetPatches.end())
return -1;
215 void StChargedPionMcEvent::addSimuTrigger(
unsigned int trigId) {
216 map<unsigned int, unsigned int>::const_iterator it = mTriggerLookup.find(trigId);
217 if(it!=mTriggerLookup.end()) {
218 mSimuTriggerBits |= it->second;
222 void StChargedPionMcEvent::setL2Result(
const void *address,
bool emulated) {
224 memcpy(mL2ResultEmulated, address, 20);
225 memcpy(mL2ResultEmulated+5, (
int*)address+6, 16);
double pt() const
doesn't quite match hard_p in the case of b quark stuff
double Q2_alternative() const
eqn 83, Chapter 7 of PYTHIA 6.400 manual
double Q2() const
this one neglects outgoing parton masses, and matches g2t_pythia->hard_p**2
double u() const
this version neglects outgoing parton masses, and matches g2t_pythia->mand_u
double t() const
this version neglects outgoing parton masses, and matches g2t_pythia->mand_t