160 likes | 181 Views
Framework for Raw Data. Thomas Kuhr Offline Week 29/06/2004. Motivation. Why do we need simulated raw data? Reasonable estimate of data volume and structure for Computing Data Challenge
E N D
Framework forRaw Data Thomas Kuhr Offline Week 29/06/2004
Motivation Why do we need simulated raw data? • Reasonable estimate of data volume and structure for Computing Data Challenge • Development and verification of reconstruction code starting from raw data Reconstruction of real data Next Physics Data Challenge
Overview Simulation Reconstruction Monte Carlo Particles SDigits Hits SDigits Digits Clusters Tracks ESD Detector DAQ Raw Data Real Data Trigger HLT Online Offline
Raw Data Format • DDL Files: • One directory per event: rawN • One binary file per DDL: DET_DDLID.ddl • File contains DDL data header and payload • Equivalent to data sent over DDL • DATE: • One date file with many events • Equipment and event headers added • Equivalent to DAQ output (without alimdc) • Root: • One root file with many events • Equivalent to recorded raw data
User Interface • Run full simulation and write raw data for all detectors: AliSimulation sim; sim.SetWriteRawData(“ALL”); sim.Run(); • Optional second argument:raw data file name (date or root) • Shortcut method: sim.WriteRawData(“TRD PMD”,“raw.root”); • Equivalent to: sim.WriteRawFiles(“TRD PMD”); sim.ConvertRawFilesToDate(“raw.date”); sim.ConvertDateToRoot(“raw.date”, “raw.root”);
Implementation • AliSimulation calls virtual method of detector: void AliModule::Digits2Raw(); • Digits2Raw method: • Create one file per DDL: DET_DDLID.ddl • Write DDL data header (AliRawDataHeader) • Set data size (AliRawDataHeader.fSize) • Indicate valid data (AliRawDataHeader.SetAttribute(0)) • Write raw data of current event • Order of channels? • Raw data DDL files → DATE file: program dateStream (put it on afs?) • DATE file → root file: program alimdc
Status http://aliweb.cern.ch/people/cheshkov/rawdata.html
Reading of Raw Data Separate two tasks: • Reading of raw data (stored in different formats) into memory • Independent of content • Raw reader classes • Interpretation of raw data • Specific to each detector • Raw stream classes
AliRawReader • Base class for reading raw data of one event • Virtual methods:Bool_t ReadHeader(); Bool_t ReadNextData(UChar_t*& data); Bool_t ReadNextInt(UInt_t& data); Bool_t Reset(); void Select(Int_t detectorID, …); UInt_t GetType() const; Int_t GetDDLID() const; Int_t GetDataSize() const; … • Derived classes: AliRawReaderFiles, AliRawReaderDate, AliRawReaderRoot
AliDETRawStream • Interpretation of detector specific raw data • Iterator over digits AliDETRawStream(AliRawReader*); Bool_t Next(); Int_t GetSector() const; Int_t GetRow() const; Int_t GetPad() const; Int_t GetTime() const; Int_t GetSignal() const; • Raw stream classes for TPC and ITS in RAW module, for TRD and PMD in detector modules
Raw Data Reading Classes AliTPCRawStream AliRawReaderFiles TPC digits Ali Raw Rea der TPC_0.ddl TRD_1024.ddl PMD_3072.ddl AliPMDRawStream AliRawReaderDate PMD digits raw.date AliRawReaderRoot AliDETRawStream raw.root DET digits
Reconstruction of Real Data Simulation Reconstruction Monte Carlo Particles SDigits Hits SDigits Digits Clusters Tracks ESD Detector DAQ Raw Data Real Data Trigger HLT Online Offline
Proposal: User Interface • Use raw data DDL files in directory dir: AliReconstruction rec; rec.Run(“dir/”); • Use DATE file raw.date: rec.Run(“raw.date”); • Use root file raw.root(extension “.root”): rec.Run(“raw.root”);
Proposal: Implementation • Extend virtual interface of AliReconstructor: void Reconstruct(AliRunLoader*,AliRawReader*) const; void FillESD(AliRunLoader*,AliRawReader*, AliESD*) const; • Loop over events inside or outside Reconstruct method? • Functionality of AliRawReader has to be extended for inside loop
Open Questions galice.root file has to be created with • Loaders • Detector parameters / geometries • Magnetic field • AliRun object ? • … • Run database ?
Summary • Simulation of raw data is vital • 3 formats of raw data: DDL files, DATE, root • AliSimulation provides framework for raw data simulation • Reading of raw data with AliRawReader and raw stream classes • Framework for reconstruction of real data proposed • Some open questions to be solved