diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ce4904f..45fe19f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ workflow: on_new_commit: conservative mirror: - stage: mirror + stage: .pre rules: - if: $CI_PIPELINE_SOURCE == "schedule" script: diff --git a/src/main/java/org/jlab/jnp/grapes/custom-services/ElastWagon.java b/src/main/java/org/jlab/jnp/grapes/custom-services/ElastWagon.java new file mode 100644 index 0000000..0788c9c --- /dev/null +++ b/src/main/java/org/jlab/jnp/grapes/custom-services/ElastWagon.java @@ -0,0 +1,104 @@ +package org.jlab.jnp.grapes.services; + +import org.jlab.jnp.physics.LorentzVector; +import org.jlab.jnp.hipo4.data.Bank; +import org.jlab.jnp.hipo4.data.Event; +import org.jlab.jnp.hipo4.data.SchemaFactory; +import java.util.ArrayList; + +/** + * + * Skim for elastic e- events + * e- events are prescaled by THRESHOLD for elastic angle theta_ec=19204 && runno<19662) eb = 6.39463; //rgk-f23, rgk-s24 + // if (runno>=19662 && runno<19894) eb = 8.47757; //rgk-s24 + + double mp = 0.93828; + double theta_pc = Math.toRadians(THETA_PC); //proton theta cutoff + double theta_ec = 2*Math.atan(1/(Math.tan(theta_pc)*(1+eb/mp))); //electron pre-scale theta + + ArrayList eleCandi = new ArrayList<>(); + + for (int ipart=0; ipart1) return false; + + double epx = RecPart.getFloat("px",eleCandi.get(0)); + double epy = RecPart.getFloat("py",eleCandi.get(0)); + double epz = RecPart.getFloat("pz",eleCandi.get(0)); + double ee = Math.sqrt(epx*epx+epy*epy+epz*epz); + + LorentzVector VVB = new LorentzVector(0,0,eb,eb); + LorentzVector VVT = new LorentzVector(0,0,0,mp); + LorentzVector VVE = new LorentzVector(epx,epy,epz,ee); + + double WW = Math.sqrt(getMM(VVB,VVT,VVE)); + + if (WW > W_CUT) return false; // W cut must go before theta_c cut! + + if (VVE.theta() < theta_ec) { //theta_ec cut + callCount++; + if (callCount < THRESHOLD) return false; + if (callCount == THRESHOLD) callCount=0; + } + + return true; + } +} + +