diff --git a/common-tools/clas-physics/pom.xml b/common-tools/clas-physics/pom.xml
index f10d001d54..36f94451b2 100644
--- a/common-tools/clas-physics/pom.xml
+++ b/common-tools/clas-physics/pom.xml
@@ -13,11 +13,4 @@
14.1.0-SNAPSHOT
-
-
- junit
- junit
-
-
-
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/EventFilter.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/EventFilter.java
deleted file mode 100644
index 5eba0fe358..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/EventFilter.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.physics;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-import org.jlab.clas.pdg.PDGDatabase;
-import org.jlab.clas.pdg.PDGParticle;
-
-/**
- *
- * @author gavalian
- */
-public class EventFilter {
-
- HashMap pParticleIDS;
- //ArrayList pOperationCuts;
-
- int nNegativeParticlesWithPid;
- int nPositiveParticlesWithPid;
- int nNeutralParticlesWithPid;
-
- int nNegativeParticlesCount;
- int nPositiveParticlesCount;
- int nNeutralParticlesCount;
-
- int nNegativeParticlesAny;
- int nPositiveParticlesAny;
- int nNeutralParticlesAny;
-
- int nPositiveParticles;
- int nNegativeParticles;
- int nNeutralParticles;
-
-
- long numberOfChecks = 0;
- long numberOfChecksPassed = 0;
- private String filterString = "";
-
- public EventFilter(String filter){
- pParticleIDS = new HashMap();
- //pOperationCuts = new ArrayList();
- this.setFilter(filter);
- }
-
- public EventFilter()
- {
- pParticleIDS = new HashMap();
- //pOperationCuts = new ArrayList();
- }
-
-
- public void addCut(String name, String particle, double min, double max)
- {
- //pOperationCuts.add(new ParticleOperation(name,particle,min,max));
- }
-
- public boolean checkFinalState(PhysicsEvent event)
- {
- boolean filter = true;
-
- int pc = event.countByCharge(+1);
- int pm = event.countByCharge(-1);
- int pn = event.countByCharge( 0);
-
- if(pcthis.getMaximumByCharge(+1))
- return false;
- if(pmthis.getMaximumByCharge(-1))
- return false;
- if(pnthis.getMaximumByCharge( 0))
- return false;
-
- Set pKeys = this.getIdKeys();
- Iterator it = pKeys.iterator();
- while(it.hasNext())
- {
- Integer key = (Integer) it.next();
- int idcount = this.getIdCount(key);
- if(event.countByPid(key)this.getMaximumByCharge(+1))
- return false;
- if(pmthis.getMaximumByCharge(-1))
- return false;
- if(pnthis.getMaximumByCharge( 0))
- return false;
-
- Set pKeys = this.getIdKeys();
- Iterator it = pKeys.iterator();
- while(it.hasNext())
- {
- Integer key = (Integer) it.next();
- int idcount = this.getIdCount(key);
- if(plist.countByPid(key)0){
- nPositiveParticlesWithPid += 1;
- } else {
- nNegativeParticlesWithPid += 1;
- }
- //increaseCharge(charge,1);
- }
- }
-
- public void parseChargedSign(String charge)
- {
- int clen = charge.length();
- char ctrail = charge.charAt(clen-1);
- int count = 0;
-
- if(clen==1)
- {
- count =1;
- } else {
- char pctrail = charge.charAt(clen-2);
- if(pctrail=='X'){
- setInclusive(ctrail);
- return;
- }
- count = Integer.parseInt(charge.substring(0, clen-1));
- }
-
- increaseChargeString(ctrail,count);
- }
-
- public int getIdCount(Integer pidKey)
- {
- return pParticleIDS.get(pidKey);
- }
-
- public Set getIdKeys()
- {
- return pParticleIDS.keySet();
- }
-
- public void setInclusive(char charge)
- {
- switch (charge)
- {
- case '+': nPositiveParticlesAny = -1;
- break;
- case '-': nNegativeParticlesAny = -1;
- break;
- case 'n': nNeutralParticlesAny = -1;
- break;
- default: break;
- }
- }
-
- public void increaseChargeString(char charge, int weight)
- {
- switch (charge)
- {
- case '+': nPositiveParticlesCount += weight;//increaseCharge(1,weight);
- break;
- case '-': nNegativeParticlesCount += weight;//increaseCharge(-1,weight);
- break;
- case 'n': nNeutralParticlesCount += weight;//increaseCharge(0,weight);
- break;
- default: break;
- }
- }
-
- public void increaseCharge(int charge, int weight)
- {
- switch (charge){
- case 1: if(nPositiveParticles>=0) nPositiveParticles+=weight;
- break;
- case -1: if(nNegativeParticles>=0) nNegativeParticles+=weight;
- break;
- case 0: if(nNeutralParticles>=0) nNeutralParticles+=weight;
- break;
- default: break;
- }
- }
-
- public final void setFilter(String opt)
- {
- this.filterString = opt;
- clear();
- String[] tokens = opt.split(":");
- for(int loop = 0; loop < tokens.length; loop++)
- {
- int tokenLen = tokens[loop].length();
- if(tokenLen>0)
- {
- char trailingChar = tokens[loop].charAt(tokenLen-1);
- if(trailingChar=='+'||trailingChar=='-'||trailingChar=='n')
- {
- parseChargedSign(tokens[loop]);
- } else {
- addPid(tokens[loop]);
- }
- }
- }
- this.numberOfChecks = 0;
- this.numberOfChecksPassed = 0;
- }
-
- public int getMinimumByCharge(int charge)
- {
- if(charge==0)
- {
- return (nNeutralParticlesWithPid + nNeutralParticlesCount);
- } else if(charge > 0) {
- return (nPositiveParticlesWithPid + nPositiveParticlesCount);
- }
-
- return (nNegativeParticlesWithPid + nNegativeParticlesCount);
- }
-
- public int getMaximumByCharge(int charge)
- {
- if(charge==0)
- {
- if(nNeutralParticlesAny<0){
- return 100;
- } else {
- return getMinimumByCharge(0);
- }
- }
-
- if(charge>0){
- if(nPositiveParticlesAny<0)
- {
- return 100;
- } else {
- return getMinimumByCharge(1);
- }
- }
-
- if(nNegativeParticlesAny<0)
- {
- return 100;
- } else {
- return getMinimumByCharge(-1);
- }
- }
-
- public int getCountByCharge(int charge)
- {
- if(charge==0)
- {
- return nNeutralParticles;
- } else if(charge>0) return nPositiveParticles;
- return nNegativeParticles;
- }
-
- @Override
- public String toString()
- {
- StringBuilder str = new StringBuilder();
- str.append(String.format("FILTER:---> POSITIVE : %6d %6d, NEGATIVE : %6d %6d , "
- + "NEUTRAL : %6d %6d",
- getMinimumByCharge( 1),getMaximumByCharge( 1),
- getMinimumByCharge(-1),getMaximumByCharge(-1),
- getMinimumByCharge( 0),getMaximumByCharge( 0)));
- //nPositiveParticles, nNegativeParticles, nNeutralParticles));
- return str.toString();
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/LorentzVector.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/LorentzVector.java
index 2b20b5bd1f..71cddc16d8 100644
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/LorentzVector.java
+++ b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/LorentzVector.java
@@ -1,7 +1,3 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package org.jlab.clas.physics;
/**
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Particle.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Particle.java
index 29b95fcc20..65c8e718ec 100644
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Particle.java
+++ b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Particle.java
@@ -1,7 +1,3 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package org.jlab.clas.physics;
import java.util.HashMap;
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleFinder.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleFinder.java
deleted file mode 100644
index 2e2992e821..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleFinder.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.physics;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.jlab.clas.pdg.PDGDatabase;
-
-/**
- *
- * @author gavalian
- */
-public class ParticleFinder {
- private final List particleOperations = new ArrayList();
-
- public ParticleFinder(){
-
- }
-
- public void generate(PhysicsEvent event){
- particleOperations.clear();
- int nphotons = event.countByPid(22);
- if(nphotons<2) return;
- for(int i = 0; i < nphotons; i++){
- for(int k = 0; k < nphotons;k++){
- if(i!=k){
- particleOperations.add(String.format("[22,%d]+[22,%d]", i,k));
- }
- }
- }
- }
-
- public Particle getPion(PhysicsEvent event){
- this.generate(event);
-
- double mass = PDGDatabase.getParticleById(111).mass();
- double distance = 1.0;
- Particle pion = null;
- for(String selection : particleOperations){
- Particle candidate = event.getParticle(selection);
- if(Math.abs(candidate.vector().mass()-mass) < distance){
- distance = Math.abs(candidate.vector().mass()-mass);
- pion = candidate;
- }
- }
- return pion;
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleGenerator.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleGenerator.java
deleted file mode 100644
index 7238af9259..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleGenerator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.jlab.clas.physics;
-
-/**
- *
- * @author gavalian
- */
-public class ParticleGenerator {
- private int particleID = 11;
- private double pCosThetaMin = -1.0;
- private double pCosThetaMax = 1.0;
- private double pPhiMin = -180.0;
- private double pPhiMax = -180.0;
- private double pMomentumMin = 1.0;
- private double pMomentumMax = 5.0;
- private final Vector3 vertexConstrains = new Vector3(0.0,0.0,0.0);
-
- public ParticleGenerator(int pid){
- particleID = pid;
- }
-
- public ParticleGenerator(int pid, double pmin, double pmax, double thmin, double thmax,
- double phimin, double phimax){
- particleID = pid;
- this.setRange(pmin, pmax, thmin, thmax, phimin, phimax);
- }
-
- public final void setRange(double pmin, double pmax, double thmin, double thmax,
- double phimin, double phimax){
- this.setMomRange(pmin, pmax);
- this.setThetaRange(thmin, thmax);
- this.setPhiRange(phimin, phimax);
- }
-
- public ParticleGenerator setMomRange(double pmin, double pmax){
- pMomentumMin = pmin;
- pMomentumMax = pmax;
- return this;
- }
-
- public ParticleGenerator setPhiRange(double pmin, double pmax){
- pPhiMin = pmin;
- pPhiMax = pmax;
- return this;
- }
-
- public ParticleGenerator setThetaRange(double tmin, double tmax){
- pCosThetaMin = Math.cos(Math.toRadians(tmin));
- pCosThetaMax = Math.cos(Math.toRadians(tmax));
- return this;
- }
-
- public Particle getParticle(){
- double p = pMomentumMin + Math.random()*(pMomentumMax-pMomentumMin);
- double theta = Math.acos(pCosThetaMin + Math.random()*(pCosThetaMax-pCosThetaMin));
- double phi = Math.toRadians(pPhiMin + Math.random()*(pPhiMax-pPhiMin));
- //Vector3 pvector = new Vector3(p*Math.sin(theta)*Math.cos(phi),
- //p*Math.sin(theta)*Math.sin(phi),p*Math.cos(theta));
- Particle part = new Particle(particleID,
- p*Math.sin(theta)*Math.cos(phi),
- p*Math.sin(theta)*Math.sin(phi),
- p*Math.cos(theta),0.0,0.0,0.0);
- return part;
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleList.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleList.java
index 944eff28b9..03a92da794 100644
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleList.java
+++ b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleList.java
@@ -1,8 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
package org.jlab.clas.physics;
import java.util.ArrayList;
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleNotFoundException.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleNotFoundException.java
index 80faaf4e5f..b9e0cac804 100644
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleNotFoundException.java
+++ b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/ParticleNotFoundException.java
@@ -1,8 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
package org.jlab.clas.physics;
/**
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsEvent.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsEvent.java
index 23553ba2dd..9d0af69b5d 100644
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsEvent.java
+++ b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsEvent.java
@@ -1,7 +1,3 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package org.jlab.clas.physics;
import java.util.ArrayList;
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsKinematics.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsKinematics.java
deleted file mode 100644
index 1e69d5ff64..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/PhysicsKinematics.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.physics;
-
-import org.jlab.clas.reactions.DecayKinematics;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsKinematics {
-
- public static Particle getParticleUnBoosted(Particle frame, Particle part){
- Vector3 boost = frame.vector().boostVector();
- boost.negative();
- LorentzVector vecL = new LorentzVector();
- vecL.copy(part.vector());
- vecL.boost(boost);
- Vector3 partBoosted = new Vector3();
- partBoosted.copy(vecL.vect());
- Vector3 partInFrame = DecayKinematics.vectorToFrame(frame.vector().vect(), partBoosted);
- Particle result = new Particle();
- result.setParticleWithMass(part.mass(), (byte) part.charge(),
- partInFrame.x(),partInFrame.y(),partInFrame.z(),
- part.vertex().x(),part.vertex().y(),part.vertex().z());
- return result;
- }
-
- public static Particle getParticleUnBoosted(Particle frame, Particle part, Boolean isBoosted){
- Vector3 boost = frame.vector().boostVector();
- boost.negative();
- LorentzVector vecL = new LorentzVector();
- vecL.copy(part.vector());
- if(isBoosted==true){
- vecL.boost(boost);
- }
- Vector3 partBoosted = new Vector3();
- partBoosted.copy(vecL.vect());
- Vector3 partInFrame = DecayKinematics.vectorToFrame(frame.vector().vect(), partBoosted);
- Particle result = new Particle();
- result.setParticleWithMass(part.mass(), (byte) part.charge(),
- partInFrame.x(),partInFrame.y(),partInFrame.z(),
- part.vertex().x(),part.vertex().y(),part.vertex().z());
- return result;
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Vector3.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Vector3.java
index 35cc04c4e8..e30dfe1722 100644
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Vector3.java
+++ b/common-tools/clas-physics/src/main/java/org/jlab/clas/physics/Vector3.java
@@ -1,7 +1,3 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package org.jlab.clas.physics;
/**
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/DecayKinematics.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/DecayKinematics.java
deleted file mode 100644
index eba541f9b4..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/DecayKinematics.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.reactions;
-
-import org.jlab.clas.physics.Vector3;
-import org.jlab.clas.physics.LorentzVector;
-/**
- *
- * @author gavalian
- */
-public class DecayKinematics {
-
- public static TransMatrix trMatrix = DecayKinematics.initMatrix();
-
- public DecayKinematics()
- {
-
- }
-
- public static TransMatrix initMatrix()
- {
- return new TransMatrix();
- }
-
- public static Vector3 vectorToLab(Vector3 frame, Vector3 vec)
- {
- DecayKinematics.trMatrix.compose(frame);
- DecayKinematics.trMatrix.inverse();
- return DecayKinematics.trMatrix.mult(vec);
- }
-
- public static Vector3 vectorToFrame(Vector3 frame, Vector3 vec)
- {
- DecayKinematics.trMatrix.compose(frame);
- return DecayKinematics.trMatrix.mult(vec);
- }
-
- public static double TwoBodyDecayMomentum(double M, double m1, double m2)
- {
- double mult1 = M*M - (m1+m2)*(m1+m2);
- double mult2 = M*M - (m1-m2)*(m1-m2);
- double mult = mult1*mult2;
- if(mult<0)
- {
- System.err.println("Decay:: error. particle with Mass="+M
- + " can not decay to particles with masses ( " + m1
- + " , " + m2 + " )");
- return -1.0;
- }
- return Math.sqrt(mult)/(2.0*M);
- }
-
- public static LorentzVector[] getDecayParticles(LorentzVector parent,
- double m1, double m2, double theta_rf, double phi_rf)
- {
- LorentzVector[] pd = new LorentzVector[2];
- for(int loop=0;loop<2;loop++) pd[loop] = new LorentzVector();
- double momentum = DecayKinematics.TwoBodyDecayMomentum(parent.mass(), m1, m2);
- Vector3 vz = new Vector3(0.,0.,0.);
- Vector3 v1 = new Vector3();
- Vector3 v2 = new Vector3();
-
- v1.setMagThetaPhi(momentum, theta_rf, phi_rf);
- vz.sub(v1);
- v2.setMagThetaPhi(momentum, Math.PI-theta_rf, 2.0*Math.PI-phi_rf);
- pd[0].setVectM(v1, m1);
- pd[1].setVectM(vz, m2);
- return pd;
- }
-
- public static LorentzVector[] getDecayParticlesLab(LorentzVector parent,
- double m1, double m2, double theta_rf, double phi_rf)
- {
- LorentzVector[] vectD = DecayKinematics.getDecayParticles(parent, m1, m2, theta_rf, phi_rf);
- Vector3 vboost = parent.boostVector();
- vectD[0].boost(vboost);
- vectD[1].boost(vboost);
- return vectD;
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/IDecay.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/IDecay.java
deleted file mode 100644
index 5f567fe7d8..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/IDecay.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.reactions;
-
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gagikgavalian
- */
-
-public interface IDecay {
- void init();
- void setDecayParticle(int id);
- void setDecayParticle(String name);
- void setDecayProducts(int pid1, int pid2);
- void setDecayProducts(String name1, String name2);
- void setDecayProducts(int pid1, int pid2, int pid3);
- void setDecayProducts(String name1, String name2, String name3);
- void decayParticles(PhysicsEvent event);
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/TransMatrix.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/TransMatrix.java
deleted file mode 100644
index f55bb6997c..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/TransMatrix.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.reactions;
-
-import org.jlab.clas.physics.Vector3;
-
-/**
- *
- * @author gagikgavalian
- */
-public class TransMatrix {
- double[][] tMatrix;
- double[] partialMatrix;
-
- Vector3[] LabV;
- Vector3[] PrimeV;
-
- Vector3 Lab1;
- Vector3 Lab2;
- Vector3 Lab3;
- Vector3 Prime1;
- Vector3 Prime2;
- Vector3 Prime3;
-
- public TransMatrix()
- {
- tMatrix = new double[3][3];
- partialMatrix = new double[4];
-
- LabV = new Vector3[3];
- PrimeV = new Vector3[3];
-
- for(int loop = 0; loop < 3; loop++)
- {
- LabV[loop] = new Vector3();
- PrimeV[loop] = new Vector3();
- }
-
- LabV[0].setXYZ(1.0, 0.0, 0.0);
- LabV[1].setXYZ(0.0, 1.0, 0.0);
- LabV[2].setXYZ(0.0, 0.0, 1.0);
-
- PrimeV[0].setXYZ(1.0, 0.0, 0.0);
- PrimeV[1].setXYZ(0.0, 1.0, 0.0);
- PrimeV[2].setXYZ(0.0, 0.0, 1.0);
-
- Lab1 = new Vector3(1.0, 0.0, 0.0);
- Lab2 = new Vector3(0.0, 1.0, 0.0);
- Lab3 = new Vector3(0.0, 0.0, 1.0);
- Prime1 = new Vector3(1.0, 0.0, 0.0);
- Prime2 = new Vector3(0.0, 1.0, 0.0);
- Prime3 = new Vector3(0.0, 0.0, 1.0);
- }
-
- public double get(int row, int col)
- {
- return tMatrix[row][col];
- }
-
- public void set(int row, int col, double val)
- {
- tMatrix[row][col] = val;
- }
-
- double partialDet(int exrow, int excol)
- {
- int index = 0;
- for(int ir = 0; ir < 3; ir++)
- for(int ic = 0; ic < 3; ic++)
- {
- if(ir!=exrow&&ic!=excol)
- {
- partialMatrix[index] = get(ir,ic);
- index++;
- }
- }
- return (partialMatrix[3]*partialMatrix[0]-partialMatrix[1]*partialMatrix[2]);
- }
-
- public double det()
- {
- double determ = 0.0;
- double factor = +1.0;
- for(int ir=0;ir<3;ir++)
- {
- factor = +1.0;
- if(ir==1) factor = -1.0;
- determ += get(ir,0)*factor*partialDet(ir,0);
- }
- return determ;
- }
-
- double epsilon(int i, int j)
- {
- double e = 0.0;
- if(i==0||i==2){
- if(j==1){
- e = -1.;
- } else {
- e = +1.;
- }
- }
-
- if(i==1){
- if(j==1){
- e = +1.;
- } else {
- e = -1.;
- }
- }
- return e;
- }
- public void unit()
- {
- for(int ir = 0; ir < 3; ir++)
- for(int ic = 0; ic < 3; ic++)
- set(ir,ic,0.0);
- set(0,0,1.0);
- set(1,1,1.0);
- set(2,2,1.0);
- }
- public void setRow(int row, double v1, double v2, double v3)
- {
- set(row,0,v1);
- set(row,1,v2);
- set(row,2,v3);
- }
-
- public void compose(Vector3 vec)
- {
- PrimeV[1] = LabV[2].cross(vec);
- if(PrimeV[1].mag()==0)
- {
- //System.out.println("set prime vector to lab direction");
- PrimeV[1].setXYZ(0.0, 1.0, 0.0);
- }
- //System.out.println(" Mag = " + PrimeV[1].mag());
- PrimeV[1].unit();
- //System.out.println(" Mag unit = " + PrimeV[1].mag());
- PrimeV[2].setXYZ(vec.x(), vec.y(), vec.z());
- PrimeV[2].unit();
- PrimeV[0] = PrimeV[1].cross(PrimeV[2]);
-
- //System.out.println("-------> prime vector");
- /*for(int j = 0; j < 3; j++)
- System.out.println(PrimeV[j].x() + " " + PrimeV[j].y() + " " + PrimeV[j].z() + " " + PrimeV[j].mag());
- System.out.println("-------> lab vector");
- for(int j = 0; j < 3; j++)
- System.out.println(LabV[j].x() + " " + LabV[j].y() + " " + LabV[j].z());
- */
- for(int ir = 0; ir < 3; ir++)
- for(int ic=0;ic<3;ic++)
- this.set(ir, ic, PrimeV[ir].dot(LabV[ic]));
- }
-
- public Vector3 mult(Vector3 v)
- {
- Vector3 trvec = new Vector3();
- trvec.setXYZ(get(0,0)*v.x()+get(0,1)*v.y()+get(0,2)*v.z(),
- get(1,0)*v.x()+get(1,1)*v.y()+get(1,2)*v.z(),
- get(2,0)*v.x()+get(2,1)*v.y()+get(2,2)*v.z()
- );
- return trvec;
- }
-
- public void inverse()
- {
- double[][] matRes = new double[3][3];
- double determ = this.det();
- if(determ==0.0)
- {
- System.err.println("----> error in transmatrix deteminant is 0.0 and it can not be inversed.");
- return;
- }
-
- double rvalue;
-
- for(int ir = 0; ir < 3; ir++)
- for(int ic = 0; ic < 3; ic++)
- {
- // Check this later if the reversed index is correct for epsilon.
- rvalue = this.epsilon(ic, ir)*partialDet(ir,ic)/determ;
- //rvalue = partialDet(ir,ic)/determ;
- matRes[ir][ic] = rvalue;
- }
-
- for(int ir = 0; ir < 3; ir++)
- for(int ic = 0; ic < 3; ic++)
- {
- this.set(ir,ic,matRes[ic][ir]);
- //this.set(ir,ic,matRes[ir][ic]);
- }
- }
-
- public void print()
- {
- System.out.println("\n");
- for(int ir = 0; ir < 3; ir++)
- System.out.println(String.format("%8.5f,%8.5f,%8.5f",
- get(ir,0),get(ir,1),get(ir,2)));
-
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/TwoBodyDecay.java b/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/TwoBodyDecay.java
deleted file mode 100644
index d4d5216558..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/clas/reactions/TwoBodyDecay.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.clas.reactions;
-
-import org.jlab.clas.pdg.PDGDatabase;
-import org.jlab.clas.pdg.PDGParticle;
-import org.jlab.clas.physics.LorentzVector;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-import org.jlab.clas.physics.Vector3;
-
-
-/**
- *
- * @author gavalian
- */
-public class TwoBodyDecay implements IDecay {
-
- int decayParticleID1;
- int decayParticleID2;
- int parentParticleID;
- LorentzVector decayProd1;
- LorentzVector decayProd2;
-
- public TwoBodyDecay()
- {
- this.setDecayParticle(111);
- this.setDecayProducts(22,22);
- }
-
- public TwoBodyDecay(int parentID, int childid1, int childid2)
- {
- decayProd1 = new LorentzVector();
- decayProd2 = new LorentzVector();
- this.setDecayParticle(parentID);
- this.setDecayProducts(childid1,childid2);
- }
-
- public TwoBodyDecay(String parent, String child1, String child2)
- {
- this.setDecayParticle(parent);
- this.setDecayProducts(child1, child2);
- }
-
- public void init() {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- public void setDecayParticle(int id) {
- this.parentParticleID = id;
- }
-
- public void setDecayParticle(String name) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- public void setDecayProducts(int pid1, int pid2) {
- this.decayParticleID1 = pid1;
- this.decayParticleID2 = pid2;
- }
-
- public void setDecayProducts(String name1, String name2) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- public void setDecayProducts(int pid1, int pid2, int pid3) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- public void setDecayProducts(String name1, String name2, String name3) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- private double getCosThetaRandom(){
- return Math.random()*2.0-1.0;
- }
-
- private double getPhiRandom(){
- return Math.random()*2.0*Math.PI-Math.PI;
- }
-
- public void decayParticles(PhysicsEvent event) {
- double cosTheta = this.getCosThetaRandom();
- double phi = this.getPhiRandom();
-
- PDGParticle p1 = PDGDatabase.getParticleById(decayParticleID1);
- PDGParticle p2 = PDGDatabase.getParticleById(decayParticleID2);
-
- Particle mother = event.getParticleByPid(parentParticleID, 0);
- LorentzVector vector = new LorentzVector();
- vector.copy(mother.vector());
-
- LorentzVector[] vec = DecayKinematics.getDecayParticles(vector,
- p1.mass(), p2.mass(), Math.acos(cosTheta), phi);
- Vector3 vectBoost = vector.boostVector();
- vec[0].boost(vectBoost);
- vec[1].boost(vectBoost);
- decayProd1.copy(vec[0]);
- decayProd2.copy(vec[1]);
-
- int index = event.getParticleIndex(parentParticleID, 0);
- event.removeParticle(index);
-
- event.addParticle(new Particle(decayParticleID1,
- vec[0].px(), vec[0].py(), vec[0].pz(),
- mother.vertex().x(),mother.vertex().y(),mother.vertex().z()
- ));
-
- event.addParticle(new Particle(decayParticleID2,
- vec[1].px(), vec[1].py(), vec[1].pz(),
- mother.vertex().x(),mother.vertex().y(),mother.vertex().z()
- ));
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/EventOperator.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/EventOperator.java
deleted file mode 100644
index 8412e7f2c7..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/EventOperator.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.analysis;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.jlab.clas.physics.EventFilter;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class EventOperator {
-
- private String operatorName = "EV";
- private final Map operatorObservables = new LinkedHashMap();
- private final EventFilter eventFilter = new EventFilter();
-
- public EventOperator(){
-
- }
-
- public EventFilter getFilter(){return eventFilter;}
-
- public String getName(){ return operatorName; }
- public EventOperator setName(String name){operatorName = name;return this;}
- public EventOperator setFilter(String filter){eventFilter.setFilter(filter);return this;}
-
- public EventOperator setObservables(String... obsnames){
- operatorObservables.clear();
- for(String n : obsnames){
- operatorObservables.put(n, (Double) 0.0);
- }
- return this;
- }
-
- public void reset(){
- Set keys = this.operatorObservables.keySet();
- for(String key : keys) this.operatorObservables.put(key, (Double) 0.0);
- }
-
- public void operate(PhysicsEvent event){
-
- }
-
- public Map observableMap(){
- return this.operatorObservables;
- }
-
- public List observableList(){
- Set oset = operatorObservables.keySet();
- List names = new ArrayList();
- for(String on : oset){
- names.add(on);
- }
- return names;
- }
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- List names = observableList();
- str.append(String.format(" %12s :", getName()));
- for(String n : names){
- str.append(String.format("\t %s : ", n));
- str.append(this.operatorObservables.get(n));
- str.append("\n");
- }
- return str.toString();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/GenericEventOperator.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/GenericEventOperator.java
deleted file mode 100644
index bffc0f4b7a..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/GenericEventOperator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.analysis;
-
-import java.util.List;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class GenericEventOperator extends EventOperator {
-
- private String operator = "";
-
- public GenericEventOperator(String name, String op, String... vars){
- setName(name);
- operator = op;
- setObservables(vars);
- }
-
- @Override
- public void operate(PhysicsEvent event){
- reset();
- if(getFilter().isValid(event)==false) return;
- Particle part = event.getParticle(operator);
- List obs = observableList();
- for(String o : obs){
- double value = part.getProperty(o);
- observableMap().put(o, value);
- }
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/PhysicsAnalysis.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/PhysicsAnalysis.java
deleted file mode 100644
index b29d97d3e8..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/PhysicsAnalysis.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.analysis;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsAnalysis {
-
- private Map descriptors = new LinkedHashMap();
- private Map observableMap = new LinkedHashMap();
- private String projectName = "defaultProject";
-
- public PhysicsAnalysis(){
-
- }
-
- public void addObservable(String descriptor, String observale){
- if(descriptors.containsKey(descriptor)==true){
- descriptors.get(descriptor).addObservable(observale);
- }
- }
-
- public void addDescriptor(ParticleDescriptor desc){
- this.descriptors.put(desc.getName(), desc);
- }
-
- public void addDescriptor(String name, String operator){
- this.addDescriptor(new ParticleDescriptor(name,operator));
- }
-
- public void processEvent(PhysicsEvent event){
- this.observableMap.clear();
- for(Map.Entry entry : this.descriptors.entrySet()){
- Particle particle = event.getParticle(entry.getValue().getOperator());
- for(String property : entry.getValue().observableList()){
- float pvalue = (float) particle.get(property);
- this.observableMap.put(entry.getKey()+":"+property, pvalue);
- }
- }
- }
-
- public Map getObservables(){
- return this.observableMap;
- }
-
- public String toTupleString(){
- StringBuilder str = new StringBuilder();
- for(Map.Entry entry : this.observableMap.entrySet()){
- str.append(String.format(" %f ", entry.getValue()));
- }
- return str.toString();
- }
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- for(Map.Entry entry : this.descriptors.entrySet()){
- str.append(entry.getValue().toString());
- str.append("\n");
- }
- return str.toString();
- }
-
- public static class ParticleDescriptor {
-
- String descriptorName = "";
- String descriptorOperator = "";
- List observables = new ArrayList();
-
- public ParticleDescriptor(String name, String operator){
- descriptorName = name;
- descriptorOperator = operator;
- }
-
- public String getName(){
- return descriptorName;
- }
-
- public String getOperator(){
- return this.descriptorOperator;
- }
-
- public void addObservable(String ob){
- this.observables.add(ob);
- }
-
- public List observableList(){
- return this.observables;
- }
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- str.append(String.format("%12s : %24s ", getName(),getOperator()));
- for(String obs : observables){
- str.append(String.format(" : %s ", obs));
- }
- return str.toString();
- }
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/PhysicsDataObject.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/PhysicsDataObject.java
deleted file mode 100644
index 4286cf61d3..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/analysis/PhysicsDataObject.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.analysis;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsDataObject {
-
- List descriptors = new ArrayList();
-
- public PhysicsDataObject(){
-
- }
-
- public void addDescriptor(DataObjectDescriptor desc){
- this.descriptors.add(desc);
- }
-
- public void addDescriptor(String observable, String... cutList){
- DataObjectDescriptor desc = new DataObjectDescriptor(observable);
- for(String cut : cutList){
- desc.getDataCuts().add(cut);
- }
- addDescriptor(desc);
- }
-
- public class DataObjectDescriptor {
-
- String dataObservable = "";
- List dataCuts = new ArrayList();
-
- public DataObjectDescriptor(String obs){
- this.dataObservable = obs;
- }
-
- public String getDataObservable(){
- return this.dataObservable;
- }
-
- public List getDataCuts(){
- return dataCuts;
- }
-
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/DimensionSpace.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/base/DimensionSpace.java
deleted file mode 100644
index 42b70b11ac..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/DimensionSpace.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.base;
-
-import java.awt.FlowLayout;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JSlider;
-
-/**
- *
- * @author gavalian
- */
-public class DimensionSpace {
-
-
- String dimName = "unknown";
- double dimValue = 0.5;
- double dimMinimum = 0.0;
- double dimMaximum = 1.0;
- double constrainUpper = 1.0;
- double constrainLower = 0.0;
- int numberOfBins = 1;
-
- JPanel dimPanel = null;
-
- public DimensionSpace(){
-
- }
-
- public DimensionSpace(String name, double min, double max){
- this.set(name, min, max);
- }
-
- public final void set(String name, double min, double max){
- this.dimName = name;
- this.dimMinimum = min;
- this.dimMaximum = max;
- this.dimValue = min + 0.5*(max-min);
- }
-
- public void reset(){
- this.constrainUpper = 1.0;
- this.constrainLower = 0.0;
- }
-
- public void setContsrains(double lower, double upper){
- this.constrainUpper = upper;
- this.constrainLower = lower;
- }
-
- public double getRandom(){
- double rndm = Math.random();
- double low = this.dimMinimum + (this.dimMaximum - this.dimMinimum)*this.constrainLower;
- double max = this.dimMinimum + (this.dimMaximum - this.dimMinimum)*this.constrainUpper;
- return low + rndm*(max-low);
- }
-
- public void setRandom(){
- this.dimValue = this.getRandom();
- }
-
- public int getBin(){
- double delta = (this.dimMaximum-this.dimMinimum)/this.numberOfBins;
- double w = (this.dimValue-this.dimMinimum)/delta;
- int bin = (int) w;
- return bin;
- }
-
- public int getNBins(){
- return this.numberOfBins;
- }
-
- public void setNBins(int bins){
- this.numberOfBins = bins;
- }
-
- public String getName(){ return this.dimName;}
-
- public void setValue(double value){ this.dimValue = value;}
-
- public void setValueNormalized(double value){
- if(value<0.0||value>1.0){
- System.out.println("error: normalized value has to be 0.0-1.0");
- } else {
- this.dimValue = this.dimMinimum + value*(this.dimMaximum-this.dimMinimum);
- }
- }
-
- public double getValue() { return this.dimValue;}
- public double getMin() { return this.dimMinimum;}
- public double getMax() { return this.dimMaximum;}
-
- public void createPanel(){
- this.dimPanel = new JPanel();
- this.dimPanel.setLayout(new FlowLayout());
- JLabel nameLabel = new JLabel(this.dimName);
- JSlider jsUpper = new JSlider(JSlider.HORIZONTAL,
- 0, 100, 0);
- JSlider jsLower = new JSlider(JSlider.HORIZONTAL,
- 0, 100, 100);
-
- this.dimPanel.add(nameLabel);
- this.dimPanel.add(jsUpper);
- this.dimPanel.add(jsLower);
- }
-
- public JPanel getPanel(){ return this.dimPanel;}
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- str.append(String.format("* %-24s * %12.6f * %12.6f * %12.6f * ",
- this.dimName,this.dimMinimum,this.dimMaximum,this.dimValue));
- return str.toString();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/EventOperation.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/base/EventOperation.java
deleted file mode 100644
index 2e981748cd..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/EventOperation.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.base;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public abstract class EventOperation {
-
- public List operators = new ArrayList();
- public List particles = new ArrayList();
- public List properties = new ArrayList();
-
- public EventOperation(){
-
- }
-
- public void init(String... oper){
- this.operators.clear();
- for(String item : oper){
- operators.add(item);
- }
- }
-
- abstract void processEvent(PhysicsEvent event);
-
- public void initParticles(PhysicsEvent event){
-
- }
-
- public double getProperty(){
- return 0.0;
- }
-
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/IEventFilter.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/base/IEventFilter.java
deleted file mode 100644
index 639a23a8da..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/IEventFilter.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.jlab.physics.base;
-
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public interface IEventFilter {
- void init(String format);
- Boolean isValid(PhysicsEvent event);
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/IPhysicsCut.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/base/IPhysicsCut.java
deleted file mode 100644
index ad1f634f27..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/IPhysicsCut.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.jlab.physics.base;
-
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public interface IPhysicsCut {
- void init(String format);
- Boolean isValid(PhysicsEvent event);
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/ParameterSpace.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/base/ParameterSpace.java
deleted file mode 100644
index 5382a2e693..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/ParameterSpace.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.base;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- *
- * @author gavalian
- */
-public class ParameterSpace {
- Map parameters = new LinkedHashMap();
- public ParameterSpace(){
-
- }
-
- public ParameterSpace addParameter(String name, double min, double max){
- parameters.put(name, new DimensionSpace(name,min,max));
- return this;
- }
-
- public ParameterSpace setValue(String name, double value){
- parameters.get(name).setValue(value);
- return this;
- }
-
- public double getValue(String name){
- return this.parameters.get(name).getValue();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/PhaseSpace.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/base/PhaseSpace.java
deleted file mode 100644
index e0ea96e3ad..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/base/PhaseSpace.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.base;
-
-import java.awt.FlowLayout;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-
-/**
- *
- * @author gavalian
- */
-public class PhaseSpace {
-
- Map params = new LinkedHashMap();
- JPanel spacePanel = null;
-
- public PhaseSpace(){
-
- }
-
- public Set getKeys(){
- return params.keySet();
- }
-
- public void add(DimensionSpace space){
- this.params.put(space.getName(), space);
- }
-
- public void add(String name, double min, double max){
- this.add(new DimensionSpace(name,min,max));
- }
-
- public void add(String name, double value, double min, double max){
- DimensionSpace dim = new DimensionSpace(name,min,max);
- dim.setValue(value);
- this.add(dim);
- }
-
- public DimensionSpace getDimension(String name){
- return this.params.get(name);
- }
-
- public JPanel createPanel(){
- this.spacePanel = new JPanel();
- this.spacePanel.setLayout(new FlowLayout());
- for(Map.Entry item : this.params.entrySet()){
- item.getValue().createPanel();
- JPanel panel = item.getValue().getPanel();
- this.spacePanel.add(panel);
- }
- return this.spacePanel;
- }
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- for(int c = 0; c < 73; c++) str.append("*");
- str.append("\n");
- str.append(String.format("* %-24s * %12s * %12s * %12s * ",
- "Name", "Min","Max","Value"));
- str.append("\n");
- for(int c = 0; c < 73; c++) str.append("*");
- str.append("\n");
- for(Map.Entry item : this.params.entrySet()){
- str.append(item.getValue().toString());
- str.append("\n");
- }
- for(int c = 0; c < 73; c++) str.append("*");
- str.append("\n");
- return str.toString();
- }
-
- public void show(){
- System.out.println(this.toString());
- }
-
- public void setRandom(){
- for(Map.Entry entry : this.params.entrySet()){
- entry.getValue().setRandom();
- }
- }
-
- public PhaseSpace copy(){
- PhaseSpace space = new PhaseSpace();
- for(Map.Entry entry : this.params.entrySet()){
- space.add(entry.getKey(), entry.getValue().getMin(), entry.getValue().getMax());
- }
- return space;
- }
-
- public static void main(String[] args){
- PhaseSpace space = new PhaseSpace();
- space.add("x" , 0.0, 1.0);
- space.add("pt" , 0.5, 1.5);
-
- System.out.println(space);
-
- JFrame frame = new JFrame();
- frame.add(space.createPanel());
- frame.pack();
- frame.setVisible(true);
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/io/LundReader.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/io/LundReader.java
deleted file mode 100644
index 94aa31437e..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/io/LundReader.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.jlab.physics.io;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class LundReader {
- private final ArrayList inputFiles = new ArrayList();
- private BufferedReader reader = null;
- private PhysicsEvent physEvent = new PhysicsEvent();
-
- public LundReader() {
-
- }
-
- public LundReader(String file) {
- this.addFile(file);
- this.open();
- }
-
- public void addFile(String file) {
- inputFiles.add(file);
- }
-
- public void open() {
- this.openFile(0);
- }
-
- private Boolean openFile(int counter) {
- try {
- File file = new File(inputFiles.get(counter));
- reader = new BufferedReader(new FileReader(file));
- } catch (FileNotFoundException ex) {
- Logger.getLogger(LundReader.class.getName()).log(Level.SEVERE, null, ex);
- }
- return true;
- }
-
- public PhysicsEvent getEvent() {
- return physEvent;
- }
-
- public Boolean next() {
- try {
- physEvent.clear();
- String header = reader.readLine();
- if (header == null)
- return false;
- String[] tokens = header.trim().split("\\s+");
- // System.err.println("TOKENS size = " + tokens.length);
- // for(int loop = 0; loop < tokens.length; loop++){
- // System.err.println(" token " + loop + " = " + tokens[loop]);
- // }
- if (tokens.length != 10)
- return false;
- Integer nrows = Integer.parseInt(tokens[0]);
- if (nrows < 1)
- return false;
- physEvent.addProperty("nPart", nrows);
- physEvent.addProperty("nTarNucl", Double.parseDouble(tokens[1]));
- physEvent.addProperty("nTarProt", Double.parseDouble(tokens[2]));
- physEvent.addProperty("tarPol", Double.parseDouble(tokens[3]));
- physEvent.addProperty("beamPol", Double.parseDouble(tokens[4]));
- physEvent.addProperty("x", Double.parseDouble(tokens[5]));
- physEvent.addProperty("y", Double.parseDouble(tokens[6]));
- physEvent.addProperty("W", Double.parseDouble(tokens[7]));
- physEvent.addProperty("Q2", Double.parseDouble(tokens[8]));
- physEvent.addProperty("nu", Double.parseDouble(tokens[9]));
-
- for (int loop = 0; loop < nrows; loop++) {
- String particleLine = reader.readLine();
- if (particleLine != null) {
- String[] params = particleLine.trim().split("\\s+");
- // System.err.println("PARAMS LENGTH = " + params.length);
- if (params.length == 14) {
-
- int pid = Integer.parseInt(params[3]);
- // System.err.println("PID = " + pid);
- int status = Integer.parseInt(params[2]);
- double px = Double.parseDouble(params[6]);
- double py = Double.parseDouble(params[7]);
- double pz = Double.parseDouble(params[8]);
- double vx = Double.parseDouble(params[11]);
- double vy = Double.parseDouble(params[12]);
- double vz = Double.parseDouble(params[13]);
- if (status == 1) {
- physEvent.addParticle(new Particle(pid, px, py, pz, vx, vy, vz));
- }
- }
- }
- }
- return true;
- } catch (IOException ex) {
- Logger.getLogger(LundReader.class.getName()).log(Level.SEVERE, null, ex);
- }
- return false;
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsCutDescriptor.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsCutDescriptor.java
deleted file mode 100644
index f9169c6030..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsCutDescriptor.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.oper;
-
-import java.util.Map;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsCutDescriptor {
-
- private String operator = "";
- private String variable = "";
- private double variableMin = 0.0;
- private double variableMax = 100.0;
- private String cutName = "default";
-
- public PhysicsCutDescriptor(String name, String variable, double min, double max){
- this.cutName = name;
- this.setVariable(variable);
- this.setMinMax(min, max);
- }
-
- public final void setName(String name){ this.cutName = name; }
- public String getName() { return this.cutName;}
-
- public final void setVariable(String var){
- this.variable = var;
- }
-
- public final void setMinMax(double min, double max){
- this.variableMin = min;
- this.variableMax = max;
- }
-
- public double getMin(){ return this.variableMin; }
- public double getMax(){ return this.variableMax;}
-
- public boolean isValid(Map map){
- if(map.containsKey(this.variable)==false) return false;
- double value = map.get(this.variable).getValue();
- return (value>=this.variableMin&&value<=this.variableMax);
- }
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- str.append(String.format("* %-12s * %-12s * (%12.5f, %12.5f) *\n",
- this.cutName,this.variable,
- this.variableMin,this.variableMax));
- return str.toString();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsEventOperator.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsEventOperator.java
deleted file mode 100644
index 9efcc3dcd5..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsEventOperator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.oper;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsEventOperator {
-
- private String operatorName = "unknown";
- private Double varMinimum = 0.0;
- private Double varMaximum = 0.0;
- private String particleSelector = "[b]";
- private String particleVariable = "mom";
- private Double currentValue = 0.0;
- private ArrayList operatorCuts = new ArrayList();
-
- public PhysicsEventOperator(String name, String variable, String particle,
- double min, double max){
- this.set(name, variable, particle);
- this.setLimits(min, max);
- }
-
- public final void set(String name, String variable, String particle){
- this.operatorName = name;
- this.particleVariable = variable;
- this.particleSelector = particle;
- }
-
- public final void setLimits(double min, double max){
- this.varMinimum = min;
- this.varMaximum = max;
- }
-
- public void apply(PhysicsEvent event){
- Particle part = event.getParticle(this.particleSelector);
- this.currentValue = part.get(this.particleVariable);
- }
-
- public boolean isValid(){
- return (this.currentValue>=this.varMinimum&&this.currentValue getCuts(){return this.operatorCuts;}
- public double getValue(){ return this.currentValue;};
-
- @Override
- public String toString(){
- return this.stringValue();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsEventProcessor.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsEventProcessor.java
deleted file mode 100644
index f524f2eee7..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsEventProcessor.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.oper;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import org.jlab.clas.physics.EventFilter;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsEventProcessor {
-
- private final TreeMap operators = new TreeMap();
- private final TreeMap particleDescriptors =
- new TreeMap();
- private final TreeMap cutDescriptors =
- new TreeMap();
-
- private final TreeMap histDescriptors =
- new TreeMap();
-
- private Particle beamParticle = new Particle(11,0.0,0.0,11.0,0.0,0.0,0.0);
- private EventFilter eventFilter = new EventFilter();
-
-
- public PhysicsEventProcessor(double energy, String filter){
- beamParticle.setVector(11, 0.0,0.0,energy,0.0,0.0,0.0);
- eventFilter.setFilter(filter);
- }
-
-
- public void addParticle(String name,String particle, String variable){
- this.particleDescriptors.put(name, new PhysicsParticleDescriptor(name,particle,variable));
- }
-
- public void addCut(String cutname, String variable, double min, double max){
- this.cutDescriptors.put(cutname, new PhysicsCutDescriptor(cutname,variable,min,max));
- }
-
- public void parseLine(String line){
- String[] tokens = line.split("\\s+");
-
- if(tokens.length>0){
-
- if(tokens[0].compareTo("PARTICLE")==0){
- this.addParticle(tokens[1], tokens[2], tokens[3]);
- }
-
- if(tokens[0].compareTo("CUT")==0){
- this.addCut(tokens[1], tokens[2],
- Double.parseDouble(tokens[3]),
- Double.parseDouble(tokens[4])
- );
- }
-
- if(tokens[0].compareTo("HIST")==0){
- this.addHistogram(tokens[1], Integer.parseInt(tokens[2]),
- Double.parseDouble(tokens[3]),
- Double.parseDouble(tokens[4]),
- tokens[5],tokens[6]
- );
- }
- }
- }
-
- public void addHistogram(String name, int nbins, double min, double max,
- String var, String cuts){
- String[] tokens = cuts.split("&");
-
- if(this.particleDescriptors.containsKey(var)==false){
- System.out.println("[PHYS-PROC] ---> warning : adding histogram ["
- + name + "] unsuccessful. no variable [" + var + "] is defined");
- return;
- }
-
- PhysicsHistogramDescriptor desc = new PhysicsHistogramDescriptor(
- name,nbins,min,max,var,"");
- //System.out.println("ADDING CUTS SIZE TOKENS = " + tokens.length);
- desc.getCuts().clear();
- for(String item : tokens){
- if(this.cutDescriptors.containsKey(item)==true){
- desc.addCut(item);
- //System.out.println(" adding cut ["+item+"]");
- } else {
- System.out.println("[PHYS-PROC] ---> warning : adding "
- + " cut ["+ item+"] to histogram ["+name+"] failed. not cut with that name found");
- }
- }
- this.histDescriptors.put(name, desc);
- }
-
- public void addOperator(PhysicsEventOperator oper){
- this.operators.put(oper.getName(), oper);
- }
-
- public boolean isEventValid(PhysicsEvent event){
- return eventFilter.isValid(event);
- }
-
- public void apply(PhysicsEvent event){
- //for(Map.Entry entry : this.operators.entrySet()){
- // entry.getValue().apply(event);
- //}
- event.setBeamParticle(beamParticle);
- for(Map.Entry desc : this.particleDescriptors.entrySet()){
- desc.getValue().applyEvent(event);
- }
-
- }
-
- public PhysicsEventOperator getOperator(String name){
- return this.operators.get(name);
- }
-
- public boolean processCuts(List cutList){
- for(int loop = 0; loop < cutList.size(); loop++){
- if(this.cutDescriptors.get(cutList.get(loop)).isValid(particleDescriptors)==false)
- return false;
- }
- return true;
- }
-
- public List getOperatorList(){
- ArrayList opList = new ArrayList ();
- for(Map.Entry entry : this.operators.entrySet()){
- opList.add(entry.getKey());
- }
- return opList;
- }
-
- public double[] getOperatorValues(){
- double[] values = new double[this.operators.size()];
- int counter = 0;
- for(Map.Entry entry : this.operators.entrySet()){
- values[counter] = entry.getValue().getValue();
- counter++;
- }
- return values;
- }
-
- public boolean isValid(String oper){
- if(this.operators.containsKey(oper)==false) return false;
- PhysicsEventOperator evOper = this.operators.get(oper);
- for(String cut : evOper.getCuts()){
- if(this.operators.containsKey(cut)==true){
- if(this.operators.get(cut).isValid()==false) return false;
- } else {
- System.out.println("[PhysicsEventProcessor] ERROR : processing operator ["
- + oper + "]. Could not find cut named [" + cut + "]" );
- }
- }
- return true;
- }
- public void showData(){
- StringBuilder str = new StringBuilder();
- //for(Map.Entry entry : this.operators.entrySet()){
- // str.append(entry.getValue().stringValue());
- // str.append("\n");
- //}
- for(Map.Entry desc : this.particleDescriptors.entrySet()){
- str.append(String.format("* %-14s * %-12s * %32s * %12.5f *\n",
- desc.getValue().getName(),
- desc.getValue().getVariable(),
- desc.getValue().getParticle(),desc.getValue().getValue()));
- }
- System.out.println(str.toString());
- }
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- //for(Map.Entry entry : this.operators.entrySet()){
- // str.append(entry.getValue().stringValue());
- // str.append("\n");
- //}
- for(Map.Entry desc : this.particleDescriptors.entrySet()){
- str.append("[VAR ] --> ");
- str.append(desc.getValue().toString());
- }
-
- for(Map.Entry desc : this.cutDescriptors.entrySet()){
- str.append("[CUT ] --> ");
- str.append(desc.getValue().toString());
- }
-
- for(Map.Entry desc : this.histDescriptors.entrySet()){
- str.append("[HIST] --> ");
- str.append(desc.getValue().toString());
- }
-
- return str.toString();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsHistogramDescriptor.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsHistogramDescriptor.java
deleted file mode 100644
index 9ea8c0e55b..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsHistogramDescriptor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.oper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsHistogramDescriptor {
- private String histName = "";
- private int numberOfBins = 100;
- private double histMin = 0.0;
- private double histMax = 1.0;
- private String variable = "a";
- private List cutList = new ArrayList();
-
- public PhysicsHistogramDescriptor(String name, int bins, double min, double max
- ,String var, String cuts){
- this.histName = name;
- this.numberOfBins = bins;
- this.histMin = min;
- this.histMax = max;
- this.variable = var;
- this.setCuts(cuts);
- }
-
- public final void setCuts(String cuts){
- this.cutList.clear();
- String[] tokens = cuts.split(":");
- for(String item : tokens){
- this.cutList.add(item);
- }
- }
-
- public void addCut(String cut){
- this.cutList.add(cut);
- }
-
- public List getCuts() { return this.cutList;}
- public String getName(){ return this.histName;}
- public String getVariable(){ return this.variable;}
- public double getMin(){ return this.histMin;}
- public double getMax(){ return this.histMax;}
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- str.append(String.format("* %-12s * %-12s * (%5d, %12.5f, %12.5f) * NCUTS = %d",
- this.histName,this.variable,this.numberOfBins,
- this.histMin,this.histMax,this.cutList.size()));
- for(String item : this.cutList){
- str.append(item);
- str.append("&");
- }
- str.append(" *\n");
- return str.toString();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsParticleDescriptor.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsParticleDescriptor.java
deleted file mode 100644
index 635f878045..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/oper/PhysicsParticleDescriptor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.oper;
-
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-
-/**
- *
- * @author gavalian
- */
-public class PhysicsParticleDescriptor {
- private String particleString = "[b]";
- private String particleVariable = "mass";
- private double descriptorValue = 0.0;
- private String descName = "unknown";
-
- public PhysicsParticleDescriptor(String name,String particle, String variable){
- this.descName = name;
- this.setParticle(particle);
- this.setVariable(variable);
- }
-
- public final void setName(String name) { this.descName = name; }
- public String getName() { return this.descName;}
-
- public final void setParticle(String part){
- this.particleString = part;
- }
-
- public final void setVariable(String var){
- this.particleVariable = var;
- }
-
- public void applyEvent(PhysicsEvent event){
- Particle part = event.getParticle(this.particleString);
- if(part!=null){
- this.descriptorValue = part.get(this.particleVariable);
- }
- }
-
- public String getParticle(){ return this.particleString; }
- public String getVariable(){ return this.particleVariable; }
- public double getValue() { return this.descriptorValue; }
-
- @Override
- public String toString(){
- StringBuilder str = new StringBuilder();
- str.append(String.format("* %-12s * %-12s * %-45s *\n",
- this.descName, this.particleVariable,this.particleString));
- return str.toString();
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/process/DVCSProcess.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/process/DVCSProcess.java
deleted file mode 100644
index 177a8417c8..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/process/DVCSProcess.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.process;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.jlab.clas.pdg.PDGDatabase;
-import org.jlab.clas.physics.LorentzVector;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.PhysicsEvent;
-import org.jlab.clas.physics.Vector3;
-import org.jlab.physics.base.PhaseSpace;
-
-/**
- *
- * @author gavalian
- */
-public class DVCSProcess implements IPhysicsProcess {
-
- private static final double MP = 0.93827;
-
- public PhysicsEvent getEvent(PhaseSpace kinematics) {
- PhysicsEvent event = new PhysicsEvent();
- event.setBeam(kinematics.getDimension("E").getValue());
-
- Particle electron = KinematicsFactory.getElectron(
- kinematics.getDimension("E").getValue(),
- kinematics.getDimension("Q2").getValue(),
- kinematics.getDimension("xb").getValue());
-
- double E = kinematics.getDimension("E").getValue();
- double q2 = kinematics.getDimension("Q2").getValue();
- double xb = kinematics.getDimension("xb").getValue();
- double t = kinematics.getDimension("t").getValue();
- double phi = kinematics.getDimension("phi").getValue();
-
- double min_t = this.t_min(q2, xb);
- double max_t = this.t_max(q2, xb);
- double xmin = q2/(2.0*MP*E);
- /*System.out.println(" t = " + t + " t-min = "
- + this.t_min(q2, xb) + " t-max = " + this.t_max(q2, xb) +
- " xmin = " + xmin);
- */
- if(tmax_t){
- return event;
- }
-
- event.addParticle(electron);
-
- List protonGamma = this.getDvcsPhoton(E, q2, xb, t, 0.0, phi);
- //System.out.println(" PROTON " + protonGamma.get(0));
- //System.out.println(" PHOTON " + protonGamma.get(1));
- if(protonGamma.size()<2){
- event.clear();
- return event;
- }
-
- Particle proton = new Particle(2212,
- protonGamma.get(0).x(),
- protonGamma.get(0).y(),
- protonGamma.get(0).z()
- );
-
- Particle photon = new Particle(22,
- protonGamma.get(1).x(),
- protonGamma.get(1).y(),
- protonGamma.get(1).z()
- );
-
- event.addParticle(proton);
- event.addParticle(photon);
- /*
- Vector3 norm = new Vector3(0.0,1.0,0.0);
-
- Particle q2p = event.getParticle("[b]-[11]");
- LorentzVector cm = new LorentzVector(q2p.vector());
- LorentzVector pr = new LorentzVector(0.0,0.0,0.0,0.938);
- cm.add(pr);
- System.out.println("*****************************");
- System.out.println(q2p.toLundString());
- cm.print();
- */
- return event;
- }
-
- public PhaseSpace getPhaseSpace() {
- PhaseSpace space = new PhaseSpace();
- space.add("E" , 6.0, 4.0, 11.0);
- space.add("Q2" , 2.4, 1.5, 5.0);
- space.add("xb" , 0.35, 0.0, 1.0);
- space.add("t" , 0.25, 0.0, 11.0);
- space.add("phi" , 0.0, -Math.PI,Math.PI);
- return space;
- }
-
- public Map getKinematics() {
- Map kinematics = new LinkedHashMap();
- /*kinematics.put("E" , 6.0);
- kinematics.put("Q2", 2.5);
- kinematics.put("xb", 0.35);
- kinematics.put("t" , 0.2);
- kinematics.put("phi", 0.0);*/
- return kinematics;
- }
-
- public double getProperty(String key, PhysicsEvent event){
-
- if(key.compareTo("Q2")==0){
- Particle q2p = event.getParticle("[b]-[11]");
- return -q2p.vector().mass2();
- }
-
- if(key.compareTo("W2")==0){
- Particle w2p = event.getParticle("[b]+[t]-[11]");
- return w2p.vector().mass2();
- }
-
- if(key.compareTo("t")==0){
- Particle delta = event.getParticle("[t]-[2212]");
- return -delta.vector().mass2();
- }
-
- if(key.compareTo("xb")==0){
- Particle q2p = event.getParticle("[b]-[11]");
- Particle ep = event.getParticle("[11]");
- Particle beam = event.getParticle("[b]");
- double nu = beam.vector().e()-ep.vector().e();
- double q2 = -q2p.vector().mass2();
- return q2/(2.0*MP*nu);
- }
-
- if(key.compareTo("phi")==0){
- Particle beam = event.getParticle("[b]");
- Particle electron = event.getParticle("[11]");
- Vector3 normE = beam.vector().vect().cross(electron.vector().vect());
- normE.unit();
- Particle proton = event.getParticle("[2212]");
- Particle gamma = event.getParticle("[22]");
- Vector3 normH = proton.vector().vect().cross(gamma.vector().vect());
- //return delta.vector().mass2();
- }
-
- return 0.0;
- }
-
- public double t_min(double q2, double xb){
- double eps = KinematicsFactory.getEpsilon(q2, xb);
- double nomin = 2.0*(1.0-xb)*(1.0-Math.sqrt(1+eps*eps)) + eps*eps;
- double denom = 4.0*xb*(1.0-xb) + eps*eps;
- return q2*(nomin/denom);
- }
-
- public double t_max(double q2, double xb){
- double eps = KinematicsFactory.getEpsilon(q2, xb);
- double nomin = 2.0*(1.0-xb)*(1.0+Math.sqrt(1+eps*eps)) + eps*eps;
- double denom = 4.0*xb*(1.0-xb) + eps*eps;
- return q2*(nomin/denom);
- }
-
- public Particle getProton(PhysicsEvent event, double q2, double xb,double t){
- Particle q2p = event.getParticle("[b]-[11]");
- LorentzVector cm = new LorentzVector(q2p.vector());
- LorentzVector pr = new LorentzVector(0.0,0.0,0.0,0.938);
- cm.add(pr);
- double min_t = this.t_min(q2, xb);
- double max_t = this.t_max(q2, xb);
- double scale = (max_t - min_t)/Math.PI;
- return new Particle(2212,0.0,0.0,0.0,0.0,0.0,0.0);
- //return 1.0;
- }
-
- public List getDvcsPhoton(double E, double q2, double xb, double t, double phield, double phigd){
-
- double nu = q2/(2.0*MP*xb);
- double qmod = Math.sqrt(nu*nu + q2);
- double esc = E - nu;
- double costel = 1.0 - q2/(2.0*E*esc);
- double sintel = Math.sqrt(1.0 - costel*costel);
-
- if(esc<0.0) return new ArrayList();
-
- double Ep = MP + t/(2.0*MP);
- double Egam = nu - t/(2.0*MP);
-
- double cosphe = Math.cos(phield);
- double sinphe = Math.sin(phield);
- Vector3 vecQ = new Vector3(0.0,0.0,E);
- Vector3 vecEP = new Vector3(esc*sintel*cosphe,esc*sintel*sinphe,esc*costel);
- vecQ.sub(vecEP);
- /*System.out.println(" Q2 VECTOR = " + "ESC = " + nu + " " + vecQ);
- System.out.println(" EP / EGAM = " + Ep + " " + Egam + " VEC " + vecQ);
- System.out.println("******* " + nu + " " + Egam + " " + q2);*/
- /*double a1 = 2.0*Egam*(MP + nu) + q2;
- double a2 = - 2.0*MP*nu ;
- double a3 = 2.0*Egam*qmod;
- */
- //System.out.println("a1/a2/a3 = " + a1 + " " + a2 + " " + a3);
- /*System.out.println(" NU = " + nu);*/
-
- double costVq = vecQ.z()/qmod;
- double sintVq = Math.sqrt(1.0 - costVq*costVq);
- double costgg = (2.0*Egam*(MP + nu) + q2 - 2.0*MP*nu )/(2.0*Egam*qmod);
- if(costgg>1.0) return new ArrayList();
- //double costgg = (2.0*Egam*(nu) + q2 - 2.0*MP*nu )/(2.0*Egam*qmod);
- double sintgg = Math.sqrt(1.0 - costgg*costgg);
- double Vgx = Egam*sintgg*Math.cos(phigd);
- double Vgy = Egam*sintgg*Math.sin(phigd);
- double Vgz = Egam*costgg;
-
- Vector3 vecG = new Vector3(
- Vgx * costVq * cosphe - Vgz*sintVq*cosphe - Vgy*sinphe,
- Vgx * costVq * sinphe - Vgz*sintVq*sinphe + Vgy*cosphe,
- Vgx * sintVq + Vgz*costVq
- );
- /*System.out.println(" cos VQ " + costVq + " costgg = " + costgg
- + " qmod = " + qmod + " Nu = " + nu);*/
- //System.out.println(" PHOTON VECT = " + vecG);
- List protonGamma = new ArrayList();
- vecQ.sub(vecG);
-
- protonGamma.add(vecQ);
- protonGamma.add(vecG);
-
- return protonGamma;
- }
-
- public static void main(String[] args){
- //PDGDatabase.show();
- DVCSProcess dvcs = new DVCSProcess();
- PhaseSpace kinematics = dvcs.getPhaseSpace();
-
- //kinematics.show();
-
- kinematics.getDimension("phi").setValue(Math.toRadians(30.0));
- PhysicsEvent event = dvcs.getEvent(kinematics);
-
- /*
- Particle q2 = event.getParticle("[b]-[11]");
- Particle e = event.getParticle("[11]");
- double q2m = 4*6.0*e.vector().e()*Math.sin(e.theta()/2.0)*Math.sin(e.theta()/2.0);
- System.out.println(q2.mass()*q2.mass() + " q2 mass = " + q2m);
- */
-
- //System.out.println(event.toLundString());
-
- Particle mt = event.getParticle("[t]-[2212]");
- Particle mtg = event.getParticle("[b]-[11]-[22]");
- System.out.println(" -t = " + mt.vector().mass2());
- System.out.println(" -tg = " + mtg.vector().mass2());
-
- /*
- for(double xb = 0.1 ; xb < 0.6; xb += 0.05){
- kinematics.getDimension("xb").setValue(xb);
- event = dvcs.getEvent(kinematics);
- }*/
- }
-
- public double getWeight(PhaseSpace kinematics) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/process/IPhysicsProcess.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/process/IPhysicsProcess.java
deleted file mode 100644
index 7ff7459601..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/process/IPhysicsProcess.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.process;
-
-import java.util.Map;
-import org.jlab.clas.physics.PhysicsEvent;
-import org.jlab.physics.base.PhaseSpace;
-
-/**
- *
- * @author gavalian
- */
-public interface IPhysicsProcess {
-
- PhysicsEvent getEvent(PhaseSpace kinematics);
- PhaseSpace getPhaseSpace();
- double getWeight(PhaseSpace kinematics);
-}
diff --git a/common-tools/clas-physics/src/main/java/org/jlab/physics/process/KinematicsFactory.java b/common-tools/clas-physics/src/main/java/org/jlab/physics/process/KinematicsFactory.java
deleted file mode 100644
index 10e9759156..0000000000
--- a/common-tools/clas-physics/src/main/java/org/jlab/physics/process/KinematicsFactory.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.jlab.physics.process;
-
-import org.jlab.clas.pdg.PDGDatabase;
-import org.jlab.clas.physics.Particle;
-import org.jlab.clas.physics.Vector3;
-
-/**
- *
- * @author gavalian
- */
-public class KinematicsFactory {
-
- public static double MP = 0.93827;
- /**
- * returns mu for given kinematics variables
- * @param q2 transferred momentum
- * @param xb Bjorken x
- * @return
- */
- public static double getMu(double q2, double xb){
- //double pmass = PDGDatabase.getParticleMass(2212);
- return q2/(2.0*0.93827*xb);
- }
- /**
- * returns E' for given energy and kinematics variables.
- * @param E initial electron energy
- * @param q2 transferred momentum to proton
- * @param xb Bjorken x
- * @return
- */
- public static double getEprime(double E, double q2, double xb){
- return E - KinematicsFactory.getMu(q2, xb);
- }
- /**
- * returns scattered electron angle for given kinematics
- * @param E initial electron energy
- * @param q2 transfered 4 momentum
- * @param xb Bjorken x
- * @return
- */
- public static double getTheta(double E, double q2, double xb){
- double eprime = KinematicsFactory.getEprime(E, q2, xb);
- double left_side = q2/(4.0*E*eprime);
- double value = Math.sqrt(left_side);
- return 2.0*Math.asin(value);
- }
-
- public static double getEpsilon(double q2, double xb){
- return 2.0*xb*0.93827/q2;
- }
-
- public static double getQ2(double E, double x, double y){
- return 2.0*MP*E*y*x;
- }
-
- /**
- * returns an electron for given beam energy, q2 and xb
- * @param E
- * @param q2
- * @param xb
- * @return
- */
- public static Particle getElectron(double E, double q2, double xb){
- double eprime = KinematicsFactory.getEprime( E, q2, xb);
- double theta = KinematicsFactory.getTheta( E, q2, xb);
- //System.out.println("E-prime = " + eprime + " theta = " + Math.toDegrees(theta));
- Vector3 vec = new Vector3();
- vec.setMagThetaPhi(eprime, theta, 0.0);
- return new Particle(11,vec.x(),vec.y(),vec.z(),0.0,0.0,0.0);
- }
- /**
- * returns magnetic moment of the proton
- * @param del2
- * @return
- */
- public static double getGM_p(double del2){
- double denom = (1.0-del2/(0.84*0.84));
- double dipol = 1.0/(denom*denom);
- return (1.0+1.79)*dipol;
- }
- /**
- * returns magnetic moment for neutron
- * @param del2
- * @return
- */
- public static double getGM_n(double del2){
- double denom = (1.0-del2/(0.84*0.84));
- double dipol = 1.0/(denom*denom);
- return -1.91*dipol;
- }
- /**
- * returns electric moment of neutron, it's
- * always 0, unless something has changed since
- * writing of this code.
- * @param del2
- * @return
- */
- public static double getGE_n(double del2){
- return 0;
- }
- /**
- * returns electric moment of the proton
- * @param del2
- * @return
- */
- public static double getGE_p(double del2){
- double denom = (1.0-del2/(0.84*0.84));
- double dipol = 1.0/(denom*denom);
- return dipol;
- }
- /**
- * Returns F1 function for U quark
- * @param del2
- * @return
- */
- public static double getF1_u(double del2){
- double delim = del2/(4.0*MP*MP);
- double f1pn_1 = (KinematicsFactory.getGE_p(del2) -
- delim*KinematicsFactory.getGM_p(del2))/(1.0-delim);
- double f1pn_2 = (KinematicsFactory.getGE_n(del2) -
- delim*KinematicsFactory.getGM_n(del2))/(1.0-delim);
- return 2.0*f1pn_1 + f1pn_2;
- }
- /**
- * returns F1 function for d quark
- * @param del2
- * @return
- */
- public static double getF1_d(double del2){
- double delim = del2/(4.0*MP*MP);
- double f1pn_1 = (KinematicsFactory.getGE_p(del2) -
- delim*KinematicsFactory.getGM_p(del2))/(1.0-delim);
- double f1pn_2 = (KinematicsFactory.getGE_n(del2) -
- delim*KinematicsFactory.getGM_n(del2))/(1.0-delim);
- return 2.0*f1pn_2 + f1pn_1;
- }
-}
diff --git a/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/LorentzVectorTest.java b/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/LorentzVectorTest.java
deleted file mode 100644
index 6f1a5b5f33..0000000000
--- a/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/LorentzVectorTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package org.jlab.clas.physics;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author naharrison
- */
-public class LorentzVectorTest {
-
- @Test
- public void testLorentzVector() {
- LorentzVector v = new LorentzVector(0.0, 0.0, 6.0, Math.sqrt(6.0*6.0 + 0.938*0.938));
- assertEquals(v.mass(), 0.938, 1e-6);
- assertEquals(v.theta(), 0.0, 1e-6);
- assertEquals(v.p(), 6.0, 1e-6);
- assertEquals(v.e(), Math.sqrt(6.0*6.0 + 0.938*0.938), 1e-6);
-
- v.setPxPyPzM(6.0, 0.0, 0.0, 0.000511);
- assertEquals(v.mass(), 0.000511, 1e-6);
- assertEquals(v.theta(), Math.PI/2.0, 1e-6);
- assertEquals(v.phi(), 0.0, 1e-6);
- assertEquals(v.p(), 6.0, 1e-6);
- assertEquals(v.e(), Math.sqrt(6.0*6.0 + 0.000511*0.000511), 1e-6);
-
- v.print();
- }
-
-
- @Test
- public void testConstructors() {
- LorentzVector v = new LorentzVector();
- v.setPxPyPzE(6.0, 0.0, 0.0, Math.sqrt(6.0*6.0 + 0.938*0.938));
- assertEquals(v.mass(), 0.938, 1e-6);
- assertEquals(v.p(), 6.0, 1e-6);
-
- LorentzVector vcopy = new LorentzVector(v);
- assertEquals(vcopy.mass(), 0.938, 1e-6);
- assertEquals(vcopy.p(), 6.0, 1e-6);
- }
-
-
- @Test
- public void testAddSubInvert() {
- LorentzVector v1 = new LorentzVector(0.0, 1.0, 0.0, Math.sqrt(1.0 + 0.938*0.938));
- LorentzVector v2 = new LorentzVector(1.0, 0.0, 0.0, Math.sqrt(1.0 + 0.938*0.938));
- v1.add(v2);
- v1.sub(v2);
- v1.add(v2);
- v1.invert();
-
- assertEquals(v1.px(), -1.0, 1e-6);
- assertEquals(v1.py(), -1.0, 1e-6);
- assertEquals(v1.pz(), 0.0, 1e-6);
- assertEquals(v2.vect().x(), 1.0, 1e-6);
- assertEquals(v2.vect().y(), 0.0, 1e-6);
- assertEquals(v2.vect().z(), 0.0, 1e-6);
- }
-
-
- @Test
- public void testRotations() {
- LorentzVector v = new LorentzVector(0.0, 6.0, 0.0, Math.sqrt(6.0*6.0 + 0.938*0.938));
-
- v.rotateY(0.1234);
- assertEquals(v.px(), 0.0, 1e-6);
- assertEquals(v.py(), 6.0, 1e-6);
- assertEquals(v.pz(), 0.0, 1e-6);
-
- v.rotateZ(Math.toRadians(90.0));
- assertEquals(v.px(), -6.0, 1e-6);
- assertEquals(v.py(), 0.0, 1e-6);
- assertEquals(v.pz(), 0.0, 1e-6);
- }
-
-
- @Test
- public void testBoostX() {
- double betaX = 0.5;
- LorentzVector v = new LorentzVector(1.0, 1.0, 1.0, Math.sqrt(3.0 + 0.938*0.938));
- double e = v.e();
- v.boost(betaX, 0.0, 0.0);
- double gamma = 1.0/Math.sqrt(1.0 - betaX*betaX);
- assertEquals(v.px(), 1.0 + (gamma-1.0) + gamma*betaX*e, 1e-6);
- assertEquals(v.py(), 1.0, 1e-6);
- assertEquals(v.pz(), 1.0, 1e-6);
- assertEquals(v.e(), gamma*(e + betaX), 1e-6);
- }
-
-
- @Test
- public void testBoostY() {
- double betaY = 0.5;
- Vector3 vboost = new Vector3(0.0, betaY, 0.0);
- LorentzVector v = new LorentzVector(1.0, 1.0, 1.0, Math.sqrt(3.0 + 0.938*0.938));
- double e = v.e();
- v.boost(vboost);
- double gamma = 1.0/Math.sqrt(1.0 - betaY*betaY);
- assertEquals(v.px(), 1.0, 1e-6);
- assertEquals(v.py(), 1.0 + (gamma-1.0) + gamma*betaY*e, 1e-6);
- assertEquals(v.pz(), 1.0, 1e-6);
- assertEquals(v.e(), gamma*(e + betaY), 1e-6);
- }
-
-}
diff --git a/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/ParticleTest.java b/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/ParticleTest.java
deleted file mode 100644
index ccd78d5639..0000000000
--- a/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/ParticleTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.jlab.clas.physics;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author naharrison
- */
-public class ParticleTest {
-
- @Test
- public void testParticle() {
- Particle p = new Particle(11, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0);
- assertEquals(p.mass(), 0.0005, 1e-4);
- assertEquals(p.mass2(), 0.0005*0.0005, 1e-4);
- assertEquals(p.charge(), -1);
- assertEquals(p.px(), 0.0, 1e-6);
- assertEquals(p.py(), 0.0, 1e-6);
- assertEquals(p.pz(), 11.0, 1e-6);
- assertEquals(p.p(), 11.0, 1e-6);
- assertEquals(p.theta(), 0.0, 1e-6);
- assertEquals(p.vertex().x(), 0.0, 1e-6);
- assertEquals(p.vertex().y(), 0.0, 1e-6);
- assertEquals(p.vertex().z(), 0.0, 1e-6);
- assertEquals(p.vx(), 0.0, 1e-6);
- assertEquals(p.vy(), 0.0, 1e-6);
- assertEquals(p.vz(), 0.0, 1e-6);
-
- Particle p2 = new Particle(p);
- assertEquals(p2.mass(), 0.0005, 1e-4);
- assertEquals(p2.mass2(), 0.0005*0.0005, 1e-4);
- assertEquals(p2.charge(), -1);
- assertEquals(p2.px(), 0.0, 1e-6);
- assertEquals(p2.py(), 0.0, 1e-6);
- assertEquals(p2.pz(), 11.0, 1e-6);
- assertEquals(p2.p(), 11.0, 1e-6);
- assertEquals(p2.theta(), 0.0, 1e-6);
- assertEquals(p2.vertex().x(), 0.0, 1e-6);
- assertEquals(p2.vertex().y(), 0.0, 1e-6);
- assertEquals(p2.vertex().z(), 0.0, 1e-6);
- assertEquals(p2.vx(), 0.0, 1e-6);
- assertEquals(p2.vy(), 0.0, 1e-6);
- assertEquals(p2.vz(), 0.0, 1e-6);
- }
-
-
- @Test
- public void testEuclideanDistance() {
- Particle p1 = new Particle();
- p1.setVector(11, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- Particle p2 = new Particle(22, 0.0, 4.0, 0.0);
- assertEquals(p1.euclideanDistance(p2), 5.0, 1e-6);
- }
-
-}
-
diff --git a/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/Vector3Test.java b/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/Vector3Test.java
deleted file mode 100644
index 6a75c819da..0000000000
--- a/common-tools/clas-physics/src/test/java/org/jlab/clas/physics/Vector3Test.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.jlab.clas.physics;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author naharrison
- */
-public class Vector3Test {
-
- @Test
- public void testDotAndCross() {
- Vector3 v1 = new Vector3();
- Vector3 v2 = new Vector3(v1);
- v1.setMagThetaPhi(1.0, Math.toRadians(90.0), 0.0);
- v2.setXYZ(0.0, 2.0, 0.0);
- v2.unit();
- assertEquals(v1.dot(v2), 0.0, 1e-6);
-
- Vector3 v3 = v1.cross(v2);
- Vector3 vz = new Vector3(0.0, 0.0, 1.0);
- assertEquals(v3.x(), vz.x(), 1e-6);
- assertEquals(v3.y(), vz.y(), 1e-6);
- assertEquals(v3.z(), vz.z(), 1e-6);
-
- Vector3 v4 = v2.cross(v1);
- vz.negative();
- assertEquals(v4.x(), vz.x(), 1e-6);
- assertEquals(v4.y(), vz.y(), 1e-6);
- assertEquals(v4.z(), vz.z(), 1e-6);
- }
-
-
- @Test
- public void testCompare() {
- Vector3 v1 = new Vector3(1, 2, 3);
- Vector3 v2 = new Vector3(1, 2, 3);
- assertEquals(v1.compare(v2), 0.0, 1e-6);
- assertEquals(v1.compareWeighted(v2), 0.0, 1e-6);
- }
-
-
- @Test
- public void testStrings() {
- Vector3 v1 = new Vector3(1, 2, 3);
- System.out.println(v1.getXYZString());
- System.out.println(v1.getMagThetaPhiString());
- System.out.println(v1.toString());
- }
-
-}