Skip to content

Commit fc59b88

Browse files
authored
small update to set polarisation state for spin1 particles (e.g. J/psi) (#66)
1 parent 82c4bd3 commit fc59b88

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

MC/config/PWGDQ/EvtGen/GeneratorEvtGen.C

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public:
4040
void PrintDebug(bool deg=kTRUE){ mDebug = deg; };
4141
void SetDecayTable(TString decTab){ mDecayTablePath = decTab; };
4242
void SetForceDecay(DecayModeEvt forceDec){ mDecayMode = forceDec; };
43+
void SetPolarization(Int_t polar){ mPolarization = polar; };
4344

4445
protected:
4546

@@ -82,7 +83,7 @@ protected:
8283
if(mDebug) std::cout << "particles in the array (before decay): PDG "<< particle.GetPdgCode() << " STATUS " << particle.GetStatusCode() << " position in the array" << iparticle << " First daughter" << particle.GetFirstDaughter() << " Last daughter " << particle.GetLastDaughter() << std::endl;
8384
TLorentzVector *momentum=new TLorentzVector();
8485
momentum->SetPxPyPzE(particle.Px(),particle.Py(),particle.Pz(),particle.Energy());
85-
DecayEvtGen(particle.GetPdgCode(),momentum);
86+
DecayEvtGen(particle.GetPdgCode(),momentum,mPolarization);
8687
if(!ImportParticlesEvtGen(iparticle)) { std::cout << "Attention: Import Particles failed" << std::endl; return kFALSE; }
8788
if(mDebug) std::cout << "particles in the array (after decay): PDG "<< particle.GetPdgCode() << " STATUS " << particle.GetStatusCode() << " position in the array" << iparticle << " First daughter" << particle.GetFirstDaughter() << " Last daughter " << particle.GetLastDaughter() << std::endl;
8889

@@ -91,26 +92,57 @@ protected:
9192
return kTRUE;
9293
}
9394

95+
9496
// decay particle
95-
void DecayEvtGen(Int_t ipart, TLorentzVector *p)
97+
void DecayEvtGen(Int_t ipart, TLorentzVector *p, Int_t alpha)
9698
{
9799
//
98100
//Decay a particle
99101
//input: pdg code and momentum of the particle to be decayed
100102
//all informations about decay products are stored in mEvtstdhep
101103
//
104+
// for particles with spin 1 (e.g. jpsi) is possible to set
105+
// the polarization status (fully transversal alpha=1 / longitudinal alpha=-1)
106+
// through spin density matrix
107+
//
102108
EvtId IPART=EvtPDL::evtIdFromStdHep(ipart);
103109
EvtVector4R p_init(p->E(),p->Px(),p->Py(),p->Pz());
104110
EvtParticle *froot_part=EvtParticleFactory::particleFactory(IPART,p_init);
111+
112+
if(TMath::Abs(alpha) == 1){
113+
114+
// check if particle has spin 1 (i.e. 3 states)
115+
if(froot_part->getSpinStates() != 3 )
116+
{
117+
std::cout << "Error: Polarization settings available for spin 1 particles" << std::endl;
118+
return;
119+
}
120+
121+
EvtSpinDensity rho;
122+
//transversal
123+
if(alpha == 1){
124+
rho.setDiag(3);
125+
rho.set(1,1,EvtComplex(0.0,0.0)); //eps00 = 0, eps++ = 1, eps-- = 1
126+
}
127+
else{
128+
//longitudinal
129+
rho.setDiag(3);
130+
rho.set(0,0,EvtComplex(0.0,0.0)); //eps++ = 0
131+
rho.set(2,2,EvtComplex(0.0,0.0)); //eps-- = 0
132+
}
133+
134+
froot_part->setSpinDensityForwardHelicityBasis(rho,p->Phi(),p->Theta(),0);
135+
} // close polarization settings
136+
105137
mEvtGen->generateDecay(froot_part);
106138
mEvtstdhep->init();
107139
froot_part->makeStdHep(*mEvtstdhep);
108140
if(mDebug) froot_part->printTree(); //to print the decay chain
109-
froot_part->deleteTree();
141+
froot_part->deleteTree();
110142
return;
111143
}
112-
113-
144+
145+
114146
Bool_t ImportParticlesEvtGen(Int_t indexMother)
115147
{
116148
//
@@ -288,6 +320,7 @@ void ForceDecay()
288320
bool mDebug = kFALSE;
289321
TString mDecayTablePath;
290322
DecayModeEvt mDecayMode = kEvtAll;
323+
Int_t mPolarization = -999;
291324
};
292325

293326
}}

0 commit comments

Comments
 (0)