Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public enum DetectorType {
AHDC (24, "AHDC"),
ATOF (25, "ATOF"),
RECOIL (26, "RECOIL"),
MUCAL (28, "MUCAL"),
MUVT (29, "MUVT"),
MURT (30, "MURT"),
MURH (31, "MURH"),
TARGET (100, "TARGET"),
MAGNETS (101, "MAGNETS");

Expand Down
60 changes: 60 additions & 0 deletions etc/bankdefs/hipo4/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,66 @@
{ "name":"TDC" , "type":"I", "info":"TDC value"}
]
},
{
"name" : "MUCAL::adc",
"group": 22800,
"item" : 11,
"info": "ADC bank for the muCLAS12 Electromagnetic Calorimeter",
"entries":[
{ "name":"sector" , "type":"B", "info":"sector (=1)"},
{ "name":"layer" , "type":"B", "info":"layer (1-6)"},
{ "name":"component" , "type":"S", "info":"strip"},
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
{ "name":"ADC" , "type":"I", "info":"ADC maximum"},
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
]
},
{
"name" : "MUVT::adc",
"group": 22900,
"item" : 11,
"info": "ADC bank for the muCLAS12 Vertex Tracker",
"entries":[
{"name":"sector" , "type":"B", "info":"sector (=1)"},
{"name":"layer" , "type":"B", "info":"layer (=1)"},
{"name":"component" , "type":"S", "info":"crystal id"},
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
{ "name":"ADC" , "type":"I", "info":"ADC integral from pulse fit"},
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
]
},
{
"name" : "MURT::adc",
"group": 23000,
"item" : 11,
"info": "ADC bank for the muCLAS12 Recoil Tracker",
"entries":[
{"name":"sector" , "type":"B", "info":"sector (=1)"},
{"name":"layer" , "type":"B", "info":"layer (=1)"},
{"name":"component" , "type":"S", "info":"crystal id"},
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
{ "name":"ADC" , "type":"I", "info":"ADC integral from pulse fit"},
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
]
},
{
"name" : "MURH::adc",
"group": 23100,
"item" : 11,
"info": "ADC bank for the muCLAS12 Recoil Hodoscope",
"entries":[
{"name":"sector" , "type":"B", "info":"sector (1-8)"},
{"name":"layer" , "type":"B", "info":"layer (1-2)"},
{"name":"component" , "type":"S", "info":"tile id"},
{ "name":"order" , "type":"B", "info":"order: 0 - ADCL , 1 - ADCR"},
{ "name":"ADC" , "type":"I", "info":"ADC integral from pulse fit"},
{ "name":"time" , "type":"F", "info":"time from pulse fit"},
{ "name":"ped" , "type":"S", "info":"pedestal from pulse analysis"}
]
},
{
"name" : "RF::adc",
"group": 21700,
Expand Down
176 changes: 176 additions & 0 deletions etc/bankdefs/hipo4/mu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
[
{
"name": "MUCAL::hits",
"group": 22800,
"item" : 21,
"info": "Reconstructed Hits in muCLAS12 calorimeter",
"entries": [
{"name":"idx", "type":"B", "info":"x id of grid"},
{"name":"idy", "type":"B", "info":"y id of grid"},
{"name":"x", "type":"F", "info":"Hit X position (cm)" },
{"name":"y", "type":"F", "info":"Hit Y position (cm)" },
{"name":"z", "type":"F", "info":"Hit Z position (cm)" },
{"name":"energy", "type":"F", "info":"Hit Energy" },
{"name":"time", "type":"F", "info":"Hit Time" },
{"name":"hitID", "type":"S", "info":"Hit Pointer to ADC bank"},
{"name":"clusterID", "type":"S", "info":"Hit Pointer to Cluster Bank"}
]
},
{
"name": "MUCAL::clusters",
"group": 22800,
"item" : 22,
"info": "Reconstructed Clusters in muCLAS12 calorimeter",
"entries": [
{"name":"size", "type":"S", "info":"Cluster size" },
{"name":"id", "type":"S", "info":"Cluster ID" },
{"name":"x", "type":"F", "info":"Cluster centroid X moment (cm)" },
{"name":"y", "type":"F", "info":"Cluster centroid Y moment (cm)" },
{"name":"z", "type":"F", "info":"Cluster centroid Z moment (cm)" },
{"name":"widthX", "type":"F", "info":"Cluster width in x (cm)" },
{"name":"widthY", "type":"F", "info":"Cluster width in y (cm)" },
{"name":"radius", "type":"F", "info":"Cluster radius (cm)" },
{"name":"time", "type":"F", "info":"Cluster timing information" },
{"name":"energy", "type":"F", "info":"Cluster total energy" },
{"name":"maxEnergy", "type":"F", "info":"Cluster maximum energy" },
{"name":"recEnergy", "type":"F", "info":"Cluster reconstructed energy" }
]
},
{
"name": "MUVT::hits",
"group": 22900,
"item" : 21,
"info": "MUVT hits",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name":"sector", "type":"B", "info":"sector number"},
{"name":"layer", "type":"B", "info":"layer number"},
{"name":"strip", "type":"S", "info":"strip number"},
{"name":"energy", "type":"F", "info":"energy of the hit (eV)"},
{"name":"time", "type":"F", "info":"time of the hit (ns)"},
{"name":"clusterId", "type":"S", "info":"id of the cluster the hit belongs to"},
{"name":"status", "type":"S", "info":"status of the hit"}
]
},
{
"name": "MUVT::clusters",
"group": 22900,
"item" : 22,
"info": "reconstructed clusters from MUVT",
"entries": [
{"name":"id", "type":"S", "info":"id of the cluster"},
{"name":"sector", "type":"B", "info":"sector"},
{"name":"layer", "type":"B", "info":"layer"},
{"name":"strip", "type":"S", "info":"seed strip"},
{"name":"energy", "type":"F", "info":"energy of the cluster (eV)"},
{"name":"time", "type":"F", "info":"time of the cluster (ns)"},
{"name":"xo", "type":"F", "info":"strip origin X coordinate (cm)"},
{"name":"yo", "type":"F", "info":"strip origin Y coordinate (cm)"},
{"name":"zo", "type":"F", "info":"strip origin Z coordinate (cm)"},
{"name":"xe", "type":"F", "info":"strip end X coordinate (cm)"},
{"name":"ye", "type":"F", "info":"strip end Y coordinate (cm)"},
{"name":"ze", "type":"F", "info":"strip end Z coordinate (cm)"},
{"name":"size", "type":"S", "info":"size of the cluster"},
{"name":"status", "type":"S", "info":"status of the cluster"}
]
},
{
"name": "MUVT::crosses",
"group": 22900,
"item" : 23,
"info": "reconstructed crosses from MUVT",
"entries": [
{"name":"id", "type":"S", "info":"id of the cross"},
{"name":"sector", "type":"B", "info":"sector"},
{"name":"region", "type":"B", "info":"region"},
{"name":"energy", "type":"F", "info":"energy of the cross (eV)"},
{"name":"time", "type":"F", "info":"time of the cross (ns)"},
{"name":"x", "type":"F", "info":"x coordinate (cm)"},
{"name":"y", "type":"F", "info":"y coordinate (cm)"},
{"name":"z", "type":"F", "info":"z coordinate (cm)"},
{"name":"cluster1", "type":"S", "info":"id of the cluster in the V layer"},
{"name":"cluster2", "type":"S", "info":"id of the cluster in the W layer"},
{"name":"status", "type":"S", "info":"status of the cluster"}
]
},
{
"name": "MUVT::tracks",
"group": 22900,
"item" : 36,
"info": "reconstructed tracks using MUVT information",
"entries": [
{"name":"index", "type":"S", "info":"index of the track in the DC bank"},
{"name":"status", "type":"B", "info":"status of the track (0: refitted using FMT, 1: original DC track)"},
{"name":"sector", "type":"B", "info":"sector of the track in DC"},
{"name":"vx", "type":"F", "info":"Vertex x-position of the swam track to the DOCA to the beamline (in cm)"},
{"name":"vy", "type":"F", "info":"Vertex y-position of the swam track to the DOCA to the beamline (in cm)"},
{"name":"vz", "type":"F", "info":"Vertex z-position of the swam track to the DOCA to the beamline (in cm)"},
{"name":"px", "type":"F", "info":"3-momentum x-coordinate of the swam track to the DOCA to the beamline (in GeV)"},
{"name":"py", "type":"F", "info":"3-momentum y-coordinate of the swam track to the DOCA to the beamline (in GeV)"},
{"name":"pz", "type":"F", "info":"3-momentum z-coordinate of the swam track to the DOCA to the beamline (in GeV)"},
{"name":"charge", "type":"B", "info":"charge of the track"},
{"name":"chi2", "type":"F", "info":"chi^2 of the fit"},
{"name":"NDF", "type":"B", "info":"number of degrees of freedom of the fit"}
]
},
{
"name": "MUVT::trajectory",
"group": 22900,
"item" : 37,
"info": "MUVT tracks trajectory bank",
"entries": [
{"name":"index", "type":"S", "info":"index of the track in the DC bank"},
{"name":"detector", "type":"B", "info":"id of the detector"},
{"name":"layer", "type":"B", "info":"id of the layer"},
{"name":"x", "type":"F", "info":"track x position at detector surface (cm)"},
{"name":"y", "type":"F", "info":"track y position at detector surface (cm)"},
{"name":"z", "type":"F", "info":"track z position at detector surface (cm)"},
{"name":"tx", "type":"F", "info":"track unit direction vector x component at detector surface"},
{"name":"ty", "type":"F", "info":"track unit direction vector y component at detector surface"},
{"name":"tz", "type":"F", "info":"track unit direction vector z component at detector surface"},
{"name":"lx", "type":"F", "info":"track x position in local coordinates (cm)"},
{"name":"ly", "type":"F", "info":"track y position in local coordinates (cm)"},
{"name":"lz", "type":"F", "info":"track z position in local coordinates (cm)"},
{"name":"dx", "type":"F", "info":"DC track x position in local coordinates (cm)"},
{"name":"dy", "type":"F", "info":"DC track y position in local coordinates (cm)"},
{"name":"dz", "type":"F", "info":"DC track z position in local coordinates (cm)"},
{"name":"path", "type":"F", "info":"pathlength of the track from the track vertex to the detector surface (cm)"}
]
},
{
"name": "MURH::hits",
"group": 23100,
"item" : 21,
"info": "Reconstructed Hits in muCLAS12 hodoscope",
"entries": [
{"name":"sector", "type":"B", "info":"sector number"},
{"name":"layer", "type":"B", "info":"layer number"},
{"name":"component", "type":"S", "info":"component number"},
{"name":"x", "type":"F", "info":"Hit X position (cm)" },
{"name":"y", "type":"F", "info":"Hit Y position (cm)" },
{"name":"z", "type":"F", "info":"Hit Z position (cm)" },
{"name":"energy", "type":"F", "info":"Hit Energy" },
{"name":"time", "type":"F", "info":"Hit Time" },
{"name":"hitID", "type":"S", "info":"Hit Pointer to ADC bank"},
{"name":"clusterID", "type":"S", "info":"Hit Pointer to Cluster Bank"}
]
},
{
"name": "MURH::clusters",
"group": 23100,
"item" : 22,
"info": "Reconstructed clusters in muCLAS12 hodoscope",
"entries": [
{"name":"size", "type":"S", "info":"Cluster size" },
{"name":"id", "type":"S", "info":"Cluster ID" },
{"name":"x", "type":"F", "info":"Cluster centroid X moment (cm)" },
{"name":"y", "type":"F", "info":"Cluster centroid Y moment (cm)" },
{"name":"z", "type":"F", "info":"Cluster centroid Z moment (cm)" },
{"name":"widthX", "type":"F", "info":"Cluster width in x (cm)" },
{"name":"widthY", "type":"F", "info":"Cluster width in y (cm)" },
{"name":"radius", "type":"F", "info":"Cluster radius (cm)" },
{"name":"time", "type":"F", "info":"Cluster timing information" },
{"name":"energy", "type":"F", "info":"Cluster total energy" }
]
}
]
3 changes: 2 additions & 1 deletion etc/bankdefs/util/bankSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def create(dirname, banklist):
rich = ["RICH::tdc","RICH::Ring","RICH::Particle"]
rtpc = ["RTPC::hits","RTPC::tracks","RTPC::KFtracks"]
alert = ["AHDC::track", "AHDC::mc", "AHDC::hits", "AHDC::preclusters", "AHDC::clusters", "AHDC::kftrack", "AHDC::ai:prediction"]
dets = band + raster + rich + rtpc + alert
muclas = ["MUCAL::clusters", "MUVT::tracks"]
dets = band + raster + rich + rtpc + alert + muclas

