This page presents an attempt to use the trigger TEM diagnostic information to recognize calorimeter ghost signal.
Pass 8 Recon & Analysis Upgrades Weekly Meeting Agenda
Summary
- Code and method
- Overlay energy for tagged clusters (MonteCarlo AG)
- Efficiency with Periodic Triggers
- Effect on Flight Data IMPORTANT
- Ghost number and cluster classification
- Event display
Information available
- The TEM trigger diagnostic information provides trigger information on CalLo and CalHi per each layer end.
- From Sasha:
The code example for accessing CAL diagnostic info I can recommend you is the algorithm from calibGenCAL package used for trigger thresholds measurement:
/afs/slac/g/glast/users/chehtman/calibGenCAL_analysis/calibGenCAL/calibGenCAL-05-06-00/src/lib/Algs/LPATrigAlg.cxx
The method
LPATrigAlg::fillTrigBitArray()
just extracts CAL trigger bits from a digi file and puts them into some local structure. - As a reminder, CalLo is at 100 MeV and CalHi at 1 GeV.
Analysis
Code and method
- Starting from Sasha's example, I wrote a piece of code that does the following:
- open digi, recon, merit and relation files
- reads digi to create two arrays of layer end trigger bits [tower][layer][face] , one for CalLo and one for CalHi
- open recon and loop on clusters, then for each cluter
- open the corresponding crystal collection
- check if any crystal end has more than 100 MeV (or whatever other threshold)
- if any, then look if the corresponding layer end has a trigger bit set
- if not so, fill in a map of missing trigger bits and add 1 to a so called "cal ghost number"
- for each cluster, the higher the ghost number, the higher the probability that it's a ghost... but it looks like that above 2, they're all ghosts.
- Basic version of the code: tagghosts.C
- Another version of the code, algorithm is the Johan's one, but output is a tree with number of tagged xtals and sum-of-energy of tagged xtals for the first 3 cluster tagghosts_v1.C .
Overlay energy for tagged clusters (MonteCarlo AG)
I run the tagghosts_v1.C on the 100 AG-GR-v19r4p1gr14-OVL, and looked at the Overlay energy in the first and second cluster vs. the ghost-tagged energy.
The selection is just trigger and filter and CalNumClusters>0. I also required that there is at least 1 tagged xtals, if there are no such xtlas there is nothing to say.
Few details on the algorithm:
- There are two tagging options: conservative (if both xtal ends are ghost-like) and permissive (if at least one xtal end is ghost-like).
- I used permissive since purity is high and efficiency looks low (see below).
- The energy threshold for tagging a xtal end is set to 120 MeV (no good reason for this number, need to be optimized).
Here the plots for first (left) and second (right) cluster.
The next step is check if we can lower the energy threshold down to the nominal 100 MeV to increase the efficiency.
If the energy is too low we can tag good xtals as ghost.
I made few reprocessing of the AG-GR-v19r4p1gr14-OVL with threshold at 120, 110, 105, 100 MeV, and plotted the Overlay energy fraction in the first cluster vs. the fraction of ghost-tagged energy.
Same selection as before, including the request of at least one tagged xtals.
The plots below show the permissive case (left) and the conservative case (right) for the 4 energy thresholds.
The higher the number of events in the plot, the higher the efficiency we can expect.
Note that the conservative case is always worse than the permissive case.
In the highest efficiency case (permissive, 100 MeV), there are few events with overlay energy = 0.
My personal best choice, among these, is permissive 105 MeV. That's why I put another plot here:
My first conclusions are:
- Johan algorithm works fine!
- Clusters with at least one ghost-tagged xtal tend to have large overlay energy.
- Only in one case the overlay energy is 0 and there is some ghost-tagged xtal (mostly connected to the energy threshold). The 'purity' of such selection is ~1.
- Efficiency is low. We can't tag a good fraction of ghost clusters in this way. (this was just the energy dependence of the efficiency, no request on min overlay energy here)
- There are few events with low overlay energy and low ghost-tagged energy. After looking at event displays I think we can consider good cluster is the ghost-tagged energy is <~3%
- My suggestion for ghost tagging ghost clusters is "TagGhostNumXtals>0 && (TagGhostRawEnergySum/CalRawEnergySum)> 0.03"
- This is valid for permissive E >= 105 MeV.
- We can include this algorithm just after clustering, and then tag ghost clusters. Not sure how we should use this info:
- Select best cluster only if non ghost-tagged - what happen if the best cluster is also a ghost (i.e. there are no other options?)?
- Use this info in tracking ( e.g. knowing that the direction is likely to be wrong). Need Tracy here...
- Use in event-level analysis to select events with useless cal information (and treat them as tracker only if possible)
Efficiency with Periodic Triggers
I used the periodic triggers in the Calibration datasets (provided by Johan) to test the efficiency of a pure sample of ghosts.
The dataset used is Periodic_CalGhost, 50 files reprocessed with v19r4p1gr07 (not the latest, but the most recent in the DataCatalog ). It has a cut on Cal deposited energy > 5 MeV.
The efficiency plot is easy: number of events selected by "TagGhostNumXtals>0 && (TagGhostRawEnergySum/CalRawEnergySum)> 0.03" divided by the total number of events.
The the plots for the permissive case (left) and conservative case (right):
The max efficiency is ~84% is reached after RawEnergy ~ 3 GeV.
I checked the effect of the request of some fraction of ghost-tagged energy (if looked necessary from AG hand scan).
The scan from 0 to 3% is in the plot below:
The effect is on the high energy side (>10 GeV) and reduces the efficiency of few percents.
Effect on Flight Data
A test sample is selected in order to see the effect of tagging algorithm on real gamma-ray in flight data
I reprocessed the first 1.5M event of a single full run with a lot of Earth Limb in it: r0324551768
Digi/Recon/merit are taken from DataCatalog, so no pass8 reprocessing is applied (not important for this test).
A cut is applied to select good gamma rays:
"FswGamState==0 && TkrNumTracks > 0 && CalEnergyRaw > 5 && CalCsIRLn>4 && CTBCORE>0 && CTBBestEnergyProb>0.1 && CTBClassLevel>2 && FT1ZenithTheta>112 && FT1ZenithTheta<115"
Cal xtals are tagged with the most conservative algorithm described above: energy >120MeV and no cal_lo trigger in both xtal ends.
Top panel of plot below shows the distribution of (log10 of) deposited energy for:
all sample, events with at least 1 ghost-tagged xtal, events with at least 1 ghost-tagged xtal & > 50% of ghost-tagged energy fraction
Bottom panel of plot below shows the correlation between number of ghost-tagged xtals and ghost-tagged energy (zero suppressed)
It looks like that almost all good gamma events have at least one ghost-tagged xtal and even requiring a large ghost-tagged energy we select a large fraction of events
I also looked at a couple of events that are "ghosty" according to this algorithm:
they look like perfect gamma-ray in which also the old reconstruction works fine
Evt Id 130047 |
Evt Id 333286 |
|
|
8 tagged xtals |
32 tagged xtals |
In conclusion, this algorithm cannot be applied to flight data.
Ghost number and cluster classification
- tbd
Event display
AG v19r4p1gr13 with OVL |
AG v19r4p1gr13 with OVL |
|
|
blue is the 1st cluster, is a ghost and has a ghost number of 3, |
blue is the 1st cluster and is the good gamma, |
Reason for change
The main thing is the switch to the new ft2 format and addition of a mechanism to flag part of a run as bad. LONE-170@JIRA
Handle the 2012/06/30 leap second. LONE-177@JIRA
Retry when testing file existence. LONE-166@JIRA
Optionally ignore some deliveries when merging run-level files.
Test Procedure
We have processed LPA and LCI runs in the DEV pipeline with this version of L1Proc.
Rollback procedure
We can easily switch back to the previous version of L1Proc, if needed.
CCB Jira
SSC-316@JIRA
Details
Complete set of tags for L1Proc 3.3
GlastRelease (sim/recon): GlastRelease-17-35-24-lp22
ScienceTools (Level 2): ScienceTools-09-27-01
svac/L1Pipeline: L1Pipeline-03-03-00
calibGenTKR: calibGenTKR-04-08-01
calibTkrUtil: calibTkrUtil-02-09-06-gr02
fitsGen: fitsGen-06-03-00
dataMonitoring/AlarmsCfg: AlarmsCfg-06-00-05
dataMonitoring/Common: Common-06-11-04
dataMonitoring/DigiReconCalMeritCfg: DigiReconCalMeritCfg-01-20-02
dataMonitoring/FastMon: FastMon-05-02-01
dataMonitoring/FastMonCfg: FastMonCfg-02-02-01
datMonitoring/IGRF: IGRF-02-01-00
svac/Monitor: Monitor-02-00-01
svac/EngineeringModelRoot: EngineeringModelRoot-05-00-00
svac/TestReport: TestReport-12-00-00
svac/findGaps: findGaps-02-02-00
users/richard/pipelineDatasets: pipelineDatasets-01-00-00
ft2Util: ft2Util-02-00-03
evtClassDefs: evtClassDefs-00-19-04
GPLtools: GPLtools-02-00-00-wf02
ROOT: ROOT v5.26.00a-gl6
Reason for change
This release has a few minor tweaks for dealing with trunc64 runs. It also features a better handling of xrootd errors.
Test Procedure
We have processed LPA and LCI runs in the DEV pipeline with this version of L1Proc. The new GR passed the system tests when compared with the old one.
Rollback procedure
We can easily switch back to the previous version of L1Proc, if needed.
CCB Jira
Details
GlastRelease-17-35-24-lp22
- there are a few differences between 17-35-24-lp22 and 17-35-24-gr15
- we ran systests comparing 17-35-24-lp22 to 17-35-24-gr15 and they agree (hhttp://glast-ground.slac.stanford.edu/SystemTests/?releaseVersionId=13201)
- the full list of changes for 17-35-24-lp22 is the following:
- EventIntegrity-00-08-05-gr02: check for all possible error codes in EventIntegrityAlg
- ldfReader-07-04-11: patch printing FIFO Full error; patch all the fprintf statements
- RootIo-24-05-00-rp02: add logging messages for root file open failures; add ROOT error check before run event loop
ROOT v5.26.00a-gl6
- tweak to xrootd to avoid a 5 minute timeout which apparently occurs when xroot servers are rebooted
dataMonitoring/Common-06-11-04
- Bug fix in pErrorLogger.py (was crashing due to a mismatched tag for files with no events with errors, e.g. the verify log).
- pErrorLogger.py modified in order not to crash with huge input xml files (this first came out with the first trunc64 test).
svac/L1Pipeline-03-02-00
- New GR, new ROOT version, new Common
Complete set of tags for L1Proc 3.2
GlastRelease (sim/recon): GlastRelease-17-35-24-lp22
ScienceTools (Level 2): ScienceTools-09-24-00
svac/L1Pipeline: L1Pipeline-03-02-00
calibGenTKR: calibGenTKR-04-08-01
calibTkrUtil: calibTkrUtil-02-09-06-gr02
fitsGen: fitsGen-06-02-04
dataMonitoring/AlarmsCfg: AlarmsCfg-06-00-05
dataMonitoring/Common: Common-06-11-04
dataMonitoring/DigiReconCalMeritCfg: DigiReconCalMeritCfg-01-20-02
dataMonitoring/FastMon: FastMon-05-02-01
dataMonitoring/FastMonCfg: FastMonCfg-02-02-01
datMonitoring/IGRF: IGRF-02-01-00
svac/Monitor: Monitor-02-00-01
svac/EngineeringModelRoot: EngineeringModelRoot-05-00-00
svac/TestReport: TestReport-12-00-00
svac/findGaps: findGaps-02-02-00
users/richard/pipelineDatasets: pipelineDatasets-01-00-00
ft2Util: ft2Util-01-02-33
evtClassDefs: evtClassDefs-00-19-04
GPLtools: GPLtools-02-00-00
ROOT: ROOT v5.26.00a-gl6