Commit in hps-java/src/main/java/org/lcsim/hps/recon/ecal on MAIN | |||
HPSEcalClusterer.java | +4 | -1 | 1.21 -> 1.22 |
HPSEcalConditions.java | +7 | -7 | 1.12 -> 1.13 |
HPSEcalRawConverterDriver.java | +12 | -2 | 1.10 -> 1.11 |
HPSEcalReadoutDriver.java | +131 | -132 | 1.16 -> 1.17 |
TestRunTriggerDriver.java | +3 | -3 | 1.1 -> 1.2 |
HPSEcalCTPClusterer.java | +9 | -2 | 1.4 -> 1.5 |
+166 | -147 |
various tweaks for PAC trigger study
diff -u -r1.21 -r1.22 --- HPSEcalClusterer.java 4 Jun 2012 23:03:58 -0000 1.21 +++ HPSEcalClusterer.java 21 Jun 2012 18:49:52 -0000 1.22 @@ -23,7 +23,7 @@
* @author Jeremy McCormick <[log in to unmask]> * @author Tim Nelson <[log in to unmask]> *
- * @version $Id: HPSEcalClusterer.java,v 1.21 2012/06/04 23:03:58 meeg Exp $
+ * @version $Id: HPSEcalClusterer.java,v 1.22 2012/06/21 18:49:52 meeg Exp $
*/ public class HPSEcalClusterer extends Driver {
@@ -53,6 +53,9 @@
public void setAddEMin(double addEMin) { this.addEMin = addEMin;
+ if (seedEMin < addEMin) { + seedEMin = addEMin; + }
} public void setEcalCollectionName(String ecalCollectionName) {
diff -u -r1.12 -r1.13 --- HPSEcalConditions.java 11 Jun 2012 22:54:48 -0000 1.12 +++ HPSEcalConditions.java 21 Jun 2012 18:49:52 -0000 1.13 @@ -17,7 +17,7 @@
/** * * @author meeg
- * @version $Id: HPSEcalConditions.java,v 1.12 2012/06/11 22:54:48 meeg Exp $
+ * @version $Id: HPSEcalConditions.java,v 1.13 2012/06/21 18:49:52 meeg Exp $
*/ public class HPSEcalConditions extends Driver {
@@ -239,16 +239,16 @@
return daqToPhysicalMap.get(getDaqID(crate, slot, channel)); }
- public static int getCrate(long physicalID) { - return (int) (physicalID >>> 32);
+ public static int getCrate(long daqID) { + return (int) (daqID >>> 32);
}
- public static short getSlot(long physicalID) { - return (short) ((physicalID >>> 16) & 0xFFFF);
+ public static short getSlot(long daqID) { + return (short) ((daqID >>> 16) & 0xFFFF);
}
- public static short getChannel(long physicalID) { - return (short) (physicalID & 0xFFFF);
+ public static short getChannel(long daqID) { + return (short) (daqID & 0xFFFF);
} public static Long physicalToDaqID(long physicalID) {
diff -u -r1.10 -r1.11 --- HPSEcalRawConverterDriver.java 6 Jun 2012 18:29:01 -0000 1.10 +++ HPSEcalRawConverterDriver.java 21 Jun 2012 18:49:52 -0000 1.11 @@ -2,8 +2,6 @@
import java.util.ArrayList; import java.util.List;
-import org.lcsim.detector.identifier.IExpandedIdentifier; -import org.lcsim.detector.identifier.IIdentifierHelper;
import org.lcsim.event.CalorimeterHit; import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit;
@@ -26,12 +24,17 @@
boolean debug = false; double threshold = Double.NEGATIVE_INFINITY; boolean applyBadCrystalMap = true;
+ boolean dropBadFADC = false;
public HPSEcalRawConverterDriver() { converter = new HPSEcalRawConverter(); }
+ public void setDropBadFADC(boolean dropBadFADC) { + this.dropBadFADC = dropBadFADC; + } +
public void setThreshold(double threshold) { this.threshold = threshold; }
@@ -71,6 +74,11 @@
return HPSEcalConditions.badChannelsLoaded() ? HPSEcalConditions.isBadChannel(hit.getCellID()) : false; }
+ public boolean isBadFADC(CalorimeterHit hit) { + long daqID = HPSEcalConditions.physicalToDaqID(hit.getCellID()); + return (HPSEcalConditions.getCrate(daqID)==1 && HPSEcalConditions.getSlot(daqID)==3); + } +
@Override public void process(EventHeader event) { ArrayList<CalorimeterHit> newHits = new ArrayList<CalorimeterHit>();
@@ -82,6 +90,7 @@
for (RawTrackerHit hit : hits) { CalorimeterHit newHit = converter.HitDtoA(hit); if(applyBadCrystalMap && isBadCrystal(newHit)) continue;
+ if (dropBadFADC && isBadFADC(newHit)) continue;
if (newHit.getRawEnergy() > threshold) { newHits.add(newHit); }
@@ -94,6 +103,7 @@
CalorimeterHit newHit = converter.HitDtoA(hit, integralWindow); if (newHit.getRawEnergy() > threshold) { if(applyBadCrystalMap && isBadCrystal(newHit)) continue;
+ if (dropBadFADC && isBadFADC(newHit)) continue;
newHits.add(newHit); } }
diff -u -r1.16 -r1.17 --- HPSEcalReadoutDriver.java 3 Apr 2012 17:02:35 -0000 1.16 +++ HPSEcalReadoutDriver.java 21 Jun 2012 18:49:52 -0000 1.17 @@ -15,141 +15,140 @@
* Performs readout of ECal hits. * * @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalReadoutDriver.java,v 1.16 2012/04/03 17:02:35 meeg Exp $
+ * @version $Id: HPSEcalReadoutDriver.java,v 1.17 2012/06/21 18:49:52 meeg Exp $
*/ public abstract class HPSEcalReadoutDriver<T> extends Driver {
- Subdetector ecal; - String ecalCollectionName; - String ecalName; - String ecalRawCollectionName = "EcalRawHits"; - String ecalReadoutName = "EcalHits"; - Class hitClass; - //hit type as in org.lcsim.recon.calorimetry.CalorimeterHitType - int hitType = 0; - //number of bunches in readout cycle - int readoutCycle = 1; - //minimum readout value to write a hit - double threshold = 0.0; - //LCIO flags - int flags = 0; - //readout period in ns - double readoutPeriod = 2.0; - //readout period time offset in ns - double readoutOffset = 0.0; - //readout period counter - int readoutCounter; - public static boolean triggerBit = false; - - public HPSEcalReadoutDriver() { - flags += 1 << LCIOConstants.CHBIT_LONG; //store position - flags += 1 << LCIOConstants.RCHBIT_ID1; //store cell ID - - } - - public void setEcalReadoutName(String ecalReadoutName) { - this.ecalReadoutName = ecalReadoutName; - } - - public void setEcalRawCollectionName(String ecalRawCollectionName) { - this.ecalRawCollectionName = ecalRawCollectionName; - } - - public void setEcalCollectionName(String ecalCollectionName) { - this.ecalCollectionName = ecalCollectionName; - } - - public void setEcalName(String ecalName) { - this.ecalName = ecalName; - } - - public void setReadoutCycle(int readoutCycle) { - this.readoutCycle = readoutCycle; - if (readoutCycle > 0) { - this.readoutPeriod = readoutCycle * ClockSingleton.getDt(); - } - } - - public void setReadoutOffset(double readoutOffset) { - this.readoutOffset = readoutOffset; - } - - public void setReadoutPeriod(double readoutPeriod) { - this.readoutPeriod = readoutPeriod; - this.readoutCycle = -1; - } - - public void setThreshold(double threshold) { - this.threshold = threshold; - } - - public void startOfData() { - if (ecalCollectionName == null) { - throw new RuntimeException("The parameter ecalCollectionName was not set!"); - } - - if (ecalName == null) { - throw new RuntimeException("The parameter ecalName was not set!"); - } - - readoutCounter = 0; - - initReadout(); - } - - public void detectorChanged(Detector detector) { - // Get the Subdetector. - ecal = detector.getSubdetector(ecalName); - } - - public void process(EventHeader event) { - //System.out.println(this.getClass().getCanonicalName() + " - process"); - // Get the list of ECal hits. - List<CalorimeterHit> hits = event.get(CalorimeterHit.class, ecalCollectionName); - if (hits == null) { - throw new RuntimeException("Event is missing ECal hits collection!"); - } - - //write hits into buffers - putHits(hits); - - ArrayList<T> newHits = new ArrayList<T>(); - - //if at the end of a readout cycle, write buffers to hits - if (readoutCycle > 0) { - if ((ClockSingleton.getClock() + 1) % readoutCycle == 0) { - readHits(newHits); - readoutCounter++; - } - } else { - while (ClockSingleton.getTime() - readoutTime() + ClockSingleton.getDt() >= readoutPeriod) { - readHits(newHits); - readoutCounter++; - } - } - - event.put(ecalRawCollectionName, newHits, hitClass, flags, ecalReadoutName); - - if (triggerBit) { - processTrigger(event); - triggerBit = false; - } - } - - protected double readoutTime() { - return readoutCounter * readoutPeriod + readoutOffset; - } - - //read analog signal out of buffers and make hits; reset buffers - protected abstract void readHits(List<T> hits); - - //add deposited energy to buffers - //must be run every event, even if the list is empty - protected abstract void putHits(List<CalorimeterHit> hits);
+ Subdetector ecal; + String ecalCollectionName; + String ecalName; + String ecalRawCollectionName = "EcalRawHits"; + String ecalReadoutName = "EcalHits"; + Class hitClass; + //hit type as in org.lcsim.recon.calorimetry.CalorimeterHitType + int hitType = 0; + //number of bunches in readout cycle + int readoutCycle = 1; + //minimum readout value to write a hit + double threshold = 0.0; + //LCIO flags + int flags = 0; + //readout period in ns + double readoutPeriod = 2.0; + //readout period time offset in ns + double readoutOffset = 0.0; + //readout period counter + int readoutCounter; + public static boolean triggerBit = false; + + public HPSEcalReadoutDriver() { + flags += 1 << LCIOConstants.CHBIT_LONG; //store position + flags += 1 << LCIOConstants.RCHBIT_ID1; //store cell ID + + } + + public void setEcalReadoutName(String ecalReadoutName) { + this.ecalReadoutName = ecalReadoutName; + } + + public void setEcalRawCollectionName(String ecalRawCollectionName) { + this.ecalRawCollectionName = ecalRawCollectionName; + } + + public void setEcalCollectionName(String ecalCollectionName) { + this.ecalCollectionName = ecalCollectionName; + } + + public void setEcalName(String ecalName) { + this.ecalName = ecalName; + } + + public void setReadoutCycle(int readoutCycle) { + this.readoutCycle = readoutCycle; + if (readoutCycle > 0) { + this.readoutPeriod = readoutCycle * ClockSingleton.getDt(); + } + } + + public void setReadoutOffset(double readoutOffset) { + this.readoutOffset = readoutOffset; + } + + public void setReadoutPeriod(double readoutPeriod) { + this.readoutPeriod = readoutPeriod; + this.readoutCycle = -1; + } + + public void setThreshold(double threshold) { + this.threshold = threshold; + } + + public void startOfData() { + if (ecalCollectionName == null) { + throw new RuntimeException("The parameter ecalCollectionName was not set!"); + } + + if (ecalName == null) { + throw new RuntimeException("The parameter ecalName was not set!"); + } + + readoutCounter = 0; + + initReadout(); + } + + public void detectorChanged(Detector detector) { + // Get the Subdetector. + ecal = detector.getSubdetector(ecalName); + } + + public void process(EventHeader event) { + //System.out.println(this.getClass().getCanonicalName() + " - process"); + // Get the list of ECal hits. + if (event.hasCollection(CalorimeterHit.class, ecalCollectionName)) { + List<CalorimeterHit> hits = event.get(CalorimeterHit.class, ecalCollectionName); + + //write hits into buffers + putHits(hits); + } + + ArrayList<T> newHits = new ArrayList<T>(); + + //if at the end of a readout cycle, write buffers to hits + if (readoutCycle > 0) { + if ((ClockSingleton.getClock() + 1) % readoutCycle == 0) { + readHits(newHits); + readoutCounter++; + } + } else { + while (ClockSingleton.getTime() - readoutTime() + ClockSingleton.getDt() >= readoutPeriod) { + readHits(newHits); + readoutCounter++; + } + } + + event.put(ecalRawCollectionName, newHits, hitClass, flags, ecalReadoutName); + + if (triggerBit) { + processTrigger(event); + triggerBit = false; + } + } + + protected double readoutTime() { + return readoutCounter * readoutPeriod + readoutOffset; + } + + //read analog signal out of buffers and make hits; reset buffers + protected abstract void readHits(List<T> hits); + + //add deposited energy to buffers + //must be run every event, even if the list is empty + protected abstract void putHits(List<CalorimeterHit> hits);
- protected void processTrigger(EventHeader event) { - }
+ protected void processTrigger(EventHeader event) { + }
- //initialize buffers - protected abstract void initReadout();
+ //initialize buffers + protected abstract void initReadout();
}
\ No newline at end of file
diff -u -r1.1 -r1.2 --- TestRunTriggerDriver.java 7 Jun 2012 00:47:31 -0000 1.1 +++ TestRunTriggerDriver.java 21 Jun 2012 18:49:52 -0000 1.2 @@ -9,7 +9,7 @@
* * @author Omar Moreno <[log in to unmask]> * @author Sho Uemura <[log in to unmask]>
- * @version $Id: TestRunTriggerDriver.java,v 1.1 2012/06/07 00:47:31 meeg Exp $
+ * @version $Id: TestRunTriggerDriver.java,v 1.2 2012/06/21 18:49:52 meeg Exp $
*/ public class TestRunTriggerDriver extends HPSTriggerDriver {
@@ -37,9 +37,9 @@
for (HPSEcalCluster cluster : clusters) { if (cluster.getEnergy() > clusterEnergyLow) {
- trigger = true;
+ trigger = true;
+ }
}
- }
if (trigger) { deadtimelessTriggerCount++; }
diff -u -r1.4 -r1.5 --- HPSEcalCTPClusterer.java 4 Jun 2012 23:03:58 -0000 1.4 +++ HPSEcalCTPClusterer.java 21 Jun 2012 18:49:52 -0000 1.5 @@ -29,7 +29,7 @@
* @author Jeremy McCormick <[log in to unmask]> * @author Tim Nelson <[log in to unmask]> * @author Sho Uemura <[log in to unmask]>
- * @version $Id: HPSEcalCTPClusterer.java,v 1.4 2012/06/04 23:03:58 meeg Exp $
+ * @version $Id: HPSEcalCTPClusterer.java,v 1.5 2012/06/21 18:49:52 meeg Exp $
*/ public class HPSEcalCTPClusterer extends Driver {
@@ -44,10 +44,15 @@
// Map of crystals to their neighbors. NeighborMap neighborMap = null; double clusterWindow = -1;
+ double addEMin = 0;
public HPSEcalCTPClusterer() { }
+ public void setAddEMin(double addEMin) { + this.addEMin = addEMin; + } +
public void setClusterWindow(double clusterWindow) { this.clusterWindow = clusterWindow; }
@@ -130,7 +135,9 @@
clusters = new ArrayList<HPSEcalCluster>(); for (CalorimeterHit hit : hits) {
- futureHits.add(hit);
+ if (hit.getRawEnergy() > addEMin) { + futureHits.add(hit); + }
} while (!futureHits.isEmpty()) {
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1