Skip to content
Snippets Groups Projects
Commit db9d3a68 authored by Bertram Kopf's avatar Bertram Kopf
Browse files

fixed some cppcheck issues

parent da9e61de
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ struct EvtPartData { ...@@ -35,7 +35,7 @@ struct EvtPartData {
float pidVector[maxPid]; float pidVector[maxPid];
EvtPartData(double e, double px, double py, double pz) { EvtPartData(double e, double px, double py, double pz) {
vector4 = new Vector4<float>(e,px,py,pz); vector4 = new Vector4<float>(e,px,py,pz);
} }
~EvtPartData() { ~EvtPartData() {
delete vector4; delete vector4;
} }
......
...@@ -74,12 +74,17 @@ DfuncHist::DfuncHist(Spin J, Spin lam1, Spin lam2) : ...@@ -74,12 +74,17 @@ DfuncHist::DfuncHist(Spin J, Spin lam1, Spin lam2) :
_dcostHist = new TH1F("_dcostHist",histName.c_str(),100, -1., 1.); _dcostHist = new TH1F("_dcostHist",histName.c_str(),100, -1., 1.);
_dcostHist->SetXTitle("cos(#Theta)"); _dcostHist->SetXTitle("cos(#Theta)");
for (double cost=-1.; cost<1.; cost+=.02){ std::string histName2="d^2("+Jstrstr.str()+","+lam1strstr.str()+","+lam2strstr.str()+")";
_d2costHist= new TH1F("_d2costHist",histName2.c_str(),100, -1., 1.);
_dcostHist->SetXTitle("cos(#Theta)");
for (double cost=-1.; cost<1.; cost+=.02){
double theta = acos(cost); double theta = acos(cost);
complex<double> currentd = Wigner_D(0., theta,0, _J, _lam1, _lam2); complex<double> currentd = Wigner_D(0., theta,0, _J, _lam1, _lam2);
// double weight=norm(currentd); // double weight=norm(currentd);
double weight=currentd.real(); double weight=currentd.real();
_dcostHist->Fill( cost, weight ); _dcostHist->Fill( cost, weight );
_d2costHist->Fill( cost, weight*weight );
} }
} }
......
...@@ -63,6 +63,7 @@ private: ...@@ -63,6 +63,7 @@ private:
Spin _lam2; Spin _lam2;
TFile* _theTFile; TFile* _theTFile;
TH1F* _dcostHist; TH1F* _dcostHist;
TH1F* _d2costHist;
}; };
#endif #endif
...@@ -67,7 +67,8 @@ struct ParticleData { ...@@ -67,7 +67,8 @@ struct ParticleData {
parity(other->parity), parity(other->parity),
theCParity(other->theCParity), theCParity(other->theCParity),
gParity(other->gParity), gParity(other->gParity),
theGParity(other->theGParity) theGParity(other->theGParity),
dynamicFunction(other->dynamicFunction)
{ } { }
}; };
......
...@@ -66,18 +66,20 @@ struct LScomb { ...@@ -66,18 +66,20 @@ struct LScomb {
Spin S; Spin S;
unsigned short idnumberLS; unsigned short idnumberLS;
LScomb(const int theL, const Spin& theS){ LScomb(const int theL, const Spin& theS):
L=theL; L(theL),
S=theS; S(theS)
{
idnumberLS=2*L*1e2+2*S; idnumberLS=2*L*1e2+2*S;
} }
LScomb(std::shared_ptr<const LScomb> theLScomb){ LScomb(std::shared_ptr<const LScomb> theLScomb):
L=theLScomb->L; L(theLScomb->L),
S=theLScomb->S; S(theLScomb->S)
{
idnumberLS=2*L*1e2+2*S; idnumberLS=2*L*1e2+2*S;
} }
virtual bool operator==(const LScomb& compare) const { virtual bool operator==(const LScomb& compare) const {
return (idnumberLS==compare.idnumberLS); return (idnumberLS==compare.idnumberLS);
} }
...@@ -107,17 +109,19 @@ struct jpcRes { ...@@ -107,17 +109,19 @@ struct jpcRes {
int P; int P;
int C; int C;
unsigned short idnumberJPC; unsigned short idnumberJPC;
jpcRes(Spin j=0, int p=1, int c=1) { jpcRes(Spin j=0, int p=1, int c=1) :
J=j; J(j),
P=p; P(p),
C=c; C(c)
{
idnumberJPC=2*J*1e2+(P+2)*1e1+(C+2); idnumberJPC=2*J*1e2+(P+2)*1e1+(C+2);
} }
jpcRes(std::shared_ptr<const jpcRes> theJPC) { jpcRes(std::shared_ptr<const jpcRes> theJPC) :
J=theJPC->J; J(theJPC->J),
P=theJPC->P; P(theJPC->P),
C=theJPC->C; C(theJPC->C)
{
idnumberJPC=2*J*1e2+(P+2)*1e1+(C+2); idnumberJPC=2*J*1e2+(P+2)*1e1+(C+2);
} }
...@@ -167,29 +171,34 @@ struct IGJPC : public jpcRes { ...@@ -167,29 +171,34 @@ struct IGJPC : public jpcRes {
double parityFactor; double parityFactor;
unsigned long idnumberIGJPC; unsigned long idnumberIGJPC;
IGJPC(const Spin j, const int p, const int c, const Spin& theI, IGJPC(const Spin& j, const int p, const int c, const Spin& theI,
int theG, const double theParityFactor=0.): jpcRes(j, p, c) { int theG, const double theParityFactor=0.):
I=theI; jpcRes(j, p, c),
G=theG; I(theI),
parityFactor=theParityFactor; G(theG),
parityFactor(theParityFactor)
{
idnumberIGJPC=2*I*1e5+(G+2)*1e4+idnumberJPC; idnumberIGJPC=2*I*1e5+(G+2)*1e4+idnumberJPC;
} }
IGJPC(std::shared_ptr<const jpcRes> theJPC, const Spin& theI, IGJPC(std::shared_ptr<const jpcRes> theJPC, const Spin& theI,
int theG, const double theParityFactor=0.): jpcRes(theJPC) { int theG, const double theParityFactor=0.):
I=theI; jpcRes(theJPC),
G=theG; I(theI),
parityFactor=theParityFactor; G(theG),
parityFactor(theParityFactor)
{
idnumberIGJPC=2*I*1e5+(G+2)*1e4+idnumberJPC; idnumberIGJPC=2*I*1e5+(G+2)*1e4+idnumberJPC;
} }
IGJPC(std::shared_ptr<const IGJPC> theIGJPC): IGJPC(std::shared_ptr<const IGJPC> theIGJPC):
jpcRes(theIGJPC->J, theIGJPC->P, theIGJPC->C) { jpcRes(theIGJPC->J, theIGJPC->P, theIGJPC->C),
I=theIGJPC->I; I(theIGJPC->I),
G=theIGJPC->G; G(theIGJPC->G),
parityFactor=theIGJPC->parityFactor; parityFactor(theIGJPC->parityFactor)
{
idnumberIGJPC=2*I*1e5+(G+2)*1e4+idnumberJPC; idnumberIGJPC=2*I*1e5+(G+2)*1e4+idnumberJPC;
} }
...@@ -231,27 +240,32 @@ struct JPClamlam : public jpcRes { ...@@ -231,27 +240,32 @@ struct JPClamlam : public jpcRes {
double parityFactor; double parityFactor;
unsigned long idnumberJPClamlam; unsigned long idnumberJPClamlam;
JPClamlam(const Spin j, const int p, const int c, const Spin& theLam1, JPClamlam(const Spin& j, const int p, const int c, const Spin& theLam1,
const Spin& theLam2, const double theParityFactor=0.): jpcRes(j, p, c) { const Spin& theLam2, const double theParityFactor=0.):
lam1=theLam1; jpcRes(j, p, c),
lam2=theLam2; lam1(theLam1),
parityFactor=theParityFactor; lam2(theLam2),
parityFactor(theParityFactor)
{
idnumberJPClamlam=idnumberJPC*1e4+2*lam2*1e2+2*lam1; idnumberJPClamlam=idnumberJPC*1e4+2*lam2*1e2+2*lam1;
} }
JPClamlam(std::shared_ptr<const jpcRes> theJPC, const Spin& theLam1, JPClamlam(std::shared_ptr<const jpcRes> theJPC, const Spin& theLam1,
const Spin& theLam2, const double theParityFactor=0.): jpcRes(theJPC) { const Spin& theLam2, const double theParityFactor=0.):
lam1=theLam1; jpcRes(theJPC),
lam2=theLam2; lam1(theLam1),
parityFactor=theParityFactor; lam2(theLam2),
parityFactor(theParityFactor)
{
idnumberJPClamlam=idnumberJPC*1e4+2*lam2*1e2+2*lam1; idnumberJPClamlam=idnumberJPC*1e4+2*lam2*1e2+2*lam1;
} }
JPClamlam(std::shared_ptr<const JPClamlam> theJPClamlam): JPClamlam(std::shared_ptr<const JPClamlam> theJPClamlam):
jpcRes(theJPClamlam->J, theJPClamlam->P, theJPClamlam->C) { jpcRes(theJPClamlam->J, theJPClamlam->P, theJPClamlam->C),
lam1=theJPClamlam->lam1; lam1(theJPClamlam->lam1),
lam2=theJPClamlam->lam2; lam2(theJPClamlam->lam2),
parityFactor=theJPClamlam->parityFactor; parityFactor(theJPClamlam->parityFactor)
{
idnumberJPClamlam=idnumberJPC*1e4+2*lam2*1e2+2*lam1; idnumberJPClamlam=idnumberJPC*1e4+2*lam2*1e2+2*lam1;
} }
...@@ -292,27 +306,31 @@ struct JPCLS : public jpcRes { ...@@ -292,27 +306,31 @@ struct JPCLS : public jpcRes {
double preFactor; double preFactor;
unsigned long idnumberJPCLS; unsigned long idnumberJPCLS;
JPCLS(const Spin j, const int p, const int c, const Spin& theL, const Spin& theS, JPCLS(const Spin& j, const int p, const int c, const Spin& theL, const Spin& theS,
const double thePreFactor=0.): jpcRes(j, p, c) { const double thePreFactor=0.):
L=theL; jpcRes(j, p, c),
S=theS; L(theL),
preFactor=thePreFactor; S(theS),
preFactor(thePreFactor)
{
idnumberJPCLS=idnumberJPC*1e4+2*L*1e2+2*S; idnumberJPCLS=idnumberJPC*1e4+2*L*1e2+2*S;
} }
JPCLS(std::shared_ptr<const jpcRes> theJPC, const Spin& theL, const Spin& theS, JPCLS(std::shared_ptr<const jpcRes> theJPC, const Spin& theL, const Spin& theS, const double thePreFactor=0.) :
const double thePreFactor=0.): jpcRes(theJPC) { jpcRes(theJPC),
L=theL; L(theL),
S=theS; S(theS),
preFactor=thePreFactor; preFactor(thePreFactor)
{
idnumberJPCLS=idnumberJPC*1e4+2*L*1e2+2*S; idnumberJPCLS=idnumberJPC*1e4+2*L*1e2+2*S;
} }
JPCLS(std::shared_ptr<const JPCLS> theJPCLS): JPCLS(std::shared_ptr<const JPCLS> theJPCLS):
jpcRes(theJPCLS->J, theJPCLS->P, theJPCLS->C) { jpcRes(theJPCLS->J, theJPCLS->P, theJPCLS->C),
L=theJPCLS->L; L(theJPCLS->L),
S=theJPCLS->S; S(theJPCLS->S),
preFactor=theJPCLS->preFactor; preFactor(theJPCLS->preFactor)
{
idnumberJPCLS=idnumberJPC*1e4+2*L*1e2+2*S; idnumberJPCLS=idnumberJPC*1e4+2*L*1e2+2*S;
} }
...@@ -361,25 +379,27 @@ struct JPCLSJJ : public JPCLS { ...@@ -361,25 +379,27 @@ struct JPCLSJJ : public JPCLS {
JPCLSJJ(std::shared_ptr<const JPCLS> theJPCLS, const Spin& theJ1, JPCLSJJ(std::shared_ptr<const JPCLS> theJPCLS, const Spin& theJ1,
const Spin& theLambda1, const Spin& theJ2, const Spin& theLambda2): const Spin& theLambda1, const Spin& theJ2, const Spin& theLambda2):
JPCLS(theJPCLS) { JPCLS(theJPCLS),
J1=theJ1; J1(theJ1),
Lambda1=theLambda1; Lambda1(theLambda1),
J2=theJ2; J2(theJ2),
Lambda2=theLambda2; Lambda2(theLambda2)
{
CGLS=Clebsch(L,0,S, Lambda1-Lambda2, J, Lambda1-Lambda2); CGLS=Clebsch(L,0,S, Lambda1-Lambda2, J, Lambda1-Lambda2);
CGJJ=Clebsch(J1, Lambda1, J2, -Lambda2, S, Lambda1-Lambda2); CGJJ=Clebsch(J1, Lambda1, J2, -Lambda2, S, Lambda1-Lambda2);
prefactorAll = sqrt( (2.*L+1)/(2.*J+1) ) * CGLS * CGJJ; prefactorAll = sqrt( (2.*L+1)/(2.*J+1) ) * CGLS * CGJJ;
} }
JPCLSJJ(std::shared_ptr<const JPCLSJJ> theJPCLSJJ): JPCLS(theJPCLSJJ) { JPCLSJJ(std::shared_ptr<const JPCLSJJ> theJPCLSJJ):
J1=theJPCLSJJ->J1; JPCLS(theJPCLSJJ),
Lambda1=theJPCLSJJ->Lambda1; J1(theJPCLSJJ->J1),
J2=theJPCLSJJ->J2; Lambda1(theJPCLSJJ->Lambda1),
Lambda2=theJPCLSJJ->Lambda2; J2(theJPCLSJJ->J2),
CGLS=theJPCLSJJ->CGLS; Lambda2(theJPCLSJJ->Lambda2),
CGJJ=theJPCLSJJ->CGJJ; CGLS(theJPCLSJJ->CGLS),
prefactorAll=theJPCLSJJ->prefactorAll; CGJJ(theJPCLSJJ->CGJJ),
} prefactorAll(theJPCLSJJ->prefactorAll)
{}
virtual bool operator==(const jpcRes& compare) const { virtual bool operator==(const jpcRes& compare) const {
return jpcRes::operator==(compare); return jpcRes::operator==(compare);
......
...@@ -132,7 +132,7 @@ public: ...@@ -132,7 +132,7 @@ public:
* *
* Note: Asserts @a matrix and @a this be the same size. * Note: Asserts @a matrix and @a this be the same size.
*/ */
template <typename V> Matrix<_Tp>& operator=(const Matrix<V> &__matrix); template <typename V> Matrix<_Tp>& operator=(const Matrix<V>& __matrix);
/// Assignment operator (for 1 x 1 matrix only) /// Assignment operator (for 1 x 1 matrix only)
Matrix<_Tp>& operator=(typename Type<_Tp>::ParamType __val){ Matrix<_Tp>& operator=(typename Type<_Tp>::ParamType __val){
......
...@@ -255,7 +255,7 @@ public: ...@@ -255,7 +255,7 @@ public:
/** Assignment operator /** Assignment operator
* Note: Legal if @a Tp = @a T is a legal assignment. * Note: Legal if @a Tp = @a T is a legal assignment.
*/ */
template<typename T> Tensor<_Tp>& operator=(const Tensor<T> &__tensor){ template<typename T> Tensor<_Tp>& operator=(const Tensor<T>& __tensor){
if(!this->RankCheck(__tensor)) this->SetRank(__tensor.Rank()); if(!this->RankCheck(__tensor)) this->SetRank(__tensor.Rank());
this->Tensor_Base::operator=(__tensor); this->Tensor_Base::operator=(__tensor);
this->_Copy(__tensor); this->_Copy(__tensor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment