1 / 24

(too) Short Introduction to O bject-oriented R econstruction for C MS A nalysis

(too) Short Introduction to O bject-oriented R econstruction for C MS A nalysis. July 13 th , 2004 Hannes Sakulin – HEPHY Vienna, Austria (for Stephan Wynhoff ). What is ORCA ?. O bject-oriented R econstruction for C MS A nalysis Large CMS Software Project

reya
Download Presentation

(too) Short Introduction to O bject-oriented R econstruction for C MS A nalysis

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. (too) Short Introduction toObject-oriented Reconstruction for CMS Analysis July 13th, 2004Hannes Sakulin – HEPHY Vienna, Austria(for Stephan Wynhoff)

  2. What is ORCA ? • Object-oriented Reconstruction for CMS Analysis • Large CMS Software Project • > 500 000 lines of C++ (not counting COBRA) • developed by a large international collaboration • Tasks • Simulation of detectors and electronics • Event Reconstruction (both offline and high level trigger) • Analysis • ORCA is in rapid development • Try to use the latest and greatest: Current version: 8_2_0 • Starting point: http://cmsdoc.cern.ch/orca

  3. The Analysis Chain CMKIN HEPEVTNtuple MC generator Production ORCA 8 OSCAR 3 2)reconstruction 3)analysis 1)digitization OSCAR SimReader RecReader RecReader Ntuplesignal POOLSimHits/signal NEW ROOTTree POOL Digis DST Ntupleminbias POOLSimHits/minbias “data summary tape” Pool Of persistent Objects for LHC User Production

  4. 1) Digitization: from Hits to Digis • Output of Simulation (OSCAR) are Hits • Position, where a particle entered a sensitive detector volume • Direction of the particle, Exit point of the particle • Energy deposited • (exact format depends on detector type) • ORCA simulates reaction of detectors to the passing particle • E.g. ionization of gas in drift tube muon chamber, drift of particles to wire, avalanche, signal • Detector electronics (analog to digital conversion, data compression, …) • Parameterizations of actual processes used • Also includes full emulation of Level-1 Trigger electronics • Result: Digis • Digis are like the raw data that will come out of the experiment!!!

  5. 1) Digitization: adding Pileup • At high LHC luminosity an average of 17 interactions occur in the same bunch crossing • Detector response is slower than 25ns: also have to consider interactions before and after Overlay crossings -5 to +3 • ~200 “minimum bias” events added to 1 signal event (before digitization) Single interaction POOLSimHits/signal 1 ORCA Digitization POOL Digis POOLSimHits/minbias ~ 200 ( recycle) Interaction + pile-up

  6. 2) Reconstruction • ORCA does Reconstruction of Raw Detector Data (or the Digis) in several steps • Detector-specific processing • Data unpacking, cluster finding, hit reconstruction, tracking,applying calibration constants • Global Tracking • include hits from different subsystems, e.g. Tracker and Muon System for muons • Vertex Finding • Bases on Tracks found in the previous step • Particle Identification  Physics Objects • Produce objects used in physics analyses: electrons, photons, muons, jets, … • Both Offline Reconstruction / and High-Level Trigger reconstruction • Similar algorithms, but offline algorithms may consume more time, may use more calibration constants, … • Can save output of reconstruction: DSTs (“Data Summary Tapes”)

  7. Reconstruction on Demand • Action on demand is a powerful tool to manage the order in which things are done, and to avoid doing things that you don’t need to do • Algorithms register with the framework • “I can produce Tracks of type T1” • Algorithms are only called when the user requests them or when another Algorithm needs them • E.g. User wants tracks of type T1 • E.g. User want vertices and vertex algorithm needs Tracks T1 • When results are available (in cache or persistent storage), just return the results • Otherwise run the algorithm and save results in cache • If the same results are needed again, the algorithm is not run again

  8. Analysisprogram ClusterAlgoB ClusterAlgoA RecUnitClusterA RecUnitClusterB Cl1 Cl2 Cl3 Cl4 Cl1 Cl2 Cl3 K1 K2 K3 K4 K5 K6 K7 K8 K9 K10 K11 K12 K13 K14 K15 K16 RecUnitCrystal Reconstruction on Demand

  9. Using ORCA

  10. Creating a Working Area • login with your CMS account (group zh) • cd $SCRATCH • can also work on AFS workspace or AFS scratch • scram listcompact ORCA[…]ORCA ORCA_8_2_0 /afs/cern.ch/cms/Releases/ORCA/ORCA_8_2_0 • scram project ORCA ORCA_8_2_0 • new directory ORCA_8_2_0 with subdirectoriessrc, config, tmp, logs • cd ORCA_8_2_0/src • eval `scram runtime –csh` • rehash Set environment variables Rebuild hash table of executables Ready to use pre-compiled executables

  11. Standard Executables • ORCA can be used in many different ways • Data can be processed in steps ( Digitization, Reconstruction,… ) • Many different executables exist • Standard executables • Test executables • You can make your own executables (e.g. in Workspace) • Standard Executables from Examples/ExProduction • writeAllDigis (read hits, digitize, write digis) • writeDST (read digis, reconstruct, write DST) • Standard Executables from Examples/Statistics • ExSimHitStatistics, ExDigiStatistics, ExDSTStatistics

  12. Example 1: from Hits to Digis • Log into CVS • cmscvsroot ORCA; cvs login(password: 98passwd) • Check out the code from CVS (in ORCA_8_2_0/src) • cvs co –r Summies04 Example/ExProduction • cd Examples/ExProduction • Set the parameters • writeAllDigis-Tutorial04.orcarc

  13. Setting Parameters: orcarc files MaxEvents = 5 InputCollections = /System/StW752SimHits/h300eemm/h300eemm OutputDataSet = /System/HSDigis/h300eemm # - minbias as 2x10^33 s^-1 cm^-2 ----------------------------PUGenerator:Collection = /System/StW752SimHits/minbias03/minbias03 PUGenerator:AverageEvents = 3.5 PUGenerator:MinBunch = -5 PUGenerator:MaxBunch = 3 PUGenerator:FirstEvent = -2 GoPersistent = true #-- database technicalities ---------------------------------- DBPopulator:CommitInterval = 15 DBPopulator:MaxDBSize = 1.5 . . Number of events Signal Hits (input!) Digis (the output) .orcarc Pile-up Hits (minimum bias) To save the digis Many more parameters follow  (to understand all these is a scientific discipline by itself) writeAllDigis-Tutorial04.orcarc Attention: The file .orcarc in the current directory is always read and used. Specify any other orcarc file with the –c option.

  14. Example 1: from Hits to Digis (cont’d) • Log into CVS • cmscvsroot ORCA; cvs login (password: 98passwd) • Check out the code from CVS (in ORCA_8_2_0/src) • cvs co –r Summies04 Example/ExProduction • cd Examples/ExProduction • Set the parameters • writeAllDigis-Tutorial04.orarc • Copy a POOL File Catalog to the local dir • cp /afs/cern.ch/cms/OO/Reconstruction/catalog/PoolFileCatalog_8_2_0.xml PoolFileCatalog.xml • (We use the default test datasets)

  15. What is in a POOL File Catalog ? XML file that knows where all the data files are. . . <File ID="72F3C417-5264-D811-82F5-0007E924923D"> <physical> <pfn filetype="ROOT_All" name="rfio:/castor/cern.ch/cms/reconstruction/datafiles/ORCA_7_5_2/EVD2_Hits.ff83cd88645111d882f50007e924923d.123.h300eemm.StW752SimHits"/> </physical> <logical> <lfn name="EVD2_Hits.ff83cd88645111d882f50007e924923d.123.h300eemm.StW752SimHits"/> </logical> <metadata att_name="DBoid" att_value="[DB=72F3C417-5264-D811-82F5-0007E924923D][CNT=.master][CLID=7D721C8E-530D-608F-BFD9-70E61D0F1EB5][TECH=00000201][OID=00000003-00000000]"/> <metadata att_name="DataType" att_value="EVD"/> <metadata att_name="FileCategory" att_value="Hits"/> <metadata att_name="dataset" att_value="h300eemm"/> <metadata att_name="jobid" att_value="ff83cd88645111d882f50007e924923d"/> <metadata att_name="owner" att_value="StW752SimHits"/> <metadata att_name="runid" att_value="123"/> </File> . . Physical file name (you may need to edit this, if you are moving the data) PoolFileCatalog.xml needs to be in current directory (or have to specify location via InputFileCatalogURL parameter in orcarc)

  16. Example 1: from Hits to Digis (cont’d) • Log into CVS • cmscvsroot ORCA; cvs login (password: 98passwd) • Check out the code from CVS (in ORCA_8_2_0/src) • cvs co –r Summies04 Example/ExProduction • cd Examples/ExProduction • Set the parameters • writeAllDigis-Tutorial04.orarc • Copy a POOL File Catalog to the local dir • cp /afs/cern.ch/cms/OO/Reconstruction/catalog/PoolFileCatalog_8_2_0.xml PoolFileCatalog.xml • (We use the default test datasets) • Run the Executable (do not need to compile) • writeAllDigis -c writeAllDigis-Tutorial04.orcarc |& tee wd1.out • Will produce Digis (attention: big files)

  17. The BuildFile writeAllDigis BuildFile # # This is to write RecHits/Digis into a DB # <environment> <ignore> To produce Calorimetry digis</ignore> <Group name=CaloHitReader> <Group name=CaloRHitWriter> <Group name=CaloRHitReader> <Group name=TriggerPrimitiveWriter> <Use name=Calorimetry> <ignore> To produce all Muon digis </ignore> <Group name=MuonDigiWriter> <Use name=CommonReco> <Use name=Muon> <ignore> To produce Tracker digis </ignore> <lib name=DDDInterface></lib> <lib name=TkHitLoader></lib> <Group name=TkOscarReader> <Group name=TkDigiWriter> <Use name=Tracker> <ignore> To store L1 global trigger </ignore> <Group name=L1TRIGGER> <Use name=Trigger> <Group name=G3> <Group name=SimReader> <external ref=COBRA Use=CARF> <bin file=writeAllDigis.cpp></bin> </environment> Reading of SimHits Calo Muons Tracker L1 Trigger Source for the executable The BuildFile is used when building an executable (or a library) with scram

  18. Example 2: Reading DIGIs • Example – Examples/Statistics/ExDigiStatistics • echo “InputCollections = /System/HSDigis/h300eemm” > readdigis.orarc • ExDigiStatistics –c readdigis.orcarc |& tee ds1.out • This will read the digis and print some information… <environment> <Group name=MuonDigiReader> <Use name=Muon> <Group name=TrackerDigiReader> <Use name=Tracker> <Group name=CaloRecHitReader> <Use name=Calorimetry> <Group name=G3> <Group name=RecReader> <external ref=COBRA Use=CARF> <bin file=ExDigiStatistics.cpp></bin> </environment> reading of digitized events Muons Tracker Calo The BuildFile needed to read digis (from Examples/Statistics/BuildFile)

  19. The Workspace • cd ../ORCA_8_2_0/src • cvs co –r ORCA_8_2_0 Workspace • cd Workspace • scram build • eval `scram runtime –csh` • rehash • ExRunEvent • (this executable is using parameters in .orcarc)

  20. Working with YOUR code • cd …/ORCA_8_2_0/src/Workspace • BuildFileselects the libraries to use for each executable • ExRunEventInfo.h, ExRunEventInfo.ccthe real code. You can put your code here.class ExRunEventInfo : private Observer<G3EventProxy *> { • ExRunEvent.cppregistration of ExRunEvent to the Framework • .orcarcwhere to find the data and more parameters

  21. Access to Higher Objects • Object are stored in RecCollections • These may be stored in the DSTs (much faster) • Reconstructed Muons • Reconstructed Electrons • Try Training Lecture 3 on the ORCA page! (under Tutorials) For example: GlobalMuonReconstructor or L3MuonReconstructor RecQuery q("<Name of Reconstructor>"); RecCollection<RecMuon> theCollection(q); for (RecCollection<RecMuon>::const_iterator it = theCollection.begin(); it != theCollection.end(); ++it) cout << "Muon: " << (**it) << endl; Can also add parametersto the RecQuery #include “ElectronPhoton/EgammaOfflineReco/interface/OfflineElectronReco.h” RecCollection<ElectronCandidate> theCollection(OfflineElectronReco::defaultQuery()); for (RecCollection<ElectronCandidate>::const_iterator it = theCollection.begin(); it != theCollection.end(); ++it) cout << ”Electron: " << (**it) << endl;

  22. RecCollections available in DSTs • DSTs contain reconstructed objects for“users” Level-1 Trigger info HLT info CombinatorialTrackFinder PixelTrackFinderFromTriplets PrincipalVertexFinder CombinedBTagging EGCandL2 EGCluster/EGBCluster/EGSCluster EGECluster EGHLTelectron/photon EPTracks/EGPhotons/EGElectrons EGcalibration EGofflineCandidates OfflineElectron, OfflinePhoton MET-L1Trigger METfromCaloRecHits/EPHTowers METfromIterConeJets/KtJets RecJet-Itercone0.5/0.7 RecJet-Ktrecom1/4 TowerBuilder (EcalPlusHcalTowers) StandAloneMuonReconstructor GlobalMuonReconstructor L2MuonReconstructor L3MuonReconstructor MuonCaloEffIsolator MuonCaloEtIsolator MuonTkEffIsolator MuonTkPtIsolator

  23. Documentation • The main ORCA pages are at http://cmsdoc.cern.ch/orca • This should be you first resource for finding information. • Two types of Documentation • UserGuideIntroduction, general description (200 pages) • ReferenceManualall classes documented, web based and semi-automatically produced, where you can delve into the details • Tutorials • CVS Browser of all sources • …

  24. The END • Much more to learn • Read the UserGuide first! • Ask your colleagues • Ask your supervisor • Check http://cmsdoc.cern.ch/orca • Read the FAQ • Problems: https://savannah.cern.ch/projects/orca • Ask question one the ORCA-feedback mailing list • cms-orca-feedback@cern.ch • ORCA is not easy, not consistent, not complete • but it is mostly working! Try to enjoy using it!

More Related