Skip to content

Commit

Permalink
Merge branch 'development' into iss64-bankFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelladevita authored Sep 7, 2023
2 parents aafc546 + a106009 commit 6e9be6f
Show file tree
Hide file tree
Showing 9 changed files with 387 additions and 3 deletions.
50 changes: 50 additions & 0 deletions bin/run-jshell
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh

. `dirname $0`/env.sh

export CLAS12DIR=`dirname $0`/..

#--------------------------------------------------------------
# Adding supporting COAT jar files
for i in `ls -a $CLAS12DIR/lib/clas/*.jar`
do
#echo "$i"
if [ -z "${JYPATH}" ] ; then
JYPATH="$i"
else
JYPATH=${JYPATH}:"$i"
fi
done
#--------------------------------------------------------------
# Adding supporting plugins directory
for i in `ls -a $CLAS12DIR/lib/services/*.jar`
do
if [ -z "${JYPATH}" ] ; then
JYPATH="$i"
else
JYPATH=${JYPATH}:"$i"
fi
done
#--------------------------------------------------------------
# Adding supporting plugins directory
#--------------------------------------------------------------
# Done loading plugins
#--------------------------------------------------------------
# Adding supporting plugins directory
for i in `ls -a $CLAS12DIR/lib/utils/*.jar`
do
if [ -z "${JYPATH}" ] ; then
JYPATH="$i"
else
JYPATH=${JYPATH}:"$i"
fi
done
#-------------------------------------------------------------
echo " "
echo " "
echo "*****************************************"
echo "* Running COAT-JAVA JShell Scripts *"
echo "*****************************************"
echo " "
echo " "
jshell --class-path "$JYPATH" "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public void findTrajectory() {
stVec.setTrkThetaAtSurface(ThetaTrackIntersPlane);
stVec.setTrkToModuleAngle(trkToMPlnAngl);
stVec.setCalcCentroidStrip(CalcCentroidStrip);
stVec.setSurfaceDetector(DetectorType.BST.getDetectorId());
if(stateVecs.size()>0
&& stateVecs.get(stateVecs.size()-1).x()==stVec.x()
&& stateVecs.get(stateVecs.size()-1).y()==stVec.y()
Expand Down Expand Up @@ -230,7 +231,8 @@ public void findTrajectory() {
stVec.setTrkThetaAtSurface(ThetaTrackIntersSurf);
stVec.setTrkToModuleAngle(trkToMPlnAngl);
stVec.setCalcCentroidStrip(CalcCentroidStrip);
if(stateVecs.size()>0
stVec.setSurfaceDetector(DetectorType.BMT.getDetectorId());
if(stateVecs.size()>0
&& stateVecs.get(stateVecs.size()-1).x()==stVec.x()
&& stateVecs.get(stateVecs.size()-1).y()==stVec.y()
&& stateVecs.get(stateVecs.size()-1).z()==stVec.z()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public Trajectory findTrajectory(int id, Ray ray, ArrayList<Cross> candCrossList
continue;
}

stVec.setSurfaceDetector(DetectorType.BST.getDetectorId());
Cluster clsOnTrk = null;
if (l % 2 == 0) {
clsOnTrk = c.getCluster1();
Expand Down Expand Up @@ -195,6 +196,7 @@ public Trajectory findTrajectory(int id, Ray ray, ArrayList<Cross> candCrossList
continue;
}

stVec.setSurfaceDetector(DetectorType.BMT.getDetectorId());
if (c.getType()==BMTType.C) { //C-detector measuring Z
//if(traj.isFinal) { // reset the cross only for final trajectory

Expand Down Expand Up @@ -226,9 +228,9 @@ public Trajectory findTrajectory(int id, Ray ray, ArrayList<Cross> candCrossList
}

//Collections.sort(stateVecs);

stateVecs.sort(Comparator.comparing(StateVec::y));
for (int l = 0; l < stateVecs.size(); l++) {
for (int l = 0; l < stateVecs.size(); l++) {
stateVecs.get(l).setSurfaceDetector(DetectorType.CVT.getDetectorId());
stateVecs.get(l).setPlaneIdx(l);
}
traj.setTrajectory(stateVecs);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package org.jlab.display.ec;

import org.jlab.clas.physics.LorentzVector;
import org.jlab.clas.reco.ReconstructionEngine;
import org.jlab.groot.data.H1F;
import org.jlab.groot.ui.TGCanvas;
import org.jlab.io.base.DataBank;
import org.jlab.io.base.DataEvent;

/**
*
* @author gavalian
*/
public class ECRECMonitor extends ReconstructionEngine {
TGCanvas canvas = null;
H1F pion = null;

public ECRECMonitor(){
super("ECMon","gavalian","1.0");
}

@Override
public boolean processDataEvent(DataEvent event) {
if(event.hasBank("REC::Particle")==true){
DataBank bank = event.getBank("REC::Particle");
int index1 = this.index(bank, 22, 0);
int index2 = this.index(bank, 22, 1);
if(index1>0&&index2>0){
LorentzVector vL_g1 = this.getVector(bank, index1, 0.0);
LorentzVector vL_g2 = this.getVector(bank, index2, 0.0);
if(vL_g1.p()>1.0&&vL_g2.p()>1.0){
vL_g1.add(vL_g2);
pion.fill(vL_g1.mass());
}
}
}
return true;
}

private LorentzVector getVector(DataBank b, int index, double mass){
LorentzVector v = new LorentzVector();
v.setPxPyPzM(b.getFloat("px", index),
b.getFloat("py", index),
b.getFloat("pz", index),
mass);
return v;
}

private int index(DataBank b, int pid, int skip){
int nrows = b.rows();
int skipped = 0;
for(int r = 0; r < nrows; r++){
int id = b.getInt("pid", r);
if(id==pid){
if(skipped==skip) return r;
skipped++;
}
}
return -1;
}
@Override
public boolean init() {
canvas = new TGCanvas("c","EC Engine Monitoring",500,500);
canvas.getCanvas().initTimer(5000);
pion = new H1F("pion",120,0.005,0.6);
return true;
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6e9be6f

Please sign in to comment.