1 / 24

ACD Software review

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]

candid
Download Presentation

ACD Software review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ACD Software review Phase I Walkthrough of major ACD software compontents Jan. 24 2008

  2. Outline • Overview • Tasks of ACD software • Code 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]

  3. Tasks of ACD software • Handle calibrations • Access calibrations in Gaudi (CalibData/Acd, CalibSvc) • Generate calibrations (calibGenACD) • Store data • TDS (Event/Digi/AcdDigi, Event/Recon/AcdRecon) • ROOT (digiRootData/AcdDigi, reconRootData/AcdRecon) • Simulating detector response • Making digis in Monte Carlo events (AcdDigi) • Reconstruct events • Geometrical calculations (AcdRecon) • Filling Merit ntuple • Extracting data from TDS (AnalysisNtuple/AcdValsTool)

  4. Various Pieces of ACD software Algs & Apps calibGenACD/apps AcdDigiAlg AcdReconAlg AcdValsTool digiRootData/Acd* RootConvert Event/ACD reconRootData/Acd* MeritTuple CalibData/Acd Public Data Tools and Libraries AcdTkrIntersectionTool AcdPha2MipTool AcdDigiUtil AcdPocaTool AcdUtil/AcdCalibFuncs AcdRecon/AcdReconFuncs AcdUtil/AcdGeomMap AcdRecon/AcdReconStruct Internal Data

  5. ACD calibrations • Seven types of calibrations • Pedestals • Gains (a.k.a. MIP peaks) • High range PHA -> MIP • Coherent readout noise effect on pedestal • Veto Threshold • CNO Threshold • Range crossover • All calibration are very similar • A few numbers for each PMT • Recycle as much technology as possible Not used in reconstruction, MC only

  6. CalibData/Acd • All calibrations are PMT based • A 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 constants • Just stored as a vector • Need AcdCalibDescription to give names to each slot • Sub-class of AcdCalibObj for each calibration type • Just there to provide fast access functions • getMean() { return operator[](0); } • getWidth() { return operator[](1); }

  7. More on CalibData and CalibSvc • CalibData/AcdCalibBase does all the work • Just a map to associate calibrations with pmt IDs • Stores data as vectors of <AcdCalibObj*> • Template CalibData/AcdCalib<CalibObjType> • This is just there for type safety • Forces use to get the right type of calibration • Reuse same trick in CalibSvc • Base class XmlAcdBaseCnv reads all the xml expect for the actual calibration constants • All the channel ID and headers • Template XmlAcdCnv<T> read the calibration constants • Uses AcdCalibDescription to know what attributes to expect

  8. AcdCalibSvc and AcdSimCalibSvc • AcdUtil provides two services to get calibrations • Both 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 templates • Base class AcdCalibMgr talks to the CalibDataSvc • Handles all the caching and validity checking • Template AcdCalibMgrTmpl<T> provides the type safety • One AcdCalibMgrTmpl<T> per calibration type

  9. Using the Acd*CalibSvc • Several Job options, somewhat confusing • DefaultFlavor [“ideal”] • Used for all calibrations unless overridden • FlavorXXX [“”] • Null string means use default, otherwise override • “ideal” doesn’t access DB, just uses pre-defined values

  10. AcdDigi 4 versions of same information 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]; This is the MC energy High range is set by board, not by PMT AcdDigi merges data from both PMTs attached to a single tile or ribbon By design, data content is superset of data coming off detector

  11. AcdDigiAlg overview • Task: to simulate Acd electronics response • Input: energy deposited in element from GEANT • Event::McPositionHitCol • Output: 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 DB • Pedestal (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 saturation • Coherent noise effect ( in PHA )

  12. AcdDigiAlg Algorithm Event::McPositionHit (Energy in MeV) Conversion to p.e. p.e. nominal Poisson Stats & dynode chain p.e. observed Conversion to MIPs Veto Calibration CNO Calibration Signal in MIP Range Calibration Readout range VETO CNO Gains (aka MIPs) LOW range PHA Pedestals HIGH range PHA High Range Calibration Zero Sup. Accept Map Bit Event::AcdDigi

  13. AcdReconAlg overview • Task: to do all ACD reconstruciton • Input: Tracks and AcdDigis • Event::TrkTrackCol • Event::AcdDigiCol • Output: full AcdRecon data • Event::AcdHitCol -> calibrated signals • Event::AcdTkrHitPocaCol -> track/hit associations • Event::AcdTkrGapPocaCol -> track/gap associations • Event::AcdTrkIntersectionCol -> track extrapolations to GEANT model • Event::AcdTkrPointCol -> track extrapolations to ACD volume • Ancillary inputs: • From job options • Cuts on signal size • From xmlGeoDbs • ACD detector geometry • From Calibrations DB • Pedestal (in PHA) • MIP peak (in PHA above Pedestal) • High Range gain and saturation • Coherent Noise effect (in PHA)

  14. AcdReconAlg algorithm Event::AcdDigiCol Event::TkrTrackCol AcdPha2MipTool Apply calibrations Extract params vector<Event::AcdHit*> AcdRecon::TrackData Calculate all POCAs Find lat exit point AcdRecon::PocaDataMap AcdRecon::ExitData AcdPocaTool Filter POCAs Latch best act_dist AcdRecon::PocaDataMap Event::AcdRecon::m_active* Propagate track AcdTrkIntersectionTool Intersect w/ GEANT model Project errors Find doca w.r.t Gaps vector<Event::AcdTkrIntersection*> set<Event::AcdTkrHitPoca*> vector<Event::AcdTkrGapPoca*>

  15. AcdRecon code elements • AcdRecon/AcdReconStruct • All the internal data structures • AcdRecon/AcdReconFuncs • A bunch of functions to do geometrical calculations • AcdRecon/AcdPha2MipTool • To convert AcdDigi to AcdHit using calibrations • AcdRecon/AcdPocaTool • To do POCA calculations • AcdRecon/AcdTrkIntersectTool • To use G4Propagator to extend tracks, calculate error matrices

  16. Calibrated ACD Hits • Just want to keep track of the pulses in terms of MIPs, rather than ADC counts Event::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 }

  17. ACD hit flags • These flags are defined so far: • PMT_ACCEPT // pmt is above zero suppression threshold • PMT_VETO // pmt fired veto discriminator • PMT_CNO // pmt fired CNO discriminator • PMT_RANGE // pmt was read out in high range • PMT_ODD_PARITY_ERROR // pmt has parity error • PMT_HEADER_PARITY_ERROR // parity error in header • PMT_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 data • PMT_DEAD, PMT_HOT could require offline tables • Leave it for now

  18. Associations Between Tracks and ACD hits • We want to keep track of which track come close to which hit ACD element • For 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 } }

  19. Track Extrapolation to ACD y m_localX; m_localY; x m_pathLengthInTile; m_localXXCov; m_localXYCov; m_lcoalYYCov; Top View m_position; m_arcLengthToISect; Last Hit in Tracker

  20. Associations Between Tracks and ACD hits m_doca m_position; m_params; m_arcLengthToISect; Last Hit in Tracker

  21. Much more to AcdRecon • How to handle gaps • Stored in AcdTkrGapPoca • Calculated in AcdTkrIntersectTool • What about screw holes? • Track Error projection? • How to handle bent tiles • Ambiguity about active distance around bent part • Plane v. 3D POCA calculations • Currently meaning changes inside tile v. outside tile • Using track error projections might get rid of this • Details about using G4Propagator • Sort PocaData objects by path length • Need to seed it, how good is energy estimate?

  22. AcdValsTool • This Tool is simple, just extracts stuff from AcdRecon • Loop over AcdTkrHitPoca objects and extract: • Largest active distance for all tracks and tiles • Largest active distance for all tiles and best track • Energies deposited in said tiles • Loop over AcdTkrGapPoca objects and extract: • Smallest DOCA to gap for all ribbons and tracks • Smallest DOCA to gap for all ribbons and best track • Variety of other quantities • Summary statistics • Numbers of hit tiles, ribbons • Total energy deposited

  23. Generating calibrations w/ calibGenACD • Framework to make calibrations • All 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 methods • Store all calibrations in xml files • Standalone apps to run calibrations. • calibGenACD/apps • runPedestal.exe • runMuonCalib_Svac.exe • runVetoCalib.exe • runCnoCalib.exe • runRangeFit.exe • runCoherentNoise.exe

  24. Status, to do: • Code is fairly well developed • Still not totally stable • Need better testing procedures • Need performance benchmarks • Some obvious points of work • Code cleanup, adhering to GLAST conventions • Track error projection • Implementing CNO calibration generation • More subtle issues • Moving to more global use of ACD in merit tuple • Considering both signal size and active distance when deciding to which track / tile pair to store • Catching tracking errors • ACD hit patterns that imply • More studies of how to handle backsplash

More Related