Download presentation
Presentation is loading. Please wait.
1
Tag based analysis Ziyan DENG
2
Data Analysis Model Raw data on disk
(All, Bhabha, Dimu., Random trigger ……) .raw Raw data on tapes Detector Calibration Index generation Detector Simulation Offline Reconstruction (DST Production) .idx .rtraw, ROOT .dst, ROOT Background Mixing (with random trigger events) Physics Skimming(nprong, DTag, …) .raw .dst, ROOT database Reconstruction User Analysis .dst, ROOT 2
3
探测器的击中信息 MDC: EMC: MUC: 单元编号 飞行时间 漂移时间 漂移距离 击中位置 …… 晶体编号 沉积能量 击中位置
击中时间 …… MUC: 击中时间 击中位置 沉积能量 动量,方向 …… 3个1GeV/c的π/μ在探测器里的不同行为
5
Gaudi Framework Provides standard interfaces for the common components necessary for data processing and analysis ISvcLocator ApplicationMgr IDataProviderSvc IAlgorithm IProperty EventDataSvc Concrete Algorithm IDataProviderSvc DetectorDataSvc IHistogramSvc HistogramSvc Obj_A Obj_B MessageSvc IMessageSvc IParticlePropertySvc ParticlePropertySvc
6
Gaudi Architecture Object Diagram
Converter Algorithm Event Data Service Persistency Data Files Transient Event Store Detec. Data Transient Detector Store Message JobOptions Particle Prop. Other Services Histogram Transient Histogram Store Application Manager
7
Set properties, add converters
RootCnvSvc Set properties, add converters RootEvtSelector Get next event ID RootAddress Root Tree names, branch names, and EntryNr RootInterface Open ROOT file, reading/writing tree RootEventBaseCnv TObjectToDataObject, DataObjectToTObject RootCnvSvc Digi/ Mc/ MdcTrackCnv MdcKalTrackCnv Rec/ MdcDedxCnv Dst/ TofTrackCnv EvtRec/ EmcTrackCnv …… ……
8
Current data processing
Data production job: Recon. Algs file1.raw file1.dst Physics analysis job: RhopiAlg Analyzing full dst files (1) file1.dst, … ntuple data skim job file1.dst file1_skim.dst Analyzing skimmed dst Or (2) Physics analysis job: RhopiAlg file1_skim.dst, … ntuple
9
Tag based analysis TAG DST TagWriterAlg Input for analysis
Size of TAG file is ~1/700 of DST file DST file directory/name event 0 entry runId eventId Total_charged event 1 ... … event 2 …… event N DST event 0 MdcTrackCol TofTrackCol …… event 1 event 2 event N TagWriterAlg Production job Input for analysis Users set tag selection criteria (“B>=2 && C=1……”) through TagFilterSvc RootCnvSvc: Read each entry in TAG file, and using TagFilterSvc to choose which DST event should read.
10
Initialize Algorithms
OfflineEventLoopMgr::initialize Setup Event Selector Setup Services OfflineEventLoopMgr::getEventRoot RootEvtSelector::next set eventId RootEvtSelector::createAddress RootEventBaseCnv::createObj RootInterface::setBranchAddress OfflineEventLoopMgr::nextEvent RootAddress:setEntryNr(eventId) Event loop RootInterface::getBranchEntry RootEventBaseCnv::TObjectToDataObject OfflineEventLoopMgr::executeEvent Algorithms::execute Finalize Algorithms OfflineEventLoopMgr::finalize Release Event Selector Release Services
11
RootInterface::currentFileName
New file ? Old file ? Read new tag file Get next entry of tag file Return eventId Get the first entry of tag file The end of tag file? no yes RootInterface::setEOF Return eventId The end of input file list? yes no No more input New file
12
Performance test All (analyzing full dst files) 3 dst files as input
Skim (analyzing skimmed dst files) Skim events with totalCharged=2 from full dst files Tag (tag based analysis) Only read events with totalCharged=2 through tag all skim tag CPU time (test 1) 402 s 170 s 177 s CPU time (test 2) 377 s 270 s CPU time of tag based analysis is similar with directly analyzing skimmed DST files, much less than analyzing full DST files. Tag based analysis can get exactly the same result as analyzing skimmed DST files
13
Tag based analysis jobOptions
#include "$ROOTIOROOT/share/jobOptions_ReadRec.txt" #include "$VERTEXFITROOT/share/jobOptions_VertexDbSvc.txt" #include "$MAGNETICFIELDROOT/share/MagneticField.txt" #include "$ABSCORROOT/share/jobOptions_AbsCor.txt" #include "$RHOPIALGROOT/share/jobOptions_Rhopi.txt" TagFilterSvc.tagFiles = { "tag_run_ _All_file001_SFO-1.root", "tag_run_ _All_file001_SFO-2.root", "tag_run_ _All_file002_SFO-1.root" }; TagFilterSvc.Criteria = "[4]==2"; EventCnvSvc.selectFromTag = 1; Input TAG files Pre-selection criteria Turn on tag based analysis
14
Discussions User interface
One TAG file for each DST file, can be produced during or after reconstruction Physics groups or individual users can define the tag files Location of DST file saved in the corresponding TAG file Specify only tag files in analysis job Performance Size of TAG file is ~1/700 of DST file, depending on what saved in TAG CPU time: similar with analyzing skimmed DST files How many users will use this? Pre-selection(2 prong, 4 prong, ……), replace skimmed data
15
Data processing with TAG
Data production job: Recon. Algs + TagWriterAlg file1.raw file1.dst, file1.tag DST and TAG files can be produced together in one job Tag select job: TagWriterAlg file1.tag, file2.tag… file1_s.tag, file2_s.tag… Physics analysis job: RhopiAlg Analyzing dst files with tag file1.dst, file2.dst… ntuple file1_s.tag, file2_s.tag… input output
16
Data processing with TAG
Data production job: Recon. Algs file1.raw file1.dst Tag writer job: TagWriterAlg file1.dst, file2.dst… file1.tag, file2.tag… DST and TAG files can be produced seperately Tag select job: TagWriterAlg file1.tag, file2.tag… file1_s.tag, file2_s.tag… Physics analysis job: RhopiAlg file1.dst, file2.dst… ntuple file1_s.tag, file2_s.tag…
17
Tag based analysis jobOptions
#include "$ROOTIOROOT/share/jobOptions_ReadRec.txt" #include "$VERTEXFITROOT/share/jobOptions_VertexDbSvc.txt" #include "$MAGNETICFIELDROOT/share/MagneticField.txt" #include "$ABSCORROOT/share/jobOptions_AbsCor.txt" #include "$RHOPIALGROOT/share/jobOptions_Rhopi.txt" // Input REC or DST file name EventCnvSvc.digiRootInputFile = { "/besfs2/offline/data/664-1/jpsi/dst/090612/run_ _All_file001_SFO-1.dst", "/besfs2/offline/data/664-1/jpsi/dst/090612/run_ _All_file001_SFO-2.dst", "/besfs2/offline/data/664-1/jpsi/dst/090612/run_ _All_file002_SFO-1.dst" }; EventCnvSvc.tagInputFile = { "sel_tag_run_ _All_file001_SFO-1.root", "sel_tag_run_ _All_file001_SFO-2.root", "sel_tag_run_ _All_file002_SFO-1.root" EventCnvSvc.selectFromTag = 1; // Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) MessageSvc.OutputLevel = 5; // Number of events to be processed (default is 10) ApplicationMgr.EvtMax = -1; ApplicationMgr.HistogramPersistency = "ROOT"; NTupleSvc.Output = { "FILE1 DATAFILE='rhopi.root' OPT='NEW' TYP='ROOT'"}; Input DST files Input TAG files Flag to switch on/off tag based analysis
18
Performance test: Skim vs Tag
All (Analyzing full dst files) Input files of all.txt -rw-r--r-- 1 offline physics Aug /besfs2/offline/data/664-1/jpsi/dst/090612/run_ _All_file001_SFO-1.dst -rw-r--r-- 1 offline physics Aug /besfs2/offline/data/664-1/jpsi/dst/090612/run_ _All_file001_SFO-2.dst -rw-r--r-- 1 offline physics Aug /besfs2/offline/data/664-1/jpsi/dst/090612/run_ _All_file002_SFO-1.dst Skim (Analyzing skimmed dst files) Skim events with otalCharged = 2 from the above 3 dst files, and output another 3 skimmed dst files Input files of flt.txt TestRelease]$ ls /besfs/users/dengzy/tag/filter/ -al -rw-r--r-- 1 dengzy physics Mar 23 11:02 f_run_ _All_file001_SFO-1.dst -rw-r--r-- 1 dengzy physics Mar 23 11:03 f_run_ _All_file001_SFO-2.dst -rw-r--r-- 1 dengzy physics Mar 23 11:04 f_run_ _All_file002_SFO-1.dst Tag (tag based analysis) Input files of tag.txt Input files of all.txt + tag files Size of TAG file is 1/740 of DST file, information included in TAG ROOT file entry, run_number, event_number, total_charged, total_neutral, total_tracks test]$ tail all.txt.bosslog u 5.716s 7: % 0+0k io 71pf+0w test]$ tail flt.txt.bosslog u 2.029s 3: % 0+0k io 26pf+0w test]$ tail tag.txt.bosslog u 3.356s 3: % 0+0k io 19pf+0w CPU time of tag based analysis is similar with directly analyzing skimmed DST files, much less than analyzing full DST files.
19
Performance test: Skim vs Tag
All (analyzing full dst files) test]$ tail all.txt.bosslog u 5.108s 6: % 0+0k io 36pf+0w Skim (analyzing skimmed dst files) test]$ tail flt.txt.bosslog u 2.789s 4: % 0+0k io 6pf+0w Tag (tag based analysis) test]$ tail tag.txt.bosslog u 3.059s 3: % 0+0k io 20pf+0w
20
Performance test: Skim vs Tag
test]$ tail tag.txt.bosslog total number: nGood==2, nCharge==0: 20816 nGam>=2: Pass Pid: Pass 4C: Pass 5C: J/psi->rho0 pi0: ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully u 3.356s 3: % 0+0k io 19pf+0w test]$ tail flt.txt.bosslog u 2.029s 3: % 0+0k io 26pf+0w
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.