acd software review
DESCRIPTION
ACD Software review. Phase I Walkthrough of major ACD software compontents. Jan. 24 2008. Outline. Overview Tasks of ACD software Code organization Calibrations Data structures and storage [in CalibData, CalibSvc] Access to calibrations [AcdCalibSvc and AcdSimCalibSvc] - PowerPoint PPT PresentationTRANSCRIPT
Eric Charles
ACD Software review
Phase IWalkthrough of major ACD software
compontents
Jan. 24 2008
Outline
OverviewTasks of ACD softwareCode organization
Calibrations Data structures and storage [in CalibData, CalibSvc]Access to calibrations [AcdCalibSvc and AcdSimCalibSvc]Acd calibration definitions and functions [AcdUtil/AcdCalib*]
Storing digi data [Event/AcdDigi]Signal simulation [AcdDigiAlg]Reconstruction [AcdRecon]
Applying calibrations [AcdPha2MipTool]Track based recon [AcdPocaTool, AcdTkrIntersectTool]
Storing recon data: [Event/AcdRecon]Extracting stuff for merit files [AcdValsTool]Generating Calibrations: [calibGenACD]
Tasks of ACD software
Handle calibrationsAccess calibrations in Gaudi (CalibData/Acd, CalibSvc)Generate calibrations (calibGenACD)
Store dataTDS (Event/Digi/AcdDigi, Event/Recon/AcdRecon)ROOT (digiRootData/AcdDigi, reconRootData/AcdRecon)
Simulating detector responseMaking digis in Monte Carlo events (AcdDigi)
Reconstruct eventsGeometrical calculations (AcdRecon)
Filling Merit ntupleExtracting data from TDS (AnalysisNtuple/AcdValsTool)
Various Pieces of ACD software
Event/ACDreconRootData/Acd*
digiRootData/Acd*
CalibData/Acd
AcdUtil/AcdGeomMap
AcdUtil/AcdCalibFuncs AcdRecon/AcdReconFuncs
AcdRecon/AcdReconStruct
AcdReconAlgAcdDigiAlgcalibGenACD/apps
AcdPha2MipTool
AcdPocaTool
AcdTkrIntersectionTool
RootConvert
AcdDigiUtil
Tools and LibrariesPublic Data
Algs & Apps
Internal Data
AcdValsTool
MeritTuple
ACD calibrations
Seven types of calibrationsPedestalsGains (a.k.a. MIP peaks)High range PHA -> MIPCoherent readout noise effect on pedestalVeto ThresholdCNO ThresholdRange crossover
All calibration are very similarA few numbers for each PMTRecycle as much technology as possible
Not used in reconstruction, MC only
CalibData/Acd
All calibrations are PMT basedA few floats and a status flag
CalibData::AcdCalibDescription captures this Gives names to each of the floats in order
E.g. “mean”, “width”, or “veto”, “width”
CalibData::AcdCalibObj stores calib constantsJust stored as a vector
Need AcdCalibDescription to give names to each slot
Sub-class of AcdCalibObj for each calibration typeJust there to provide fast access functions
getMean() { return operator[](0); }getWidth() { return operator[](1); }
More on CalibData and CalibSvc
CalibData/AcdCalibBase does all the workJust a map to associate calibrations with pmt IDsStores data as vectors of <AcdCalibObj*>
Template CalibData/AcdCalib<CalibObjType>This is just there for type safetyForces use to get the right type of calibration
Reuse same trick in CalibSvcBase class XmlAcdBaseCnv reads all the xml expect for the actual calibration constants
All the channel ID and headersTemplate XmlAcdCnv<T> read the calibration constants
Uses AcdCalibDescription to know what attributes to expect
AcdCalibSvc and AcdSimCalibSvc
AcdUtil provides two services to get calibrationsBoth are used in MC jobs, allows user different calibrations to generate and simulate
AcdCalibSvc (for reconstruction)Pedestals, Gains, High Range, CoherentNoise
AcdSimCalibSvc (for simulation)Also Veto & CNO thresholds, Range crossover
Reuse same trick with templatesBase class AcdCalibMgr talks to the CalibDataSvc
Handles all the caching and validity checkingTemplate AcdCalibMgrTmpl<T> provides the type safety
One AcdCalibMgrTmpl<T> per calibration type
Using the Acd*CalibSvc
Several Job options, somewhat confusingDefaultFlavor [“ideal”]
Used for all calibrations unless overriddenFlavorXXX [“”]
Null string means use default, otherwise override
“ideal” doesn’t access DB, just uses pre-defined values
AcdDigi
AcdId m_id;const char* m_tileName;int m_tileNumber;VolumeIdentifier m_volId;double m_energy;unsigned short m_pha[2];bool m_veto[2];bool m_low[2];bool m_high[2];Range m_range[2];ParityError m_error[4];
High range is set by board, not by PMT
This is the MC energy
4 versions of same information
AcdDigi merges data from both PMTs attachedto a single tile or ribbon
By design, data content is superset of data coming offdetector
AcdDigiAlg overviewTask: to simulate Acd electronics responseInput: energy deposited in element from GEANT
Event::McPositionHitColOutput: full AcdDigi collection
Pulse height, Veto, CNO, zero suppression discriminators
Ancillary inputs:From xml file
Conversion from MeV -> p.e. Conversion from p.e. -> mips Zero suppression threshold (in PHA -> converted to mips)Edge effects
From Calibrations DBPedestal (in PHA) MIP peak (in PHA above Pedestal) Range crossover value (in PHA ->converted to mips)Veto threshold (in PHA->converted to mips)CNO threshold (in PHA->converted to mips)High Range gain and saturationCoherent noise effect ( in PHA )
AcdDigiAlg Algorithm
p.e. nominal
Readout range
HIGH range PHA
Event::AcdDigi
Event::McPositionHit (Energy in MeV)
p.e. observed
Signal in MIP
Conversion to p.e.
Poisson Stats & dynode chain
Conversion to MIPs
Range Calibration
High Range CalibrationLOW range PHAPedestals
Gains (aka MIPs)
VETO CNO
Veto Calibration
CNO Calibration
Accept Map BitZero Sup.
AcdReconAlg overviewTask: to do all ACD reconstrucitonInput: Tracks and AcdDigis
Event::TrkTrackColEvent::AcdDigiCol
Output: full AcdRecon dataEvent::AcdHitCol -> calibrated signalsEvent::AcdTkrHitPocaCol -> track/hit associationsEvent::AcdTkrGapPocaCol -> track/gap associationsEvent::AcdTrkIntersectionCol -> track extrapolations to GEANT modelEvent::AcdTkrPointCol -> track extrapolations to ACD volume
Ancillary inputs:From job options
Cuts on signal sizeFrom xmlGeoDbs
ACD detector geometry From Calibrations DB
Pedestal (in PHA) MIP peak (in PHA above Pedestal) High Range gain and saturationCoherent Noise effect (in PHA)
AcdReconAlg algorithmEvent::AcdDigiCol
AcdRecon::TrackData
AcdRecon::PocaDataMap
Event::AcdRecon::m_active*
vector<Event::AcdTkrIntersection*>
vector<Event::AcdHit*>
vector<Event::AcdTkrGapPoca*>set<Event::AcdTkrHitPoca*>
Event::TkrTrackCol
AcdRecon::ExitData
AcdRecon::PocaDataMap
AcdPha2MipTool
Extract params
Find lat exit pointCalculate all POCAs
Propagate track
Apply calibrations
AcdPocaToolLatch best act_distFilter POCAs
AcdTrkIntersectionTool
Find doca w.r.t GapsProject errorsIntersect w/ GEANT model
AcdRecon code elements
AcdRecon/AcdReconStructAll the internal data structures
AcdRecon/AcdReconFuncsA bunch of functions to do geometrical calculations
AcdRecon/AcdPha2MipToolTo convert AcdDigi to AcdHit using calibrations
AcdRecon/AcdPocaToolTo do POCA calculations
AcdRecon/AcdTrkIntersectToolTo use G4Propagator to extend tracks, calculate error matrices
Calibrated ACD Hits
Just want to keep track of the pulses in terms of MIPs,
rather than ADC countsEvent::AcdHit {
AcdId m_tileId; // which tile was hit
ushort m_pha[2]; // Digi level data for both PMT ushort m_flags[2] // Veto, Accept bits, error flags for both PMT float m_mips[2]; // calibrated values for both PMT}
ACD hit flags
These flags are defined so far:PMT_ACCEPT // pmt is above zero suppression threshold PMT_VETO // pmt fired veto discriminatorPMT_CNO // pmt fired CNO discriminatorPMT_RANGE // pmt was read out in high rangePMT_ODD_PARITY_ERROR // pmt has parity errorPMT_HEADER_PARITY_ERROR // parity error in headerPMT_DEAD // pmt was dead or masked off PMT_HOT // pmt was hot
Maybe others such as:PMT_IN_ROI // pmt was used in making an ROI coincidence
Some of these require non-acd dataPMT_DEAD, PMT_HOT could require offline tables
Leave it for now
Associations Between Tracks and ACD hits
We want to keep track of which track come close to which hit ACD elementFor each track with an arbitrary distance of a hit ACD element we can store
Event::AcdTkrHitPoca { AcdId m_tileId; // which tile was hit int m_trkId; // which track did the hitting Event::AcdTkrLocalCoords { float m_local[XY]; // Position where track crossed element plane float m_local[XY]Cov; // Covariance on that positions float m_pathLength; // path length in sensor float m_cosTheta; // Angle of track w.r.t. element plane int m_region; // which part of element } Event::AcdPocaData { double m_arcLength; // distance from POCA to tile plane
float m_doca, m_docaErr; // the active distance and the error on it Point m_poca; // 3D global postion of POCA Vector m_pocaVector; // Vector from POCA to element edge }}
Track Extrapolation to ACD
Top View
m_arcLengthToISect;
m_position;
Last Hit in Tracker
y
x
m_localX;m_localY;
m_localXXCov;m_localXYCov;m_lcoalYYCov;
m_pathLengthInTile;
Associations Between Tracks and ACD hits
m_arcLengthToISect;m_position;m_params;
Last Hit in Tracker
m_doca
Much more to AcdRecon
How to handle gapsStored in AcdTkrGapPocaCalculated in AcdTkrIntersectToolWhat about screw holes?
Track Error projection?How to handle bent tiles
Ambiguity about active distance around bent part
Plane v. 3D POCA calculationsCurrently meaning changes inside tile v. outside tileUsing track error projections might get rid of this
Details about using G4PropagatorSort PocaData objects by path lengthNeed to seed it, how good is energy estimate?
AcdValsTool
This Tool is simple, just extracts stuff from AcdRecon
Loop over AcdTkrHitPoca objects and extract:Largest active distance for all tracks and tilesLargest active distance for all tiles and best trackEnergies deposited in said tiles
Loop over AcdTkrGapPoca objects and extract:Smallest DOCA to gap for all ribbons and tracksSmallest DOCA to gap for all ribbons and best track
Variety of other quantitiesSummary statistics
Numbers of hit tiles, ribbonsTotal energy deposited
Generating calibrations w/ calibGenACD
Framework to make calibrationsAll calibrations are PMT based
Share lots of tools. Basically fill histograms for each PMT then fit them all at the event of the event loop
For each calibrations type, may want try a couple different fitting methodsStore all calibrations in xml files
Standalone apps to run calibrations.calibGenACD/apps
runPedestal.exerunMuonCalib_Svac.exerunVetoCalib.exerunCnoCalib.exerunRangeFit.exerunCoherentNoise.exe
Status, to do:
Code is fairly well developedStill not totally stableNeed better testing proceduresNeed performance benchmarks
Some obvious points of workCode cleanup, adhering to GLAST conventionsTrack error projectionImplementing CNO calibration generation
More subtle issuesMoving to more global use of ACD in merit tuple
Considering both signal size and active distance when deciding to which track / tile pair to storeCatching tracking errors
ACD hit patterns that implyMore studies of how to handle backsplash