Code: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
No edit summary
 
(162 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[http://mu2e.fnal.gov/atwork/computing/temp/v6_0_2.shtml example page for git documentation]
== Building code ==
== Building code ==


<blockquote>
* [[End of Life for Scientific Linux 7]] Instructions needed for June 2024 only.
There is one main mu2e code git repository which holds our simulation and reconstruction modules and algorithms, and fcl files.  You can run the code out of a tagged and pre-built release, by building the entire repository locally, or by build part of the repository locally in a satellite release.  You can build it optimized (prof) or in debug.
* [[UPS to Spack Transition]] ongoing from spring 2024
</blockquote>
* [[CodeEnvironment]] how to setup the linux environment
 
* [[GitIntro]] code management preliminaries for newcomers
* [[CodeRecipe|Basic Recipe]] for setup, checkout and build
* [[OfflineStatus]] which branch or tag of Mu2e Offline you should start from
* [[git]]
* [[GitHubWorkflow]] - code repository checkout and commit procedures
* [[scons]]
* [[IncludeFiles]] - where to find include files
* [[SatelliteRelease|Satellite Releases]] - building only the part of the code base you need
* [[Muse]] - Mu2e code setup and build scripts
*   Base releases and test releases.
* [[scons]] - internal commercial build tool, called by Muse
 
* [[Building Offline with cmake]] - DAQ is building Offline using a different commercial tool.
== References and How-to's ==
* [[CodeDebugging|Debugging]] code debugging tools and tips
* Mu2e Geometry: The Big Picture
* [https://www.github.com/Mu2e Mu2e github organization]
** Notes on the geometry files
* [[UPS|UPS]] - using the Fermilab UPS product setup
* Using random numbers:  
* [[Redmine]] - a few pieces of code are still in the redmine git repository
** Basic Instructions
* [[CVS]] - a few pieces of code are still in the CVS repository
** Complete Instructions


* Magnetic Field Maps.
== Configuring executables ==
* Conditions Data
* [[FclIntro|fcl]] - intro to fcl art job control language
* products and modules
** [[FclPaths|paths]] - which modules and what order
** Which names need to match each other.
** [[FclIOModules|I/O modules]]
** The Mantra for making data products.
** [[MessageLogger|Message logger]]
** listing products and printing their contents
* [[SearchPaths|Search paths]] - how data, fcl, and other control files are found
*   What are Services?
* [[SimpleConfig|SimpleConfig]] - another way to input parameters to an executable
**       Services distributed with the framework.
* [[Simulation|Simulation]] - an overview
**           Deprecated art services
** [[SimulationFCL]] - fcl procedures for MDC2020 and later
*   About handles.
** [[Generators]] - generating the first particle
*   Filter Modules.
*** [[CORSIKA]] cosmic ray simulation
*   Inter-Product References: art::Ptr, art::PtrVector, art::Assns
** [[Staging|Staging]] - how and why of running the simulation in stages
*   cet::map_vector: a new class template
** [[TimeSim|Time simulation]] - adding lifetimes
*   Exceptions: Mu2e policy,  CMS guide to managing exceptions.
** [[BunchIntensity|Bunch intensity]] - simulating bunch-to-bunch variations
** [[Mixing|Mixing]] - mixing background and signal simulation
** [[RunNumbers]] - how run numbers ranges are used
* Other applications
** [[EventDisplays]]
** [[Ntuples]] - data access at the interactive level
** [[MachineLearning|Machine learning]] - neural networks


== Configuring fcl ==
== Modules, Products, and Services ==
* SimpleConfig
* Modules
*   Run-time Configuration (.fcl files)
** [[Modules|Modules]]
*   Trigger_paths, end_paths and reconstruction on demand.
** [[FclIOModules|I/O modules]]
*   Configuring input and output modules
** [[FilterModules|Filter Modules]]
*   Search path for some run-time files.
* Products
*   Using and configuring the message logger
** [[ReadProducts|Reading products]]
** [[PrintProducts|Listing and printing]]
** [[MakeProducts|Making data products]]
** [[Handles]]
** [[PhysicalVolumeInfoCollection]]
** [[Provenance]]
** [[CetMapVector|cet::map_vector]]
** [[SchemaEvolution| Schema Evolution]]
* [[Geometry|Geometry]]
** [http://mu2e-docdb.fnal.gov/cgi-bin/ShowDocument?docid=1120 Units and Coordinate Systems]
* [[Alignment]]
* Random numbers:
** [[RandomNumbersBasic|Basic Instructions]]
** [[RandomNumbers|Complete Instructions]]
* [[MagneticFieldMaps|Magnetic Field Maps]]
* [[ConditionsData|Conditions Data]]
** [https://mu2einternalwiki.fnal.gov/wiki/CalibrationSets CalibrationSets]
* [[Services|Services]]
** [[ArtServices|Framework services]]
* [[SimpleConfig|SimpleConfig]]
* [[Exceptions|Exceptions]]
* [[MessageLogger|Message logger]]
* [[PyWrap]] - wrap compiled c++ code so it can be used in python
* [https://cdcvs.fnal.gov/redmine/projects/art/wiki/ArtExitCodes art error codes]
* [[Elastic Analysis Facility (EAF)|Elastic Analysis Facility (EAF)]]


== Code Management ==
== Code Management ==


mu2e uses git for all code management. There is one main repository for code (with BTrk, the Kalman fit, in a separate respository) and a few smaller repositories for tools. Built releases are distributed worldwide, including remote institutions and the grids with the cvmfs distributed disk system. The code is built after every commit, and built and validated every night on the Jenkins build platform.
* [[Spack]] - setup and build tool to replace UPS and MRB
 
* [[SpackMaintenance]] - expert procedures and debugging
* [[GitMu2e|The Mu2e git page]]
* [[Legacy_Access_to_SL7]]
* Jenkins - a central build platform
* [[MuseMaintenance]] - Muse procedures for experts
** [[Jenkins|Jenkins overview]]
* [[ReleaseList]]
** [http://mu2e.fnal.gov/atwork/computing/ops/nightlyBuild/nightly.shtml  Jenkins Nightly build results]
* [[Git|git]] - overview and pointers to detailed and mu2e-specific instructions
* CVMFS - a distributed disk system to serve tagged, static code builds and products
* [[Validation]] - automatic and occasional procedures for validation
** [[Cvmfs#Using CVMFS|for users]]  
* [[GeantChecklist]] - validation of new geant versions
** [[Cvmfs#Installing CVMFS|installing at remote sites]]
* [[Jenkins]] - a central build platform
** [[Cvmfs#Adding CVMFS content|maintaining content]]  
* [[Cvmfs|CVMFS]] - a virtual disk mount containing our code
* [[Docker]] a portable software container to hold and run our environment and software
* [[CodeDistribution|Download]] - pull a local copy to remote institutions or laptops
* [[CodeDistribution|Download]] - pull a local copy to remote institutions or laptops
* [[BTrk]] - the KalMan fitter code is in this non-standard product
* [[Scisoft|scisoft]] - server for product manifests
* [[BTrk]] - (deprecated) the Kalman fitter code is in this non-standard product
* [[KinKal]] - a repo and UPS product containing the core track Kalman fit code
* [[CVS]]
* [[CodeDepencyGraph]] - how to make the code dependency graph
* [[DAQ]] [https://cdcvs.fnal.gov/redmine/projects/mu2edaq/wiki DAQ redmine]
* [[RootBuild|building root]]
* [https://cdcvs.fnal.gov/redmine/projects/artutilscripts/repository/revisions/master/raw/tools/checkPrerequisites checkPrerequisites tool] - check linux has rpms needed by art
* [[SconsUPS]] - how to build a new version of scons, packaged for UPS
* [[Pyana]] - setting up python analysis packages
* [[Github_CI_Maintenance|Github CI Maintenance]] - information about the CI repo, used by Jenkins for build tests


== Standards and Practices ==
== Standards and Practices ==
*  Editors: Emacs,  vim;  policy of not using tab characters.
* [[CodingStandards]] - an overview of code issues
* CMS code references: Home Offline WorkBook SW Guide
* [[CodeTools]] - code formatting and checking tools
* Units and Coordinate Systems
* [[MagicNumbers|Magic numbers]] - where to get value of pi, etc.
 
[[Editors|Editors]] - tips on editors and policy of not using tab characters.
* [[CodeDebugging|Debugging]]
* [[GeantTips]]
* [https://en.wikipedia.org/wiki/ISO_8601 ISO 8601 time format]
* CMS code references:
** [https://twiki.cern.ch/twiki/bin/view/CMSPublic/WebHome Home]
** [https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBook Offline WorkBook]
** [https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuide SW Guide]
* FAQs
** [[CppFAQ|c++]]
** [[LinuxFAQ|linux]]
** [[RootFAQ|root]]
** [http://thbecker.net/articles/rvalue_references/section_01.html move semantics and r-value references]


== External Packages ==
== External Packages ==
* UPS/UPD as used by Mu2e  
* [[UPS| UPS]] [https://cdcvs.fnal.gov/redmine/projects/ups/wiki/ReferenceManual/ manual] [https://cdcvs.fnal.gov/redmine/projects/ups/wiki/Getting_Started_Using_UPS getting started]
* Setting up ROOT by itself
* Mu2e [https://github.com/Mu2e github] [https://cdcvs.fnal.gov/redmine/projects/mu2eofflinesoftwaremu2eoffline/repository redmine] [http://cdcvs.fnal.gov/lxr lab LXR] [http://cdcvs.fnal.gov/lxr/mu2eofflinesoftware/index.html Mu2e LXR] [https://lxr.sourceforge.io/en/index.php LXR project]
* Mu2e code    
* [https://web.fnal.gov/project/ArtDoc/Pages/home.aspx art]  [https://web.fnal.gov/project/ArtDoc/SitePages/documentation.aspx doc] [https://github.com/art-framework-suite github] [https://cdcvs.fnal.gov/redmine/projects/art redmine] [https://cdcvs.fnal.gov/redmine/projects/art/repository/revisions/master/show/art browser] [https://listserv.fnal.gov/scripts/wa.exe?A0=ART-USERS art-users] [https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/AboutQualifiers product flags] [https://cdcvs.fnal.gov/redmine/projects/art/wiki/ArtExitCodes error codes]
* art    
* [https://gcc.gnu.org/projects/cxx-status.html gcc features development] [https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.iso gcc library dependence]
* CMS Framework    
* [https://indico.fnal.gov/category/1191/ recent art stakeholders meetings]; [https://cdcvs.fnal.gov/redmine/projects/art/wiki/Stakeholder_meeting_presentations older art stakeholders meetings]
* Root (v5.28)
* [https://cdcvs.fnal.gov/redmine/projects/artdaq/wiki artdaq wiki]
*  Geant4 DOxygen(v9.4.p01)
* [http://rpubs.com/paterno/303233 Paterno memory profiling instructions]
* Geant4 LXR
* [http://valgrind.org valgrind]]
* CLHEP(v.2.2.0.4)
* [https://cdcvs.fnal.gov/redmine/projects/art/wiki/Getting_started_with_MAP_and_DDT MAP and DDT debuggers]
* HepPDT
* [https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuide CMS Framework] [http://cmslxr.fnal.gov/lxr/ LXR]
* fhicl-cpp
* [https://cdcvs.fnal.gov/redmine/projects/larsoft/wiki/SetupCMSbotScriptsYourOrg CMS github PR] [https://cdcvs.fnal.gov/redmine/projects/larsoft/wiki/Maintaining_CMSbot_scripts_and_Jenkins_jobs more info]
* cetlib
* [https://root.cern.ch/root/ root] [https://root.cern.ch/guides/reference-guide docs]
* Message Facility
* [http://geant4.web.cern.ch/geant4/ geant] [https://web.fnal.gov/project/Geant4/SitePages/Home.aspx at Fermilab]  [http://www-geant4.kek.jp/Reference/9.4.p01/Geant4 DOxygen(v9.4.p01)] [http://www-geant4.kek.jp/LXR/ LXR]
* cpp0x
* [[Geant4Examples]] How to run the standard Geant4 examples on the Mu2e interactive machines.
* BTrk
* [http://public.muonsinc.com/Projects/G4beamline.aspx G4Beamline]  [http://mu2e-docdb.fnal.gov/cgi-bin/ShowDocument?docid=1490 Mu2e manual]
* LXR browsers for many Fermilab projects
* [http://proj-clhep.web.cern.ch/proj-clhep/ CLHEP] [http://proj-clhep.web.cern.ch/proj-clhep/doc/CLHEP_2_2_0_4/html/ CLHEP(v.2.2.0.4)]
* The art redmine wiki,  art-users archive
* [http://lcgapp.cern.ch/project/simu/HepPDT/ HepPDT]
* Other external software used by Mu2e with links to documentation.
* [https://cdcvs.fnal.gov/redmine/projects/fhicl/wiki fhicl] [https://cdcvs.fnal.gov/redmine/projects/fhicl-cpp/repository  fhicl-cpp]
 
* [https://cdcvs.fnal.gov/redmine/projects/cetlib cetlib] [https://cdcvs.fnal.gov/redmine/projects/cetlib/repository  browser] [https://fnalssi.github.io/cetmodules/ cetmodules]
* [https://cdcvs.fnal.gov/redmine/projects/messagefacility Message Facility] [https://cdcvs.fnal.gov/redmine/projects/messagefacility/repository browser]
* [https://cdcvs.fnal.gov/redmine/projects/cpp0x cpp0x] [https://cdcvs.fnal.gov/redmine/projects/cpp0x/repository browser]
* [http://www.boost.org/ boost]  [http://www.boost.org/doc/libs/1_47_0 browser]
* [[BTrk]] [https://github.com/KFTrack/BTrk browser]
* [https://cdcvs.fnal.gov/lxr/ LXR browsers] for many Fermilab projects
* [[Scons|scons]]
* [http://mu2e.fnal.gov/atwork/computing_atwork/mu2emars.shtml MARS] (password protected)
[[Category:Computing]]
[[Category:Computing]]
[[Category:Computing/Code]]
[[Category:Code]]

Latest revision as of 16:15, 23 August 2024

Building code

Configuring executables

Modules, Products, and Services

Code Management

Standards and Practices

External Packages