Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pwg-c2f/analysis/centrality
  • o.lubynets/centrality
2 results
Show changes
Commits on Source (17)
Showing
with 680 additions and 216 deletions
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignOperands: false
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PointerAlignment: Left
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
UseTab: Never
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AccessorsWereOverridden" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AssociatedTypeMismatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CallDealloc" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CheckDtdRefs" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="CheckEmptyScriptTag" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CheckNodeTest" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CheckTagEmptyBody" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CheckValidXmlInScriptTagBody" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="CheckXmlFileWithXercesValidator" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="CommandLineInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="DuplicateAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HardwiredNamespacePrefix" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HidesClassScope" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlExtraClosingTag" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlMissingClosingTag" enabled="false" level="INFORMATION" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownAnchorTarget" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownAttribute" enabled="false" level="WARNING" enabled_by_default="false">
<option name="myValues">
<value>
<list size="0" />
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="HtmlUnknownBooleanAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownTag" enabled="false" level="WARNING" enabled_by_default="false">
<option name="myValues">
<value>
<list size="6">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
<inspection_tool class="HtmlUnknownTarget" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ImplementationHasNoInterface" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ImplicitTypeConversion" enabled="false" level="WARNING" enabled_by_default="false">
<option name="BITS" value="1720" />
<option name="FLAG_EXPLICIT_CONVERSION" value="true" />
<option name="IGNORE_NODESET_TO_BOOLEAN_VIA_STRING" value="true" />
</inspection_tool>
<inspection_tool class="IndexZeroUsage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="InterfaceHasNoImplementation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="Json5StandardCompliance" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="JsonDuplicatePropertyKeys" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="JsonSchemaCompliance" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="JsonSchemaDeprecation" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="JsonSchemaRefReference" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="JsonStandardCompliance" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="KeyValueCoding" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LastArgumentMustBeNull" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="MethodIsLaterInTheScope" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="MsBuiltinInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="MysqlParsingInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NoAttributeForProperty" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NoClassDefinition" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NoGetterOrSetter" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NotImplementedMethods" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NotImplementsProtocol" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NotInHierarchyMessage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NotReleasedValue" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NotVisibleClass" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCLegacyObjCLiteral" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCNotLocalizedString" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCNotReleasedIvar" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverriddenAttributeMismatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverriddenTypeMismatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PgSelectFromProcedureInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PrivateCategoryShouldBeNearImplementation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PropertyAndIvarTypeMismatch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyAbstractClassInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyArgumentListInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyAssignmentToLoopOrWithParameterInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyAsyncCallInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyAttributeOutsideInitInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyBroadExceptionInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyByteLiteralInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyCallByClassInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyCallingNonCallableInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyChainedComparisonsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyClassHasNoInitInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyComparisonWithNoneInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyDataclassInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyDecoratorInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyDefaultArgumentInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyDeprecationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyDictCreationInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyDictDuplicateKeysInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyDocstringTypesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyDunderSlotsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyExceptClausesOrderInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyExceptionInheritInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyFinalInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyFromFutureImportInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyGlobalUndefinedInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyInconsistentIndentationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyIncorrectDocstringInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyInitNewSignatureInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyInterpreterInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyListCreationInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyMethodFirstArgAssignmentInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyMethodMayBeStaticInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyMethodOverridingInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyMethodParametersInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyMissingConstructorInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyNamedTupleInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyNestedDecoratorsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyNonAsciiCharInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyNoneFunctionAssignmentInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyOldStyleClassesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyOverloadsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="false" level="WARNING" enabled_by_default="false">
<option name="ignoredPackages">
<value>
<list size="0" />
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyPep8NamingInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyPropertyAccessInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyPropertyDefinitionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyProtectedMemberInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyProtocolInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyRedeclarationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyRedundantParenthesesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyReturnFromInitInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PySetFunctionToLiteralInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyShadowingBuiltinsInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyShadowingNamesInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PySimplifyBooleanCheckInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PySingleQuotedDocstringInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyStatementEffectInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyStringExceptionInspection" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="PyStringFormatInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyStubPackagesAdvertiser" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyStubPackagesCompatibilityInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PySuperArgumentsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyTestParametrizedInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyTrailingSemicolonInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyTupleAssignmentBalanceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyTupleItemAssignmentInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyTypeCheckerInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyTypeHintsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyUnboundLocalVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyUnnecessaryBackslashInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyUnreachableCodeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="PyUnusedLocalInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false">
<option name="ignoreTupleUnpacking" value="true" />
<option name="ignoreLambdaParameters" value="true" />
<option name="ignoreLoopIterationVariables" value="true" />
<option name="ignoreVariablesStartingWithUnderscore" value="true" />
</inspection_tool>
<inspection_tool class="RedundantTypeConversion" enabled="false" level="WARNING" enabled_by_default="false">
<option name="CHECK_ANY" value="false" />
</inspection_tool>
<inspection_tool class="RegExpDuplicateAlternationBranch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="RegExpEmptyAlternationBranch" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="RegExpEscapedMetaCharacter" enabled="false" level="INFORMATION" enabled_by_default="false" />
<inspection_tool class="RegExpOctalEscape" enabled="false" level="INFORMATION" enabled_by_default="false" />
<inspection_tool class="RegExpRedundantEscape" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="RegExpRepeatedSpace" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="RegExpSingleCharAlternation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="RegExpUnexpectedAnchor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="ReleasingOfAssignProperties" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="RequiredAttributes" enabled="false" level="WARNING" enabled_by_default="false">
<option name="myAdditionalRequiredHtmlAttributes" value="" />
</inspection_tool>
<inspection_tool class="SetterForReadonlyProperty" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
<inspection_tool class="SqlAddNotNullColumnInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlAggregatesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlAmbiguousColumnInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlAutoIncrementDuplicateInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlCaseVsCoalesceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlCaseVsIfInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlCheckUsingColumnsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlConstantConditionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlCurrentSchemaInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlDeprecateTypeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlDerivedTableAliasInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlDialectInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlDropIndexedColumnInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlDuplicateColumnInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlErrorHandlingInspection" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="SqlIdentifierInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlIllegalCursorStateInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlInsertIntoGeneratedColumnInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlInsertValuesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlJoinWithoutOnInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlMultipleLimitClausesInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlNullComparisonInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlRedundantAliasInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlRedundantLimitInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlRedundantOrderingDirectionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlResolveInspection" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="SqlShouldBeInGroupByInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlSideEffectsInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlSignatureInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlStorageInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlStringLengthExceededInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlTriggerTransitionInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlTypeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlUnreachableCodeInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlUnusedSubqueryItemInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlUnusedVariableInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SqlWithoutWhereInspection" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringLocalization" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnavailableInDeploymentTarget" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnresolvedCollectionMessage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnresolvedMessage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnusedImportStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UsingZeroAsNil" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="XmlDefaultAttributeValue" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="XmlDeprecatedElement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="XmlDuplicatedId" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XmlHighlighting" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XmlInvalidId" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XmlPathReference" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XmlUnboundNsPrefix" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="XmlUnusedNamespaceDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="XmlWrongRootElement" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XsltDeclarations" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XsltTemplateInvocation" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="XsltUnusedDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="XsltVariableShadowing" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="YAMLDuplicatedKeys" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="YAMLRecursiveAlias" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="YAMLSchemaDeprecation" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="YAMLSchemaValidation" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="YAMLUnresolvedAlias" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="YAMLUnusedAnchor" enabled="false" level="WARNING" enabled_by_default="false" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/centrality.iml" filepath="$PROJECT_DIR$/.idea/centrality.iml" />
</modules>
</component>
</project>
\ No newline at end of file
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 3.5)
project(Centrality) project(Centrality)
set(CMAKE_MACOSX_RPATH 1) set(CMAKE_MACOSX_RPATH 1)
set(PROJECT_VERSION 1.0) set(PROJECT_VERSION 1.0)
...@@ -12,99 +12,46 @@ message(STATUS "Using C++${CMAKE_CXX_STANDARD}") ...@@ -12,99 +12,46 @@ message(STATUS "Using C++${CMAKE_CXX_STANDARD}")
# by default build optimized code with debug symbols # by default build optimized code with debug symbols
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE RELWITHDEBINFO) set(CMAKE_BUILD_TYPE Release)
endif () endif ()
# in DEBUG mode make verbose Makefile # in DEBUG mode make verbose Makefile
if (CMAKE_BUILD_TYPE MATCHES DEBUG) if (CMAKE_BUILD_TYPE MATCHES DEBUG OR CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_VERBOSE_MAKEFILE ON)
endif () endif ()
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb -DDEBUG -D__DEBUG -Wall") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -ggdb -DDEBUG -D__DEBUG -Wall -Wextra -fopenmp")
set(CMAKE_CXX_FLAGS_Debug "-O0 -ggdb -DDEBUG -D__DEBUG -Wall -Wextra -fopenmp")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -ftree-vectorize -ffast-math -DNODEBUG -fopenmp") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -ftree-vectorize -ffast-math -DNODEBUG -fopenmp")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -ggdb") set(CMAKE_CXX_FLAGS_Release "-O3 -march=native -ftree-vectorize -ffast-math -DNODEBUG -fopenmp")
message(STATUS "Using CXX flags for ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}") message(STATUS "Using CXX flags for ${CMAKE_BUILD_TYPE}: ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}")
set(SOURCES
src/BordersFinder.cpp
src/BordersFinderHelper.cpp
src/Getter.cpp
src/BordersFinder2D.cpp
src/Container.cpp
glauber/Fitter.cpp
glauber/FitterHelper.cpp
)
string(REPLACE ".cpp" ".h" HEADERS "${SOURCES}")
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
# Telling CMake where to find the ROOT installation. # Telling CMake where to find the ROOT installation.
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/lib") list(APPEND CMAKE_PREFIX_PATH ${ROOTSYS})
#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS) #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
find_package(ROOT REQUIRED COMPONENTS Core MathCore RIO Hist Tree) find_package(ROOT REQUIRED COMPONENTS Core MathCore RIO Hist Tree)
find_package(AnalysisTree QUIET)
# Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY) # Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
message(STATUS "Using ROOT: ${ROOT_VERSION} <${ROOT_CONFIG}>")
include_directories(${CMAKE_SOURCE_DIR} ${ROOT_INCLUDE_DIR} ${ROOT_INCLUDE_DIRS})
include(${ROOT_USE_FILE}) include(${ROOT_USE_FILE})
add_definitions(${ROOT_CXX_FLAGS})
include_directories(${CMAKE_SOURCE_DIR} ${ROOT_INCLUDE_DIRS})
set(DICT_FILE_NAME G__${PROJECT_NAME})
set(PCM_FILE_NAME lib${PROJECT_NAME})
ROOT_GENERATE_DICTIONARY(${DICT_FILE_NAME} ${HEADERS} LINKDEF src/CentralityLinkDef.h)
add_library(Centrality SHARED ${SOURCES} ${DICT_FILE_NAME})
target_link_libraries(Centrality ${ROOT_LIBRARIES})
# Create a main program using the library
add_executable(main main.cpp)
target_link_libraries(main Centrality ${ROOT_LIBRARIES})
target_include_directories(main PUBLIC src)
add_executable(glauber glauber/main.cpp)
target_link_libraries(glauber ${ROOT_LIBRARIES} Centrality)
# install(FILES ${HEADERS} DESTINATION include)
# install(TARGETS Centrality DESTINATION lib)
# Packaging routine
# For complete explanation
# @see https://cmake.org/cmake/help/git-master/manual/cmake-packages.7.html#creating-packages
include(GenerateExportHeader)
if (NOT AnalysisTree_FOUND)
message(STATUS "AnalysisTree is not found")
else ()
add_subdirectory(at_interface)
endif ()
generate_export_header(Centrality) add_subdirectory(src)
set_property(TARGET Centrality PROPERTY VERSION ${PROJECT_VERSION}) add_subdirectory(tasks)
set_property(TARGET Centrality PROPERTY SOVERSION ${PROJECT_VERSION})
set_property(TARGET Centrality PROPERTY INTERFACE_Centrality_MAJOR_VERSION 1)
set_property(TARGET Centrality APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INTERFACE_Centrality_MAJOR_VERSION)
install(TARGETS Centrality EXPORT CentralityTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install( install(
FILES FILES
${HEADERS} "${CMAKE_CURRENT_BINARY_DIR}/${PCM_FILE_NAME}.rootmap"
"${CMAKE_CURRENT_BINARY_DIR}/centrality_export.h"
DESTINATION
include/centrality
COMPONENT
Devel
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/${PCM_FILE_NAME}_rdict.pcm"
DESTINATION DESTINATION
lib lib
OPTIONAL OPTIONAL
...@@ -120,6 +67,8 @@ write_basic_package_version_file( ...@@ -120,6 +67,8 @@ write_basic_package_version_file(
export(EXPORT CentralityTargets export(EXPORT CentralityTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/Centrality/CentralityTargets.cmake") FILE "${CMAKE_CURRENT_BINARY_DIR}/Centrality/CentralityTargets.cmake")
message(STATUS "CentralityTargets: ${CentralityTargets}")
set(ConfigPackageLocation lib/cmake/Centrality) set(ConfigPackageLocation lib/cmake/Centrality)
set(Centrality_INCLUDE_DIR "include") set(Centrality_INCLUDE_DIR "include")
...@@ -129,9 +78,6 @@ configure_package_config_file( ...@@ -129,9 +78,6 @@ configure_package_config_file(
CentralityConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Centrality/CentralityConfig.cmake CentralityConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Centrality/CentralityConfig.cmake
INSTALL_DESTINATION ${ConfigPackageLocation} INSTALL_DESTINATION ${ConfigPackageLocation}
PATH_VARS Centrality_INCLUDE_DIR Centrality_LIBRARY_DIR PATH_VARS Centrality_INCLUDE_DIR Centrality_LIBRARY_DIR
# [NO_SET_AND_CHECK_MACRO]
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
# [INSTALL_PREFIX <path>]
) )
install(EXPORT CentralityTargets install(EXPORT CentralityTargets
......
# !!! NEW REPOSITORY
https://github.com/HeavyIonAnalysis/Centrality
# Centrality Framework # Centrality Framework
## Installation ## Installation
......
...@@ -4,7 +4,4 @@ ...@@ -4,7 +4,4 @@
#pragma link off all classes; #pragma link off all classes;
#pragma link off all functions; #pragma link off all functions;
#pragma link C++ class Glauber::Fitter+;
#pragma link C++ class Centrality::Getter+;
#endif #endif
set(SOURCES
CentralityFiller.cpp
# CentralityTask.cpp
# CentralityTaskTracks.cpp
# CentralityTaskPsd.cpp
)
string(REPLACE ".cpp" ".hpp" HEADERS "${SOURCES}")
set(DICT_FILE_NAME G__ATCentrality)
set(PCM_FILE_NAME libATCentrality)
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ${AnalysisTree_INCLUDE_DIR})
add_library(ATCentrality SHARED ${SOURCES} ${DICT_FILE_NAME})
ROOT_GENERATE_DICTIONARY(${DICT_FILE_NAME} ${HEADERS} LINKDEF ATCentralityLinkDef.hpp)
target_link_libraries(ATCentrality Centrality AnalysisTreeBase AnalysisTreeInfra ${ROOT_LIBRARIES})
#install(TARGETS Centrality EXPORT CentralityTargets
# LIBRARY DESTINATION lib
# ARCHIVE DESTINATION lib
# RUNTIME DESTINATION bin
# INCLUDES DESTINATION include
# )
#
#install(
# FILES
# ${HEADERS}
# DESTINATION
# include/Centrality
# COMPONENT
# Devel
#)
#
#install(
# FILES
# "${CMAKE_CURRENT_BINARY_DIR}/${PCM_FILE_NAME}_rdict.pcm"
# DESTINATION
# lib
# OPTIONAL
#)
#
#install(
# FILES
# "${CMAKE_CURRENT_BINARY_DIR}/${PCM_FILE_NAME}.rootmap"
# DESTINATION
# lib
# OPTIONAL
#)
#include "CentralityFiller.hpp"
#include <memory>
#include "TFile.h"
namespace AnalysisTree{
CentralityFiller::CentralityFiller(const std::string& file, const std::string& getter) {
auto centr_file = std::unique_ptr<TFile>(TFile::Open(file.c_str(), "read"));
if((!centr_file) || (centr_file->IsZombie())) {
throw std::runtime_error("No file or file is zombie");
}
getter_ = centr_file->Get<Centrality::Getter>(getter.c_str());
if(getter_ == nullptr) {
throw std::runtime_error("Centrality Getter is nullptr");
}
}
void CentralityFiller::Init() {
auto man = TaskManager::GetInstance();
auto chain = man->GetChain();
input_ = chain->GetBranch(input_name_);
is_event_header_ = input_.GetBranchType() == DetType::kEventHeader;
in_field_ = input_.GetField(input_field_name_);
in_branches_.emplace(input_name_);
auto conf = input_.GetConfig().Clone(output_name_, AnalysisTree::DetType::kEventHeader);
conf.AddField<float>(output_field_name_, "centrality, %");
output_ = Branch(conf);
out_field_ = output_.GetField(output_field_name_);
output_.SetMutable();
output_.Freeze();
input_.Freeze();
man->AddBranch(&output_);
}
void CentralityFiller::Exec() {
if(is_event_header_) {
FillFromEventHeader();
} else {
FillFromChannels();
}
}
void CentralityFiller::FillFromEventHeader() {
const auto value = input_[0][in_field_];
output_[0].CopyContent(input_[0]);
const auto centrality = getter_->GetCentrality(value);
output_[0].SetValue(out_field_, centrality);
}
void CentralityFiller::FillFromChannels() {
const auto n = input_.size();
int m{0};
for(size_t i = 0; i < n; ++i) {
if(!event_cuts_ || event_cuts_->Apply(input_[i])) {
m++;
}
}
const auto centrality = getter_->GetCentrality(m);
output_[0].SetValue(out_field_, centrality);
}
}
\ No newline at end of file
#ifndef CENTRALITY_AT_INTERFACE_CENTRALITYFILLER_HPP_
#define CENTRALITY_AT_INTERFACE_CENTRALITYFILLER_HPP_
#include <utility>
#include "AnalysisTree/Task.hpp"
#include "AnalysisTree/TaskManager.hpp"
#include "Getter.hpp"
namespace AnalysisTree{
class CentralityFiller : public AnalysisTree::Task{
public:
CentralityFiller() = delete;
CentralityFiller(const std::string& file, const std::string& getter);
void Init() override;
void Exec() override;
void Finish() override {
delete getter_;
}
void SetInput(std::string branch, std::string field = "") {
input_name_ = std::move(branch);
input_field_name_ = std::move(field);
}
void SetOutput(std::string branch, std::string field) {
output_name_ = std::move(branch);
output_field_name_ = std::move(field);
}
~CentralityFiller() override = default;
protected:
void FillFromEventHeader();
void FillFromChannels();
std::string input_name_;
std::string input_field_name_;
std::string output_name_;
std::string output_field_name_;
Centrality::Getter* getter_{nullptr};
AnalysisTree::Branch input_;
AnalysisTree::Branch output_;
AnalysisTree::Field in_field_;
AnalysisTree::Field out_field_;
bool is_event_header_{true};
// AnalysisTree::Cuts* cuts_{nullptr};
};
}
#endif //CENTRALITY_AT_INTERFACE_CENTRALITYFILLER_HPP_
# Contribution Guide # Contribution Guide
https://google.github.io/styleguide/cppguide.html https://google.github.io/styleguide/cppguide.html
## Doxygen documentation ## Doxygen documentation
Always document your code, e. g. put at least a brief class description Always document your code, e. g. put at least a brief class description
/** @file MyClass.h /** @file MyClass.h
...@@ -37,9 +38,11 @@ The selection of name spaces is reflected also in the directory structure for th ...@@ -37,9 +38,11 @@ The selection of name spaces is reflected also in the directory structure for th
## Include Files ## Include Files
In header files only use include which MUST be there. Unnecessary includes increase the compilation time. Most of the time all necessary includes can be moved to the implementation. In header files only use include which MUST be there. Unnecessary includes increase the compilation time. Most of the
time all necessary includes can be moved to the implementation.
To avoid including header files more than once, use the preprocessor macro _nsp_ClassName_h_ to mark a header as already included. Usage of these inclusion guards is nonnegotiable. To avoid including header files more than once, use the preprocessor macro _nsp_ClassName_h_ to mark a header as already
included. Usage of these inclusion guards is nonnegotiable.
// file: .../include/nsp/ClassName.h // file: .../include/nsp/ClassName.h
...@@ -51,34 +54,40 @@ To avoid including header files more than once, use the preprocessor macro _nsp_ ...@@ -51,34 +54,40 @@ To avoid including header files more than once, use the preprocessor macro _nsp_
#endif #endif
Since with the introduction of namespaces, a class can exist in more than one namespace, we can have header files with the same name to define the same class. We have to add the namespace both to the path for locating the file and to the preprocessor macro preventing multiple inclusion of a header. Since with the introduction of namespaces, a class can exist in more than one namespace, we can have header files with
the same name to define the same class. We have to add the namespace both to the path for locating the file and to the
preprocessor macro preventing multiple inclusion of a header.
## Pass by const reference ## Pass by const reference
* Complex objects should be passed by reference.
* Complex objects should be passed by reference.
* Don’t use it for simple types (int, float, . . . ), it can be an overhead * Don’t use it for simple types (int, float, . . . ), it can be an overhead
* Prefer over pointer: This makes sure you get a valid object * Prefer over pointer: This makes sure you get a valid object
void func(const myClass& c); // good void func(const myClass& c); // good void func(const myClass* c); // ok, if you know why (needed only in rare cases)
void func(const myClass* c); // ok, if you know why (needed only in rare cases) void func(myClass c); // not so good, unless you know why
void func(myClass c); // not so good, unless you know why
## Pointers ## Pointers
* Only use pointer if you have a strong reason!
* If you use objects on the stack you don’t have to care about deletion * Only use pointer if you have a strong reason!
* If you need pointers, prefer smart pointers over plain pointers * If you use objects on the stack you don’t have to care about deletion
* If you need pointers, prefer smart pointers over plain pointers
## Using namespace statement ## Using namespace statement
Due to the global effect on all code that includes the particular header, using and using namespace statement should never be given in header files. NEVER do that in header: Due to the global effect on all code that includes the particular header, using and using namespace statement should
never be given in header files. NEVER do that in header:
using namespace std; using namespace std;
This means all files including your header will have the std namespace. You could do it in the implementation, not considered nice style. Prefer importing only single function, only do it in your implementation This means all files including your header will have the std namespace. You could do it in the implementation, not
considered nice style. Prefer importing only single function, only do it in your implementation
using std::cout; using std::cout;
Furthermore, since using namespace statement has an immediate effect also outside of the file scope, in .cpp files all such statements should come after all includes. Furthermore, since using namespace statement has an immediate effect also outside of the file scope, in .cpp files all
You could also define an alias, this can even be done locally in a function body such statements should come after all includes. You could also define an alias, this can even be done locally in a
function body
using cout = std::cout; using cout = std::cout;
...@@ -89,71 +98,92 @@ consider using modern ‘typedef’ ...@@ -89,71 +98,92 @@ consider using modern ‘typedef’
## Abbreviations ## Abbreviations
In general, avoid abbreviations in variable and class names. Here is a list of accepted abbreviations which should not be expanded explicitly: In general, avoid abbreviations in variable and class names. Here is a list of accepted abbreviations which should not
be expanded explicitly:
* MC: Monte-Carlo * MC: Monte-Carlo
* NBD: Negative Binomial Distribution * NBD: Negative Binomial Distribution
* ... * ...
## Const correctness and constness issues ## Const correctness and constness issues
It is of utmost importance that all classes, functions and methods respect the correct and logical use of const modifier. Methods that do not change class data members should be declared const. Function and method parameters should be declared const if they are not intended to be changed inside of the function body. This is even more true when references are passed through the parameters.
It is of utmost importance that all classes, functions and methods respect the correct and logical use of const
modifier. Methods that do not change class data members should be declared const. Function and method parameters should
be declared const if they are not intended to be changed inside of the function body. This is even more true when
references are passed through the parameters.
In this respect the use of const_cast is strongly discouraged since it can unravel weird compiler bugs. In this respect the use of const_cast is strongly discouraged since it can unravel weird compiler bugs.
The rule of a thumb for each programmer should be that first of all a new variable (if possible) is declared not before the value for it is available (i.e. no C-style declarations of variables at the beginning of the code block) and that every new local variable is declared const by default. A forward declaration of a local variable should be used only in special cases when its value will be known only after complex processing (possibly taking place inside of a nested scope). The rule of a thumb for each programmer should be that first of all a new variable (if possible) is declared not before
the value for it is available (i.e. no C-style declarations of variables at the beginning of the code block) and that
every new local variable is declared const by default. A forward declaration of a local variable should be used only in
special cases when its value will be known only after complex processing (possibly taking place inside of a nested
scope).
## NULL vs. nullptr ## NULL vs. nullptr
Note that NULL is a (macro) remainder from C and should be avoided. nullptr is meant as a replacement to NULL. nullptr provides a typesafe pointer value representing an empty (null) pointer. The general rule of thumb that I recommend is that you should start using nullptr whenever you would have used NULL in the past. Even better: avoid usage of pointers completely. Almost everything can be done with references instead and is more bug-resistant.
Note that NULL is a (macro) remainder from C and should be avoided. nullptr is meant as a replacement to NULL. nullptr
provides a typesafe pointer value representing an empty (null) pointer. The general rule of thumb that I recommend is
that you should start using nullptr whenever you would have used NULL in the past. Even better: avoid usage of pointers
completely. Almost everything can be done with references instead and is more bug-resistant.
## Pointer * and reference & placement ## Pointer * and reference & placement
The * and & modifiers are part of the type and there thus they belong: The * and & modifiers are part of the type and there thus they belong:
Core::Track& foo; Core::Track& foo;
## Constructor initializer list ## Constructor initializer list
If possible put it directly after member declaration in the header If possible put it directly after member declaration in the header
Double32_t energy_{0}; // track energy in GeV Double32_t energy_{0}; // track energy in GeV
## Increment, decrement ## Increment, decrement
As default, only pre-increment (++i) and pre-decrement (--i) operators should be used, unless the post-increment/-decrement (i++) feature is explicitly required. The reason is that the post- versions require temporary storage of the previous value of a variable. The compiler will (most probably) optimize such waste away for the built-in types (int etc) but this does not happen for custom code of the various iterators (STL, Offline). The bad habit of placing ++ after the variables can be avoided by forcing yourself to use pre- versions of operators everywhere.
As default, only pre-increment (++i) and pre-decrement (--i) operators should be used, unless the
post-increment/-decrement (i++) feature is explicitly required. The reason is that the post- versions require temporary
storage of the previous value of a variable. The compiler will (most probably) optimize such waste away for the built-in
types (int etc) but this does not happen for custom code of the various iterators (STL, Offline). The bad habit of
placing ++ after the variables can be avoided by forcing yourself to use pre- versions of operators everywhere.
## Forbidden practices ## Forbidden practices
Generally, the C/FORTRAN-hackish style should be avoided. In particular, the following practices are absolutely forbidden.
Generally, the C/FORTRAN-hackish style should be avoided. In particular, the following practices are absolutely
forbidden.
Do not use fixed size C arrays when variable size arrays are needed, such as Do not use fixed size C arrays when variable size arrays are needed, such as
// A "probably big enough" fixed size array in a place where variable size array would be needed: // A "probably big enough" fixed size array in a place where variable size array would be needed:
double a[20]; double a[20];
Use STL vector instead, such as Use STL vector instead, such as
std::vector<double> a(20); std::vector<double> a(20);
Do not use dynamical C arrays, such as Do not use dynamical C arrays, such as
// Allocate: // Allocate:
double* a = (double*)calloc(30, sizeof(double)); double* a = (double*)calloc(30, sizeof(double));
// De-allocate: // De-allocate:
free(a); free(a);
Use STL vector instead, see previous point. Use STL vector instead, see previous point. Do not pass large data to function arguments via pointers, such as
Do not pass large data to function arguments via pointers, such as
int function(int a, double* array); int function(int a, double* array);
or or
int function(int a, double[] array); int function(int a, double[] array);
Use instead C++ reference: Use instead C++ reference:
int function(int a, std::vector<double>& array); int function(int a, std::vector<double>& array);
Do not use unnamed constants, such as Do not use unnamed constants, such as
std::vector<double> array(23); std::vector<double> array(23);
Use instead enums so that we know what 23 is: Use instead enums so that we know what 23 is:
// Declared somewhere at the beginning: // Declared somewhere at the beginning:
......
File moved
#include "FitterHelper.h"
void HistoCompare() { void HistoCompare() {
TFile *f = new TFile("root_files/out_histo_2.root"); TFile* f = new TFile("root_files/out_histo_2.root");
TH1F *hData = (TH1F *) f->Get("h1d_Mult_TPC_Ref"); TH1F* hData = (TH1F*) f->Get("h1d_Mult_TPC_Ref");
TH1F *h0 = new TH1F("h0", "", 125, 0, 250); TH1F* h0 = new TH1F("h0", "", 125, 0, 250);
TH1F *h1 = (TH1F *) f->Get("glaub_0.25_0.1709_0.78_1000000"); TH1F* h1 = (TH1F*) f->Get("glaub_0.25_0.1709_0.78_1000000");
TH1F *h2 = (TH1F *) f->Get("glaub_0.80_0.3048_0.75_1000000"); TH1F* h2 = (TH1F*) f->Get("glaub_0.80_0.3048_0.75_1000000");
TH1F *h3 = (TH1F *) f->Get("glaub_0.80_0.3048_0.75_1000000"); TH1F* h3 = (TH1F*) f->Get("glaub_0.80_0.3048_0.75_1000000");
TH1F *hDiff1 = new TH1F("diff1", "", 125, 0, 250); TH1F* hDiff1 = new TH1F("diff1", "", 125, 0, 250);
TH1F *hDiff2 = new TH1F("diff2", "", 125, 0, 250); TH1F* hDiff2 = new TH1F("diff2", "", 125, 0, 250);
TH1F *hDiff3 = new TH1F("diff3", "", 125, 0, 250); TH1F* hDiff3 = new TH1F("diff3", "", 125, 0, 250);
for (Int_t ii = 0; ii < 125; ii++) { for(Int_t ii = 0; ii < 125; ii++) {
if (hData->GetBinContent(ii + 1) > 0) { if(hData->GetBinContent(ii + 1) > 0) {
Float_t diff1 = (h1->GetBinContent(ii + 1) / hData->GetBinContent(ii + 1)); Float_t diff1 = (h1->GetBinContent(ii + 1) / hData->GetBinContent(ii + 1));
hDiff1->SetBinContent(ii + 1, diff1); hDiff1->SetBinContent(ii + 1, diff1);
...@@ -29,23 +29,23 @@ void HistoCompare() { ...@@ -29,23 +29,23 @@ void HistoCompare() {
} }
} }
TCanvas *c1 = new TCanvas("c1", "canvas", 1500, 900); TCanvas* c1 = new TCanvas("c1", "canvas", 1500, 900);
hDiff1->SetLineColor(2); hDiff1->SetLineColor(2);
hDiff2->SetLineColor(3); hDiff2->SetLineColor(3);
hDiff3->SetLineColor(4); hDiff3->SetLineColor(4);
hDiff1->Draw(); hDiff1->Draw();
hDiff2->Draw("same"); hDiff2->Draw("same");
// hDiff3->Draw("same"); // hDiff3->Draw("same");
h0->Draw("same"); h0->Draw("same");
TLegend *legDiff = new TLegend(0.4, 0.75, 0.75, 0.9); TLegend* legDiff = new TLegend(0.4, 0.75, 0.75, 0.9);
legDiff->AddEntry(hDiff1, "f = 0.25 mu = 0.1709 k = 0.78", "l"); legDiff->AddEntry(hDiff1, "f = 0.25 mu = 0.1709 k = 0.78", "l");
legDiff->AddEntry(hDiff2, "f = 0.80 mu = 0.3048 k = 0.75", "l"); legDiff->AddEntry(hDiff2, "f = 0.80 mu = 0.3048 k = 0.75", "l");
// legDiff->AddEntry(hDiff3 ,"f = 1", "l"); // legDiff->AddEntry(hDiff3 ,"f = 1", "l");
legDiff->Draw("same"); legDiff->Draw("same");
TCanvas *c2 = new TCanvas("c2", "canvas", 1500, 900); TCanvas* c2 = new TCanvas("c2", "canvas", 1500, 900);
h1->SetLineColor(2); h1->SetLineColor(2);
h2->SetLineColor(3); h2->SetLineColor(3);
...@@ -55,12 +55,12 @@ void HistoCompare() { ...@@ -55,12 +55,12 @@ void HistoCompare() {
h1->Draw(); h1->Draw();
hData->Draw("same"); hData->Draw("same");
h2->Draw("same"); h2->Draw("same");
// h3->Draw("same"); // h3->Draw("same");
TLegend *legData = new TLegend(0.4, 0.75, 0.75, 0.9); TLegend* legData = new TLegend(0.4, 0.75, 0.75, 0.9);
legData->AddEntry(h1, "f = 0.25 mu = 0.1709 k = 0.78", "l"); legData->AddEntry(h1, "f = 0.25 mu = 0.1709 k = 0.78", "l");
legData->AddEntry(h2, "f = 0.80 mu = 0.3048 k = 0.75", "l"); legData->AddEntry(h2, "f = 0.80 mu = 0.3048 k = 0.75", "l");
// legData->AddEntry(h3 ,"f = 1", "l"); // legData->AddEntry(h3 ,"f = 1", "l");
legData->AddEntry(hData, "data", "l"); legData->AddEntry(hData, "data", "l");
legData->Draw("same"); legData->Draw("same");
} }
\ No newline at end of file
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") { void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") {
TString CentralityFrameworkDir = "/lustre/nyx/cbm/users/klochkov/soft/CentralityFramework/"; TString CentralityFrameworkDir = "/lustre/nyx/cbm/users/klochkov/soft/CentralityFramework/";
// TString DataFileName = CentralityFrameworkDir + "containers/ana_dima_merged.root"; // TString DataFileName = CentralityFrameworkDir + "containers/ana_dima_merged.root";
TString DataFileName = "/lustre/nyx/cbm/users/klochkov/soft/PidFramework/input/DCM_1M.root"; TString DataFileName = "/lustre/nyx/cbm/users/klochkov/soft/PidFramework/input/DCM_1M.root";
gStyle->SetOptStat(0000); gStyle->SetOptStat(0000);
TFile *DataFile = new TFile(DataFileName, "read"); TFile* DataFile = new TFile(DataFileName, "read");
CentralityEventContainer *container = new CentralityEventContainer; CentralityEventContainer* container = new CentralityEventContainer;
TTree *ContTree = (TTree *) DataFile->Get("cbm_data"); TTree* ContTree = (TTree*) DataFile->Get("cbm_data");
ContTree->SetBranchAddress("CentralityEventContainer", &container); ContTree->SetBranchAddress("CentralityEventContainer", &container);
ContTree->Draw("CentralityEventContainer.GetDetectorWeight(3) >> h1(500, 0, 500)"); ContTree->Draw("CentralityEventContainer.GetDetectorWeight(3) >> h1(500, 0, 500)");
TH1F *hData1 = (TH1F *) gPad->GetPrimitive("h1"); TH1F* hData1 = (TH1F*) gPad->GetPrimitive("h1");
TFile *file = new TFile(InFileName); TFile* file = new TFile(InFileName);
TTree *tree = file->Get("test_tree"); TTree* tree = file->Get("test_tree");
Float_t f, mu, k; Float_t f, mu, k;
Float_t chi2; Float_t chi2;
Float_t sigma; Float_t sigma;
TH1F *h1 = new TH1F("h1", "", 500, 0, 500); TH1F* h1 = new TH1F("h1", "", 500, 0, 500);
tree->SetBranchAddress("f", &f); tree->SetBranchAddress("f", &f);
tree->SetBranchAddress("mu", &mu); tree->SetBranchAddress("mu", &mu);
...@@ -47,7 +47,7 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") { ...@@ -47,7 +47,7 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") {
if (chi2 > 2.5) continue; if (chi2 > 2.5) continue;
if (true) { if (true) {
TCanvas *c1 = new TCanvas("c1", "c1", 1200, 800); TCanvas* c1 = new TCanvas("c1", "c1", 1200, 800);
hData1->Draw(); hData1->Draw();
h1->Draw("same"); h1->Draw("same");
...@@ -57,7 +57,7 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") { ...@@ -57,7 +57,7 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") {
gPad->SetLogy(); gPad->SetLogy();
gPad->Update(); gPad->Update();
hData1->SetLineColor(kRed); hData1->SetLineColor(kRed);
TLegend *leg1 = new TLegend(0.7, 0.75, 0.85, 0.89); TLegend* leg1 = new TLegend(0.7, 0.75, 0.85, 0.89);
leg1->AddEntry(hData1, "M_{STS}", "l"); leg1->AddEntry(hData1, "M_{STS}", "l");
leg1->AddEntry(h1, "MC-Glauber Fit", "l"); leg1->AddEntry(h1, "MC-Glauber Fit", "l");
leg1->Draw("same"); leg1->Draw("same");
...@@ -65,7 +65,6 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") { ...@@ -65,7 +65,6 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") {
c1->SaveAs("fit.root"); c1->SaveAs("fit.root");
c1->SaveAs("fit.C"); c1->SaveAs("fit.C");
} }
Int_t jj; Int_t jj;
...@@ -73,7 +72,7 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") { ...@@ -73,7 +72,7 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") {
if (jj == 0) break; if (jj == 0) break;
} }
TGraph2D *g = new TGraph2D(x.size(), &(x[0]), &(y[0]), &(z[0])); TGraph2D* g = new TGraph2D(x.size(), &(x[0]), &(y[0]), &(z[0]));
g->GetXaxis()->SetTitle("f"); g->GetXaxis()->SetTitle("f");
g->SetName(" "); g->SetName(" ");
g->SetMinimum(5); g->SetMinimum(5);
...@@ -82,5 +81,4 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") { ...@@ -82,5 +81,4 @@ void RunGlauberAna(TString InFileName = "root_files/MinMult_60/merged.root") {
gPad->SetLogz(); gPad->SetLogz();
g->Draw("colz"); g->Draw("colz");
gPad->Update(); gPad->Update();
} }
\ No newline at end of file
enum eEstimators{ enum eEstimators{
kPsd = 0, kPsd = 0,
kTracks, kTracks,
kTracksPsd2D, kTracksPsd2D,
nEstimators nEstimators
}; };
void TestGetter(const TString file = "../build/test.root" ) void TestGetter(const TString file = "../build/test.root") {
{ std::unique_ptr<TFile> f{TFile::Open(file, "read")};
std::unique_ptr <TFile> f {TFile::Open(file, "read")};
std::unique_ptr <Centrality::Getter> getter1d {(Centrality::Getter*)f->Get("centr_getter_1d")}; std::unique_ptr<Centrality::Getter> getter1d{(Centrality::Getter*) f->Get("centr_getter_1d")};
std::unique_ptr <Centrality::Getter> getter2d {(Centrality::Getter*)f->Get("centr_getter_2d")}; std::unique_ptr<Centrality::Getter> getter2d{(Centrality::Getter*) f->Get("centr_getter_2d")};
Centrality::Container cont; Centrality::Container cont;
for (uint iEvent = 0; iEvent<1; ++iEvent) for(uint iEvent = 0; iEvent < 1; ++iEvent) {
{ const float value1 = 150.;
const float value1 = 150.; const float value2 = 20.;
const float value2 = 20.;
const float centrality1 = getter1d->GetCentrality(value1);
const float centrality1 = getter1d->GetCentrality(value1); const float centrality2 = getter2d->GetCentrality(value1, value2);
const float centrality2 = getter2d->GetCentrality(value1, value2);
cont.Clear();
cont.Clear(); cont.AddCentralityEstimator(kTracks, centrality1);
cont.AddCentralityEstimator(kTracks, centrality1); cont.AddCentralityEstimator(kTracksPsd2D, centrality2);
cont.AddCentralityEstimator(kTracksPsd2D, centrality2); }
}
std::cout << "centrality (estimator 1) = " << cont.GetCentrality(kTracks) << std::endl;
std::cout << "centrality (estimator 1) = " << cont.GetCentrality(kTracks) << std::endl; std::cout << "centrality (estimator 2) = " << cont.GetCentrality(kTracksPsd2D) << std::endl;
std::cout << "centrality (estimator 2) = " << cont.GetCentrality(kTracksPsd2D) << std::endl;
} }
const int nPoints = 10000; const int nPoints = 10000;
void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) { void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) {
TH1F *h1d_Mult_TPC_Ref/* = new TH1F("h1d_Mult_TPC_Ref","M_{TPC}^{ref}", 125, 0, 250)*/; TH1F* h1d_Mult_TPC_Ref /* = new TH1F("h1d_Mult_TPC_Ref","M_{TPC}^{ref}", 125, 0, 250)*/;
TFile *f111 = new TFile("/lustre/nyx/cbm/users/klochkov/soft/CentralityFramework/Macro/hTPC_ref.root"); TFile* f111 = new TFile("/lustre/nyx/cbm/users/klochkov/soft/CentralityFramework/Macro/hTPC_ref.root");
h1d_Mult_TPC_Ref = (TH1F *) f111->Get("h1Corr"); h1d_Mult_TPC_Ref = (TH1F*) f111->Get("h1Corr");
h1d_Mult_TPC_Ref->GetYaxis()->SetRangeUser(0.1, 1e5); h1d_Mult_TPC_Ref->GetYaxis()->SetRangeUser(0.1, 1e5);
TCanvas *c1 = new TCanvas("c1", "canvas", 1400, 1000); TCanvas* c1 = new TCanvas("c1", "canvas", 1400, 1000);
if (Mode == 2) { if(Mode == 2) {
c1->Divide(2, 1); c1->Divide(2, 1);
TPad *c1_1 = (TPad *) c1->GetListOfPrimitives()->FindObject("c1_1"); TPad* c1_1 = (TPad*) c1->GetListOfPrimitives()->FindObject("c1_1");
c1_1->SetLogy(1); c1_1->SetLogy(1);
} }
TString filename = Form("MinMult_%d/merged_%d.root", MultMin, MultMin); TString filename = Form("MinMult_%d/merged_%d.root", MultMin, MultMin);
TFile *file = new TFile(filename); TFile* file = new TFile(filename);
// TTree *tree = file->Get("fit_tree"); // TTree *tree = file->Get("fit_tree");
TTree *tree = file->Get("test_tree"); TTree* tree = file->Get("test_tree");
TH1F *h1 = new TH1F("h1", "", 125, 0, 250); TH1F* h1 = new TH1F("h1", "", 125, 0, 250);
TH1F *h3 = new TH1F("h3", "", 125, 0, 250); TH1F* h3 = new TH1F("h3", "", 125, 0, 250);
for (Int_t i = 0; i < 125; i++) for(Int_t i = 0; i < 125; i++) {
h3->SetBinContent(i + 1, 1); h3->SetBinContent(i + 1, 1);
}
h3->SetLineColor(3); h3->SetLineColor(3);
TH1F *hDiff = new TH1F("hDiff", "", 125, 0, 250); TH1F* hDiff = new TH1F("hDiff", "", 125, 0, 250);
hDiff->GetYaxis()->SetRangeUser(0.0, 2); hDiff->GetYaxis()->SetRangeUser(0.0, 2);
Float_t f, mu, k; Float_t f, mu, k;
...@@ -42,7 +43,7 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) { ...@@ -42,7 +43,7 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) {
Int_t n = tree->GetEntries(); Int_t n = tree->GetEntries();
TH2F *h2 = new TH2F("h2", "", 20, 0., 1., 50, 0., 1); TH2F* h2 = new TH2F("h2", "", 20, 0., 1., 50, 0., 1);
h1d_Mult_TPC_Ref->GetYaxis()->SetRangeUser(0.1, 1e6); h1d_Mult_TPC_Ref->GetYaxis()->SetRangeUser(0.1, 1e6);
h1d_Mult_TPC_Ref->SetLineColor(2); h1d_Mult_TPC_Ref->SetLineColor(2);
...@@ -60,7 +61,7 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) { ...@@ -60,7 +61,7 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) {
h1->Draw("same"); h1->Draw("same");
gPad->Update(); gPad->Update();
} }
// sigma = mu*(1+mu/k); // sigma = mu*(1+mu/k);
for (Int_t ii = 0; ii < 125; ii++) for (Int_t ii = 0; ii < 125; ii++)
if (h1d_Mult_TPC_Ref->GetBinContent(ii + 1) > 0) { if (h1d_Mult_TPC_Ref->GetBinContent(ii + 1) > 0) {
Float_t diff1 = (h1->GetBinContent(ii + 1) / h1d_Mult_TPC_Ref->GetBinContent(ii + 1)); Float_t diff1 = (h1->GetBinContent(ii + 1) / h1d_Mult_TPC_Ref->GetBinContent(ii + 1));
...@@ -78,16 +79,16 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) { ...@@ -78,16 +79,16 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) {
Int_t k_bin = int(k / 0.02 + 0.01); Int_t k_bin = int(k / 0.02 + 0.01);
Int_t sigma_bin = TMath::Nint(sigma * 50) + 1; Int_t sigma_bin = TMath::Nint(sigma * 50) + 1;
// if (chi2 < 2) // if (chi2 < 2)
std::cout << "f = " << f << " mu = " << mu << " k = " << k << " sigma = " << sigma << " chi2 = " << chi2 std::cout << "f = " << f << " mu = " << mu << " k = " << k << " sigma = " << sigma << " chi2 = " << chi2
<< std::endl; << std::endl;
// std::cout << "f = " << f_bin << " mu = " << mu << " k = " << k_bin << " sigma = " << sigma_bin << std::endl; // std::cout << "f = " << f_bin << " mu = " << mu << " k = " << k_bin << " sigma = " << sigma_bin << std::endl;
x[i] = f; x[i] = f;
y[i] = sigma; y[i] = sigma;
z[i] = chi2; z[i] = chi2;
// if (chi2 < 50) // if (chi2 < 50)
h2->SetBinContent(f_bin, sigma_bin, chi2); h2->SetBinContent(f_bin, sigma_bin, chi2);
if (Mode == 2) { if (Mode == 2) {
...@@ -98,7 +99,7 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) { ...@@ -98,7 +99,7 @@ void TreeReader(Int_t MultMin = 130, Int_t Mode = 2) {
} }
if (Mode == 1) { if (Mode == 1) {
TGraph2D *g = new TGraph2D(nPoints, x, y, z); TGraph2D* g = new TGraph2D(nPoints, x, y, z);
g->GetXaxis()->SetTitle("f"); g->GetXaxis()->SetTitle("f");
g->GetYaxis()->SetTitle("sigma"); g->GetYaxis()->SetTitle("sigma");
g->Draw("colz"); g->Draw("colz");
......
File moved
...@@ -7,15 +7,15 @@ void plot_chi2(TString InFileName) { ...@@ -7,15 +7,15 @@ void plot_chi2(TString InFileName) {
TString histoname = "reco_info/hMreco"; TString histoname = "reco_info/hMreco";
std::unique_ptr<TFile> fqa{TFile::Open(qa_filename.Data())}; std::unique_ptr<TFile> fqa{TFile::Open(qa_filename.Data())};
TH1F *hData1 = (TH1F *) fqa->Get(histoname); TH1F* hData1 = (TH1F*) fqa->Get(histoname);
TFile *file = new TFile(InFileName); TFile* file = new TFile(InFileName);
TTree *tree = (TTree *) file->Get("test_tree"); TTree* tree = (TTree*) file->Get("test_tree");
Float_t f, mu, k; Float_t f, mu, k;
Float_t chi2; Float_t chi2;
Float_t sigma; Float_t sigma;
TH1F *h1 = new TH1F("h1", "", 500, 0, 500); TH1F* h1 = new TH1F("h1", "", 500, 0, 500);
tree->SetBranchAddress("f", &f); tree->SetBranchAddress("f", &f);
tree->SetBranchAddress("mu", &mu); tree->SetBranchAddress("mu", &mu);
...@@ -42,10 +42,10 @@ void plot_chi2(TString InFileName) { ...@@ -42,10 +42,10 @@ void plot_chi2(TString InFileName) {
y.push_back(k); y.push_back(k);
z.push_back(chi2); z.push_back(chi2);
// if ( chi2 > 2.5 ) continue; // if ( chi2 > 2.5 ) continue;
if (false) { if (false) {
TCanvas *c1 = new TCanvas("c1", "c1", 1200, 800); TCanvas* c1 = new TCanvas("c1", "c1", 1200, 800);
hData1->Draw(); hData1->Draw();
h1->Draw("same"); h1->Draw("same");
...@@ -55,7 +55,7 @@ void plot_chi2(TString InFileName) { ...@@ -55,7 +55,7 @@ void plot_chi2(TString InFileName) {
gPad->SetLogy(); gPad->SetLogy();
gPad->Update(); gPad->Update();
hData1->SetLineColor(kRed); hData1->SetLineColor(kRed);
TLegend *leg1 = new TLegend(0.7, 0.75, 0.85, 0.89); TLegend* leg1 = new TLegend(0.7, 0.75, 0.85, 0.89);
leg1->AddEntry(hData1, "M_{STS}", "l"); leg1->AddEntry(hData1, "M_{STS}", "l");
leg1->AddEntry(h1, "MC-Glauber Fit", "l"); leg1->AddEntry(h1, "MC-Glauber Fit", "l");
leg1->Draw("same"); leg1->Draw("same");
...@@ -63,22 +63,20 @@ void plot_chi2(TString InFileName) { ...@@ -63,22 +63,20 @@ void plot_chi2(TString InFileName) {
c1->SaveAs("fit.root"); c1->SaveAs("fit.root");
c1->SaveAs("fit.C"); c1->SaveAs("fit.C");
} }
// Int_t jj; // Int_t jj;
// std::cin >> jj; // std::cin >> jj;
// if (jj == 0) break; // if (jj == 0) break;
} }
TCanvas *c1 = new TCanvas("c1", "c1", 800, 800); TCanvas* c1 = new TCanvas("c1", "c1", 800, 800);
TGraph2D *g = new TGraph2D(x.size(), &(x[0]), &(y[0]), &(z[0])); TGraph2D* g = new TGraph2D(x.size(), &(x[0]), &(y[0]), &(z[0]));
g->SetName("#chi^{2} vs f, k"); g->SetName("#chi^{2} vs f, k");
g->SetTitle("#chi^{2} vs f, k; f; k; #chi^{2}"); g->SetTitle("#chi^{2} vs f, k; f; k; #chi^{2}");
// gPad->SetLogz(); // gPad->SetLogz();
g->Draw("colz"); g->Draw("colz");
gPad->Update(); gPad->Update();
} }
{ {
const TString dir="../build/"; const TString dir = "../build/";
gSystem->Load( dir + "libCentrality.so"); gSystem->
Load(dir
+ "libCentrality.so");
} }