Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Commit

Permalink
fixed error in EVENT.json, few variable type errors in DetectorData, …
Browse files Browse the repository at this point in the history
…scintillator component definition, writing of empty banks
  • Loading branch information
raffaelladevita committed May 7, 2017
1 parent cce8ec8 commit 80add0b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ public static DataBank getDetectorParticleBank(List<DetectorParticle> particles,
bank.setFloat("vy", row, (float) particles.get(row).vertex().y());
bank.setFloat("vz", row, (float) particles.get(row).vertex().z());

bank.setFloat("mass", row, (float) particles.get(row).getMass());
// bank.setFloat("mass", row, (float) particles.get(row).getMass());
bank.setFloat("beta", row, (float) particles.get(row).getBeta());
bank.setByte("status", row, (byte) particles.get(row).getStatus());
bank.setShort("status", row, (short) particles.get(row).getStatus());
bank.setFloat("chi2pid", row, (float) 0.0);
}
return bank;
Expand All @@ -204,8 +204,8 @@ public static DataBank getCalorimeterResponseBank(List<CalorimeterResponse> resp
bank.setShort("index", row, (short) r.getHitIndex());
bank.setShort("pindex", row, (short) r.getAssociation());
bank.setShort("detector", row, (short) r.getDescriptor().getType().getDetectorId());
bank.setShort("sector", row, (short) r.getDescriptor().getSector());
bank.setShort("layer", row, (short) r.getDescriptor().getLayer());
bank.setByte("sector", row, (byte) r.getDescriptor().getSector());
bank.setByte("layer", row, (byte) r.getDescriptor().getLayer());
bank.setFloat("x", row, (float) r.getPosition().x());
bank.setFloat("y", row, (float) r.getPosition().y());
bank.setFloat("z", row, (float) r.getPosition().z());
Expand Down Expand Up @@ -236,8 +236,8 @@ public static DataBank getScintillatorResponseBank(List<ScintillatorResponse> re
bank.setShort("index",row,(short) r.getHitIndex());
bank.setShort("pindex", row, (short) r.getAssociation());
bank.setShort("detector", row, (short) r.getDescriptor().getType().getDetectorId());
bank.setShort("sector", row, (short) r.getDescriptor().getSector());
bank.setShort("layer", row, (short) r.getDescriptor().getLayer());
bank.setByte("sector", row, (byte) r.getDescriptor().getSector());
bank.setByte("layer", row, (byte) r.getDescriptor().getLayer());
bank.setShort("component", row, (short) r.getDescriptor().getComponent());
bank.setFloat("x", row, (float) r.getPosition().x());
bank.setFloat("y", row, (float) r.getPosition().y());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ScintillatorResponse {
private Double detectorEnergy = 0.0;
private Double particlePath = 0.0;
private int association = -1;
private int component = -1;
// private int component = -1;
private double hitQuality = 0.0;
private int hitIndex = -1;

Expand All @@ -49,11 +49,11 @@ public ScintillatorResponse(int sector, int layer, int component){
public void setMatchPosition(double x, double y, double z){this.hitPositionMatched.setXYZ(x, y, z);}
public void setPath(double path){ this.particlePath = path;}
public void setEnergy(double energy) { this.detectorEnergy = energy; }
public void setComponent(int paddle) {this.component = paddle;}
// public void setComponent(int paddle) {this.component = paddle;}
public void setHitQuality(double q) {this.hitQuality = q;}
public void setHitIndex(int index) {this.hitIndex = index;}

public int getComponent() {return this.component;}
// public int getComponent() {return this.component;}
public int getHitIndex(){return this.hitIndex;}
public double getTime(){ return this.detectorTime;}
public double getEnergy(){ return this.detectorEnergy; }
Expand Down Expand Up @@ -119,16 +119,14 @@ public static List<ScintillatorResponse> readHipoEvent(DataEvent event,
for(int row = 0; row < nrows; row++){
int sector = bank.getByte("sector", row);
int layer = bank.getByte("layer", row);
int component = bank.getShort("component",row);


ScintillatorResponse response = new ScintillatorResponse(sector,layer,0);
ScintillatorResponse response = new ScintillatorResponse(sector,layer,component);
response.getDescriptor().setType(type);
float x = bank.getFloat("x", row);
float y = bank.getFloat("y", row);
float z = bank.getFloat("z", row);
int component = bank.getShort("component",row);
response.setHitIndex(row);
response.setComponent(component);
response.setPosition(x, y, z);
response.setEnergy(bank.getFloat("energy", row));
response.setTime(bank.getFloat("time", row));
Expand Down
4 changes: 2 additions & 2 deletions etc/bankdefs/hipo/EVENT.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
"items": [
{"name":"index", "id":1, "type":"int16", "info":"index of the hit in the specific detector bank"},
{"name":"pindex", "id":2, "type":"int16", "info":"row number in the particle bank hit is associated with"},
{"name":"detector", "id":3, "type":"int8", "info":"Detector ID, defined in COATJAVA DetectorType"},
{"name":"detector", "id":3, "type":"int16", "info":"Detector ID, defined in COATJAVA DetectorType"},
{"name":"sector", "id":4, "type":"int8", "info":"Sector of the Detector hit"},
{"name":"layer", "id":5, "type":"int16", "info":"Layer of the Detector hit"},
{"name":"layer", "id":5, "type":"int8", "info":"Layer of the Detector hit"},
{"name":"x", "id":6, "type":"float", "info":"X coordinate of the hit"},
{"name":"y", "id":7, "type":"float", "info":"Y coordinate of the hit"},
{"name":"z", "id":8, "type":"float", "info":"Z coordinate of the hit"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public boolean processDataEvent(DataEvent de) {
DataBank bankChe = DetectorData.getCherenkovResponseBank(cherenkovs, de, cherenkovBank);
//DataBank bankEve = DetectorData.getEventBank(eb.getEvent(), de, eventBank);
//DataBank bankMat = DetectorData.getTBCovMatBank(eb.getEvent().getParticles(), de, matrixBank);
de.appendBanks(bankP,bankCal,bankSci,bankChe);
de.appendBanks(bankP);
if(bankCal.rows()>0) de.appendBanks(bankCal);
if(bankSci.rows()>0) de.appendBanks(bankSci);
if(bankChe.rows()>0) de.appendBanks(bankChe);
if(EBio.isTimeBased(de)==true){
//de.appendBanks(bankMat);
}
Expand Down

0 comments on commit 80add0b

Please sign in to comment.