# additions for the calibration schema:
calib = ["BAND::adc","BAND::laser","BAND::tdc","BAND::hits","BAND::rawhits","CND::adc","CND::hits","CND::tdc","CTOF::calib","CVTRec::Tracks","CVTRec::UTracks","DC::calib","ECAL::adc","ECAL::calib","ECAL::clusters","ECAL::peaks","ECAL::tdc","FMT::Hits","FMT::Clusters","FMT::Tracks","FMT::Trajectory","FT::particles","FTCAL::adc","FTCAL::clusters","FTCAL::hits","FTHODO::adc","FTHODO::clusters","FTHODO::hits","FTTRK::clusters","FTTRK::hits","FTTRK::crosses","FTOF::adc","FTOF::calib","HTCC::adc","HTCC::rec","LTCC::adc","LTCC::clusters","RASTER::adc","RF::adc","RF::tdc","RICH::calib","RTPC::adc","RTPC::hits","RTPC::tracks","RUN::rf","RUN::trigger","TimeBasedTrkg::TBTracks"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javax.swing.JFrame;
import org.jlab.clas.detector.DetectorData;
import org.jlab.clas.detector.DetectorEvent;
import org.jlab.clas.physics.PhysicsEvent;
import org.jlab.clas.reco.ReconstructionEngine;
import org.jlab.geom.prim.Vector3D;
import org.jlab.groot.data.H1F;
Expand Down Expand Up @@ -89,4 +90,75 @@ public int setRunConditionsParameters(DataEvent event) {

return run;
}


public static void main (String arg[]) {
FTCALEngine cal = new FTCALEngine();
cal.init();
// String input = "/Users/devita/Work/clas12/simulations/clas12Tags/4.4.0/out.hipo";
// String input = "/home/filippi/clas/ForwardTracker/DATA/out_realGeo_noMagField.data";
// String input = "/home/filippi/clas/gemc/electronGun/gemc.hipo";
String input = "/home/filippi/clas12/fttrkDev/clas12-offline-software-6.5.13-fttrkDev/ft_005038.evio.01231.hipo";
HipoDataSource reader = new HipoDataSource();
// String input = "/Users/devita/Work/clas12/simulations/tests/detectors/clas12/ft/out_header.ev";
// EvioSource reader = new EvioSource();
reader.open(input);

// initialize histos
H1F h1 = new H1F("Cluster Energy",100, 0.,5.);
h1.setOptStat(Integer.parseInt("1111")); h1.setTitleX("Cluster Energy (GeV)");
H1F h2 = new H1F("Energy Resolution",100, -1, 1);
h2.setOptStat(Integer.parseInt("1111")); h2.setTitleX("Energy Resolution(GeV)");
H1F h3 = new H1F("Theta Resolution",100, -2, 2);
h3.setOptStat(Integer.parseInt("1111")); h3.setTitleX("Theta Resolution(deg)");
H1F h4 = new H1F("Phi Resolution",100, -10, 10);
h4.setOptStat(Integer.parseInt("1111")); h4.setTitleX("Phi Resolution(deg)");
// H1F h5 = new H1F("Time Resolution",100, -10, 10);
H1F h5 = new H1F("Time Resolution",100, -100, 300);
h5.setOptStat(Integer.parseInt("1111")); h5.setTitleX("Time Resolution(ns)");
H2F h6 = new H2F("cluster xy", 100, -15., 15., 100, -15., 15.);
h6.setTitleX("cluster x"); h6.setTitleY("cluster y");

while(reader.hasEvent()){
// for(int nev=0; nev<2; nev++){
DataEvent event = (DataEvent) reader.getNextEvent();
cal.processDataEvent(event);

DetectorEvent detectorEvent = DetectorData.readDetectorEvent(event);
PhysicsEvent gen = detectorEvent.getGeneratedEvent();
if(event.hasBank("FTCAL::clusters")) {
DataBank bank = event.getBank("FTCAL::clusters");
int nrows = bank.rows();
for(int i=0; i<nrows;i++) {
h1.fill(bank.getFloat("energy",i));
Vector3D cluster = new Vector3D(bank.getFloat("x",i),bank.getFloat("y",i),bank.getFloat("z",i));
// System.out.println(cluster.theta() + " " + gen.getGeneratedParticle(0).theta());
// System.out.println(cluster.x() + " " + cluster.y() + " " + cluster.z() + " ");
/// h5.fill(bank.getFloat("time",i)-124.25); // 124.25 offet for MC data
h5.fill(bank.getFloat("time", i));
h6.fill(cluster.x(), cluster.y());
if(gen.countGenerated() != 0){
h2.fill(bank.getFloat("energy",i)-gen.getGeneratedParticle(0).vector().p());
h3.fill(Math.toDegrees(cluster.theta()-gen.getGeneratedParticle(0).theta()));
h4.fill(Math.toDegrees(cluster.phi()-gen.getGeneratedParticle(0).phi()));
}
}
}
}
JFrame frame = new JFrame("FT Reconstruction");
frame.setSize(800,800);
EmbeddedCanvas canvas = new EmbeddedCanvas();
canvas.divide(2,3);
canvas.cd(0); canvas.draw(h1);
canvas.cd(1); canvas.draw(h2);
canvas.cd(2); canvas.draw(h3);
canvas.cd(3); canvas.draw(h4);
canvas.cd(4); canvas.draw(h6);
canvas.cd(5); canvas.draw(h5);
frame.add(canvas);
frame.setLocationRelativeTo(null);
frame.setVisible(true);

}

}
Loading
Loading