Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pwg-c2f
data
data_tree_qa
Commits
7293dd54
Commit
7293dd54
authored
Oct 27, 2018
by
Oleg Golosov
Browse files
hate
parent
adcbef23
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
760 additions
and
310 deletions
+760
-310
CMakeLists.txt
CMakeLists.txt
+120
-13
DataTreeQAConfig.cmake.in
DataTreeQAConfig.cmake.in
+13
-0
cuts/DataTreeCuts.cxx
cuts/DataTreeCuts.cxx
+11
-13
cuts/DataTreeCutsConfig.h
cuts/DataTreeCutsConfig.h
+13
-13
macro/PopulateQAConfigurations.py
macro/PopulateQAConfigurations.py
+56
-7
macro/RunDataTreeQA.C
macro/RunDataTreeQA.C
+61
-0
qa/DataTreeQA.cxx
qa/DataTreeQA.cxx
+411
-231
qa/DataTreeQA.h
qa/DataTreeQA.h
+57
-27
qa/DataTreeQAConfig.h
qa/DataTreeQAConfig.h
+18
-6
No files found.
CMakeLists.txt
View file @
7293dd54
cmake_minimum_required
(
VERSION 3.0
)
project
(
DataTreeQA
)
set
(
CMAKE_BUILD_TYPE debug
)
set
(
PROJECT_VERSION 1.0
)
# You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
# - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
# - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
list
(
APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}
)
list
(
APPEND CMAKE_PREFIX_PATH
${
ROOTSYS
}
)
list
(
APPEND CMAKE_PREFIX_PATH $ENV{DATATREE_HOME}
)
# For old version of ROOT (<5.34.34), cmake complaints on absence of FindROOT.cmake in
# CMAKE_MODULE_PATH. To overcome this problem uncomment the following line
#list(APPEND CMAKE_MODULE_PATH $ENV{ROOTSYS}/etc/cmake)
#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
find_package
(
ROOT REQUIRED COMPONENTS RIO Tree
)
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
# For old version of ROOT (<5.34.34) FindROOT.cmake ROOT_USE_FILE is not
# defined in FindROOT.cmake; Hence, simply comment this line
include
(
${
ROOT_USE_FILE
}
)
include_directories
(
${
CMAKE_SOURCE_DIR
}
${
ROOT_INCLUDE_DIRS
}
${
DataTree_INCLUDE_DIR
}
)
#include_directories(${CMAKE_SOURCE_DIR} ${ROOT_INCLUDE_DIRS} ${DataTree_INCLUDE_DIR})
include_directories
(
${
ROOT_INCLUDE_DIR
}
${
ROOT_INCLUDE_DIRS
}
)
include_directories
(
criterion cuts qa
)
add_definitions
(
${
ROOT_CXX_FLAGS
}
)
# set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wconversion -Wshadow") # add -g -ggdb for debug
set
(
CMAKE_CXX_FLAGS
"-Wall"
)
# add -g -ggdb for debug
find_package
(
DataTree REQUIRED
)
############################
# CRITERIONS LIBRARY
############################
file
(
GLOB DataTreeCriterion_SOURCES criterion/*.cxx
)
file
(
GLOB DataTreeCriterion_HEADERS RELATIVE
${
CMAKE_SOURCE_DIR
}
criterion/*.h
)
#
file(GLOB DataTreeCriterion_SOURCES criterion/*.cxx)
#
file(GLOB DataTreeCriterion_HEADERS RELATIVE ${CMAKE_SOURCE_DIR}
/criterion
criterion/*.h)
#ROOT_GENERATE_DICTIONARY(G__DataTreeCriterion
# ${DataTreeCriterion_HEADERS}
...
...
@@ -52,13 +54,118 @@ file(GLOB DataTreeCriterion_HEADERS RELATIVE ${CMAKE_SOURCE_DIR} criterion/*.h)
############################
# qa
############################
ROOT_GENERATE_DICTIONARY
(
G__DataTreeQA
qa/DataTreeQA.h cuts/DataTreeAbstractCuts.h cuts/DataTreeCutsConfig.h cuts/DataTreeCuts.h qa/DataTreeQAConfig.h
LINKDEF DataTreeQALinkDef.h
OPTIONS -m
${
CMAKE_BINARY_DIR
}
/DataTree/libDataTree_rdict.pcm -I
${
DataTree_INCLUDE_DIR
}
set
(
DICT_FILE_NAME G__
${
PROJECT_NAME
}
)
set
(
PCM_FILE_NAME lib
${
PROJECT_NAME
}
)
file
(
GLOB DataTreeCuts_SOURCES cuts/*.cxx
)
file
(
GLOB DataTreeCuts_HEADERS cuts/*.h
)
file
(
GLOB DataTreeCuts_HEADERS_DICT RELATIVE
${
CMAKE_SOURCE_DIR
}
/cuts cuts/*.h
)
file
(
GLOB DataTreeQA_SOURCES qa/*.cxx
)
file
(
GLOB DataTreeQA_HEADERS qa/*.h
)
file
(
GLOB DataTreeQA_HEADERS_DICT RELATIVE
${
CMAKE_SOURCE_DIR
}
/qa qa/*.h
)
ROOT_GENERATE_DICTIONARY
(
${
DICT_FILE_NAME
}
${
DataTreeCuts_HEADERS_DICT
}
${
DataTreeQA_HEADERS_DICT
}
LINKDEF
${
CMAKE_CURRENT_SOURCE_DIR
}
/DataTreeQALinkDef.h
OPTIONS -s
${
PCM_FILE_NAME
}
-I
${
DataTree_INCLUDE_DIR
}
-DDATATREE_
${
EXPERIMENT
}
)
add_library
(
DataTreeQA SHARED
qa/DataTreeQA.cxx cuts/DataTreeCutsConfig.cxx cuts/DataTreeCuts.cxx G__DataTreeQA.cxx qa/DataTreeQAConfig
.cxx
)
add_library
(
DataTreeQA SHARED
${
DataTreeCuts_SOURCES
}
${
DataTreeQA_SOURCES
}
${
DICT_FILE_NAME
}
.cxx
)
target_link_libraries
(
DataTreeQA
${
ROOT_LIBRARIES
}
DataTree
)
target_compile_definitions
(
DataTreeQA PUBLIC DATATREE_
${
EXPERIMENT
}
)
add_executable
(
RunDataTreeQA macro/RunDataTreeQA.C
)
target_link_libraries
(
RunDataTreeQA DataTree DataTreeQA
${
ROOT_LIBRARIES
}
)
set
(
HEADERS
${
DataTreeCriterion_HEADERS
}
${
DataTreeCuts_HEADERS
}
${
DataTreeQA_HEADERS
}
)
include
(
GenerateExportHeader
)
if
(
${
CMAKE_MAJOR_VERSION
}
GREATER 2
)
generate_export_header
(
DataTreeQA
)
set_property
(
TARGET DataTreeQA PROPERTY VERSION
${
PROJECT_VERSION
}
)
set_property
(
TARGET DataTreeQA PROPERTY SOVERSION
${
PROJECT_VERSION
}
)
set_property
(
TARGET DataTreeQA PROPERTY INTERFACE_DataTreeQA_MAJOR_VERSION 1
)
set_property
(
TARGET DataTreeQA APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INTERFACE_DataTreeQA_MAJOR_VERSION
)
install
(
TARGETS DataTreeQA EXPORT DataTreeQATargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
install
(
FILES
${
HEADERS
}
"
${
CMAKE_CURRENT_BINARY_DIR
}
/datatreeqa_export.h"
DESTINATION
include
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
(
CMakePackageConfigHelpers
)
write_basic_package_version_file
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/DataTreeQA/DataTreeQAConfigVersion.cmake"
VERSION
${
PROJECT_VERSION
}
COMPATIBILITY AnyNewerVersion
)
export
(
EXPORT DataTreeQATargets
FILE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/DataTreeQA/DataTreeQATargets.cmake"
)
set
(
ConfigPackageLocation lib/cmake/DataTreeQA
)
set
(
DataTreeQA_INCLUDE_DIR
"include"
)
set
(
DataTreeQA_LIBRARY_DIR
"lib"
)
configure_package_config_file
(
DataTreeQAConfig.cmake.in
${
CMAKE_CURRENT_BINARY_DIR
}
/DataTreeQA/DataTreeQAConfig.cmake
INSTALL_DESTINATION
${
ConfigPackageLocation
}
PATH_VARS DataTreeQA_INCLUDE_DIR DataTreeQA_LIBRARY_DIR
# [NO_SET_AND_CHECK_MACRO]
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
# [INSTALL_PREFIX <path>]
)
install
(
EXPORT DataTreeQATargets
FILE
DataTreeQATargets.cmake
DESTINATION
${
ConfigPackageLocation
}
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/DataTreeQA/DataTreeQAConfig.cmake"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/DataTreeQA/DataTreeQAConfigVersion.cmake"
DESTINATION
${
ConfigPackageLocation
}
COMPONENT
Devel
)
else
()
message
(
"CMAKE_MAJOR_VERSION <= 2. Packaging routine won't be generated"
)
endif
()
DataTreeQAConfig.cmake.in
0 → 100644
View file @
7293dd54
include("${CMAKE_CURRENT_LIST_DIR}/DataTreeQATargets.cmake")
@PACKAGE_INIT@
message ("-- Found DataTreeQA...")
set(DataTreeQA_INCLUDE_DIR "@PACKAGE_DataTreeQA_INCLUDE_DIR@")
message ("DataTreeQA_INCLUDE_DIR = ${DataTreeQA_INCLUDE_DIR}")
set(DataTreeQA_LIBRARY_DIR "@PACKAGE_DataTreeQA_LIBRARY_DIR@")
message ("DataTreeQA_LIBRARY_DIR = ${DataTreeQA_LIBRARY_DIR}")
cuts/DataTreeCuts.cxx
View file @
7293dd54
...
...
@@ -52,26 +52,24 @@ Bool_t DataTreeCuts::IsGoodTrack(const DataTreeTrack &track) {
const
Int_t
nHitsPot
=
nHitsPotVTPC1
+
nHitsPotVTPC2
+
nHitsPotMTPC
;
if
(
fCutsConfig
->
IsApplyTrackQuality
())
{
if
(
nHitsPot
!=
0
&&
!
(
fCutsConfig
->
GetNHitsToNHitsPotMin
()
<
Double_t
(
nHits
)
/
nHitsPot
&&
Double_t
(
nHits
)
/
nHitsPot
<
1.0
))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetNHitsTotalMin
()
==
-
999
)
&&
!
(
nHits
>=
fCutsConfig
->
GetNHitsTotalMin
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetNHitsToNHitsPotMin
()
==
-
999
)
&&
!
(
nHitsPot
==
0
)
&&
!
(
fCutsConfig
->
GetNHitsToNHitsPotMin
()
<
Double_t
(
nHits
)
/
nHitsPot
&&
Double_t
(
nHits
)
/
nHitsPot
<
1.0
))
return
kFALSE
;
if
(
!
(
0
<
chi2
&&
chi2
<
fCutsConfig
->
GetTrackChiMax
()))
return
kFALSE
;
if
(
!
(
nHits
>=
fCutsConfig
->
GetNHitsTotalMin
()))
return
kFALSE
;
if
(
!
(
nHitsVTPC1
+
nHitsVTPC2
>=
fCutsConfig
->
GetNHitsVTPCMin
()))
return
kFALSE
;
if
(
!
(
nHitsPotVTPC1
+
nHitsPotVTPC2
>=
fCutsConfig
->
GetNHitsPotVTPCMin
()))
return
kFALSE
;
if
(
!
(
nHitsMTPC
>=
fCutsConfig
->
GetNHitsMTPCMin
()))
return
kFALSE
;
if
(
!
(
nHitsPotMTPC
>=
fCutsConfig
->
GetNHitsPotMTPCMin
()))
return
kFALSE
;
if
(
!
(
nHits
>=
fCutsConfig
->
GetNHitsTotalMin
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetNHitsVTPCMin
()
==
-
999
)
&&
!
(
nHitsVTPC1
+
nHitsVTPC2
>=
fCutsConfig
->
GetNHitsVTPCMin
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetNHitsPotVTPCMin
()
==
-
999
)
&&
!
(
nHitsPotVTPC1
+
nHitsPotVTPC2
>=
fCutsConfig
->
GetNHitsPotVTPCMin
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetNHitsMTPCMin
()
==
-
999
)
&&
!
(
nHitsMTPC
>=
fCutsConfig
->
GetNHitsMTPCMin
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetNHitsPotMTPCMin
()
==
-
999
)
&&
!
(
nHitsPotMTPC
>=
fCutsConfig
->
GetNHitsPotMTPCMin
()))
return
kFALSE
;
// if (! (nHitsPotVTPC1 >= fCutsConfig->GetNHitsPotVTPC1Min()) &&
// ! (nHitsPotVTPC2 >= fCutsConfig->GetNHitsPotVTPC2Min()) &&
// ! (nHitsPotMTPC >= fCutsConfig->GetNHitsPotMTPCMin())) return kFALSE; // NA49 - comment the upper 6 if's
if
(
!
(
fabs
(
dca_X
-
fCutsConfig
->
GetDCA_X_Center
())
<
fCutsConfig
->
GetDCA_X_Max
()))
return
kFALSE
;
if
(
!
(
fabs
(
dca_Y
-
fCutsConfig
->
GetDCA_Y_Center
())
<
fCutsConfig
->
GetDCA_Y_Max
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetDCA_X_Max
()
==
-
999
)
&&
!
(
fabs
(
dca_X
-
fCutsConfig
->
GetDCA_X_Center
())
<
fCutsConfig
->
GetDCA_X_Max
()))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetDCA_Y_Max
()
==
-
999
)
&&
!
(
fabs
(
dca_Y
-
fCutsConfig
->
GetDCA_Y_Center
())
<
fCutsConfig
->
GetDCA_Y_Max
()))
return
kFALSE
;
if
(
!
(
Sqrt
(
Power
(
dca_X
-
fCutsConfig
->
GetDCA_X_Center
(),
2.0
)
+
Power
(
dca_Y
-
fCutsConfig
->
GetDCA_Y_Center
(),
2.0
))
<
fCutsConfig
->
GetDCA_Max
()
))
return
kFALSE
;
if
(
!
(
fCutsConfig
->
GetDCA_Max
()
==
-
999
)
&&
!
(
Sqrt
(
Power
(
dca_X
-
fCutsConfig
->
GetDCA_X_Center
(),
2.0
)
+
Power
(
dca_Y
-
fCutsConfig
->
GetDCA_Y_Center
(),
2.0
))
<
fCutsConfig
->
GetDCA_Max
()))
return
kFALSE
;
}
if
(
fCutsConfig
->
IsApplyTrackKinematics
())
{
...
...
cuts/DataTreeCutsConfig.h
View file @
7293dd54
...
...
@@ -346,18 +346,18 @@ private:
* Track quality cuts
*/
Bool_t
fApplyTrackQuality
{
kFALSE
};
Int_t
fNHitsVTPCMin
{
0
};
Int_t
fNHitsMTPCMin
{
0
};
Int_t
fNHitsPotVTPCMin
{
0
};
Int_t
fNHitsPotMTPCMin
{
0
};
Int_t
fNHitsTotalMin
{
0
};
Double_t
fNHitsToNHitsPotMin
{
0
};
Double_t
fTrackChiMax
{
1000
};
Double_t
fDCA_Max
{
1000
};
Double_t
fDCA_X_Max
{
1000
};
Double_t
fDCA_Y_Max
{
1000
};
Double_t
fDCA_X_Center
{
0
};
Double_t
fDCA_Y_Center
{
0
};
Int_t
fNHitsVTPCMin
{
-
999
};
Int_t
fNHitsMTPCMin
{
-
999
};
Int_t
fNHitsPotVTPCMin
{
-
999
};
Int_t
fNHitsPotMTPCMin
{
-
999
};
Int_t
fNHitsTotalMin
{
-
999
};
Double_t
fNHitsToNHitsPotMin
{
-
999.
};
Double_t
fTrackChiMax
{
-
999
};
Double_t
fDCA_Max
{
-
999.
};
Double_t
fDCA_X_Max
{
-
999.
};
Double_t
fDCA_Y_Max
{
-
999.
};
Double_t
fDCA_X_Center
{
0
.
};
Double_t
fDCA_Y_Center
{
0
.
};
/**
* Kinematics
...
...
@@ -367,7 +367,7 @@ private:
Double_t
fPtMax
{
-
999.
};
Double_t
fEtaMin
{
-
999.
};
Double_t
fEtaMax
{
-
999.
};
Double_t
fRapidityWindow
[
2
];
Double_t
fRapidityWindow
[
2
]
=
{
-
999.
,
-
999.
}
;
/**
...
...
macro/PopulateQAConfigurations.py
View file @
7293dd54
...
...
@@ -30,11 +30,60 @@ default_mc_config.SetExperiment('NA61')
default_mc_config
.
SetSystem
(
'pbpb'
)
default_mc_config
.
SetIsSimulation
(
True
)
default_mc_config
.
SetBeamMomentum
(
13
)
default_mc_config
.
SetMidRapidity
(
1.66155580381
)
#
default_mc_config.SetMidRapidity(1.66155580381)
default_mc_config
.
SetCutsConfig
(
default_cuts
)
default_mc_config
.
SetNominalVertex
(
0.0
,
0.0
,
-
591.9
)
default_mc_config
.
Write
()
#
# DEFAULT CBM CONFIG
#
default_cbm_cuts
=
ROOT
.
cuts
.
DataTreeCutsConfig
(
'default_cbm_cuts'
)
default_cbm_cuts
.
ApplyEventQuality
(
False
)
default_cbm_cuts
.
ApplyEventVertex
(
False
)
default_cbm_cuts
.
ApplyTrackQuality
(
True
)
default_cbm_cuts
.
SetTrackChiMax
(
5
)
default_cbm_cuts
.
SetFittedVertexId
(
0
)
default_cbm_cuts
.
Write
()
cbm_3_3agev_config
=
ROOT
.
DataTreeQAConfig
();
cbm_3_3agev_config
.
SetName
(
'cbm_3.3agev_config'
)
cbm_3_3agev_config
.
SetExperiment
(
'CBM'
)
cbm_3_3agev_config
.
SetSystem
(
'auau'
)
cbm_3_3agev_config
.
SetIsSimulation
(
True
)
cbm_3_3agev_config
.
SetBeamMomentum
(
3.3
)
cbm_3_3agev_config
.
SetMsimMax
(
600
)
cbm_3_3agev_config
.
SetMrecoMax
(
250
)
cbm_3_3agev_config
.
SetPSDEnergyMax
(
20
)
cbm_3_3agev_config
.
SetCutsConfig
(
default_cbm_cuts
)
cbm_3_3agev_config
.
SetNominalVertex
(
0.0
,
0.0
,
0.0
)
cbm_3_3agev_config
.
Write
()
cbm_5_36agev_config
=
ROOT
.
DataTreeQAConfig
();
cbm_5_36agev_config
.
SetName
(
'cbm_5.36agev_config'
)
cbm_5_36agev_config
.
SetExperiment
(
'CBM'
)
cbm_5_36agev_config
.
SetSystem
(
'auau'
)
cbm_5_36agev_config
.
SetIsSimulation
(
True
)
cbm_5_36agev_config
.
SetBeamMomentum
(
5.36
)
cbm_5_36agev_config
.
SetMsimMax
(
800
)
cbm_5_36agev_config
.
SetMrecoMax
(
400
)
cbm_5_36agev_config
.
SetPSDEnergyMax
(
30
)
cbm_5_36agev_config
.
SetCutsConfig
(
default_cbm_cuts
)
cbm_5_36agev_config
.
SetNominalVertex
(
0.0
,
0.0
,
0.0
)
cbm_5_36agev_config
.
Write
()
cbm_12agev_config
=
ROOT
.
DataTreeQAConfig
();
cbm_12agev_config
.
SetName
(
'cbm_12agev_config'
)
cbm_12agev_config
.
SetExperiment
(
'CBM'
)
cbm_12agev_config
.
SetSystem
(
'auau'
)
cbm_12agev_config
.
SetIsSimulation
(
True
)
cbm_12agev_config
.
SetBeamMomentum
(
12.
)
cbm_12agev_config
.
SetMsimMax
(
1300
)
cbm_12agev_config
.
SetMrecoMax
(
700
)
cbm_12agev_config
.
SetPSDEnergyMax
(
50
)
cbm_12agev_config
.
SetCutsConfig
(
default_cbm_cuts
)
cbm_12agev_config
.
SetNominalVertex
(
0.0
,
0.0
,
0.0
)
cbm_12agev_config
.
Write
()
#
# Pb+Pb 13AGeV SHINE Simulation
...
...
@@ -68,7 +117,7 @@ pbpb_13agev_mc_config.SetExperiment('NA61')
pbpb_13agev_mc_config
.
SetSystem
(
'pbpb'
)
pbpb_13agev_mc_config
.
SetBeamMomentum
(
13
)
pbpb_13agev_mc_config
.
SetCutsConfig
(
cuts
)
pbpb_13agev_mc_config
.
SetMidRapidity
(
1.66155580381
)
#
pbpb_13agev_mc_config.SetMidRapidity(1.66155580381)
pbpb_13agev_mc_config
.
SetIsSimulation
(
True
)
pbpb_13agev_mc_config
.
SetNominalVertex
(
0.0
,
0.0
,
-
591.9
)
pbpb_13agev_mc_config
.
Write
()
...
...
@@ -79,7 +128,7 @@ pbpb_13agev_mc_config.Write()
#
pbpb_30agev_mc_config
=
pbpb_13agev_mc_config
.
Clone
(
'pbpb_30agev_mc_config'
)
pbpb_30agev_mc_config
.
SetBeamMomentum
(
30
)
pbpb_30agev_mc_config
.
SetMidRapidity
(
2.07915216109
)
#
pbpb_30agev_mc_config.SetMidRapidity(2.07915216109)
pbpb_30agev_mc_config
.
Write
()
...
...
@@ -152,7 +201,7 @@ pbpb_13agev_data_config.SetName('pbpb_13agev_data_config')
pbpb_13agev_data_config
.
SetExperiment
(
'NA61'
)
pbpb_13agev_data_config
.
SetSystem
(
'pbpb'
)
pbpb_13agev_data_config
.
SetBeamMomentum
(
13
)
pbpb_13agev_data_config
.
SetMidRapidity
(
1.66155580381
)
#
pbpb_13agev_data_config.SetMidRapidity(1.66155580381)
pbpb_13agev_data_config
.
SetCutsConfig
(
cuts
)
pbpb_13agev_data_config
.
SetIsSimulation
(
False
)
pbpb_13agev_data_config
.
SetNominalVertex
(
0.0
,
0.0
,
-
591.9
)
...
...
@@ -232,7 +281,7 @@ pbpb_30agev_data_config.SetName('pbpb_30agev_data_config')
pbpb_30agev_data_config
.
SetExperiment
(
'NA61'
)
pbpb_30agev_data_config
.
SetSystem
(
'pbpb'
)
pbpb_30agev_data_config
.
SetBeamMomentum
(
30
)
pbpb_30agev_data_config
.
SetMidRapidity
(
2.07915216109
)
#
pbpb_30agev_data_config.SetMidRapidity(2.07915216109)
pbpb_30agev_data_config
.
SetCutsConfig
(
cuts
)
pbpb_30agev_data_config
.
SetIsSimulation
(
False
)
pbpb_30agev_data_config
.
SetNominalVertex
(
0.0
,
0.0
,
-
591.9
)
...
...
@@ -271,7 +320,7 @@ na49_pbpb_40agev_mc_config.SetName('na49_pbpb_40agev_mc_config')
na49_pbpb_40agev_mc_config
.
SetExperiment
(
'NA49'
)
na49_pbpb_40agev_mc_config
.
SetSystem
(
'pbpb'
)
na49_pbpb_40agev_mc_config
.
SetBeamMomentum
(
40
)
na49_pbpb_40agev_mc_config
.
SetMidRapidity
(
2.22293973419
)
#
na49_pbpb_40agev_mc_config.SetMidRapidity(2.22293973419)
na49_pbpb_40agev_mc_config
.
SetCutsConfig
(
cuts
)
na49_pbpb_40agev_mc_config
.
SetIsSimulation
(
True
)
na49_pbpb_40agev_mc_config
.
SetNominalVertex
(
0.0
,
0.0
,
-
587.1
)
...
...
@@ -311,7 +360,7 @@ na49_pbpb_40agev_config.SetName('na49_pbpb_40agev_config')
na49_pbpb_40agev_config
.
SetExperiment
(
'NA49'
)
na49_pbpb_40agev_config
.
SetSystem
(
'pbpb'
)
na49_pbpb_40agev_config
.
SetBeamMomentum
(
40
)
na49_pbpb_40agev_config
.
SetMidRapidity
(
2.22293973419
)
#
na49_pbpb_40agev_config.SetMidRapidity(2.22293973419)
na49_pbpb_40agev_config
.
SetCutsConfig
(
cuts
)
na49_pbpb_40agev_config
.
SetIsSimulation
(
False
)
na49_pbpb_40agev_config
.
Write
()
...
...
macro/RunDataTreeQA.C
0 → 100644
View file @
7293dd54
#include <TString.h>
void
RunDataTreeQA
(
TString
fileList
=
"../list"
,
TString
refFileList
=
""
,
TString
output_file
=
"qa.root"
,
TString
config_file
=
"../macro/QAConfigurations.root"
,
TString
config_name
=
"cbm_12agev_config"
,
TString
cuts_name
=
""
,
Long64_t
nEvents
=
1e9
);
# ifndef __CLING__
#include "DataTreeQA.h"
#include "DataTreeQAConfig.h"
#include "DataTreeCutsConfig.h"
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
==
8
)
RunDataTreeQA
(
argv
[
1
],
argv
[
2
],
argv
[
3
],
argv
[
4
],
argv
[
5
],
argv
[
6
],
atoi
(
argv
[
7
]));
else
if
(
argc
==
7
)
RunDataTreeQA
(
argv
[
1
],
argv
[
2
],
argv
[
3
],
argv
[
4
],
argv
[
5
],
argv
[
6
]);
else
if
(
argc
==
6
)
RunDataTreeQA
(
argv
[
1
],
argv
[
2
],
argv
[
3
],
argv
[
4
],
argv
[
5
]);
else
if
(
argc
==
5
)
RunDataTreeQA
(
argv
[
1
],
argv
[
2
],
argv
[
3
],
argv
[
4
]);
else
if
(
argc
==
4
)
RunDataTreeQA
(
argv
[
1
],
argv
[
2
],
argv
[
3
]);
else
if
(
argc
==
3
)
RunDataTreeQA
(
argv
[
1
],
argv
[
2
]);
else
if
(
argc
==
2
)
RunDataTreeQA
(
argv
[
1
]);
else
RunDataTreeQA
();
return
0
;
}
# endif // __CLING__
using
namespace
std
;
using
namespace
qa
;
using
namespace
cuts
;
void
RunDataTreeQA
(
TString
fileList
,
TString
refFileList
,
TString
output_file
,
TString
config_file
,
TString
config_name
,
TString
cuts_name
,
Long64_t
nEvents
)
{
cout
<<
"fileList = "
<<
fileList
<<
endl
;
cout
<<
"refFileList = "
<<
refFileList
<<
endl
;
cout
<<
"output_file = "
<<
output_file
<<
endl
;
cout
<<
"config_file = "
<<
config_file
<<
endl
;
cout
<<
"config_name = "
<<
config_name
<<
endl
;
cout
<<
"cuts_name = "
<<
cuts_name
<<
endl
;
cout
<<
"nEvents:"
<<
nEvents
<<
endl
;
TFile
*
conf_fd
=
new
TFile
(
config_file
,
"read"
);
DataTreeQAConfig
*
qa_config
=
(
DataTreeQAConfig
*
)
conf_fd
->
Get
(
config_name
);
DataTreeCutsConfig
*
cuts_config
;
cout
<<
"Using QA config: "
<<
qa_config
->
GetName
()
<<
endl
;
if
(
cuts_name
!=
""
)
{
cuts_config
=
(
DataTreeCutsConfig
*
)
conf_fd
->
Get
(
cuts_name
);
qa_config
->
SetCutsConfig
(
cuts_config
);
}
DataTreeQA
qa
;
qa
.
Init
(
qa
.
MakeChain
(
fileList
,
"DataTree"
));
if
(
refFileList
!=
""
)
qa
.
SetReferenceChain
(
qa
.
MakeChain
(
refFileList
,
"DataTree"
));
qa
.
SetQAConfig
(
*
qa_config
);
qa
.
Init_Histograms
();
qa
.
Run
(
nEvents
);
qa
.
Write_Histograms
(
output_file
);
}
qa/DataTreeQA.cxx
View file @
7293dd54
This diff is collapsed.
Click to expand it.
qa/DataTreeQA.h
View file @
7293dd54
...
...
@@ -4,10 +4,10 @@
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <TClonesArray.h>
#include <Rtypes.h>
#include <cuts/DataTreeAbstractCuts.h>
#include <TH3D.h>
#include <THnSparse.h>
#include <unordered_map>
...
...
@@ -18,12 +18,13 @@
#include "TH2.h"
#include "TFile.h"
#include "TProfile.h"
#include "T
F
ile.h"
#include "T
Prof
ile
2D
.h"
#include "TChain.h"
#include "DataTreeEvent.h"
#include "DataTreeTrack.h"
#include "DataTreeQAConfig.h"
#include <DataTreeAbstractCuts.h>
namespace
qa
{
...
...
@@ -36,13 +37,13 @@ namespace qa {
* Axes definition
*/
enum
EMomentumAxis
{
kPT
=
0
,
kETA
,
kPHI
,
kYM
,
kAxes
kPT
=
0
,
kETA
,
kPHI
,
kYM
,
kPX
,
kPY
,
kPZ
,
kP
,
kTX
,
kTY
,
kQP
,
kAxes
};
const
struct
TMomentumAxis
{
Int_t
id
;
std
::
s
tring
name
;
std
::
s
tring
displayName
;
TS
tring
name
;
TS
tring
displayName
;
Int_t
nBins
;
Double_t
min
;
Double_t
max
;
...
...
@@ -52,9 +53,23 @@ namespace qa {
/* pseudorapidity */
{.
id
=
kETA
,
.
name
=
"Eta"
,
.
displayName
=
"
\\
eta"
,
.
nBins
=
1000
,
.
min
=-
2.0
,
.
max
=
8.0
},
/* azimuthal angle */
{.
id
=
kPHI
,
.
name
=
"Phi"
,
.
displayName
=
"
\\
p
hi"
,
.
nBins
=
1000
,
.
min
=-
TMath
::
Pi
(),
.
max
=
TMath
::
Pi
()},
{.
id
=
kPHI
,
.
name
=
"Phi"
,
.
displayName
=
"
\\
P
hi"
,
.
nBins
=
1000
,
.
min
=-
TMath
::
Pi
(),
.
max
=
TMath
::
Pi
()},
/* rapidity in CoM frame */
{.
id
=
kYM
,
.
name
=
"Y"
,
.
displayName
=
"Y_{
\\
pi} - Y_{CM}"
,
.
nBins
=
1000
,
.
min
=-
4.0
,
.
max
=
4.0
},
{.
id
=
kYM
,
.
name
=
"Y"
,
.
displayName
=
"#it{y}"
,
.
nBins
=
1000
,
.
min
=-
4.0
,
.
max
=
4.0
},
/* Px */
{.
id
=
kPX
,
.
name
=
"Px"
,
.
displayName
=
"P_{x}"
,
.
nBins
=
1000
,
.
min
=-
4.0
,
.
max
=
4.0
},
/* Py */
{.
id
=
kPY
,
.
name
=
"Py"
,
.
displayName
=
"P_{y}"
,
.
nBins
=
1000
,
.
min
=-
4.0
,
.
max
=
4.0
},
/* Pz */
{.
id
=
kPZ
,
.
name
=
"Pz"
,
.
displayName
=
"P_{z}"
,
.
nBins
=
1000
,
.
min
=
0.
,
.
max
=
15.0
},
/* P */
{.
id
=
kP
,
.
name
=
"P"
,
.
displayName
=
"P"
,
.
nBins
=
1000
,
.
min
=
0.
,
.
max
=
15.0
},
/* tx = px/pz */
{.
id
=
kTX
,
.
name
=
"Tx"
,
.
displayName
=
"t_{x}"
,
.
nBins
=
1000
,
.
min
=-
1.0
,
.
max
=
1.0
},
/* tx = py/pz */
{.
id
=
kTY
,
.
name
=
"Ty"
,
.
displayName
=
"t_{y}"
,
.
nBins
=
1000
,
.
min
=-
1.0
,
.
max
=
1.0
},
/* q/p */
{.
id
=
kQP
,
.
name
=
"QP"
,
.
displayName
=
"q/p"
,
.
nBins
=
1000
,
.
min
=-
10.0
,
.
max
=
10.0
},
};
/**
...
...
@@ -68,8 +83,8 @@ namespace qa {
Int_t
pdg
;
Double_t
mass
;
Int_t
charge
;
std
::
s
tring
name
;
std
::
s
tring
displayName
;
TS
tring
name
;
TS
tring
displayName
;
}
gParticles
[
kParticles
]
=
{
{
kPROTON
,
2212
,
0.938
,
1
,
"p"
,
"p"
},
{
kPROTONBAR
,
-
2212
,
0.938
,
-
1
,
"pbar"
,
"
\\
bar{p}"
},
...
...
@@ -90,21 +105,24 @@ namespace qa {
};
const
struct
TPSDGroup
{
Int_t
id
;
std
::
s
tring
name
;
std
::
s
tring
displayName
;
TS
tring
name
;
TS
tring
displayName
;
std
::
vector
<
Int_t
>
modules
;
}
gPSDGroups
[
kPSDGroups
]
=
{
{.
id
=
kPSD1
,
.
name
=
"PSD1"
,
.
displayName
=
"PSD1"
,
.
modules
=
{
45
,
6
,
7
,
10
,
11
,
1
,
2
,
3
,
4
,
5
,
8
,
9
,
12
,
// {.id = kPSD1, .name = "PSD1", .displayName = "PSD1", .modules = {45, 6, 7, 10, 11, 1, 2, 3, 4, 5, 8, 9, 12,
{.
id
=
kPSD1
,
.
name
=
"PSD1"
,
.
displayName
=
"PSD1"
,
.
modules
=
{
6
,
7
,
10
,
11
,
1
,
2
,
3
,
4
,
5
,
8
,
9
,
12
,
13
,
14
,
15
,
16
}},
{.
id
=
kPSD2
,
.
name
=
"PSD2"
,
.
displayName
=
"PSD2"
,
.
modules
=
{
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
}},
{.
id
=
kPSD3
,
.
name
=
"PSD3"
,
.
displayName
=
"PSD3"
,
.
modules
=
{
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
}},
{.
id
=
kPSD1_2
,
.
name
=
"PSD1_2"
,
.
displayName
=
"PSD1 + PSD2"
,
.
modules
=
{
45
,
6
,
7
,
10
,
11
,
1
,
2
,
3
,
4
,
5
,
8
,
9
,
12
,
// {.id = kPSD1_2, .name = "PSD1_2", .displayName = "PSD1 + PSD2", .modules = {45, 6, 7, 10, 11, 1, 2, 3, 4, 5, 8, 9, 12,
{.
id
=
kPSD1_2
,
.
name
=
"PSD1_2"
,
.
displayName
=
"PSD1 + PSD2"
,
.
modules
=
{
6
,
7
,
10
,
11
,
1
,
2
,
3
,
4
,
5
,
8
,
9
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
}},
{.
id
=
kPSDCENTR
,
.
name
=
"PSDCENTR"
,
.
displayName
=
"PSD (Central moules #45 + #6,7,10,11)"
,
.
modules
=
{
45
,
6
,
7
,
10
,
11
}},
// {.id = kPSDCENTR, .name = "PSDCENTR", .displayName = "PSD (Central moules #45 + #6,7,10,11)", .modules = {45, 6, 7, 10, 11}},
{.
id
=
kPSDCENTR
,
.
name
=
"PSDCENTR"
,
.
displayName
=
"PSD (Central moules #45 + #6,7,10,11)"
,
.
modules
=
{
6
,
7
,
10
,
11
}},
{.
id
=
kPSDAll
,
.
name
=
"PSDAll"
,
.
displayName
=
"PSD All"
,
.
modules
=
{}}
};
...
...
@@ -134,6 +152,8 @@ namespace qa {
void
FillTrackMatching
();
void
FillRunByRun
();
TChain
*
MakeChain
(
TString
filename
,
TString
treename
);
void
Write_Histograms
(
const
TString
filename
);
...
...
@@ -154,7 +174,7 @@ namespace qa {
void
SetReferenceChain
(
TChain
*
fReferenceChain
)
{
DataTreeQA
::
fReferenceChain
=
fReferenceChain
;
}
void
Run
(
Int
_t
nEvents
);
void
Run
(
Long64
_t
nEvents
=
1e9
);
void
FillEfficiency
();
...
...
@@ -186,7 +206,7 @@ namespace qa {
DataTreeQAConfig
fQAConfig
;
TFile
*
MyFile
;
TChain
*
fChain
;
TChain
*
fReferenceChain
{};
DataTreeEvent
*
DTEvent
;
...
...
@@ -197,7 +217,12 @@ namespace qa {
*/
const
EnumTPC
::
eTPC
gTPCList
[
EnumTPC
::
nTPCs
]
=
{
EnumTPC
::
kVTPC1
,
EnumTPC
::
kVTPC2
,
EnumTPC
::
kMTPC
,
EnumTPC
::
kTPCAll
};
TString
sTPC
[
EnumTPC
::
nTPCs
]
=
{
"VTPC1"
,
"VTPC2"
,
"MTPC"
,
"allTPC"
};
std
::
vector
<
TString
>
sTPC_na61
=
{
"VTPC1"
,
"VTPC2"
,
"MTPC"
,
"allTPC"
};
std
::
vector
<
TString
>
sTPC_cbm
=
{
"STS"
};
std
::
vector
<
TString
>
*
sTPC
;
TString
fExperiment
;
bool
fAnalyzeEfficiency
{
kFALSE
};
bool
fOnlineQA
{
kFALSE
};
cuts
::
DataTreeAbstractCuts
*
fCuts
;
...
...
@@ -208,7 +233,9 @@ namespace qa {
Int_t
fNGoodEvents
;
TString
sXyz
[
3
]
=
{
"X"
,
"Y"
,
"Z"
};
TH2D
*
h2PSDModuleEnergy
;
TProfile2D
*
p2PSDModulePositionEnergy
;
/* PSD correlation histograms */
TH2D
*
hPSDGroupsCorr
[
3
];
TH2D
*
hPSDMultCorr
[
kPSDGroups
];
...
...
@@ -242,7 +269,7 @@ namespace qa {
TH1D
*
hTrackDCA
[
3
];
TH2D
*
hTrackDCAXY
;
TH1D
*
hTrackMomentum<