| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

FilterExample.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Example of filter the recon data from a file containing raw and
00004 # reconstructed data.
00005 #
00006 # Usage:
00007 #   nuwa.py -o reconData.root DybAlg.FilterExample fullData.root
00008 #
00009 
00010 # Load GaudiPython
00011 from DybAlg.FilterAlgs import FilterAlg, CoincidenceFilterAlg
00012 import GaudiKernel.SystemOfUnits as units
00013 
00014 def configure():
00015     return
00016 
00017 def run(app):
00018     '''
00019     Add filtering algorithm to the job
00020     '''
00021     # Store all Recon data
00022     reconFilter = FilterAlg("ReconFilter")
00023     reconFilter.OutputLevel = 1
00024     reconFilter.ClearStore = True  # First filter should clear storage
00025     reconFilter.StorePath = "/Event/Rec/RecHeader"
00026     app.addAlgorithm(reconFilter)
00027 
00028     # Save simulation and readout data with a prescale.
00029     singlesReadoutFilter = FilterAlg("SinglesReadoutFilter")
00030     singlesReadoutFilter.OutputLevel = 1
00031     # Secondary filters shouldn't re-clear storage
00032     singlesReadoutFilter.ClearStore = False 
00033     singlesReadoutFilter.StorePath = "/Event/Readout/ReadoutHeader"
00034     singlesReadoutFilter.Prescale = 0.01
00035     app.addAlgorithm(singlesReadoutFilter)
00036     
00037     # Save readouts if both within coincidence time window
00038     coincFilter = CoincidenceFilterAlg("CoincidenceFilter")
00039     coincFilter.OutputLevel = 1
00040     #coincFilter.StorePaths = ["/Event/Readout/ReadoutHeader"]
00041     coincFilter.StorePaths = ["/Event/Readout/ReadoutHeader",
00042                               "/Event/SimReadout/SimReadoutHeader",
00043                               "/Event/SimTrig/SimTrigHeader",
00044                               "/Event/Elec/ElecHeader",
00045                               "/Event/Sim/SimHeader",
00046                               "/Event/Gen/GenHeader"]
00047     coincFilter.CoincidenceWindow = 15.0 * units.millisecond
00048     # Tag coincidences in same AD only
00049     # coincFilter.AdOnly = True
00050     # Tag coincidences in any detector, as long as prompt/delayed in same det.
00051     # coincFilter.SameDetectorOnly = True
00052     # Tag coincidences in a list of detectors
00053     coincFilter.DetectorNames = ["DayaBayAD1", "DayaBayAD2"]
00054     # Save other detector readouts between prompt/delayed readouts
00055     coincFilter.SaveIntermediate = True
00056     # Save readouts occuring in other detectors in small time window
00057     # before prompt.
00058     coincFilter.SaveNeighbors = True
00059     coincFilter.NeighborWindow = 1.0 * units.microsecond
00060     app.addAlgorithm(coincFilter)
00061     pass
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:40:40 2011 for DybAlg by doxygen 1.4.7