forked from HEP-FCC/FCCAnalyses
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'HEP-FCC:master' into master
- Loading branch information
Showing
74 changed files
with
9,605 additions
and
4,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
--- | ||
Language: Cpp | ||
# BasedOnStyle: LLVM | ||
AccessModifierOffset: -2 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveMacros: false | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveBitFields: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: Right | ||
AlignOperands: Align | ||
AlignTrailingComments: true | ||
AllowAllArgumentsOnNextLine: true | ||
AllowAllConstructorInitializersOnNextLine: true | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortEnumsOnASingleLine: true | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: All | ||
AllowShortLambdasOnASingleLine: All | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: MultiLine | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterStruct: false | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
BeforeLambdaBody: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Attach | ||
BreakBeforeInheritanceComma: false | ||
BreakInheritanceList: BeforeColon | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializersBeforeComma: false | ||
BreakConstructorInitializers: BeforeColon | ||
BreakAfterJavaFieldAnnotations: false | ||
BreakStringLiterals: true | ||
ColumnLimit: 80 | ||
CommentPragmas: '^ IWYU pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DeriveLineEnding: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ExperimentalAutoDetectBinPacking: false | ||
FixNamespaceComments: true | ||
ForEachMacros: | ||
- foreach | ||
- Q_FOREACH | ||
- BOOST_FOREACH | ||
IncludeBlocks: Preserve | ||
IncludeCategories: | ||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' | ||
Priority: 2 | ||
SortPriority: 0 | ||
- Regex: '^(<|"(gtest|gmock|isl|json)/)' | ||
Priority: 3 | ||
SortPriority: 0 | ||
- Regex: '.*' | ||
Priority: 1 | ||
SortPriority: 0 | ||
IncludeIsMainRegex: '(Test)?$' | ||
IncludeIsMainSourceRegex: '' | ||
IndentCaseLabels: false | ||
IndentCaseBlocks: false | ||
IndentGotoLabels: true | ||
IndentPPDirectives: None | ||
IndentExternBlock: AfterExternBlock | ||
IndentWidth: 2 | ||
IndentWrappedFunctionNames: false | ||
InsertTrailingCommas: None | ||
JavaScriptQuotes: Leave | ||
JavaScriptWrapImports: true | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCBinPackProtocolList: Auto | ||
ObjCBlockIndentWidth: 2 | ||
ObjCBreakBeforeNestedBlockParam: true | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakAssignment: 2 | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyBreakTemplateDeclaration: 10 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
PointerAlignment: Right | ||
ReflowComments: true | ||
SortIncludes: true | ||
SortUsingDeclarations: true | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInConditionalStatement: false | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
SpaceBeforeSquareBrackets: false | ||
Standard: Latest | ||
StatementMacros: | ||
- Q_UNUSED | ||
- QT_REQUIRE_VERSION | ||
TabWidth: 8 | ||
UseCRLF: false | ||
UseTab: Never | ||
WhitespaceSensitiveMacros: | ||
- STRINGIZE | ||
- PP_STRINGIZE | ||
- BOOST_PP_STRINGIZE | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: clang-format | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: cvmfs-contrib/github-action-cvmfs@v2 | ||
- name: Start container | ||
run: | | ||
docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash | ||
- name: Add upstream | ||
run: | | ||
docker exec CI_container /bin/bash -c 'cd ./Package | ||
git remote add upstream https://github.com/HEP-FCC/FCCAnalyses.git | ||
git fetch upstream' | ||
- name: Run formatter | ||
run: | | ||
docker exec CI_container /bin/bash -c 'cd ./Package | ||
source /cvmfs/sft.cern.ch/lcg/contrib/clang/14.0.6/x86_64-centos7/setup.sh | ||
git clang-format --style=file $(git merge-base upstream/master HEAD)' | ||
- name: Check cleanliness | ||
run: | | ||
docker exec CI_container /bin/bash -c 'cd ./Package | ||
git diff' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,11 +10,11 @@ files and producing the plots. | |
> | ||
> To have access to the FCC samples, you need to be subscribed to one of the | ||
> following e-groups (with owner approval) `fcc-eos-read-xx` with `xx=ee,hh,eh`. | ||
> For the time being, the configuration files are accessible on `fccsw` public | ||
> AFS. This is not optimal and will be changed in the future with migration to DIRAC, thus you are | ||
> also kindly asked to contact `[email protected]`, `[email protected]`, `clement.helsens@cern.ch` and request access to | ||
> `/afs/cern.ch/work/f/fccsw/public/FCCDicts/`. | ||
> | ||
> The configuration files are accessible at `/afs/cern.ch/work/f/fccsw/public/FCCDicts/` with a mirror at `/cvmfs/fcc.cern.ch/FCCDicts/`. | ||
> For accessing/reading information about existing datasets you do not need special rights. | ||
> However, if you need new datasets, you are invited to contact `[email protected]`, `[email protected]` or `juraj.smiesko@cern.ch` | ||
> who will explian the procedure, including granting the required access, where relevant. | ||
> | ||
Detailed code documentation can be found | ||
[here](http://hep-fcc.github.io/FCCAnalyses/doc/latest/index.html). | ||
|
@@ -31,6 +31,8 @@ Detailed code documentation can be found | |
* [Pre-selection](#pre-selection) | ||
* [Final selection](#final-selection) | ||
* [Plotting](#plotting) | ||
* [Contributing](#contributing) | ||
* [Formating](#code-formating) | ||
|
||
|
||
## RootDataFrame based | ||
|
@@ -46,9 +48,18 @@ ROOT dataframe documentation is available | |
|
||
## Getting started | ||
|
||
In order to use the FCC analysers within ROOT dataframe, a dictionary needs to | ||
be built and put into `LD_LIBRARY_PATH` (this happens in `setup.sh`). The | ||
following needs to be done when running local code and for developers. | ||
In order to use the FCC analyzers within ROOT RDataFrame, a dictionary needs to | ||
be built and put into `LD_LIBRARY_PATH`. In order to build and load FCCAnalyses | ||
with default options one needs to run following two commands: | ||
|
||
```shell | ||
source ./setup.sh | ||
fccanalysis build | ||
``` | ||
|
||
The FCCAnalyses is a CMake based project and any customizations can be provided | ||
in classic CMake style, the following commands are equivalent to default version | ||
of FCCAnalyses: | ||
|
||
```shell | ||
source ./setup.sh | ||
|
@@ -63,6 +74,21 @@ cd .. | |
> Each time changes are made in the C++ code, for example in | ||
> `analyzers/dataframe/` please do not forget to re-compile :) | ||
> | ||
> To cleanly recompile the default version of FCCAnalyses one can use | ||
> `fccanalysis build --clean-build`. | ||
In order to provide the possibility to keep developing an analysis with well | ||
defined Key4hep stack, the sub-command `fccanalysis pin` is provided. One can | ||
pin his/her analysis with | ||
``` | ||
source setup.sh | ||
fccanalysis pin | ||
``` | ||
|
||
To remove the pin run | ||
``` | ||
fccanalysis pin --clear | ||
``` | ||
|
||
|
||
## Generalities | ||
|
@@ -120,7 +146,7 @@ where `p8_ee_ZH_ecm240` should match an existing sample in the database, | |
of output files) and `output` in case you need to change the name of the output | ||
file (please note that then the sample will not be matched in the database for | ||
`finalSel.py` histograms normalisation). The other parameters are explained in | ||
[the example file](https://github.com/HEP-FCC/FCCAnalyses/tree/master/example/FCCee/higgs/mH-recoil/analysis_stage1.py). | ||
[the example file](https://github.com/HEP-FCC/FCCAnalyses/blob/master/examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py). | ||
|
||
To run the pre-selection stage of the example analysis run: | ||
|
||
|
@@ -195,3 +221,25 @@ Resulting plots will be located the `outdir` defined in the analysis file. | |
|
||
In an attempt to ease the development of new physics case studies, such as for the [FCCee physics performance](https://github.com/HEP-FCC/FCCeePhysicsPerformance) cases, a new experimental analysis package creation tool is introduced. | ||
[See here](case-studies/README.md) for more details. | ||
|
||
|
||
## Contributing | ||
|
||
### Code formating | ||
|
||
The preferred style of the C++ code in the FCCAnalyses is LLVM which is checked | ||
by CI job. | ||
|
||
Currently `clang-format` is not available in the Key4hep stack, but one can | ||
obtain a suitable version of it from CVMFS thanks to LCG: | ||
``` | ||
source /cvmfs/sft.cern.ch/lcg/contrib/clang/14.0.6/x86_64-centos7/setup.sh | ||
``` | ||
|
||
Then to apply formatting to a given file: | ||
``` | ||
clang-format -i -style=file /path/to/file.cpp | ||
``` | ||
|
||
Another way to obtain a recent version of `clang-format` is through downloading | ||
[Key4hep Spack instance](https://key4hep.github.io/key4hep-doc/spack-build-instructions-for-librarians/spack-setup.html#downloading-a-spack-instance). |
Oops, something went wrong.