lcsim/src/org/lcsim/recon/cluster/density
diff -u -r1.1 -r1.2
--- DTreeAnalysis.java 7 Dec 2005 18:57:14 -0000 1.1
+++ DTreeAnalysis.java 12 Dec 2005 05:15:17 -0000 1.2
@@ -76,20 +76,20 @@
if(_runPar.ClusterSeparately()){
String[] columnNamesEM = {"nclusEM","emClusFolder={float ene,float x,float y,float z,int size}",
- "emCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTag}","evtno"};
+ "emCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTag,int ily,int iz,int iphi}","evtno"};
Class[] columnClassesEM = {Integer.TYPE,ITuple.class,ITuple.class,Integer.TYPE};
_tupleEM = _tf.create("EM","Recon Clusters",columnNamesEM,columnClassesEM);
String[] columnNamesHD = {"nclusHD","hdClusFolder={float ene,float x,float y,float z,int size}",
- "hdCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTag}","evtno"};
+ "hdCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTag,int ily,int iz,int iphi}","evtno"};
Class[] columnClassesHD = {Integer.TYPE,ITuple.class,ITuple.class,Integer.TYPE};
_tupleHD = _tf.create("HD","Recon Clusters",columnNamesHD,columnClassesHD);
- String[] columnNamesMCem = {"nclusMCem","emmcClusFolder={float ene,float x,float y,float z,int size,int pid,float chrg,float e,float px,float py,float pz}","emmcCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTagG,int cellTagR,int ily,int iz,int iphi}","evtno"};
+ String[] columnNamesMCem = {"nclusMCem","emmcClusFolder={float ene,float x,float y,float z,int size,int pid,float chrg,float e,float px,float py,float pz,float vx,float vy,float vz}","emmcCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTagG,int cellTagR,int ily,int iz,int iphi,float r,float phi,float theta,float time}","evtno"};
Class[] columnClassesMCem = {Integer.TYPE,ITuple.class,ITuple.class,Integer.TYPE};
_tupleMCem = _tf.create("MCEM","Gen Clusters in EM",columnNamesMCem,columnClassesMCem);
- String[] columnNamesMChd = {"nclusMChd","hdmcClusFolder={float ene,float x,float y,float z,int size,int pid,int chrg,float e,float px,float py,float pz}","hdmcCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTagG,int cellTagR,int ily,int iz,int iphi}","evtno"};
+ String[] columnNamesMChd = {"nclusMChd","hdmcClusFolder={float ene,float x,float y,float z,int size,int pid,int chrg,float e,float px,float py,float pz,float vx,float vy,float vz}","hdmcCellFolder={float cellE,float cellX,float cellY,float cellZ,float cellD,int cellTagG,int cellTagR,int ily,int iz,int iphi,float r,float phi,float theta,float time}","evtno"};
Class[] columnClassesMChd = {Integer.TYPE,ITuple.class,ITuple.class,Integer.TYPE};
_tupleMChd = _tf.create("MCHD","Gen Clusters in HD",columnNamesMChd,columnClassesMChd);
}
@@ -119,8 +119,8 @@
= new HashMap<CalorimeterHit,Integer>();
for(BasicCluster clust : recon ) {
List<CalorimeterHit> cellVec = clust.getCalorimeterHits();
- // System.out.println(tag+" "+cellVec.size());
- if(cellVec.size()==0.) System.out.println("Damn 3");
+ System.out.println(tag+" "+cellVec.size());
+ if(cellVec.size()==0) System.out.println("*** bad cellVec in "+_calType);
// for(int i=0;i<cellVec.size();i++){
// MyCalorimeterHit myhit = (MyCalorimeterHit) cellVec.get(i);
for(CalorimeterHit ihit : cellVec) {
@@ -129,6 +129,10 @@
recTagMap.put(ihit,tagObject);
double[] pos = ihit.getPosition();
double cdens = _loader.getDensity(ihit);
+ long jid = ihit.getCellID();
+ int ily = MyTools.getLayer(jid);
+ int iz = MyTools.getThetaBin(jid);
+ int iphi = MyTools.getPhiBin(jid);
if(_calType=="EM"){
emCellFolder.fill(0,(float) ihit.getRawEnergy());
emCellFolder.fill(1,(float)pos[0]);
@@ -136,6 +140,9 @@
emCellFolder.fill(3,(float)pos[2]);
emCellFolder.fill(4,(float) cdens);
emCellFolder.fill(5,tag);
+ emCellFolder.fill(6,ily);
+ emCellFolder.fill(7,iz);
+ emCellFolder.fill(8,iphi);
emCellFolder.addRow();
}
if(_calType=="HD"){
@@ -145,6 +152,9 @@
hdCellFolder.fill(3,(float)pos[2]);
hdCellFolder.fill(4,(float) cdens);
hdCellFolder.fill(5,tag);
+ hdCellFolder.fill(6,ily);
+ hdCellFolder.fill(7,iz);
+ hdCellFolder.fill(8,iphi);
hdCellFolder.addRow();
}
}
@@ -177,8 +187,9 @@
Integer tagObject = recTagMap.get(ihit);
// System.out.println("getting: "+ihit+" -> "+tagObject);
- int rtag = -1;
- if(tagObject!=null) rtag = tagObject.intValue();
+ int rtag = -1;
+ if(tagObject!=null) rtag = tagObject.intValue();
+// int rtag = tagObject.intValue();
double[] pos = ihit.getPosition();
double cdens = _loader.getDensity(ihit);
if(cdens==0) continue; // skip hits below energy cut
@@ -186,6 +197,19 @@
int ily = MyTools.getLayer(jid);
int iz = MyTools.getThetaBin(jid);
int iphi = MyTools.getPhiBin(jid);
+ double cellR = Math.sqrt(pos[0]*pos[0]+pos[1]*pos[1]);
+ double theta = Math.atan2(cellR,pos[2]);
+ double phi = Math.atan2(pos[1],pos[0]);
+ if(phi<0.) phi += 2.0*Math.PI;
+ SimCalorimeterHit iihit = (SimCalorimeterHit)ihit;
+ int npart = iihit.getMCParticleCount();
+ double timeStamp = 99999.;
+ for(int j=0;j<npart;j++){
+ double tmpTime = (double) iihit.getContributedTime(j);
+ if(tmpTime<timeStamp){
+ timeStamp = tmpTime;
+ }
+ }
if(_calType=="EM") {
emmcCellFolder.fill(0,(float) ihit.getRawEnergy());
emmcCellFolder.fill(1,(float)pos[0]);
@@ -197,6 +221,10 @@
emmcCellFolder.fill(7,ily);
emmcCellFolder.fill(8,iz);
emmcCellFolder.fill(9,iphi);
+ emmcCellFolder.fill(10,(float) cellR);
+ emmcCellFolder.fill(11,(float) phi);
+ emmcCellFolder.fill(12,(float) theta);
+ emmcCellFolder.fill(13,(float) timeStamp);
emmcCellFolder.addRow();
// System.out.println("EM Clus cells tag="+tag+", rtag="+rtag
// +", id="+MyTools.printID(jid)
@@ -214,6 +242,10 @@
hdmcCellFolder.fill(7,ily);
hdmcCellFolder.fill(8,iz);
hdmcCellFolder.fill(9,iphi);
+ hdmcCellFolder.fill(10,(float) cellR);
+ hdmcCellFolder.fill(11,(float) phi);
+ hdmcCellFolder.fill(12,(float) theta);
+ hdmcCellFolder.fill(13,(float) timeStamp);
hdmcCellFolder.addRow();
// if(tag==7){
// System.out.println("HD Clus cells: id="+MyTools.printID(jid)
@@ -229,6 +261,7 @@
float mcE = (float)mcpart.getEnergy();
Hep3Vector mcMom = mcpart.getMomentum();
double[] pos = clust.getPosition();
+ Hep3Vector vert = mcpart.getOrigin();
if(_calType=="EM"){
emmcClusFolder.fill(0,(float) clust.getEnergy());
emmcClusFolder.fill(1, (float)pos[0] );
@@ -241,6 +274,9 @@
emmcClusFolder.fill(8, (float)mcMom.x());
emmcClusFolder.fill(9,(float)mcMom.y());
emmcClusFolder.fill(10,(float)mcMom.z());
+ emmcClusFolder.fill(11,(float) vert.x());
+ emmcClusFolder.fill(12,(float) vert.y());
+ emmcClusFolder.fill(13,(float) vert.z());
emmcClusFolder.addRow();
}
if(_calType=="HD") {
@@ -255,6 +291,9 @@
hdmcClusFolder.fill(8, (float)mcMom.x());
hdmcClusFolder.fill(9, (float)mcMom.y());
hdmcClusFolder.fill(10, (float)mcMom.z());
+ hdmcClusFolder.fill(11,(float) vert.x());
+ hdmcClusFolder.fill(12,(float) vert.y());
+ hdmcClusFolder.fill(13,(float) vert.z());
hdmcClusFolder.addRow();
}
tag++;