lcsim/src/org/lcsim/recon/vertexing/pixsim
diff -u -r1.3 -r1.4
--- PixilatedSensorManager.java 14 Dec 2010 21:42:13 -0000 1.3
+++ PixilatedSensorManager.java 17 Dec 2010 21:48:45 -0000 1.4
@@ -14,17 +14,19 @@
import java.text.*;
import java.util.*;
import org.lcsim.util.lcio.LCIOConstants;
+import org.lcsim.util.aida.AIDA;
/**
* This class are designed for creating a list of pixilated sensor
* for each event (only sensors which have hits in them are created)
*
* @author Nick Sinev
- * @version $Id: PixilatedSensorManager.java,v 1.3 2010/12/14 21:42:13 sinev Exp $
+ * @version $Id: PixilatedSensorManager.java,v 1.4 2010/12/17 21:48:45 sinev Exp $
*/
public class PixilatedSensorManager extends Driver
{
+ private static boolean doHist = true;
boolean cal_res_bar = false;
boolean cal_res_ec = false;
boolean read_rest_bar=true;
@@ -32,7 +34,7 @@
boolean incl_el_noise = false;
boolean ready = false;
static PixSimConstants cons = PixSimConstants.instance();
- static final int MAXHTSPEV = 10000;
+ static final int MAXHTSPEV = 100000;
private static final double bunch_period = cons.BunchInterval;
private static int phys_bc = 0;
private static int cluster_thr_barr = 8;
@@ -40,6 +42,10 @@
private static boolean firstcall = true;
private static boolean assign_bc = true;
private static double enoise = 50.;
+ private static long startime=0;
+ private static long endtime=0;
+ private static long proctime=0;
+ private static AIDA aida = AIDA.defaultInstance();
// boolean choises for 3 sensor positions - Barrel, ECPlus and ECMinus
@@ -94,8 +100,8 @@
private static boolean ec_pl_ec_mi_same_prop = true;
// here we have arrays of all settable variables for different sensor options
- private static int[] opt_cluster_thr_barr = {8,8,8,1,1,1,1,1,1,8};
- private static int[] opt_cluster_thr_ec = {8,8,8,1,1,1,1,1,1,8};
+ private static int[] opt_cluster_thr_barr = {8,1,8,1,1,1,1,1,1,8};
+ private static int[] opt_cluster_thr_ec = {8,1,8,1,1,1,1,1,1,8};
private static boolean[] opt_prop_tab_barrel_local = {false,false,false,true,true,true,true,true,true,true};
private static boolean[] opt_prop_tab_ec_pl_local = {false,false,false,true,true,true,true,true,true,true};
private static boolean[] opt_prop_tab_ec_mi_local = {false,false,false,true,true,true,true,true,true,true};
@@ -109,43 +115,44 @@
{"CCD_20x20x20_B5_propagator.dat",
"CCD_20x20x20_B5_propagator.dat",
"CCD_20x20x20_B5_propagator.dat",
+ "CCD_20x20x20_B5_propagator.dat",
"Chronopix_8x8x20hr_B5_Barr_propagator.dat",
"Chronopix_12x12x20hr_B5_Barr_propagator.dat",
"Chronopix_16x16x20hr_B5_Barr_propagator.dat",
"Chronopix_8x8x12hr_B5_Barr_propagator.dat",
"Chronopix_12x12x12hr_B5_Barr_propagator.dat",
- "chronopix_16x16x12hr_B5_Barr_propagator.dat",
- "mimosa18_B5_Barr_propagator.dat"
+ "chronopix_16x16x12hr_B5_Barr_propagator.dat"
};
private static String[] opt_ec_pl_prop_tname =
{"CCD_20x20x20_B5_EC_propagator.dat",
"CCD_20x20x20_B5_EC_propagator.dat",
"CCD_20x20x20_B5_EC_propagator.dat",
+ "CCD_20x20x20_B5_EC_propagator.dat",
"Chronopix_8x8x20_B5_EC_propagator.dat",
"Chronopix_12x12x20_B5_EC_propagator.dat",
"Chronopix_16x16x20_B5_EC_propagator.dat",
"Chronopix_8x8x12_B5_EC_propagator.dat",
"Chronopix_12x12x12_B5_EC_propagator.dat",
- "chronopix_16x16x12_hr_B5_EC_propagator.dat",
- "mimosa18_B5_EC_propagator.dat"
+ "chronopix_16x16x12_hr_B5_EC_propagator.dat"
};
private static String[] opt_ec_mi_prop_tname =
{"CCD_20x20x20_B5_EC_propagator.dat",
"CCD_20x20x20_B5_EC_propagator.dat",
"CCD_20x20x20_B5_EC_propagator.dat",
+ "CCD_20x20x20_B5_EC_propagator.dat",
"Chronopix_8x8x20_B5_EC_propagator.dat",
"Chronopix_12x12x20_B5_EC_propagator.dat",
"Chronopix_16x16x20_B5_EC_propagator.dat",
"Chronopix_8x8x12_B5_EC_propagator.dat",
"Chronopix_12x12x12_B5_EC_propagator.dat",
- "chronopix_16x16x12_hr_B5_EC_propagator.dat",
- "mimosa18_B5_EC_propagator.dat"
+ "chronopix_16x16x12_hr_B5_EC_propagator.dat"
};
private static String[] opt_rtab_name_bar =
{"CCD_20x20x20_B5_res_bar.dat",
+ "CCD_20x20x20_B5_res_bar.dat",
"CPCCD_20x20x20_B5_res_bar.dat",
"ShortColCCD_20x20x20_B5_res_bar.dat",
"Chronopix_8x8x20hr_B5_res_bar.dat",
@@ -153,12 +160,12 @@
"Chronopix_16x16x20hr_B5_res_bar.dat",
"Chronopix_8x8x12hr_B5_res_bar.dat",
"Chronopix_12x12x12hr_B5_res_barr.dat",
- "chronopix_16x16x12hr_B5_res_barr.dat",
- "mimosa18_B5_res_bar.dat"
+ "chronopix_16x16x12hr_B5_res_barr.dat"
};
private static String[] opt_rtab_name_ec_pl=
{"CCD_20x20x20_B5_res_ec.dat",
+ "CCD_20x20x20_B5_res_ec.dat",
"CPCCD_20x20x20_B5_res_ec.dat",
"ShortColCCD_20x20x20_B5_res_ec.dat",
"Chronopix_8x8x20hr_B5_res_ec.dat",
@@ -166,12 +173,12 @@
"Chronopix_16x16x20hr_B5_res_ec.dat",
"Chronopix_8x8x12hr_B5_res_ec.dat",
"Chronopix_12x12x12hr_B5_res_ec.dat",
- "chronopix_16x16x12hr_B5_res_ec.dat",
- "mimosa18_B5_res_ec.dat"
+ "chronopix_16x16x12hr_B5_res_ec.dat"
};
private static String[] opt_rtab_name_ec_mi =
{"CCD_20x20x20_B5_res_ec.dat",
+ "CCDd_20x20x20_B5_res_ec.dat",
"CPCCD_20x20x20_B5_res_ec.dat",
"ShortColCCD_20x20x20_B5_res_ec.dat",
"Chronopix_8x8x20hr_B5_res_ec.dat",
@@ -234,15 +241,15 @@
public PixilatedSensorManager(SensorOption opt, boolean usetable)
{
if(opt == SensorOption.ClassicCCD) option = 0;
- if(opt == SensorOption.CPCCD) option = 1;
- if(opt == SensorOption.ShortColumnCCD) option = 2;
- if(opt == SensorOption.Chrono8x8x20) option = 3;
- if(opt == SensorOption.Chrono12x12x20) option = 4;
- if(opt == SensorOption.Chrono16x16x20) option = 5;
- if(opt == SensorOption.Chrono8x8x12) option = 6;
- if(opt == SensorOption.Chrono12x12x12) option = 7;
- if(opt == SensorOption.Chrono16x16x12) option = 8;
- if(opt == SensorOption.Mimosa) option = 9;
+ if(opt == SensorOption.ClassicCCDdigit) option = 1;
+ if(opt == SensorOption.CPCCD) option = 2;
+ if(opt == SensorOption.ShortColumnCCD) option = 3;
+ if(opt == SensorOption.Chrono8x8x20) option = 4;
+ if(opt == SensorOption.Chrono12x12x20) option = 5;
+ if(opt == SensorOption.Chrono16x16x20) option = 6;
+ if(opt == SensorOption.Chrono8x8x12) option = 7;
+ if(opt == SensorOption.Chrono12x12x12) option = 8;
+ if(opt == SensorOption.Chrono16x16x12) option = 9;
use_prop_tab_barrel = usetable;
use_prop_tab_ec_pl = usetable;
use_prop_tab_ec_mi = usetable;
@@ -276,6 +283,27 @@
setOptionVariables();
IPixelSensorElectronics el = new CCDElectronics();
el.includeElectronicNoiseHits(incl_el_noise);
+ el.setADCScale(140.);
+ el.setNoiseLevel(enoise);
+ el.setADCSaturation(1);
+ el.setBunchesPerClock(30); // this is about maximum clock image speed (100 KHz) for classic CCD - asuming 50MHz speed in R register
+ // for VXD3 CCD we would set this value to 300 (10 KHz image clock and 5 MHz R register speed)
+ el.useCorrelatedDoubleSampling(false);
+ el.setPixelThreshold(1);
+ bar_el = el;
+ ecp_el = el;
+ ecm_el = el;
+ bpcf = new PixelConfiguration();
+ bcpr = new CarrierPropagator(bpcf);
+ ecppr = new CarrierPropagator(bpcf);
+ ecmpr = ecppr;
+ ready = true;
+ }
+ if(option == 2)
+ {
+ setOptionVariables();
+ IPixelSensorElectronics el = new CCDElectronics();
+ el.includeElectronicNoiseHits(incl_el_noise);
el.setADCScale(25.);
el.setNoiseLevel(enoise);
el.setADCSaturation(255);
@@ -309,7 +337,7 @@
cluster_thr_ec = opt_cluster_thr_ec[option];
}
- public void includeElectronicsNoise(boolean yes) { incl_el_noise=yes; }
+ public void includeElectronicsNoiseHits(boolean yes) { incl_el_noise=yes; }
public void setNoiseLevel(double noise) { enoise=noise; }
@@ -457,6 +485,7 @@
}
}
}
+
if(use_prop_tab_ec_mi)
{
if(!ec_pl_ec_mi_same_prop)
@@ -569,7 +598,8 @@
{
PixilatedSensor pse = new PixilatedSensor(de,bcpr,false);
pse.setElectronics(bar_el);
- pse.setErrorEstimate(eeb);
+ pse.setErrorEstimate(eeb);
+ pse.setClusterThreshold(cluster_thr_barr);
if(nbe==0 && cal_res_bar) pse.calibrateErrorEstimate(calibr_stat_b,rtab_name_bar);
nbe++;
psbrl.add(pse);
@@ -585,6 +615,7 @@
PixilatedSensor pse = new PixilatedSensor(de,ecppr,true);
pse.setElectronics(ecp_el);
pse.setErrorEstimate(eeep);
+ pse.setClusterThreshold(cluster_thr_ec);
eeep.setTableParameters(11,11,11,0.,1.5,0.,1.5,2.2,7.2);
if(nbc==0 && cal_res_ec) pse.calibrateErrorEstimate(calibr_stat_ep,rtab_name_ec_pl);
nbc++;
@@ -606,6 +637,7 @@
PixilatedSensor pse = new PixilatedSensor(de,ecmpr,true);
pse.setElectronics(ecm_el);
pse.setErrorEstimate(eeem);
+ pse.setClusterThreshold(cluster_thr_ec);
if(!ec_pl_ec_mi_same_prop)
{
eeem.setTableParameters(11,11,11,0.,1.5,0.,1.5,2.2,7.2);
@@ -617,6 +649,7 @@
System.out.println("Created: "+nbe+" barrel pixilated sensors and "+nbc+" EC positive and "+nbcm+" EC negative pixilated sensors");
} // end of if(firstcall)
if(!ready) return;
+ if(doHist) startime = System.currentTimeMillis();
for(IDetectorElement de:vxbrels)
{
if(de.hasReadout()) { IReadout ro = de.getReadout(); ro.clear(); }
@@ -638,19 +671,19 @@
String ehcname=null;
if(evhits != null)
{
- System.out.println("Event has "+evhits.size()+" SimTrackerHit collections: ");
+// System.out.println("Event has "+evhits.size()+" SimTrackerHit collections: ");
for(List<SimTrackerHit> sdhits:evhits)
{
EventHeader.LCMetaData md = event.getMetaData(sdhits);
String cname = md.getName();
- System.out.println("Collection name: "+cname);
+// System.out.println("Collection name: "+cname);
if((cname.indexOf("Vtx")!=-1)||(cname.indexOf("Vertex") != -1))
{
if(cname.indexOf("Barrel")!=-1) bhcname=cname;
if(cname.indexOf("Endcap")!=-1) ehcname=cname;
}
}
- System.out.println("Vertex barrel sim hit collection name is: "+bhcname+" and for encap it is: "+ehcname);
+// System.out.println("Vertex barrel sim hit collection name is: "+bhcname+" and for encap it is: "+ehcname);
}
int asshts = 0;
int nprints = 0;
@@ -659,7 +692,7 @@
if(bhcname != null)
{
List<SimTrackerHit> vxbhts = event.get(SimTrackerHit.class,bhcname);
- System.out.println("SimTrackerHit collection size for barrel: "+vxbhts.size());
+// System.out.println("SimTrackerHit collection size for barrel: "+vxbhts.size());
for(SimTrackerHit hit:vxbhts)
{
double[] hpnt = hit.getPoint();
@@ -689,7 +722,7 @@
if(ehcname != null)
{
List<SimTrackerHit> vxehts = event.get(SimTrackerHit.class,ehcname);
- System.out.println("SimTrackerHit collection size for endcap: "+vxehts.size());
+// System.out.println("SimTrackerHit collection size for endcap: "+vxehts.size());
for(SimTrackerHit hit:vxehts)
{
double[] hpnt = hit.getPoint();
@@ -767,12 +800,14 @@
} // end if(evhits != null)
List<TrackerHit> ebhits = new ArrayList<TrackerHit>();
List<TrackerHit> eehits = new ArrayList<TrackerHit>();
- List<RawTrackerHit> rawhits = new ArrayList<RawTrackerHit>();
+ List<RawTrackerHit> rawhits = new ArrayList<RawTrackerHit>();
+ int tnrawhpe = 0; // total number of raw hirs, including noise hits
for(PixilatedSensor psn:psbrl)
{
psn.processEvent(phys_bc);
IDetectorElement de = psn.getParent();
IReadout ro = de.getReadout();
+ if(doHist) tnrawhpe+=(psn.getRawHits()).size();
List<TrackerHit> sthts = ro.getHits(TrackerHit.class);
for(TrackerHit ht:sthts)
{
@@ -786,6 +821,7 @@
psn.processEvent(phys_bc);
IDetectorElement de = psn.getParent();
IReadout ro = de.getReadout();
+ if(doHist) tnrawhpe+=(psn.getRawHits()).size();
List<TrackerHit> sthts = ro.getHits(TrackerHit.class);
for(TrackerHit ht:sthts)
{
@@ -799,6 +835,7 @@
psn.processEvent(phys_bc);
IDetectorElement de = psn.getParent();
IReadout ro = de.getReadout();
+ if(doHist) tnrawhpe+=(psn.getRawHits()).size();
List<TrackerHit> sthts = ro.getHits(TrackerHit.class);
for(TrackerHit ht:sthts)
{
@@ -807,12 +844,23 @@
}
}
// System.out.println("Endcap minus hits processed!");
- System.out.println("Adding "+ebhits.size()+" hits to RecVtxBarrHits collection");
+// System.out.println("Adding "+ebhits.size()+" hits to RecVtxBarrHits collection");
event.put("RecVtxBarrHits",ebhits,TrackerHit.class,0);
- System.out.println("Adding "+eehits.size()+" hits to RecVtxEndcapHits collection");
+// System.out.println("Adding "+eehits.size()+" hits to RecVtxEndcapHits collection");
event.put("RecVtxEndcapHits",eehits,TrackerHit.class,0);
event.put("RecVtxRawHits",rawhits,RawTrackerHit.class,(1 << LCIOConstants.RTHBIT_HITS));
// event.put("RecVtxRawHits",rawhits,RawTrackerHit.class,0);
+ if(doHist)
+ {
+ int nrechits = 0;
+ nrechits+=ebhits.size();
+ nrechits+=eehits.size();
+ aida.cloud1D("total number of reconstructed VTX hits per event").fill(nrechits);
+ aida.cloud1D("total number of raw VTX hits per event").fill(tnrawhpe);
+ endtime = System.currentTimeMillis();
+ proctime=endtime-startime;
+ aida.cloud1D("pixsim event processing time, ms ").fill(proctime);
+ }
} // end function process